diff options
author | Filippos Karapetis | 2011-01-28 16:13:12 +0000 |
---|---|---|
committer | Filippos Karapetis | 2011-01-28 16:13:12 +0000 |
commit | a2f960017931ad871c37bf1d9c197418aa8afca9 (patch) | |
tree | ea003cd1f548266f26255e048d1d575673b981d7 /engines/sword25/gfx/animationresource.cpp | |
parent | 7760628bdba085f57711b18c3fa9fdff6c12a38b (diff) | |
download | scummvm-rg350-a2f960017931ad871c37bf1d9c197418aa8afca9.tar.gz scummvm-rg350-a2f960017931ad871c37bf1d9c197418aa8afca9.tar.bz2 scummvm-rg350-a2f960017931ad871c37bf1d9c197418aa8afca9.zip |
SWORD25: Disabled the mechanism which precaches all of the game's resources on startup.
This reduced the initial memory used by 100MB for me, though the game keeps allocating
new resources in each scene without deleting them, because of the missing functionality in
getUsedMemory(). This change also slightly reduces the loading time on game startup.
svn-id: r55593
Diffstat (limited to 'engines/sword25/gfx/animationresource.cpp')
-rw-r--r-- | engines/sword25/gfx/animationresource.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp index 8b1062c706..f9347e3dad 100644 --- a/engines/sword25/gfx/animationresource.cpp +++ b/engines/sword25/gfx/animationresource.cpp @@ -35,6 +35,7 @@ #include "sword25/gfx/animationresource.h" #include "sword25/kernel/kernel.h" +#include "sword25/kernel/resmanager.h" // for PRECACHE_RESOURCES #include "sword25/package/packagemanager.h" #include "sword25/gfx/bitmapresource.h" @@ -208,10 +209,14 @@ AnimationResource::~AnimationResource() { bool AnimationResource::precacheAllFrames() const { Common::Array<Frame>::const_iterator iter = _frames.begin(); for (; iter != _frames.end(); ++iter) { +#ifdef PRECACHE_RESOURCES if (!Kernel::getInstance()->getResourceManager()->precacheResource((*iter).fileName)) { error("Could not precache \"%s\".", (*iter).fileName.c_str()); return false; } +#else + Kernel::getInstance()->getResourceManager()->requestResource((*iter).fileName); +#endif } return true; |