From 63c38701ee8a8db57b093bfd587a6ec2cb103d0a Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Tue, 15 Mar 2011 02:33:44 -0500 Subject: [PATCH 1/5] update lua docs --- Docs/Luadoc/Lua.xml | 43 +++++++++++++++++++++++----- Docs/Luadoc/LuaDocumentation.xml | 49 ++++++++++++++++++++++++++++---- 2 files changed, 79 insertions(+), 13 deletions(-) diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index 4f921c8a65..634915d001 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -42,10 +42,10 @@ + - @@ -177,11 +177,11 @@ - + @@ -672,6 +672,7 @@ + @@ -801,6 +802,10 @@ + + + + @@ -826,6 +831,9 @@ + + + @@ -856,9 +864,11 @@ + + @@ -876,6 +886,9 @@ + + + @@ -917,6 +930,7 @@ + @@ -1100,6 +1114,7 @@ + @@ -1245,6 +1260,7 @@ + @@ -1353,6 +1369,8 @@ + + @@ -1583,6 +1601,10 @@ + + + + @@ -1696,9 +1718,10 @@ - - - + + + + @@ -1752,6 +1775,7 @@ + @@ -1779,6 +1803,11 @@ + + + + + @@ -1963,6 +1992,6 @@ - sm-ssc v1.2.2 - 2011-02-21 + sm-ssc v1.2.3 + 2011-03-15 diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 9fb419a4a8..7f33265edb 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -1526,6 +1526,9 @@ Returns true if enough credits have been inserted to join. + + fishpolk.mid; See also: Rise of the Triad + Returns the environment table. See . @@ -1898,6 +1901,14 @@ Loads the HoldJudgment for the specified MultiPlayer. + + + Returns the X position of the mouse. + + + Returns the Y position of the mouse. + + Returns the amount of life left in the LifeMeter as a float in the range 0..1. @@ -1964,7 +1975,7 @@ - + Sets the width of the MeterDisplay to fWidth. @@ -2045,6 +2056,9 @@ Returns an index of the choice in the row that player pn is on. + + Returns the OptionRow's layout type. + Returns the name of the OptionRow. @@ -2054,6 +2068,9 @@ Returns the row title string. + + Returns the OptionRow's select type. + Returns true if this row is focused by player pn. @@ -2080,6 +2097,11 @@ + + + Returns the current NoteSkin set in the PlayerOptions. + + Returns true if a full combo (TNS_W3 and up) was obtained. @@ -2208,8 +2230,11 @@ Returns the player number for this PlayerState. - - Returns a string of player options for the specified ModsLevel. + + Returns a PlayerOptions object for the specified ModsLevel. + + + Returns a string of player options for the specified ModsLevel. (was GetPlayerOptions in v1.2.2 and prior) Returns a table of strings, containing the player options for the specified ModsLevel. @@ -2667,6 +2692,9 @@ Returns true if the player is going to the options screen. + + Returns the MusicWheel used on this screen. + [02 StageMods.lua] Sets up modifiers for course modes. @@ -3059,12 +3087,15 @@ - - Returns the Steps description. - Returns the author that made that particular Steps pattern. + + Returns the Chart Style for this Steps. + + + Returns the Steps description. + Returns the Steps difficulty. @@ -3342,6 +3373,12 @@ + + Returns the wheel's current index. + + + Returns the total number of items in the wheel. + Returns the WheelItem at index iIndex. From 0d8045023036d67f2653914024a8dd9c1b5ffeeb Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 15 Mar 2011 12:05:35 -0400 Subject: [PATCH 2/5] Figures I'd miss one of these. Thanks to @dtinth for catching it. --- src/NotesLoaderBMS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index 4832fa78da..c3cc7684e6 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -786,7 +786,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() ); sWavID.MakeUpper(); // HACK: undo the MakeLower() - out.m_vsKeysoundFile.push_back( sData ); + out.m_vsKeysoundFile.push_back( nData ); idToKeySoundIndexOut[ sWavID ] = out.m_vsKeysoundFile.size()-1; LOG->Trace( "Inserting keysound index %u '%s'", unsigned(out.m_vsKeysoundFile.size()-1), sWavID.c_str() ); } From ad75520446e9c440a8d51aa2ba8097c9391b8246 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Tue, 15 Mar 2011 15:08:21 -0500 Subject: [PATCH 3/5] revert change that disallowed reloading of fonts via F2 --- src/Font.cpp | 1 - src/FontManager.cpp | 22 ++++++++++++++-------- src/FontManager.h | 2 +- src/ScreenManager.cpp | 35 +++++++++++++++++++++-------------- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/src/Font.cpp b/src/Font.cpp index 4fd73591d2..3c3cdf1e4a 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -728,7 +728,6 @@ void Font::Load( const RString &sIniPath, RString sChars ) Font subfont; subfont.Load(fPath,""); MergeFont(subfont); - //FONT->UnloadFont(subfont); } } diff --git a/src/FontManager.cpp b/src/FontManager.cpp index 1500a78e29..380f00384b 100644 --- a/src/FontManager.cpp +++ b/src/FontManager.cpp @@ -22,7 +22,7 @@ FontManager::~FontManager() { const FontName &fn = i->first; Font* pFont = i->second; - if(pFont->m_iRefCount>0) { + if(pFont->m_iRefCount > 0) { LOG->Trace( "FONT LEAK: '%s', RefCount = %d.", fn.first.c_str(), pFont->m_iRefCount ); } delete pFont; @@ -53,14 +53,13 @@ Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sCha { pFont=p->second; pFont->m_iRefCount++; - } - else { - pFont= new Font; - pFont->Load(sFontOrTextureFilePath, sChars); - g_mapPathToFont[NewName] = pFont; + return pFont; } - return pFont; + Font *f = new Font; + f->Load(sFontOrTextureFilePath, sChars); + g_mapPathToFont[NewName] = f; + return f; } Font *FontManager::CopyFont( Font *pFont ) @@ -79,16 +78,22 @@ void FontManager::UnloadFont( Font *fp ) if(i->second != fp) continue; - ASSERT_M(fp->m_iRefCount>0,"Attempting to unload a font with zero ref count!"); + ASSERT_M(fp->m_iRefCount > 0,"Attempting to unload a font with zero ref count!"); i->second->m_iRefCount--; + if( fp->m_iRefCount == 0 ) + { + delete i->second; // free the texture + g_mapPathToFont.erase( i ); // and remove the key in the map + } return; } FAIL_M( ssprintf("Unloaded an unknown font (%p)", fp) ); } +/* void FontManager::PruneFonts() { for( std::map::iterator i = g_mapPathToFont.begin();i != g_mapPathToFont.end();) { Font *fp=i->second; @@ -101,6 +106,7 @@ void FontManager::PruneFonts() { } } } +*/ /* * (c) 2001-2003 Chris Danford, Glenn Maynard diff --git a/src/FontManager.h b/src/FontManager.h index 9124d694f9..f3159ab006 100644 --- a/src/FontManager.h +++ b/src/FontManager.h @@ -15,7 +15,7 @@ public: Font* LoadFont( const RString &sFontOrTextureFilePath, RString sChars = "" ); Font *CopyFont( Font *pFont ); void UnloadFont( Font *fp ); - void PruneFonts(); + //void PruneFonts(); /* Warning: This reloads fonts completely, so all BitmapTexts need to be * reset, too. If this isn't done, best case they end up with old font diff --git a/src/ScreenManager.cpp b/src/ScreenManager.cpp index 15dcc3bc32..ed8549f05d 100644 --- a/src/ScreenManager.cpp +++ b/src/ScreenManager.cpp @@ -76,7 +76,7 @@ ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program static Preference g_bDelayedScreenLoad( "DelayedScreenLoad", false ); -static Preference g_bPruneFonts( "PruneFonts", true ); +//static Preference g_bPruneFonts( "PruneFonts", true ); // Screen registration static map *g_pmapRegistrees = NULL; @@ -592,9 +592,11 @@ void ScreenManager::PrepareScreen( const RString &sScreenName ) } // Prune any unused fonts now that we have had a chance to reference the fonts + /* if(g_bPruneFonts) { FONT->PruneFonts(); } + */ TEXTUREMAN->DiagnosticOutput(); } @@ -690,17 +692,19 @@ void ScreenManager::LoadDelayedScreen() * cleanup, so it doesn't get deleted by cleanup. */ bool bLoaded = ActivatePreparedScreenAndBackground( sScreenName ); - bool deletePrepared=g_setGroupedScreens.find(sScreenName) == g_setGroupedScreens.end(); - - /* It's time to delete all old prepared screens. Depending on DelayedScreenLoad, - * we can either delete the screens before or after we load the new screen. - * Either way, we must remove them from the prepared list before we prepare - * new screens. - * If DelayedScreenLoad is true, delete them now; this lowers memory - * requirements, but results in redundant loads as we unload common data. */ - if( deletePrepared && g_bDelayedScreenLoad ) { - DeletePreparedScreens(); - deletePrepared=false; + vector apActorsToDelete; + if( g_setGroupedScreens.find(sScreenName) == g_setGroupedScreens.end() ) + { + /* It's time to delete all old prepared screens. Depending on + * DelayedScreenLoad, we can either delete the screens before or after + * we load the new screen. Either way, we must remove them from the + * prepared list before we prepare new screens. + * If DelayedScreenLoad is true, delete them now; this lowers memory + * requirements, but results in redundant loads as we unload common data. */ + if( g_bDelayedScreenLoad ) + DeletePreparedScreens(); + else + GrabPreparedActors( apActorsToDelete ); } // If the screen wasn't already prepared, load it. @@ -717,9 +721,12 @@ void ScreenManager::LoadDelayedScreen() ASSERT( bLoaded ); } - if( deletePrepared ) + if( !apActorsToDelete.empty() ) { - DeletePreparedScreens(); + BeforeDeleteScreen(); + FOREACH( Actor*, apActorsToDelete, a ) + SAFE_DELETE( *a ); + AfterDeleteScreen(); } MESSAGEMAN->Broadcast( Message_ScreenChanged ); From 6c1cc8c05c366f384ac89b019ee528437feabe7f Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Tue, 15 Mar 2011 15:27:45 -0500 Subject: [PATCH 4/5] cleanup --- src/RageInputDevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RageInputDevice.h b/src/RageInputDevice.h index 84230edd81..af28513bc2 100644 --- a/src/RageInputDevice.h +++ b/src/RageInputDevice.h @@ -321,7 +321,7 @@ public: /* Whether this button is pressed. This is level with a threshold and * debouncing applied. */ bool bDown; - + RageTimer ts; DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), x(0), y(0), bDown(false), ts(RageZeroTimer) { } From daf01e3496c51f6121002a5945502de8f73a83ad Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Tue, 15 Mar 2011 15:27:57 -0500 Subject: [PATCH 5/5] make mouse buttons show proper names instead of 'Mouse 0' --- src/RageInputDevice.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/RageInputDevice.cpp b/src/RageInputDevice.cpp index 9421dc17b0..354baa5110 100644 --- a/src/RageInputDevice.cpp +++ b/src/RageInputDevice.cpp @@ -155,9 +155,6 @@ RString DeviceButtonToString( DeviceButton key ) if( key >= MIDI_FIRST && key <= MIDI_LAST ) return ssprintf( "Midi %d", key-MIDI_FIRST ); - if( key >= MOUSE_LEFT && key <= MOUSE_WHEELDOWN ) - return ssprintf( "Mouse %d", key-MOUSE_LEFT ); - map::const_iterator it = g_mapNamesToString.find( key ); if( it != g_mapNamesToString.end() ) return it->second;