[Scummvm-cvs-logs] SF.net SVN: scummvm:[46095] scummvm/trunk/engines/draci/game.cpp
spalek at users.sourceforge.net
spalek at users.sourceforge.net
Sun Nov 22 21:17:40 CET 2009
Revision: 46095
http://scummvm.svn.sourceforge.net/scummvm/?rev=46095&view=rev
Author: spalek
Date: 2009-11-22 20:17:39 +0000 (Sun, 22 Nov 2009)
Log Message:
-----------
Clearing object animations in a cleaner way
Verified that we really do not need object animations even if they are in
a different location, and clearing them thus regardless of their location.
Although the game was not crashing due to previous work-arounds at this
moment, this cleanup obliterates the most horrible hack and makes sure
animations will never get stale.
Modified Paths:
--------------
scummvm/trunk/engines/draci/game.cpp
Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp 2009-11-22 20:02:13 UTC (rev 46094)
+++ scummvm/trunk/engines/draci/game.cpp 2009-11-22 20:17:39 UTC (rev 46095)
@@ -1157,11 +1157,13 @@
}
void Game::deleteObjectAnimations() {
+ // Deallocate all animations, because their sound samples will not
+ // survive clearing the sound sample cache when changing the location.
+ // It's OK to unload them even if they are still in the inventory,
+ // because we only need their icons which survive.
for (uint i = 1; i < _info._numObjects; ++i) {
GameObject *obj = &_objects[i];
- if (obj->_location == getPreviousRoomNum()) {
- obj->deleteAnims();
- }
+ obj->deleteAnims();
}
// WORKAROUND
@@ -1209,13 +1211,6 @@
// animations instead of listing what to deallocate. maybe simply
// deallocate everything; reloading isn't that expensive.
//
- // TODO: if a game item's location changes (e.g., due to a GPL2
- // command), its animations survive in the memory. I believe this
- // isn't needed, because only icons need to survive, but it is
- // dangerous if those animations contain sounds. maybe delete all
- // objects regardless of their location. dump first how often this
- // happens.
- //
// TODO: completely rewrite the resource management. maybe implement
// usage counters? maybe completely ignore the GPL2 hints and manage
// memory completely on my own?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list