start animations in LoadPieces, but not LoadMilkshapeAsciiBones
This commit is contained in:
@@ -99,7 +99,9 @@ void Model::LoadPieces( CString sMeshesPath, CString sMaterialsPath, CString sBo
|
||||
|
||||
LoadMaterialsFromMilkshapeAscii( sMaterialsPath );
|
||||
|
||||
LoadMilkshapeAsciiBones( DEFAULT_ANIMATION_NAME, sBonesPath );
|
||||
if( LoadMilkshapeAsciiBones( DEFAULT_ANIMATION_NAME, sBonesPath ) )
|
||||
PlayAnimation( DEFAULT_ANIMATION_NAME );
|
||||
|
||||
|
||||
//
|
||||
// Setup temp vertices (if necessary)
|
||||
@@ -263,7 +265,7 @@ void Model::LoadMaterialsFromMilkshapeAscii( CString sPath )
|
||||
f.Close();
|
||||
}
|
||||
|
||||
void Model::LoadMilkshapeAsciiBones( CString sAniName, CString sPath )
|
||||
bool Model::LoadMilkshapeAsciiBones( CString sAniName, CString sPath )
|
||||
{
|
||||
FixSlashesInPlace(sPath);
|
||||
const CString sDir = Dirname( sPath );
|
||||
@@ -275,6 +277,7 @@ void Model::LoadMilkshapeAsciiBones( CString sAniName, CString sPath )
|
||||
CString sLine;
|
||||
int iLineNum = 0;
|
||||
|
||||
bool bLoaded = false;
|
||||
while( f.GetLine( sLine ) > 0 )
|
||||
{
|
||||
iLineNum++;
|
||||
@@ -394,9 +397,9 @@ void Model::LoadMilkshapeAsciiBones( CString sAniName, CString sPath )
|
||||
for( unsigned j = 0; j < Bone.RotationKeys.size(); ++j )
|
||||
Animation.nTotalFrames = max( Animation.nTotalFrames, (int)Bone.RotationKeys[j].fTime );
|
||||
}
|
||||
|
||||
PlayAnimation( sAniName );
|
||||
}
|
||||
|
||||
return bLoaded;
|
||||
}
|
||||
|
||||
bool Model::EarlyAbortDraw()
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
void LoadFromModelFile( CString sFile );
|
||||
void LoadMilkshapeAscii( CString sFile );
|
||||
void LoadMaterialsFromMilkshapeAscii( CString sPath );
|
||||
void LoadMilkshapeAsciiBones( CString sAniName, CString sPath );
|
||||
bool LoadMilkshapeAsciiBones( CString sAniName, CString sPath );
|
||||
void PlayAnimation( CString sAniName, float fPlayRate = 1 );
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
@@ -57,9 +57,13 @@ private:
|
||||
|
||||
// If any vertex has a bone weight, then then render from m_pTempGeometry.
|
||||
// Otherwise, render directly from m_pGeometry.
|
||||
vector<msMesh> m_vTempMeshes;
|
||||
RageCompiledGeometry* m_pTempGeometry;
|
||||
|
||||
/* Keep a copy of the mesh data only if m_pTempGeometry is in use. The normal and
|
||||
* position data will be changed; the rest is static and kept only to prevent making
|
||||
* a complete copy. */
|
||||
vector<msMesh> m_vTempMeshes;
|
||||
|
||||
void DrawMesh( int i ) const;
|
||||
|
||||
float m_fCurFrame;
|
||||
|
||||
Reference in New Issue
Block a user