[ScreenGameplaySyncMachine] Allow themes to use either .ssc or .sm files.

This commit is contained in:
AJ Kelly
2011-02-22 19:35:06 -06:00
parent 46f9ae63d0
commit 68300c1d53
2 changed files with 8 additions and 2 deletions
+1
View File
@@ -18,6 +18,7 @@ sm-ssc v1.2.3 | 201102??
* [ScreenEdit] Display the Player Number for Routine mode. [Wolfman2000] * [ScreenEdit] Display the Player Number for Routine mode. [Wolfman2000]
* [ScreenEdit] Add format string metrics for the right hand side of the editor. * [ScreenEdit] Add format string metrics for the right hand side of the editor.
[Wolfman2000] [Wolfman2000]
* [ScreenGameplaySyncMachine] Allow themes to use either .ssc or .sm files [AJ]
20110221 20110221
-------- --------
+7 -2
View File
@@ -1,6 +1,7 @@
#include "global.h" #include "global.h"
#include "ScreenGameplaySyncMachine.h" #include "ScreenGameplaySyncMachine.h"
#include "NotesLoaderSSC.h" #include "NotesLoaderSSC.h"
#include "NotesLoaderSM.h"
#include "GameState.h" #include "GameState.h"
#include "GameManager.h" #include "GameManager.h"
#include "PrefsManager.h" #include "PrefsManager.h"
@@ -19,7 +20,11 @@ void ScreenGameplaySyncMachine::Init()
AdjustSync::ResetOriginalSyncData(); AdjustSync::ResetOriginalSyncData();
RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music"); RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music");
SSCLoader::LoadFromSSCFile( sFile, m_Song ); // Allow themers to use .ssc and .sm files. -aj
bool bLoadedSSCFile = SSCLoader::LoadFromSSCFile( sFile, m_Song );
if( !bLoadedSSCFile )
SMLoader::LoadFromSMFile( sFile, m_Song );
m_Song.SetSongDir( Dirname(sFile) ); m_Song.SetSongDir( Dirname(sFile) );
m_Song.TidyUpData(); m_Song.TidyUpData();
@@ -27,7 +32,7 @@ void ScreenGameplaySyncMachine::Init()
// needs proper StepsType - freem // needs proper StepsType - freem
vector<Steps*> vpSteps; vector<Steps*> vpSteps;
SongUtil::GetPlayableSteps( &m_Song, vpSteps ); SongUtil::GetPlayableSteps( &m_Song, vpSteps );
ASSERT(vpSteps.size() > 0); ASSERT_M(vpSteps.size() > 0, "No playable steps for ScreenGameplaySyncMachine");
Steps *pSteps = vpSteps[0]; Steps *pSteps = vpSteps[0];
GAMESTATE->m_pCurSteps[0].Set( pSteps ); GAMESTATE->m_pCurSteps[0].Set( pSteps );