From 58f88569d5806c7a9d70152c9bbb123ff626e7ab Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Wed, 5 Mar 2025 04:56:33 -0800 Subject: [PATCH] Remove AdjustForChangedSystemCapabilities() from StepMania.cpp Remove this method, which only executes on Windows, which overwrites a few of your preferences based on whether or not you have at least 192MB of free RAM. The entire body of the function is wrapped in _WIN32 ifdefs. It is the only function making use of the LastSeenMemory value stored in Preferences.ini. --- src/StepMania.cpp | 50 ----------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 6312dff364..4b9203c8af 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -73,11 +73,6 @@ #include #include -#if defined(_WIN32) -#define WIN32_LEAN_AND_MEAN -#include -#endif - void ShutdownGame(); bool HandleGlobalInputs( const InputEventPlus &input ); void HandleInputEvents(float fDeltaTime); @@ -387,49 +382,6 @@ RString StepMania::GetSelectMusicScreen() return SELECT_MUSIC_SCREEN.GetValue(); } -#if defined(_WIN32) -static Preference g_iLastSeenMemory( "LastSeenMemory", 0 ); -#endif - -static void AdjustForChangedSystemCapabilities() -{ -#if defined(_WIN32) - // Has the amount of memory changed? - MEMORYSTATUS mem; - GlobalMemoryStatus(&mem); - - const int Memory = mem.dwTotalPhys / (1024*1024); - - if( g_iLastSeenMemory == Memory ) - return; - - LOG->Trace( "Memory changed from %i to %i; settings changed", g_iLastSeenMemory.Get(), Memory ); - g_iLastSeenMemory.Set( Memory ); - - // is this assumption outdated? -aj - /* Let's consider 128-meg systems low-memory, and 256-meg systems high-memory. - * Cut off at 192. This is pretty conservative; many 128-meg systems can - * deal with higher memory profile settings, but some can't. - * - * Actually, Windows lops off a meg or two; cut off a little lower to treat - * 192-meg systems as high-memory. */ - const bool HighMemory = (Memory >= 190); - const bool LowMemory = (Memory < 100); // 64 and 96-meg systems - - /* Two memory-consuming features that we can disable are texture caching and - * preloaded banners. Texture caching can use a lot of memory; disable it for - * low-memory systems. */ - PREFSMAN->m_bDelayedTextureDelete.Set( HighMemory ); - - /* Preloaded banners takes about 9k per song. Although it's smaller than the - * actual song data, it still adds up with a lot of songs. - * Disable it for 64-meg systems. */ - PREFSMAN->m_ImageCache.Set( LowMemory ? IMGCACHE_OFF:IMGCACHE_LOW_RES_PRELOAD ); - - PREFSMAN->SavePrefsToDisk(); -#endif -} - #if defined(_WIN32) #include "RageDisplay_D3D.h" #include "archutils/Win32/VideoDriverInfo.h" @@ -947,8 +899,6 @@ int sm_main(int argc, char* argv[]) LOG->Info( "TLS is %savailable", RageThread::GetSupportsTLS()? "":"not " ); #endif - AdjustForChangedSystemCapabilities(); - GAMEMAN = new GameManager; THEME = new ThemeManager; ANNOUNCER = new AnnouncerManager;