aboutsummaryrefslogtreecommitdiff
path: root/engines/toltecs/menu.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-10-03 22:21:52 +0200
committerTorbjörn Andersson2012-10-03 22:21:52 +0200
commit8335e340fd98bbef465a169bc7b043c15bd0243b (patch)
treef6ff9dc15ef0e39d0a7c1da59e7e9d88e98fd470 /engines/toltecs/menu.cpp
parent85bd7daa41ff8b755cf2159b0a1450c05a780acf (diff)
downloadscummvm-rg350-8335e340fd98bbef465a169bc7b043c15bd0243b.tar.gz
scummvm-rg350-8335e340fd98bbef465a169bc7b043c15bd0243b.tar.bz2
scummvm-rg350-8335e340fd98bbef465a169bc7b043c15bd0243b.zip
TOLTECS: Fix menu positining in the simplest way I can think of
All this does is to offset the image when copying it to the screen, and offset the position when checking for clickable items at specific coordinates. It looks and works right to me. I guess that just leaves the buildColorTransTable2() function, but I'm useless for that so someone else will have to look into it.
Diffstat (limited to 'engines/toltecs/menu.cpp')
-rw-r--r--engines/toltecs/menu.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/engines/toltecs/menu.cpp b/engines/toltecs/menu.cpp
index 4fd40324e8..6e23ff988f 100644
--- a/engines/toltecs/menu.cpp
+++ b/engines/toltecs/menu.cpp
@@ -58,10 +58,6 @@ int MenuSystem::run(MenuID menuId) {
_editingDescription = false;
_running = true;
-
- // TODO: It seems the Y coordinate of the entire GUI should be offset
- // by this much to be drawn correctly. At least, that appears to be the
- // case for the main menu at the start of the game.
_top = 30 - _vm->_guiHeight / 2;
_needRedraw = false;
@@ -106,7 +102,7 @@ void MenuSystem::update() {
if (_needRedraw) {
//_vm->_system->copyRectToScreen(_vm->_screen->_frontScreen + 39 * 640 + 60, 640, 60, 39, 520, 247);
- _vm->_system->copyRectToScreen(_vm->_screen->_frontScreen, 640, 0, 0, 640, 400);
+ _vm->_system->copyRectToScreen(_vm->_screen->_frontScreen, 640, 0, _top, 640, 400 - _top);
//debug("redraw");
_needRedraw = false;
}
@@ -206,7 +202,7 @@ void MenuSystem::handleKeyDown(const Common::KeyState& kbd) {
ItemID MenuSystem::findItemAt(int x, int y) {
for (Common::Array<Item>::iterator iter = _items.begin(); iter != _items.end(); iter++) {
- if ((*iter).rect.contains(x, y))
+ if ((*iter).rect.contains(x, y - _top))
return (*iter).id;
}
return kItemIdNone;