[Scummvm-cvs-logs] scummvm master -> bb4a6c28996511b9c57465807276d8d8fb624cd4
eriktorbjorn
eriktorbjorn at telia.com
Mon Jan 6 14:48:07 CET 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bb4a6c2899 NEVERHOOD: Add mousewheel support to original save/load dialogs
Commit: bb4a6c28996511b9c57465807276d8d8fb624cd4
https://github.com/scummvm/scummvm/commit/bb4a6c28996511b9c57465807276d8d8fb624cd4
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-01-06T05:47:17-08:00
Commit Message:
NEVERHOOD: Add mousewheel support to original save/load dialogs
Changed paths:
engines/neverhood/gamemodule.cpp
engines/neverhood/gamemodule.h
engines/neverhood/menumodule.cpp
engines/neverhood/messages.h
engines/neverhood/neverhood.cpp
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index 45f9465..12703d9 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -119,6 +119,18 @@ void GameModule::handleMouseUp(int16 x, int16 y) {
}
}
+void GameModule::handleWheelUp() {
+ if (_childObject) {
+ sendMessage(_childObject, NM_MOUSE_WHEELUP, 0);
+ }
+}
+
+void GameModule::handleWheelDown() {
+ if (_childObject) {
+ sendMessage(_childObject, NM_MOUSE_WHEELDOWN, 0);
+ }
+}
+
void GameModule::handleSpaceKey() {
if (_childObject) {
debug(2, "GameModule::handleSpaceKey()");
diff --git a/engines/neverhood/gamemodule.h b/engines/neverhood/gamemodule.h
index 2f2fecf..198f8f6 100644
--- a/engines/neverhood/gamemodule.h
+++ b/engines/neverhood/gamemodule.h
@@ -40,6 +40,8 @@ public:
void handleMouseMove(int16 x, int16 y);
void handleMouseDown(int16 x, int16 y);
void handleMouseUp(int16 x, int16 y);
+ void handleWheelUp();
+ void handleWheelDown();
void handleSpaceKey();
void handleAsciiKey(char key);
void handleKeyDown(Common::KeyCode keyCode);
diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index a8d88a7..cf21bc0 100644
--- a/engines/neverhood/menumodule.cpp
+++ b/engines/neverhood/menumodule.cpp
@@ -1025,6 +1025,12 @@ uint32 GameStateMenu::handleMessage(int messageNum, const MessageParam ¶m, E
break;
}
break;
+ case NM_MOUSE_WHEELUP:
+ _listBox->scrollUp();
+ break;
+ case NM_MOUSE_WHEELDOWN:
+ _listBox->scrollDown();
+ break;
}
return 0;
}
diff --git a/engines/neverhood/messages.h b/engines/neverhood/messages.h
index 9816c2c..5f1e1b8 100644
--- a/engines/neverhood/messages.h
+++ b/engines/neverhood/messages.h
@@ -65,7 +65,11 @@ enum NeverhoodMessage {
NM_KLAYMEN_RELEASE_LEVER = 0x4827,
NM_MOVE_TO_BACK = 0x482A,
- NM_MOVE_TO_FRONT = 0x482B
+ NM_MOVE_TO_FRONT = 0x482B,
+
+ // New to ScummVM
+ NM_MOUSE_WHEELUP = 0xF000,
+ NM_MOUSE_WHEELDOWN = 0xF001
};
} // End of namespace Neverhood
diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp
index af09624..82590d6 100644
--- a/engines/neverhood/neverhood.cpp
+++ b/engines/neverhood/neverhood.cpp
@@ -178,6 +178,12 @@ void NeverhoodEngine::mainLoop() {
case Common::EVENT_RBUTTONUP:
_gameModule->handleMouseUp(event.mouse.x, event.mouse.y);
break;
+ case Common::EVENT_WHEELUP:
+ _gameModule->handleWheelUp();
+ break;
+ case Common::EVENT_WHEELDOWN:
+ _gameModule->handleWheelDown();
+ break;
case Common::EVENT_QUIT:
_system->quit();
break;
More information about the Scummvm-git-logs
mailing list