From f948027667fe8db238e02d6eb21dd8fa0cbece24 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 11 Sep 2003 23:21:33 +0000 Subject: [PATCH] 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. --- stepmania/src/ScreenHowToPlay.cpp | 2 +- stepmania/src/ThemeManager.cpp | 3 ++- stepmania/src/ThemeManager.h | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index 54a47b93ba..3bb1d468e9 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -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); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index ad0f3c78ef..8b90267104 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -41,7 +41,8 @@ const CString ELEMENT_CATEGORY_STRING[NUM_ELEMENT_CATEGORIES] = "Fonts", "Graphics", "Numbers", - "Sounds" + "Sounds", + "Other" }; ThemeManager::ThemeManager() diff --git a/stepmania/src/ThemeManager.h b/stepmania/src/ThemeManager.h index d57e545ec9..943c958cb4 100644 --- a/stepmania/src/ThemeManager.h +++ b/stepmania/src/ThemeManager.h @@ -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 );