merge manul

This commit is contained in:
WLs50
2025-03-09 15:36:11 +01:00
parent a687f551a2
commit a5f6397eca
1211 changed files with 483542 additions and 58643 deletions

View File

@@ -72,7 +72,7 @@ shape_node::shapenode_data::serialize( std::ostream &Output ) const {
sn_utils::s_str(
Output,
( material != null_handle ?
GfxRenderer->Material( material ).name :
GfxRenderer->Material( material )->GetName() :
"" ) );
lighting.serialize( Output );
// geometry
@@ -198,26 +198,26 @@ shape_node::import( cParser &Input, scene::node_data const &Nodedata ) {
// TBT, TODO: add methods to material manager to access these simpler
auto const texturehandle = (
m_data.material != null_handle ?
GfxRenderer->Material( m_data.material ).textures[0] :
GfxRenderer->Material( m_data.material )->GetTexture(0) :
null_handle );
auto const &texture = (
texturehandle ?
GfxRenderer->Texture( texturehandle ) :
opengl_texture() ); // dirty workaround for lack of better api
*ITexture::null_texture() ); // dirty workaround for lack of better api
bool const clamps = (
texturehandle ?
contains( texture.traits, 's' ) :
contains( texture.get_traits(), 's' ) :
false );
bool const clampt = (
texturehandle ?
contains( texture.traits, 't' ) :
contains( texture.get_traits(), 't' ) :
false );
// remainder of legacy 'problend' system -- geometry assigned a texture with '@' in its name is treated as translucent, opaque otherwise
if( texturehandle != null_handle ) {
m_data.translucent = (
( ( contains( texture.name, '@' ) )
&& ( true == texture.has_alpha ) ) ?
( ( contains( texture.get_name(), '@' ) )
&& ( true == texture.get_has_alpha() ) ) ?
true :
false );
}
@@ -344,7 +344,7 @@ shape_node::convert( TSubModel const *Submodel ) {
m_data.lighting.diffuse = Submodel->f4Diffuse;
m_data.lighting.specular = Submodel->f4Specular;
m_data.material = Submodel->m_material;
m_data.translucent = ( GfxRenderer->Material( m_data.material ).get_or_guess_opacity() == 0.0f );
m_data.translucent = ( GfxRenderer->Material( m_data.material )->get_or_guess_opacity() == 0.0f );
// NOTE: we set unlimited view range typical for terrain, because we don't expect to convert any other 3d models
m_data.rangesquared_max = std::numeric_limits<double>::max();