Allow hinting sprite loads through MakeActor
This commit is contained in:
@@ -85,15 +85,15 @@ static Actor* LoadActor( CString sPath )
|
|||||||
return pActor;
|
return pActor;
|
||||||
}
|
}
|
||||||
|
|
||||||
Actor* MakeActor( CString sPath )
|
Actor* MakeActor( RageTextureID ID )
|
||||||
{
|
{
|
||||||
CString sExt = GetExtension(sPath);
|
CString sExt = GetExtension( ID.filename );
|
||||||
sExt.MakeLower();
|
sExt.MakeLower();
|
||||||
|
|
||||||
|
|
||||||
if( sExt=="actor" )
|
if( sExt=="actor" )
|
||||||
{
|
{
|
||||||
return LoadActor( sPath );
|
return LoadActor( ID.filename );
|
||||||
}
|
}
|
||||||
else if( sExt=="png" ||
|
else if( sExt=="png" ||
|
||||||
sExt=="jpg" ||
|
sExt=="jpg" ||
|
||||||
@@ -105,18 +105,18 @@ Actor* MakeActor( CString sPath )
|
|||||||
sExt=="sprite" )
|
sExt=="sprite" )
|
||||||
{
|
{
|
||||||
Sprite* pSprite = new Sprite;
|
Sprite* pSprite = new Sprite;
|
||||||
pSprite->Load( sPath );
|
pSprite->Load( ID );
|
||||||
return pSprite;
|
return pSprite;
|
||||||
}
|
}
|
||||||
else if( sExt=="txt" )
|
else if( sExt=="txt" )
|
||||||
{
|
{
|
||||||
Model* pModel = new Model;
|
Model* pModel = new Model;
|
||||||
pModel->LoadMilkshapeAscii( sPath );
|
pModel->LoadMilkshapeAscii( ID.filename );
|
||||||
return pModel;
|
return pModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
RageException::Throw("File \"%s\" has unknown type, \"%s\"",
|
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 )
|
void IncorrectActorParametersWarning( const CStringArray &asTokens, int iMaxIndexAccessed, int size )
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "Actor.h"
|
#include "Actor.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "RageTexture.h"
|
||||||
|
|
||||||
|
|
||||||
#define SET_XY( actor ) UtilSetXY( actor, m_sName )
|
#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
|
// 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
|
// creates the appropriate Actor derivitive on load and
|
||||||
|
|||||||
Reference in New Issue
Block a user