diff options
author | uruk | 2014-06-06 22:20:05 +0200 |
---|---|---|
committer | uruk | 2014-06-06 22:20:05 +0200 |
commit | 97bb1370a317b7ce3784889d74b61b6e5fd7bc84 (patch) | |
tree | 54aa0d5c8607495cf5b474cb29de7edaf3306631 | |
parent | 152d795b456e4e71e85322cdfcfa402241bf9365 (diff) | |
download | scummvm-rg350-97bb1370a317b7ce3784889d74b61b6e5fd7bc84.tar.gz scummvm-rg350-97bb1370a317b7ce3784889d74b61b6e5fd7bc84.tar.bz2 scummvm-rg350-97bb1370a317b7ce3784889d74b61b6e5fd7bc84.zip |
CGE2: Reimplement the way of handling y coord.
In CGE2, the top left coords are (0, kScreenHeight), not (0,0).
-rw-r--r-- | engines/cge2/events.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/cge2/events.cpp b/engines/cge2/events.cpp index c036d5d676..55c384cf9c 100644 --- a/engines/cge2/events.cpp +++ b/engines/cge2/events.cpp @@ -155,6 +155,7 @@ EventManager::EventManager(CGE2Engine *vm) : _vm(vm){ void EventManager::poll() { while (g_system->getEventManager()->pollEvent(_event)) { + _event.mouse.y = kScrHeight - _event.mouse.y; switch (_event.type) { case Common::EVENT_KEYDOWN: case Common::EVENT_KEYUP: @@ -186,7 +187,7 @@ void EventManager::handleEvents() { // update mouse cursor position if (e._mask & kMouseRoll) - _vm->_mouse->gotoxyz(e._x, kWorldHeight - e._y); + _vm->_mouse->gotoxyz(e._x, e._y); // activate current touched SPRITE if (e._spritePtr) { |