pass bNeedsNormals into RageCompiledGeometry

This commit is contained in:
Chris Danford
2005-01-14 10:23:22 +00:00
parent c558727bf7
commit 5c79ac4196
8 changed files with 43 additions and 18 deletions
+16 -4
View File
@@ -94,11 +94,13 @@ void Model::LoadPieces( CString sMeshesPath, CString sMaterialsPath, CString sBo
{
Clear();
ASSERT( m_pGeometry == NULL );
m_pGeometry = MODELMAN->LoadMilkshapeAscii( sMeshesPath );
// TRICKY: Load materials before geometry so we can figure out whether the materials require normals.
LoadMaterialsFromMilkshapeAscii( sMaterialsPath );
ASSERT( m_pGeometry == NULL );
m_pGeometry = MODELMAN->LoadMilkshapeAscii( sMeshesPath, this->MaterialsNeedNormals() );
if( LoadMilkshapeAsciiBones( DEFAULT_ANIMATION_NAME, sBonesPath ) )
PlayAnimation( DEFAULT_ANIMATION_NAME );
@@ -110,7 +112,7 @@ void Model::LoadPieces( CString sMeshesPath, CString sMaterialsPath, CString sBo
{
m_vTempMeshes = m_pGeometry->m_Meshes;
m_pTempGeometry = DISPLAY->CreateCompiledGeometry();
m_pTempGeometry->Set( m_vTempMeshes );
m_pTempGeometry->Set( m_vTempMeshes, this->MaterialsNeedNormals() );
}
}
@@ -762,6 +764,16 @@ void Model::HandleCommand( const Command &command )
EndHandleArgs;
}
bool Model::MaterialsNeedNormals() const
{
FOREACH_CONST( msMaterial, m_Materials, m )
{
if( m->NeedsNormals() )
return true;
}
return false;
}
/*
* (c) 2003-2004 Chris Danford
* All rights reserved.