Allow hinting sprite loads through MakeActor
This commit is contained in:
@@ -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 )
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user