refactoring: selectable gfx renderer groundwork

This commit is contained in:
tmj-fstate
2019-10-12 18:38:01 +02:00
parent c312251580
commit 936e537a7a
24 changed files with 245 additions and 171 deletions

View File

@@ -25,7 +25,7 @@ opengl_material::deserialize( cParser &Input, bool const Loadnow ) {
has_alpha = (
texture1 != null_handle ?
GfxRenderer.Texture( texture1 ).has_alpha :
GfxRenderer->Texture( texture1 ).has_alpha :
false );
return result;
@@ -63,7 +63,7 @@ opengl_material::deserialize_mapping( cParser &Input, int const Priority, bool c
auto const value { deserialize_random_set( Input ) };
if( ( texture1 == null_handle )
|| ( Priority > priority1 ) ) {
texture1 = GfxRenderer.Fetch_Texture( value, Loadnow );
texture1 = GfxRenderer->Fetch_Texture( value, Loadnow );
priority1 = Priority;
}
}
@@ -72,7 +72,7 @@ opengl_material::deserialize_mapping( cParser &Input, int const Priority, bool c
auto const value { deserialize_random_set( Input ) };
if( ( texture2 == null_handle )
|| ( Priority > priority2 ) ) {
texture2 = GfxRenderer.Fetch_Texture( value, Loadnow );
texture2 = GfxRenderer->Fetch_Texture( value, Loadnow );
priority2 = Priority;
}
}
@@ -168,11 +168,11 @@ material_manager::create( std::string const &Filename, bool const Loadnow ) {
// if there's no .mat file, this can be either autogenerated texture,
// or legacy method of referring just to diffuse texture directly.
// wrap basic material around it in either case
material.texture1 = GfxRenderer.Fetch_Texture( Filename, Loadnow );
material.texture1 = GfxRenderer->Fetch_Texture( Filename, Loadnow );
if( material.texture1 != null_handle ) {
// use texture path and name to tell the newly created materials apart
material.name = GfxRenderer.Texture( material.texture1 ).name;
material.has_alpha = GfxRenderer.Texture( material.texture1 ).has_alpha;
material.name = GfxRenderer->Texture( material.texture1 ).name;
material.has_alpha = GfxRenderer->Texture( material.texture1 ).has_alpha;
}
}