From 488d166ba4468e2d0e8e47708d4b0ab60522b73f Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 26 Sep 2006 09:32:14 +0000 Subject: [PATCH] Deprecated. Note that lua_objlen() doesn't actually return the number of elements in the table. It simply evaluates the new # operator which will return the first integer n such that t[n] is not nil and t[n+1] is nil. Note that this means that this is only useful for tables which have no "holes" and integer indexes (starting at 1). If you really want the table size, you have to walk the whole table (using next() or pairs() in Lua or lua_next() in C). --- stepmania/src/ScreenDebugOverlay.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stepmania/src/ScreenDebugOverlay.cpp b/stepmania/src/ScreenDebugOverlay.cpp index e4c4a07314..ce252d89c6 100644 --- a/stepmania/src/ScreenDebugOverlay.cpp +++ b/stepmania/src/ScreenDebugOverlay.cpp @@ -507,12 +507,12 @@ class DebugLineAutosync : public IDebugLine virtual bool IsEnabled() { return GAMESTATE->m_SongOptions.GetSong().m_AutosyncType!=SongOptions::AUTOSYNC_OFF; } virtual void Do( RString &sMessageOut ) { - SongOptions::AutosyncType as = enum_add2( GAMESTATE->m_SongOptions.GetSong().m_AutosyncType, 1 ); + int as = GAMESTATE->m_SongOptions.GetSong().m_AutosyncType + 1; bool bAllowSongAutosync = !GAMESTATE->IsCourseMode(); if( !bAllowSongAutosync && as == SongOptions::AUTOSYNC_SONG ) as = SongOptions::AUTOSYNC_MACHINE; - wrap( (int&)as, SongOptions::NUM_AUTOSYNC_TYPES ); - SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Song, m_AutosyncType, as ); + wrap( as, SongOptions::NUM_AUTOSYNC_TYPES ); + SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Song, m_AutosyncType, SongOptions::AutosyncType(as) ); MESSAGEMAN->Broadcast( Message_AutosyncChanged ); IDebugLine::Do( sMessageOut ); } @@ -525,9 +525,9 @@ class DebugLineCoinMode : public IDebugLine virtual bool IsEnabled() { return true; } virtual void Do( RString &sMessageOut ) { - CoinMode cm = (CoinMode)(PREFSMAN->m_CoinMode+1); - wrap( (int&)cm, NUM_CoinMode ); - PREFSMAN->m_CoinMode.Set( cm ); + int cm = PREFSMAN->m_CoinMode+1; + wrap( cm, NUM_CoinMode ); + PREFSMAN->m_CoinMode.Set( CoinMode(cm) ); SCREENMAN->RefreshCreditsMessages(); IDebugLine::Do( sMessageOut ); }