Allow hinting sprite loads through MakeActor

This commit is contained in:
Glenn Maynard
2003-10-30 23:47:01 +00:00
parent a9c98610ba
commit 19f3338e5a
2 changed files with 8 additions and 7 deletions
+6 -6
View File
@@ -85,15 +85,15 @@ static Actor* LoadActor( CString sPath )
return pActor;
}
Actor* MakeActor( CString sPath )
Actor* MakeActor( RageTextureID ID )
{
CString sExt = GetExtension(sPath);
CString sExt = GetExtension( ID.filename );
sExt.MakeLower();
if( sExt=="actor" )
{
return LoadActor( sPath );
return LoadActor( ID.filename );
}
else if( sExt=="png" ||
sExt=="jpg" ||
@@ -105,18 +105,18 @@ Actor* MakeActor( CString sPath )
sExt=="sprite" )
{
Sprite* pSprite = new Sprite;
pSprite->Load( sPath );
pSprite->Load( ID );
return pSprite;
}
else if( sExt=="txt" )
{
Model* pModel = new Model;
pModel->LoadMilkshapeAscii( sPath );
pModel->LoadMilkshapeAscii( ID.filename );
return pModel;
}
RageException::Throw("File \"%s\" has unknown type, \"%s\"",
sPath.c_str(), sExt.c_str() );
ID.filename.c_str(), sExt.c_str() );
}
void IncorrectActorParametersWarning( const CStringArray &asTokens, int iMaxIndexAccessed, int size )
+2 -1
View File
@@ -13,6 +13,7 @@
#include "Actor.h"
#include "ThemeManager.h"
#include "RageTexture.h"
#define SET_XY( actor ) UtilSetXY( actor, m_sName )
@@ -67,7 +68,7 @@ inline float UtilSetXYAndOnCommand( Actor* pActor, CString sClassName ) { return
// Return a Sprite, BitmapText, or Model depending on the file type
Actor* MakeActor( CString sPath );
Actor* MakeActor( RageTextureID ID );
// creates the appropriate Actor derivitive on load and