On Tue, Jul 7, 2009 at 8:21 AM,  <span dir="ltr"><<a href="mailto:dkasak13@users.sourceforge.net">dkasak13@users.sourceforge.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Revision: 42224<br>
          <a href="http://scummvm.svn.sourceforge.net/scummvm/?rev=42224&view=rev" target="_blank">http://scummvm.svn.sourceforge.net/scummvm/?rev=42224&view=rev</a><br>
Author:   dkasak13<br>
Date:     2009-07-07 15:21:41 +0000 (Tue, 07 Jul 2009)<br>
<br>
Log Message:<br>
-----------<br>
mplemented changing rooms properly (overlays and objects' animations are deleted before a new room is loaded) and set up a quick demonstration (left click advances to the next room, right click goes back).<br>
<br>
Modified Paths:<br>
--------------<br>
    scummvm/branches/gsoc2009-draci/engines/draci/game.cpp<br>
    scummvm/branches/gsoc2009-draci/engines/draci/game.h<br>
    scummvm/branches/gsoc2009-draci/engines/draci/mouse.cpp<br>
<br>
Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.cpp<br>
===================================================================<br>
--- scummvm/branches/gsoc2009-draci/engines/draci/game.cpp      2009-07-07 14:52:36 UTC (rev 42223)<br>
+++ scummvm/branches/gsoc2009-draci/engines/draci/game.cpp      2009-07-07 15:21:41 UTC (rev 42224)<br>
@@ -319,6 +319,21 @@<br>
 }<br>
<br>
 void Game::changeRoom(uint roomNum) {<br>
+       _vm->_roomsArchive->clearCache();<br>
+       _vm->_anims->deleteOverlays();<br>
</blockquote><div><br></div><div>you may want to clear all BArchive caches, i.e. palettes, sprites, etc.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

+       for (uint i = 0; i < _info->_numObjects; ++i) {<br>
+               GameObject *obj = &_objects[i];<br>
+<br>
+               if (i != 0 && obj->_location == oldRoomNum) {<br>
+                       for (uint j = 0; j < obj->_numSeq; ++j) {<br>
+                                       _vm->_anims->deleteAnimation(obj->_seqTab[j]);<br>
+                       }<br>
</blockquote><div><br></div><div>I would move the inner loop to a method of obj, deleteAnimations(), and call it unconditionally regardless of the location number.   if it isn't in this location, then it will just do nothing.</div>

<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">+               // HACK: We change to the next room when the left mouse button is pressed.<br>


+               // This is only for testing.<br>
+               _vm->_game->incRoomNum();<br>
+               room = _vm->_game->getRoomNum();<br>
+               _vm->_game->changeRoom(room);</blockquote><div><br></div><div>since this is for testing only, don't worry, but for the future, this interface is quite cumbersome.  if incRoomNum() returned the new number, you wouldn't need to call getRoomNum().</div>

<div><br></div></div>-- <br>Robert Špalek <<a href="mailto:rspalek@gmail.com">rspalek@gmail.com</a>><br>