[Scummvm-cvs-logs] SF.net SVN: scummvm:[46094] scummvm/trunk/engines/draci/game.cpp
spalek at users.sourceforge.net
spalek at users.sourceforge.net
Sun Nov 22 21:02:13 CET 2009
Revision: 46094
http://scummvm.svn.sourceforge.net/scummvm/?rev=46094&view=rev
Author: spalek
Date: 2009-11-22 20:02:13 +0000 (Sun, 22 Nov 2009)
Log Message:
-----------
Fixed assert() on already loaded animation
Now the game seems fully playable with crazy loading all the time, even
though it is a hacky solution. Updated the TODOs
Modified Paths:
--------------
scummvm/trunk/engines/draci/game.cpp
Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp 2009-11-22 18:21:40 UTC (rev 46093)
+++ scummvm/trunk/engines/draci/game.cpp 2009-11-22 20:02:13 UTC (rev 46094)
@@ -138,6 +138,8 @@
_objects[i]._location = (~(1 << 7) & tmp) - 1;
_objects[i]._playingAnim = -1;
+ _objects[i]._absNum = i;
+ // _anims have been initialized by the constructor
}
assert(numDialogues == _info._numDialogues);
@@ -1207,12 +1209,12 @@
// animations instead of listing what to deallocate. maybe simply
// deallocate everything; reloading isn't that expensive.
//
- // URGENT TODO: if a game item's location changes (e.g., due to a GPL2
- // command), its animations survive and we get assert in
- // AnimationManager::load() next time. we must address this before a
- // proper clean-up to make game playable. happens when loading game
- // before getting the fairy tale book, playing a bit, and then doing it
- // again. the fairy-tale book's animations raise an assert.
+ // 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
@@ -1597,7 +1599,7 @@
_program._length = file->_length;
_playingAnim = -1;
- _anim.clear();
+ deleteAnims(); // If the object has already been loaded, then discard the previous animations
}
void GameItem::load(int itemID, BArchive *archive) {
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