From 1f91dc03846caecc0651101f54ad25f1864ae132 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 12 Apr 2008 23:17:21 +0000 Subject: - some refactoring for Kyra3 - removed unneeded map code in KyraEngine_v3 svn-id: r31488 --- engines/kyra/gui_v1.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'engines/kyra/gui_v1.cpp') diff --git a/engines/kyra/gui_v1.cpp b/engines/kyra/gui_v1.cpp index fd6e0cbdf5..61129956b6 100644 --- a/engines/kyra/gui_v1.cpp +++ b/engines/kyra/gui_v1.cpp @@ -186,7 +186,7 @@ int KyraEngine_v1::buttonAmuletCallback(Button *caller) { #pragma mark - -GUI_v1::GUI_v1(KyraEngine_v1 *vm) : GUI(vm), _vm(vm) { +GUI_v1::GUI_v1(KyraEngine_v1 *vm, Screen_v1 *screen) : GUI(vm), _vm(vm), _screen(screen) { _menu = 0; initStaticResource(); _scrollUpFunctor = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::scrollUp); @@ -212,16 +212,16 @@ int GUI_v1::processButtonList(Button *list, uint16 inputFlag) { int x = list->x; int y = list->y; - assert(list->dimTableIndex < _screen->_screenDimTableCount); + assert(_screen->getScreenDim(list->dimTableIndex) != 0); if (x < 0) { - x += _screen->_screenDimTable[list->dimTableIndex].w << 3; + x += _screen->getScreenDim(list->dimTableIndex)->w << 3; } - x += _screen->_screenDimTable[list->dimTableIndex].sx << 3; + x += _screen->getScreenDim(list->dimTableIndex)->sx << 3; if (y < 0) { - y += _screen->_screenDimTable[list->dimTableIndex].h; + y += _screen->getScreenDim(list->dimTableIndex)->h; } - y += _screen->_screenDimTable[list->dimTableIndex].sy; + y += _screen->getScreenDim(list->dimTableIndex)->sy; Common::Point mouse = _vm->getMousePos(); if (mouse.x >= x && mouse.y >= y && x + list->width >= mouse.x && y + list->height >= mouse.y) { @@ -302,12 +302,12 @@ void GUI_v1::processButton(Button *button) { int x = button->x; int y = button->y; - assert(button->dimTableIndex < _screen->_screenDimTableCount); + assert(_screen->getScreenDim(button->dimTableIndex) != 0); if (x < 0) - x += _screen->_screenDimTable[button->dimTableIndex].w << 3; + x += _screen->getScreenDim(button->dimTableIndex)->w << 3; if (y < 0) - y += _screen->_screenDimTable[button->dimTableIndex].h; + y += _screen->getScreenDim(button->dimTableIndex)->h; if (processType == 1 && shape) _screen->drawShape(_screen->_curPage, shape, x, y, button->dimTableIndex, 0x10); -- cgit v1.2.3