[Scummvm-devel] [Scummvm-cvs-logs] SF.net SVN: scummvm:[42224] scummvm/branches/gsoc2009-draci/engines/draci

Robert Špalek rspalek at gmail.com
Tue Jul 7 18:10:41 CEST 2009


On Tue, Jul 7, 2009 at 8:21 AM, <dkasak13 at users.sourceforge.net> wrote:

> Revision: 42224
>          http://scummvm.svn.sourceforge.net/scummvm/?rev=42224&view=rev
> Author:   dkasak13
> Date:     2009-07-07 15:21:41 +0000 (Tue, 07 Jul 2009)
>
> Log Message:
> -----------
> 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).
>
> Modified Paths:
> --------------
>    scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
>    scummvm/branches/gsoc2009-draci/engines/draci/game.h
>    scummvm/branches/gsoc2009-draci/engines/draci/mouse.cpp
>
> Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
> ===================================================================
> --- scummvm/branches/gsoc2009-draci/engines/draci/game.cpp      2009-07-07
> 14:52:36 UTC (rev 42223)
> +++ scummvm/branches/gsoc2009-draci/engines/draci/game.cpp      2009-07-07
> 15:21:41 UTC (rev 42224)
> @@ -319,6 +319,21 @@
>  }
>
>  void Game::changeRoom(uint roomNum) {
> +       _vm->_roomsArchive->clearCache();
> +       _vm->_anims->deleteOverlays();
>

you may want to clear all BArchive caches, i.e. palettes, sprites, etc.


> +       for (uint i = 0; i < _info->_numObjects; ++i) {
> +               GameObject *obj = &_objects[i];
> +
> +               if (i != 0 && obj->_location == oldRoomNum) {
> +                       for (uint j = 0; j < obj->_numSeq; ++j) {
> +
> _vm->_anims->deleteAnimation(obj->_seqTab[j]);
> +                       }
>

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.



> +               // HACK: We change to the next room when the left mouse
> button is pressed.
> +               // This is only for testing.
> +               _vm->_game->incRoomNum();
> +               room = _vm->_game->getRoomNum();
> +               _vm->_game->changeRoom(room);


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().

-- 
Robert Špalek <rspalek at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20090707/c8e6e2f2/attachment.html>


More information about the Scummvm-devel mailing list