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.
This commit is contained in:
@@ -73,11 +73,6 @@
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void ShutdownGame();
|
void ShutdownGame();
|
||||||
bool HandleGlobalInputs( const InputEventPlus &input );
|
bool HandleGlobalInputs( const InputEventPlus &input );
|
||||||
void HandleInputEvents(float fDeltaTime);
|
void HandleInputEvents(float fDeltaTime);
|
||||||
@@ -387,49 +382,6 @@ RString StepMania::GetSelectMusicScreen()
|
|||||||
return SELECT_MUSIC_SCREEN.GetValue();
|
return SELECT_MUSIC_SCREEN.GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
static Preference<int> 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)
|
#if defined(_WIN32)
|
||||||
#include "RageDisplay_D3D.h"
|
#include "RageDisplay_D3D.h"
|
||||||
#include "archutils/Win32/VideoDriverInfo.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 " );
|
LOG->Info( "TLS is %savailable", RageThread::GetSupportsTLS()? "":"not " );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AdjustForChangedSystemCapabilities();
|
|
||||||
|
|
||||||
GAMEMAN = new GameManager;
|
GAMEMAN = new GameManager;
|
||||||
THEME = new ThemeManager;
|
THEME = new ThemeManager;
|
||||||
ANNOUNCER = new AnnouncerManager;
|
ANNOUNCER = new AnnouncerManager;
|
||||||
|
|||||||
Reference in New Issue
Block a user