- Fix Android compilation issues

- Added a "cachesize" option (not available from the menu, but can be manually edited in players/options.txt, for example cachesize=200 means 200MB of cache). The hardcoded cache on windows/linux is 20MB, which is not enough for Hi Res cards (60 is better, 200 is great)
This commit is contained in:
wagic.the.homebrew
2011-10-02 09:05:39 +00:00
parent 9e572ee416
commit 3decbe7f1d
5 changed files with 16 additions and 12 deletions

View File

@@ -894,13 +894,7 @@ void ResourceManagerImpl::RemoveWFonts()
void ResourceManagerImpl::ResetCacheLimits()
{
#if defined WIN32 || defined LINUX || defined (IOS)
#ifdef FORCE_LOW_CACHE_MEMORY
textureWCache.Resize(kConstrainedCacheLimit, MAX_CACHE_OBJECTS);
#else
textureWCache.Resize(HUGE_CACHE_LIMIT,MAX_CACHE_OBJECTS);
#endif
#else
#if defined PSP
unsigned int ram = ramAvailable();
unsigned int myNewSize = ram - OPERATIONAL_SIZE + textureWCache.totalSize;
if (myNewSize < TEXTURES_CACHE_MINSIZE)
@@ -908,6 +902,14 @@ void ResourceManagerImpl::ResetCacheLimits()
DebugTrace( "Error, Not enough RAM for Cache: " << myNewSize << " - total Ram: " << ram);
}
textureWCache.Resize(MIN(myNewSize, HUGE_CACHE_LIMIT), MAX_CACHE_OBJECTS);
#else
#ifdef FORCE_LOW_CACHE_MEMORY
textureWCache.Resize(kConstrainedCacheLimit, MAX_CACHE_OBJECTS);
#else
unsigned long cacheSize = options["cachesize"].number ? (unsigned long)(options["cachesize"].number) * 1024 * 1024 : HUGE_CACHE_LIMIT;
textureWCache.Resize(cacheSize,MAX_CACHE_OBJECTS);
#endif
#endif
return;
}