-Fixed bugs:
(OpenGL) Arrow shader fails on full-screen, causing scrolling brackets
Actor sounds ignore attract sound settings
+ After switching themes, OpenITG crashes on the songwheel
+ Theme switching sometimes causes failed asserts
Phantom input when canceling custom song loads
ScreenArcadeStart loops endlessly until manual exit
-Fixed mistakes:
if( m_sModifiers != "" )
FOREACH_CONST( PlayerNumber, vpns, pn )
GAMESTATE->ApplyModifiers( *pn, m_sModifiers );
- if( m_LuaFunction.IsSet() )
+
+ /* do this here, so we load new metrics before attempting screen loads.
+ * IMPORTANT: re-cache SONGMAN metrics so we don't encounter an ugly crash. */
+ if( m_sTheme != "" && m_sTheme != THEME->GetCurThemeName() )
{
+ THEME->SwitchThemeAndLanguage( m_sTheme, THEME->GetCurLanguage() );
+ SONGMAN->LoadGroupColors();
+ }
+
+ /* This demonstrates a non-trivial error in the LUA subsystem,
+ * or a grave misunderstanding on my part. Why can the LUA
+ * function be set with no actual data?
+ * Oh well. We can get away with just ignoring it here.
+ * -- Vyhd */
+ if( m_LuaFunction.IsSet() && m_LuaFunction.GetExpression() != "" )
+ {
+
Lua *L = LUA->Get();
FOREACH_CONST( PlayerNumber, vpns, pn )
{
m_LuaFunction.PushSelf( L );
- /* UGLY DISGUSTING HACK: if theme switching, work around a
- * crash here. We'll find the actual cause before long... */
- if( lua_isnil(L, -1) && m_sTheme != "" )
- break;
-
ASSERT( !lua_isnil(L, -1) );
-
lua_pushnumber( L, *pn ); // 1st parameter
lua_call( L, 1, 0 ); // call function with 1 argument and 0 results
}
if( m_bStopMusic )
SOUND->StopMusic();
- /* do this here, so we load new metrics before attempting screen loads */
- if( m_sTheme != "" && m_sTheme != THEME->GetCurThemeName() )
- THEME->SwitchThemeAndLanguage( m_sTheme, THEME->GetCurLanguage() );
-
FOREACH_CONST( CString, m_vsScreensToPrepare, s )
SCREENMAN->PrepareScreen( *s );
if( m_bDeletePreparedScreens )
public:
LuaExpression( const CString &sExpression = "" ) { if( sExpression != "" ) SetFromExpression( sExpression ); }
void SetFromExpression( const CString &sExpression );
-
+ CString GetExpression() const { return m_sExpression; }
protected:
virtual void Register();
SongManager::SongManager()
{
- NUM_SONG_GROUP_COLORS .Load("SongManager","NumSongGroupColors");
- SONG_GROUP_COLOR .Load("SongManager",SONG_GROUP_COLOR_NAME,NUM_SONG_GROUP_COLORS);
- NUM_COURSE_GROUP_COLORS .Load("SongManager","NumCourseGroupColors");
- COURSE_GROUP_COLOR .Load("SongManager",COURSE_GROUP_COLOR_NAME,NUM_COURSE_GROUP_COLORS);
+ LoadGroupColors();
}
SongManager::~SongManager()
FreeSongs();
}
+void SongManager::LoadGroupColors()
+{
+ NUM_SONG_GROUP_COLORS .Load("SongManager","NumSongGroupColors");
+ SONG_GROUP_COLOR .Load("SongManager",SONG_GROUP_COLOR_NAME,NUM_SONG_GROUP_COLORS);
+ NUM_COURSE_GROUP_COLORS .Load("SongManager","NumCourseGroupColors");
+ COURSE_GROUP_COLOR .Load("SongManager",COURSE_GROUP_COLOR_NAME,NUM_COURSE_GROUP_COLORS);
+}
+
void SongManager::InitAll( LoadingWindow *ld )
{
InitSongsFromDisk( ld );
RageColor SongManager::GetSongGroupColor( const CString &sSongGroupName )
{
+ CHECKPOINT;
// search for the group index
unsigned i;
for( i=0; i<m_sSongGroupNames.size(); i++ )
{
if( m_sSongGroupNames[i] == sSongGroupName )
+ {
+ CHECKPOINT_M( "Found group name." );
break;
+ }
}
ASSERT_M( i != m_sSongGroupNames.size(), sSongGroupName ); // this is not a valid group
+ CHECKPOINT_M( "Assert not met." );
return SONG_GROUP_COLOR.GetValue( i%NUM_SONG_GROUP_COLORS );
}
void InitSongsFromDisk( LoadingWindow *ld );
void FreeSongs();
void Cleanup();
+ void LoadGroupColors();
void Invalidate( Song *pStaleSong );
void RevertFromDisk( Song *pSong, bool bAllowNotesLoss=false );