Bump Util commands out of the header.
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "BitmapText.h"
|
#include "BitmapText.h"
|
||||||
#include "Model.h"
|
#include "Model.h"
|
||||||
|
#include "BGAnimation.h"
|
||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "RageUtil_FileDB.h"
|
#include "RageUtil_FileDB.h"
|
||||||
@@ -90,7 +91,6 @@ Actor* MakeActor( RageTextureID ID )
|
|||||||
CString sExt = GetExtension( ID.filename );
|
CString sExt = GetExtension( ID.filename );
|
||||||
sExt.MakeLower();
|
sExt.MakeLower();
|
||||||
|
|
||||||
|
|
||||||
if( sExt=="actor" )
|
if( sExt=="actor" )
|
||||||
{
|
{
|
||||||
return LoadActor( ID.filename );
|
return LoadActor( ID.filename );
|
||||||
@@ -114,7 +114,14 @@ Actor* MakeActor( RageTextureID ID )
|
|||||||
pModel->LoadMilkshapeAscii( ID.filename );
|
pModel->LoadMilkshapeAscii( ID.filename );
|
||||||
return pModel;
|
return pModel;
|
||||||
}
|
}
|
||||||
|
/* Do this last, to avoid the IsADirectory in most cases. */
|
||||||
|
else if( IsADirectory(ID.filename) )
|
||||||
|
{
|
||||||
|
BGAnimation *pBGA = new BGAnimation;
|
||||||
|
pBGA->LoadFromAniDir( ID.filename );
|
||||||
|
return pBGA;
|
||||||
|
}
|
||||||
|
else
|
||||||
RageException::Throw("File \"%s\" has unknown type, \"%s\"",
|
RageException::Throw("File \"%s\" has unknown type, \"%s\"",
|
||||||
ID.filename.c_str(), sExt.c_str() );
|
ID.filename.c_str(), sExt.c_str() );
|
||||||
}
|
}
|
||||||
@@ -127,3 +134,31 @@ void IncorrectActorParametersWarning( const CStringArray &asTokens, int iMaxInde
|
|||||||
if( DISPLAY->IsWindowed() )
|
if( DISPLAY->IsWindowed() )
|
||||||
HOOKS->MessageBoxOK( sError );
|
HOOKS->MessageBoxOK( sError );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UtilSetXY( Actor& actor, CString sClassName )
|
||||||
|
{
|
||||||
|
ASSERT( !actor.GetName().empty() );
|
||||||
|
actor.SetXY( THEME->GetMetricF(sClassName,actor.GetName()+"X"), THEME->GetMetricF(sClassName,actor.GetName()+"Y") );
|
||||||
|
}
|
||||||
|
|
||||||
|
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName )
|
||||||
|
{
|
||||||
|
ASSERT( !actor.GetName().empty() );
|
||||||
|
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+sCommandName+"Command") );
|
||||||
|
}
|
||||||
|
|
||||||
|
float UtilOnCommand( Actor& actor, CString sClassName )
|
||||||
|
{
|
||||||
|
ASSERT( !actor.GetName().empty() );
|
||||||
|
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+"OnCommand") );
|
||||||
|
}
|
||||||
|
|
||||||
|
float UtilOffCommand( Actor& actor, CString sClassName )
|
||||||
|
{
|
||||||
|
// HACK: It's very often that we command things to TweenOffScreen
|
||||||
|
// that we aren't drawing. We know that an Actor is not being
|
||||||
|
// used if it's name is blank. So, do nothing on Actors with a blank name.
|
||||||
|
if( actor.GetName().empty() )
|
||||||
|
return 0;
|
||||||
|
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+"OffCommand") );
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Actor.h"
|
#include "Actor.h"
|
||||||
#include "ThemeManager.h"
|
|
||||||
#include "RageTexture.h"
|
#include "RageTexture.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -23,42 +22,19 @@
|
|||||||
#define COMMAND( actor, command_name ) UtilCommand( actor, m_sName, command_name )
|
#define COMMAND( actor, command_name ) UtilCommand( actor, m_sName, command_name )
|
||||||
|
|
||||||
|
|
||||||
inline void UtilSetXY( Actor& actor, CString sClassName )
|
void UtilSetXY( Actor& actor, CString sClassName );
|
||||||
{
|
|
||||||
ASSERT( !actor.GetName().empty() );
|
|
||||||
actor.SetXY( THEME->GetMetricF(sClassName,actor.GetName()+"X"), THEME->GetMetricF(sClassName,actor.GetName()+"Y") );
|
|
||||||
}
|
|
||||||
inline void UtilSetXY( Actor* pActor, CString sClassName ) { UtilSetXY( *pActor, sClassName ); }
|
inline void UtilSetXY( Actor* pActor, CString sClassName ) { UtilSetXY( *pActor, sClassName ); }
|
||||||
|
|
||||||
|
|
||||||
inline float UtilOnCommand( Actor& actor, CString sClassName )
|
float UtilOnCommand( Actor& actor, CString sClassName );
|
||||||
{
|
|
||||||
ASSERT( !actor.GetName().empty() );
|
|
||||||
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+"OnCommand") );
|
|
||||||
}
|
|
||||||
inline float UtilOnCommand( Actor* pActor, CString sClassName ) { return UtilOnCommand( *pActor, sClassName ); }
|
inline float UtilOnCommand( Actor* pActor, CString sClassName ) { return UtilOnCommand( *pActor, sClassName ); }
|
||||||
|
|
||||||
|
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName );
|
||||||
inline float UtilCommand( Actor& actor, CString sClassName, CString sCommandName )
|
|
||||||
{
|
|
||||||
ASSERT( !actor.GetName().empty() );
|
|
||||||
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+sCommandName+"Command") );
|
|
||||||
}
|
|
||||||
inline float UtilCommand( Actor* pActor, CString sClassName, CString sCommandName ) { return UtilCommand( *pActor, sClassName, sCommandName ); }
|
inline float UtilCommand( Actor* pActor, CString sClassName, CString sCommandName ) { return UtilCommand( *pActor, sClassName, sCommandName ); }
|
||||||
|
|
||||||
|
float UtilOffCommand( Actor& actor, CString sClassName );
|
||||||
inline float UtilOffCommand( Actor& actor, CString sClassName )
|
|
||||||
{
|
|
||||||
// HACK: It's very often that we command things to TweenOffScreen
|
|
||||||
// that we aren't drawing. We know that an Actor is not being
|
|
||||||
// used if it's name is blank. So, do nothing on Actors with a blank name.
|
|
||||||
if( actor.GetName().empty() )
|
|
||||||
return 0;
|
|
||||||
return actor.Command( THEME->GetMetric(sClassName,actor.GetName()+"OffCommand") );
|
|
||||||
}
|
|
||||||
inline float UtilOffCommand( Actor* pActor, CString sClassName ) { return UtilOffCommand( *pActor, sClassName ); }
|
inline float UtilOffCommand( Actor* pActor, CString sClassName ) { return UtilOffCommand( *pActor, sClassName ); }
|
||||||
|
|
||||||
|
|
||||||
inline float UtilSetXYAndOnCommand( Actor& actor, CString sClassName )
|
inline float UtilSetXYAndOnCommand( Actor& actor, CString sClassName )
|
||||||
{
|
{
|
||||||
UtilSetXY( actor, sClassName );
|
UtilSetXY( actor, sClassName );
|
||||||
|
|||||||
Reference in New Issue
Block a user