mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
refactoring: selectable gfx renderer groundwork
This commit is contained in:
12
material.cpp
12
material.cpp
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user