aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/mouse.cpp
diff options
context:
space:
mode:
authorDenis Kasak2009-07-07 15:21:41 +0000
committerDenis Kasak2009-07-07 15:21:41 +0000
commit7f3af129f218ee47f806e7672ffe4074b86194c2 (patch)
tree346b0a0a2589191ec9fe63915f742af9df4989a6 /engines/draci/mouse.cpp
parent82e6bcea2f0cf3fb0d44cbdd6fc5ad9240ef20e2 (diff)
downloadscummvm-rg350-7f3af129f218ee47f806e7672ffe4074b86194c2.tar.gz
scummvm-rg350-7f3af129f218ee47f806e7672ffe4074b86194c2.tar.bz2
scummvm-rg350-7f3af129f218ee47f806e7672ffe4074b86194c2.zip
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).
svn-id: r42224
Diffstat (limited to 'engines/draci/mouse.cpp')
-rw-r--r--engines/draci/mouse.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/engines/draci/mouse.cpp b/engines/draci/mouse.cpp
index b342487209..09216085a7 100644
--- a/engines/draci/mouse.cpp
+++ b/engines/draci/mouse.cpp
@@ -41,27 +41,45 @@ Mouse::Mouse(DraciEngine *vm) {
void Mouse::handleEvent(Common::Event event) {
_x = (uint16) event.mouse.x;
_y = (uint16) event.mouse.y;
-
+ int room;
+
switch (event.type) {
case Common::EVENT_LBUTTONDOWN:
debugC(6, kDraciGeneralDebugLevel, "Left button down (x: %u y: %u)", _x, _y);
_lButton = true;
+
+ // 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);
break;
+
case Common::EVENT_LBUTTONUP:
debugC(6, kDraciGeneralDebugLevel, "Left button up (x: %u y: %u)", _x, _y);
_lButton = false;
break;
+
case Common::EVENT_RBUTTONDOWN:
debugC(6, kDraciGeneralDebugLevel, "Right button down (x: %u y: %u)", _x, _y);
_rButton = true;
+
+ // HACK: We change to the previous room when the right mouse button is pressed.
+ // This is only for testing.
+ _vm->_game->decRoomNum();
+ room = _vm->_game->getRoomNum();
+ _vm->_game->changeRoom(room);
break;
+
case Common::EVENT_RBUTTONUP:
debugC(6, kDraciGeneralDebugLevel, "Right button up (x: %u y: %u)", _x, _y);
_rButton = false;
break;
+
case Common::EVENT_MOUSEMOVE:
setPosition(_x, _y);
break;
+
default:
break;
}