[Scummvm-cvs-logs] SF.net SVN: scummvm:[45822] scummvm/trunk/engines/draci

spalek at users.sourceforge.net spalek at users.sourceforge.net
Wed Nov 11 00:21:30 CET 2009


Revision: 45822
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45822&view=rev
Author:   spalek
Date:     2009-11-10 23:21:29 +0000 (Tue, 10 Nov 2009)

Log Message:
-----------
Fixed two bugs.

Putting items back to the inventory into clipped coordinates, and exiting
running GPL2 programs when the game engine it to be interrupted.

Modified Paths:
--------------
    scummvm/trunk/engines/draci/draci.cpp
    scummvm/trunk/engines/draci/game.cpp

Modified: scummvm/trunk/engines/draci/draci.cpp
===================================================================
--- scummvm/trunk/engines/draci/draci.cpp	2009-11-10 23:06:09 UTC (rev 45821)
+++ scummvm/trunk/engines/draci/draci.cpp	2009-11-10 23:21:29 UTC (rev 45822)
@@ -222,6 +222,7 @@
 		case Common::EVENT_QUIT:
 		case Common::EVENT_RTL:
 			_game->setQuit(true);
+			_script->endCurrentProgram(true);
 			break;
 		case Common::EVENT_KEYDOWN:
 			switch (event.kbd.keycode) {

Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp	2009-11-10 23:06:09 UTC (rev 45821)
+++ scummvm/trunk/engines/draci/game.cpp	2009-11-10 23:21:29 UTC (rev 45822)
@@ -24,6 +24,7 @@
  */
 
 #include "common/stream.h"
+#include "common/util.h"
 
 #include "draci/draci.h"
 #include "draci/game.h"
@@ -332,12 +333,12 @@
 		// Otherwise, if we are holding an item, try to place it inside the
 		// inventory
 		} else if (_currentItem) {
-			const int column = scummvm_lround(
+			const int column = CLIP(scummvm_lround(
 				(_vm->_mouse->getPosX() - kInventoryX + kInventoryItemWidth / 2.) /
-				kInventoryItemWidth) - 1;
-			const int line = scummvm_lround(
+				kInventoryItemWidth) - 1, 0L, (long) kInventoryColumns - 1);
+			const int line = CLIP(scummvm_lround(
 				(_vm->_mouse->getPosY() - kInventoryY + kInventoryItemHeight / 2.) /
-				kInventoryItemHeight) - 1;
+				kInventoryItemHeight) - 1, 0L, (long) kInventoryLines - 1);
 			const int index = line * kInventoryColumns + column;
 			putItem(_currentItem, index);
 


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