Create an "Other" category for ScreenHowToPlay steps.sm, and other

files that don't really go anywhere else.

Fix possible ELEMENT_CATEGORY_STRING null pointer dereference.
This commit is contained in:
Glenn Maynard
2003-09-11 23:21:33 +00:00
parent 6b84056a1c
commit f948027667
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay")
}
SMLoader smfile;
smfile.LoadFromSMFile( THEME->GetPathToSM(STEPFILE), m_Song, false );
smfile.LoadFromSMFile( THEME->GetPathToO(STEPFILE), m_Song, false );
ASSERT( m_Song.m_apNotes.size() == 1 );
m_Song.m_apNotes[0]->GetNoteData(&m_NoteData);
+2 -1
View File
@@ -41,7 +41,8 @@ const CString ELEMENT_CATEGORY_STRING[NUM_ELEMENT_CATEGORIES] =
"Fonts",
"Graphics",
"Numbers",
"Sounds"
"Sounds",
"Other"
};
ThemeManager::ThemeManager()
+2 -2
View File
@@ -17,7 +17,7 @@
class IniFile;
enum ElementCategory { BGAnimations, Fonts, Graphics, Numbers, Sounds, SMFiles, NUM_ELEMENT_CATEGORIES };
enum ElementCategory { BGAnimations, Fonts, Graphics, Numbers, Sounds, Other, NUM_ELEMENT_CATEGORIES };
class ThemeManager
{
@@ -41,7 +41,7 @@ public:
CString GetPathToG( CString sFileName, bool bOptional=false ) { return GetPathTo(Graphics,sFileName,bOptional); };
CString GetPathToN( CString sFileName, bool bOptional=false ) { return GetPathTo(Numbers,sFileName,bOptional); };
CString GetPathToS( CString sFileName, bool bOptional=false ) { return GetPathTo(Sounds,sFileName,bOptional); };
CString GetPathToSM( CString sFileName, bool bOptional=false ) { return GetPathTo(SMFiles,sFileName,bOptional); };
CString GetPathToO( CString sFileName, bool bOptional=false ) { return GetPathTo(Other,sFileName,bOptional); };
bool HasMetric( CString sClassName, CString sValueName );
CString GetMetricRaw( CString sClassName, CString sValueName );