Fixed some extremely strange linebreaks in ObjectEntry.h/cpp

This was SVN commit r265.
This commit is contained in:
MarkT
2004-05-25 22:52:05 +00:00
parent 88e8a56487
commit 2bb064e8d8
2 changed files with 41 additions and 21 deletions
+32 -19
View File
@@ -61,22 +61,30 @@ bool CObjectEntry::BuildModel()
CStr texturefilename(m_TextureName);
m_Model->SetTexture(CTexture((const char*) texturefilename));
for( uint t = 0; t < m_Animations.size(); t++ )
{
if( m_Animations[t].m_FileName.Length() > 0 )
{
CStr animfilename( "mods\\official\\" );
animfilename += m_Animations[t].m_FileName;
try
{
m_Animations[t].m_AnimData = CSkeletonAnim::Load( animfilename );
}
for( uint t = 0; t < m_Animations.size(); t++ )
{
if( m_Animations[t].m_FileName.Length() > 0 )
{
CStr animfilename( "mods\\official\\" );
animfilename += m_Animations[t].m_FileName;
try
{
m_Animations[t].m_AnimData = CSkeletonAnim::Load( animfilename );
}
catch( ... )
{
m_Animations[t].m_AnimData = NULL;
}
if( m_Animations[t].m_AnimName.LowerCase() == CStr( "idle" ) )
m_IdleAnim = m_Animations[t].m_AnimData;
if( m_Animations[t].m_AnimName.LowerCase() == CStr( "walk" ) )
m_WalkAnim = m_Animations[t].m_AnimData;
}
}
}
if( m_Animations[t].m_AnimName.LowerCase() == CStr( "idle" ) )
m_Model->SetAnimation( m_IdleAnim );
// rebuild model bounds
m_Model->CalcBounds();
// replace any units using old model to now use new model
@@ -84,12 +92,7 @@ bool CObjectEntry::BuildModel()
for (uint i=0;i<units.size();++i) {
if (units[i]->m_Model->GetModelDef()==oldmodel) {
units[i]->m_Model->InitModel(m_Model->GetModelDef());
if (m_Animations.size()) {
if (m_Animations[0].m_FileName.Length()>0) {
animfilename+=m_Animations[0].m_FileName;
try {
}
}
@@ -98,7 +101,17 @@ bool CObjectEntry::BuildModel()
return true;
}
// rebuild model bounds // janwas: WTF? sign mismatch warning on this line?
CSkeletonAnim* CObjectEntry::GetNamedAnimation( CStr animationName )
{
for( uint t = 0; t < m_Animations.size(); t++ )
{
if( m_Animations[t].m_AnimName == animationName )
return( m_Animations[t].m_AnimData );
}
return( NULL );
}
bool CObjectEntry::Load(const char* filename)
{
bool parseOK = false;