remove .sprite file support. Use .xml instead

This commit is contained in:
Chris Danford
2005-07-26 20:00:19 +00:00
parent dda9f61179
commit 7cfcce6e7d
5 changed files with 4 additions and 41 deletions
-3
View File
@@ -440,7 +440,6 @@ void ActorUtil::SortByZPosition( vector<Actor*> &vActors )
static const CString FileTypeNames[] = {
"Actor",
"Bitmap",
"Sprite",
"Movie",
"Directory",
"Xml",
@@ -468,8 +467,6 @@ FileType ActorUtil::GetFileType( const CString &sPath )
sExt=="avi" ||
sExt=="mpeg" ||
sExt=="mpg" ) return FT_Movie;
else if(
sExt=="sprite" ) return FT_Sprite;
else if(
sExt=="txt" ) return FT_Model;
else return FT_Invalid;
-1
View File
@@ -29,7 +29,6 @@ enum FileType
{
FT_Actor,
FT_Bitmap,
FT_Sprite,
FT_Movie,
FT_Directory,
FT_Xml,
+3 -35
View File
@@ -111,9 +111,8 @@ bool Sprite::LoadBG( RageTextureID ID )
bool Sprite::Load( RageTextureID ID )
{
bool result;
if( ID.filename == "" ) result = true;
if( ID.filename.Right(7) == ".sprite" )
result = LoadFromSpriteFile( ID );
if( ID.filename == "" )
result = true;
else
result = LoadFromTexture( ID );
@@ -138,7 +137,7 @@ retry:
GetDirListing( sPath + "*", asElementPaths, false, true );
if( asElementPaths.size() == 0 )
{
CString sMessage = ssprintf( "The sprite file '%s' points to a texture '%s' which doesn't exist.", m_sSpritePath.c_str(), sPath.c_str() );
CString sMessage = ssprintf( "A Sprite in '%s' points to a texture '%s' which doesn't exist.", sDir.c_str(), sPath.c_str() );
switch( Dialog::AbortRetryIgnore(sMessage) )
{
case Dialog::abort:
@@ -196,37 +195,6 @@ retry:
Actor::LoadFromNode( sDir, pNode );
}
// Sprite file has the format:
//
// [Sprite]
// Texture=Textures\Logo.bmp
// Frame0000=0
// Delay0000=1.0
// Frame0001=3
// Delay0000=2.0
// BaseRotationXDegrees=0
// BaseRotationYDegrees=0
// BaseRotationZDegrees=0
// BaseZoomX=1
// BaseZoomY=1
// BaseZoomZ=1
bool Sprite::LoadFromSpriteFile( RageTextureID ID )
{
LOG->Trace( ssprintf("Sprite::LoadFromSpriteFile(%s)", ID.filename.c_str()) );
//Init();
m_sSpritePath = ID.filename;
// read sprite file
IniFile ini;
if( !ini.ReadFile( m_sSpritePath ) )
RageException::Throw( "Error opening Sprite file '%s'.", m_sSpritePath.c_str() );
LoadFromNode( Dirname(m_sSpritePath), ini.GetChild("Sprite") );
return true;
}
void Sprite::UnloadTexture()
{
if( m_pTexture != NULL ) // If there was a previous bitmap...
-1
View File
@@ -74,7 +74,6 @@ public:
protected:
virtual bool LoadFromTexture( RageTextureID ID );
virtual bool LoadFromSpriteFile( RageTextureID ID );
void DrawTexture( const TweenState *state );
+1 -1
View File
@@ -386,7 +386,7 @@ try_element_again:
static const char *masks[NUM_ElementCategory][14] = {
{ "redir", "", "actor", "xml", NULL },
{ "redir", "ini", NULL },
{ "redir", "xml", "actor", "sprite", "png", "jpg", "bmp", "gif","avi", "mpg", "mpeg", "txt", "", NULL},
{ "redir", "xml", "actor", "png", "jpg", "bmp", "gif","avi", "mpg", "mpeg", "txt", "", NULL},
{ "redir", "png", NULL },
{ "redir", "mp3", "ogg", "wav", NULL },
{ "*", NULL },