remove .model file format, replace with more general .actor file format

This commit is contained in:
Chris Danford
2003-09-21 20:57:07 +00:00
parent 3f2d2c7f77
commit dba1188c97
7 changed files with 53 additions and 76 deletions
+30 -7
View File
@@ -15,6 +15,7 @@
#include "Sprite.h"
#include "BitmapText.h"
#include "Model.h"
#include "IniFile.h"
Actor* MakeActor( CString sPath )
@@ -24,7 +25,35 @@ Actor* MakeActor( CString sPath )
sExt.MakeLower();
if( sExt=="png" ||
if( sExt=="actor" )
{
// TODO: Check for recursive loading
CString sDir, sThrowAway;
splitrelpath( sPath, sDir, sThrowAway, sThrowAway );
IniFile ini;
ini.SetPath( sPath );
ini.ReadFile();
if( !ini.GetKey("Actor") )
RageException::Throw( "The actor file '%s' is invalid.", sPath.c_str() );
CString sFileName;
ini.GetValue( "Actor", "File", sFileName );
Actor* pActor = MakeActor( sDir+sFileName );
float f;
if( ini.GetValueF( "Actor", "BaseRotationXDegrees", f ) ) pActor->SetBaseRotationX( f );
if( ini.GetValueF( "Actor", "BaseRotationYDegrees", f ) ) pActor->SetBaseRotationY( f );
if( ini.GetValueF( "Actor", "BaseRotationZDegrees", f ) ) pActor->SetBaseRotationZ( f );
if( ini.GetValueF( "Actor", "BaseZoomX", f ) ) pActor->SetBaseZoomX( f );
if( ini.GetValueF( "Actor", "BaseZoomY", f ) ) pActor->SetBaseZoomY( f );
if( ini.GetValueF( "Actor", "BaseZoomZ", f ) ) pActor->SetBaseZoomZ( f );
return pActor;
}
else if( sExt=="png" ||
sExt=="jpg" ||
sExt=="gif" ||
sExt=="bmp" ||
@@ -49,12 +78,6 @@ Actor* MakeActor( CString sPath )
pModel->LoadMilkshapeAscii( sPath );
return pModel;
}
else if( sExt=="model" )
{
Model* pModel = new Model;
pModel->LoadFromModelFile( sPath );
return pModel;
}
ASSERT(0);
return NULL;