From 19f3338e5aba30a47eb80f9929fe94553cc33154 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 30 Oct 2003 23:47:01 +0000 Subject: [PATCH] Allow hinting sprite loads through MakeActor --- stepmania/src/ActorUtil.cpp | 12 ++++++------ stepmania/src/ActorUtil.h | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index bbf0ecc4ac..3504b4a32e 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -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 ) diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index 475cd9d0f6..9555584ecb 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -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