From 7cfcce6e7d802c1e2f0785f3471f8fb5132530ca Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 26 Jul 2005 20:00:19 +0000 Subject: [PATCH] remove .sprite file support. Use .xml instead --- stepmania/src/ActorUtil.cpp | 3 --- stepmania/src/ActorUtil.h | 1 - stepmania/src/Sprite.cpp | 38 +++------------------------------- stepmania/src/Sprite.h | 1 - stepmania/src/ThemeManager.cpp | 2 +- 5 files changed, 4 insertions(+), 41 deletions(-) diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 3b87de94ab..d656496512 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -440,7 +440,6 @@ void ActorUtil::SortByZPosition( vector &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; diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index a4617e28fb..bc15016f27 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -29,7 +29,6 @@ enum FileType { FT_Actor, FT_Bitmap, - FT_Sprite, FT_Movie, FT_Directory, FT_Xml, diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index b32e1b4c33..2fc9de393d 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -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... diff --git a/stepmania/src/Sprite.h b/stepmania/src/Sprite.h index 16e36df35a..ae296b2256 100644 --- a/stepmania/src/Sprite.h +++ b/stepmania/src/Sprite.h @@ -74,7 +74,6 @@ public: protected: virtual bool LoadFromTexture( RageTextureID ID ); - virtual bool LoadFromSpriteFile( RageTextureID ID ); void DrawTexture( const TweenState *state ); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 8d6f839e83..0b76e22bca 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -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 },