From 7c4f2595abeb99c5557385cbab5ae7887e87465e Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 2 Sep 2005 00:09:21 +0000 Subject: [PATCH] Remove support for .actor. Use .xml instead. --- stepmania/src/ActorUtil.cpp | 21 ++------------------- stepmania/src/ActorUtil.h | 1 - stepmania/src/Background.cpp | 1 - stepmania/src/ThemeManager.cpp | 14 +++++++------- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 87e4e46c22..3c350b5841 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -232,7 +232,7 @@ Actor* ActorUtil::LoadFromActorFile( const CString& sDir, const XNode* pNode ) * loading the layer we're in. */ if( sFile == "" ) { - CString sError = ssprintf( "The actor file in '%s' is missing the File attribute or has an invalid Class \"%s\"", + CString sError = ssprintf( "An xml file in '%s' is missing the File attribute or has an invalid Class \"%s\"", sDir.c_str(), sClass.c_str() ); Dialog::OK( sError ); pReturn = new Sprite; // Return a dummy object so that we don't crash in AutoActor later. @@ -287,21 +287,6 @@ Actor* ActorUtil::MakeActor( const RageTextureID &ID ) CString sDir = Dirname( ID.filename ); return LoadFromActorFile( sDir, &xml ); } - case FT_Actor: - { - // TODO: Check for recursive loading - IniFile ini; - if( !ini.ReadFile( ID.filename ) ) - RageException::Throw( "%s", ini.GetError().c_str() ); - - CString sDir = Dirname( ID.filename ); - - const XNode* pNode = ini.GetChild( "Actor" ); - if( pNode == NULL ) - RageException::Throw( "The file '%s' doesn't have layer 'Actor'.", ID.filename.c_str() ); - - return LoadFromActorFile( sDir, pNode ); - } case FT_Directory: { CString sDir = ID.filename; @@ -425,7 +410,6 @@ void ActorUtil::SortByZPosition( vector &vActors ) } static const CString FileTypeNames[] = { - "Actor", "Bitmap", "Movie", "Directory", @@ -439,8 +423,7 @@ FileType ActorUtil::GetFileType( const CString &sPath ) CString sExt = GetExtension( sPath ); sExt.MakeLower(); - if( sExt=="xml" ) return FT_Xml; - else if( sExt=="actor" ) return FT_Actor; + if( sExt=="xml" ) return FT_Xml; else if( sExt=="png" || sExt=="jpg" || diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index bc15016f27..90aa409eb7 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -27,7 +27,6 @@ typedef Actor* (*CreateActorFn)(const CString& sDir, const XNode* pNode); enum FileType { - FT_Actor, FT_Bitmap, FT_Movie, FT_Directory, diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index edbbd6a4fb..03e94671a0 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -368,7 +368,6 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun case FT_Movie: sEffect = SBE_StretchNormal; break; - case FT_Actor: case FT_Directory: case FT_Xml: case FT_Model: diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 75c8c9ba46..469d67f8fa 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -334,7 +334,7 @@ CString ThemeManager::GetPathToAndFallback( const CString &sThemeName, ElementCa CString sFallback; GetMetricRaw( sClass, "Fallback", sFallback ); if( sFallback.empty() ) - return ""; + return NULL; sClass = sFallback; } @@ -373,9 +373,9 @@ try_element_again: for( unsigned p = 0; p < asPaths.size(); ++p ) { static const char *masks[NUM_ElementCategory][14] = { - { "redir", "", "actor", "xml", NULL }, + { "redir", "", "xml", NULL }, { "redir", "ini", NULL }, - { "redir", "xml", "actor", "png", "jpg", "bmp", "gif","avi", "mpg", "mpeg", "txt", "", NULL}, + { "redir", "xml", "png", "jpg", "bmp", "gif","avi", "mpg", "mpeg", "txt", "", NULL}, { "redir", "png", NULL }, { "redir", "mp3", "ogg", "wav", NULL }, { "*", NULL }, @@ -408,7 +408,7 @@ try_element_again: // HACK: have Fonts fall back to Numbers. Eventually Numbers will be removed. if( category == EC_FONTS ) return GetPathToRaw( sThemeName, EC_NUMBERS, sClassName, sElement ) ; - return ""; // This isn't fatal. + return NULL; // This isn't fatal. } if( asElementPaths.size() > 1 ) @@ -524,7 +524,7 @@ try_element_again: if( bOptional ) { Cache[sFileName] = ""; - return ""; + return NULL; } const CString &sCategory = ElementCategoryToString(category); @@ -564,7 +564,7 @@ try_element_again: GetThemeDirFromName(BASE_THEME_NAME).c_str() ); default: ASSERT(0); - return ""; + return NULL; } } @@ -645,7 +645,7 @@ try_metric_again: ReloadMetrics(); goto try_metric_again; case Dialog::ignore: - return ""; + return NULL; default: ASSERT(0); }