diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/gui/gui.cpp | 10 | ||||
-rw-r--r-- | engines/sci/gui/gui.h | 2 | ||||
-rw-r--r-- | engines/sci/gui/gui_helpers.h | 4 | ||||
-rw-r--r-- | engines/sci/gui/gui_windowmgr.cpp | 68 | ||||
-rw-r--r-- | engines/sci/gui/gui_windowmgr.h | 2 | ||||
-rw-r--r-- | engines/sci/gui32/gui32.cpp | 16 | ||||
-rw-r--r-- | engines/sci/gui32/gui32.h | 2 |
7 files changed, 52 insertions, 52 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index a01aed81cd..ea6adcb766 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -102,13 +102,13 @@ void SciGUI::localToGlobal(int16 *x, int16 *y) { *y = *y + curPort->top; } -reg_t SciGUI::newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) { +reg_t SciGUI::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) { sciWnd *wnd = NULL; - if (rect2.top != 0 && rect2.left != 0 && rect2.height() != 0 && rect2.width() != 0) - wnd = _windowMgr->NewWindow(&rect1, &rect2, title, style, priority, 0); + if (restoreRect.top != 0 && restoreRect.left != 0 && restoreRect.height() != 0 && restoreRect.width() != 0) + wnd = _windowMgr->NewWindow(dims, &restoreRect, title, style, priority, 0); else - wnd = _windowMgr->NewWindow(&rect1, NULL, title, style, priority, 0); + wnd = _windowMgr->NewWindow(dims, NULL, title, style, priority, 0); wnd->penClr = colorPen; wnd->backClr = colorBack; _windowMgr->DrawWindow(wnd); @@ -126,7 +126,7 @@ void SciGUI::display(const char *text, int argc, reg_t *argv) { int16 align = 0; int16 bgcolor = -1, width = -1, bRedraw = 1; byte bSaveUnder = false; - Common::Rect rect, *orect = &((sciWnd *)_gfx->GetPort())->rect0; + Common::Rect rect, *orect = &((sciWnd *)_gfx->GetPort())->dims; memcpy(&oldPort, _gfx->GetPort(), sizeof(sciPort)); // setting defaults diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h index bffaa0f1a9..5c52a59fcf 100644 --- a/engines/sci/gui/gui.h +++ b/engines/sci/gui/gui.h @@ -49,7 +49,7 @@ public: virtual reg_t getPort(); virtual void globalToLocal(int16 *x, int16 *y); virtual void localToGlobal(int16 *x, int16 *y); - virtual reg_t newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title); + virtual reg_t newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title); virtual void disposeWindow(uint16 windowPtr, int16 arg2); virtual void display(const char *text, int argc, reg_t *argv); diff --git a/engines/sci/gui/gui_helpers.h b/engines/sci/gui/gui_helpers.h index 7859b68ff8..7a0399454d 100644 --- a/engines/sci/gui/gui_helpers.h +++ b/engines/sci/gui/gui_helpers.h @@ -65,8 +65,8 @@ struct sciWnd { int16 textFace, penClr, backClr; int16 penMode; // window specific members - Common::Rect rect0; // client area of window - Common::Rect rect1; // total area of window including borders + Common::Rect dims; // client area of window + Common::Rect restoreRect; // total area of window including borders uint16 wndStyle; uint16 uSaveFlag; reg_t hSaved1; diff --git a/engines/sci/gui/gui_windowmgr.cpp b/engines/sci/gui/gui_windowmgr.cpp index 1561bf3a34..01fcffc15a 100644 --- a/engines/sci/gui/gui_windowmgr.cpp +++ b/engines/sci/gui/gui_windowmgr.cpp @@ -68,7 +68,7 @@ SciGUIwindowMgr::SciGUIwindowMgr(EngineState *state, SciGUIgfx *gfx) windowList.AddToFront(wmgrPortH); - _picWind = NewWindow(&_picRect, 0, 0, TRANSPARENT | NOFRAME, 0, 1); + _picWind = NewWindow(_picRect, 0, 0, TRANSPARENT | NOFRAME, 0, 1); } SciGUIwindowMgr::~SciGUIwindowMgr() { @@ -112,7 +112,7 @@ void SciGUIwindowMgr::EndUpdate(sciWnd *wnd) { _gfx->SetPort(oldPort); } -sciWnd *SciGUIwindowMgr::NewWindow(Common::Rect *rect, Common::Rect *rect2, const char *title, uint16 style, uint16 arg8, uint16 argA) { +sciWnd *SciGUIwindowMgr::NewWindow(const Common::Rect &dims, const Common::Rect *restoreRect, const char *title, uint16 style, uint16 arg8, uint16 argA) { HEAPHANDLE hWnd = heapNewPtr(sizeof(sciWnd), kDataWindow, title); Common::Rect r; @@ -127,10 +127,10 @@ sciWnd *SciGUIwindowMgr::NewWindow(Common::Rect *rect, Common::Rect *rect2, cons windowList.AddToEnd(hWnd); sciWnd *pwnd = (sciWnd *)heap2Ptr(hWnd); _gfx->OpenPort((sciPort *)pwnd); - r = *rect; - pwnd->rect = *rect; - if (rect2) - pwnd->rect1 = *rect2; + r = dims; + pwnd->rect = dims; + if (restoreRect) + pwnd->restoreRect = *restoreRect; pwnd->wndStyle = style; pwnd->hSaved1 = pwnd->hSaved2 = NULL_REG; @@ -148,7 +148,7 @@ sciWnd *SciGUIwindowMgr::NewWindow(Common::Rect *rect, Common::Rect *rect2, cons strcpy((char *)heap2Ptr(hTitle), title); } - r = *rect; + r = dims; if (style == USER || (style & NOFRAME) == 0) { r.grow(1); if (style & TITLE) { @@ -157,28 +157,28 @@ sciWnd *SciGUIwindowMgr::NewWindow(Common::Rect *rect, Common::Rect *rect2, cons } } - pwnd->rect0 = r; + pwnd->dims = r; const Common::Rect *wmprect = &_wmgrPort->rect; - int16 oldtop = pwnd->rect0.top; - int16 oldleft = pwnd->rect0.left; - if (wmprect->top > pwnd->rect0.top) - pwnd->rect0.moveTo(pwnd->rect0.left, wmprect->top); + int16 oldtop = pwnd->dims.top; + int16 oldleft = pwnd->dims.left; + if (wmprect->top > pwnd->dims.top) + pwnd->dims.moveTo(pwnd->dims.left, wmprect->top); - if (wmprect->bottom < pwnd->rect0.bottom) - pwnd->rect0.moveTo(pwnd->rect0.left, wmprect->bottom - - pwnd->rect0.bottom + pwnd->rect0.top); + if (wmprect->bottom < pwnd->dims.bottom) + pwnd->dims.moveTo(pwnd->dims.left, wmprect->bottom + - pwnd->dims.bottom + pwnd->dims.top); - if (wmprect->right < pwnd->rect0.right) - pwnd->rect0.moveTo(wmprect->right + pwnd->rect0.left - - pwnd->rect0.right, pwnd->rect0.top); + if (wmprect->right < pwnd->dims.right) + pwnd->dims.moveTo(wmprect->right + pwnd->dims.left + - pwnd->dims.right, pwnd->dims.top); - if (wmprect->left > pwnd->rect0.left) - pwnd->rect0.moveTo(wmprect->left, pwnd->rect0.top); + if (wmprect->left > pwnd->dims.left) + pwnd->dims.moveTo(wmprect->left, pwnd->dims.top); - pwnd->rect.moveTo(pwnd->rect.left + pwnd->rect0.left - oldleft, - pwnd->rect.top + pwnd->rect0.top - oldtop); - if (rect2 == 0) - pwnd->rect1 = pwnd->rect0; + pwnd->rect.moveTo(pwnd->rect.left + pwnd->dims.left - oldleft, + pwnd->rect.top + pwnd->dims.top - oldtop); + if (restoreRect == 0) + pwnd->restoreRect = pwnd->dims; if (argA) DrawWindow(pwnd); @@ -198,17 +198,17 @@ void SciGUIwindowMgr::DrawWindow(sciWnd *pWnd) { sciPort *oldport = _gfx->SetPort(_wmgrPort); _gfx->PenColor(0); if ((wndStyle & TRANSPARENT) == 0) { - pWnd->hSaved1 = _gfx->SaveBits(pWnd->rect1, 1); + pWnd->hSaved1 = _gfx->SaveBits(pWnd->restoreRect, 1); if (pWnd->uSaveFlag & 2) { - pWnd->hSaved2 = _gfx->SaveBits(pWnd->rect1, 2); + pWnd->hSaved2 = _gfx->SaveBits(pWnd->restoreRect, 2); if ((wndStyle & USER) == 0) - _gfx->FillRect(pWnd->rect1, 2, 0, 0xF); + _gfx->FillRect(pWnd->restoreRect, 2, 0, 0xF); } } // drawing frame,shadow and title if ((wndStyle & USER) == 0) { - r = pWnd->rect0; + r = pWnd->dims; if ((wndStyle & NOFRAME) == 0) { r.translate(1, 1); _gfx->FrameRect(r);// shadow @@ -225,7 +225,7 @@ void SciGUIwindowMgr::DrawWindow(sciWnd *pWnd) { _gfx->PenColor(oldcolor); } - r = pWnd->rect0; + r = pWnd->dims; r.top += 9; } @@ -234,7 +234,7 @@ void SciGUIwindowMgr::DrawWindow(sciWnd *pWnd) { if ((wndStyle & TRANSPARENT) == 0) _gfx->FillRect(r, 1, pWnd->backClr); - _gfx->ShowBits(pWnd->rect0, 1); + _gfx->ShowBits(pWnd->dims, 1); } _gfx->SetPort(oldport); } @@ -244,9 +244,9 @@ void SciGUIwindowMgr::DisposeWindow(sciWnd *pWnd, int16 arg2) { _gfx->RestoreBits(pWnd->hSaved1); _gfx->RestoreBits(pWnd->hSaved2); if (arg2) - _gfx->ShowBits(pWnd->rect1, 1); + _gfx->ShowBits(pWnd->restoreRect, 1); // else -// g_sci->ReAnimate(&pwnd->rect0); +// g_sci->ReAnimate(&pwnd->dims); HEAPHANDLE hh = ptr2heap((byte *)pWnd); windowList.DeleteNode(hh); SelectWindow(windowList.getLast()); @@ -259,11 +259,11 @@ void SciGUIwindowMgr::UpdateWindow(sciWnd *wnd) { sciMemoryHandle handle; if (wnd->uSaveFlag && wnd->bDrawed) { - handle = _gfx->SaveBits(wnd->rect1, 1); + handle = _gfx->SaveBits(wnd->restoreRect, 1); _gfx->RestoreBits(wnd->hSaved1); wnd->hSaved1 = handle; if (wnd->uSaveFlag & 2) { - handle = _gfx->SaveBits(wnd->rect1, 2); + handle = _gfx->SaveBits(wnd->restoreRect, 2); _gfx->RestoreBits(wnd->hSaved2); wnd->hSaved2 = handle; } diff --git a/engines/sci/gui/gui_windowmgr.h b/engines/sci/gui/gui_windowmgr.h index bc7ea47c20..b0d46cf31f 100644 --- a/engines/sci/gui/gui_windowmgr.h +++ b/engines/sci/gui/gui_windowmgr.h @@ -39,7 +39,7 @@ public: SCILanguage getSCILanguage(); char* StrSplit(char*buff, const char*msg, const char*fmt); char* getIntlString(char*buff, const char*msg, const char*fmt, SCILanguage lang, SCILanguage prop); - sciWnd *NewWindow(Common::Rect *rect, Common::Rect *rect2, const char *title, uint16 style, uint16 arg8, uint16 argA); + sciWnd *NewWindow(const Common::Rect &dims, const Common::Rect *restoreRect, const char *title, uint16 style, uint16 arg8, uint16 argA); void DrawWindow(sciWnd *wnd); void DisposeWindow(sciWnd *pWnd, int16 arg2); void UpdateWindow(sciWnd *wnd); diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp index 7163ca422b..0ccebf0055 100644 --- a/engines/sci/gui32/gui32.cpp +++ b/engines/sci/gui32/gui32.cpp @@ -171,7 +171,7 @@ void SciGUI32::localToGlobal(int16 *x, int16 *y) { *y = *y + s->port->zone.y; } -reg_t SciGUI32::newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) { +reg_t SciGUI32::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) { GfxPort *window; int x, y, xl, yl; gfx_color_t bgcolor; @@ -179,10 +179,10 @@ reg_t SciGUI32::newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, gfx_color_t black; gfx_color_t lWhite; - y = rect1.top; - x = rect1.left; - yl = rect1.height(); - xl = rect1.width(); + y = dims.top; + x = dims.left; + yl = dims.height(); + xl = dims.width(); y += s->wm_port->_bounds.y; @@ -205,7 +205,7 @@ reg_t SciGUI32::newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, bgcolor.mask |= priority >= 0 ? GFX_MASK_PRIORITY : 0; bgcolor.alpha = 0; bgcolor.control = -1; - debugC(2, kDebugLevelGraphics, "New window with params %d, %d, %d, %d\n", rect1.top, rect1.left, rect1.height(), rect1.width()); + debugC(2, kDebugLevelGraphics, "New window with params %d, %d, %d, %d\n", dims.top, dims.left, dims.height(), dims.width()); fgcolor.visual = get_pic_color(s, colorPen); fgcolor.mask = GFX_MASK_VISUAL; @@ -227,8 +227,8 @@ reg_t SciGUI32::newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, s->titlebar_port->_font, lWhite, black, title ? s->strSplit(title, NULL).c_str() : NULL, style); // PQ3 and SCI1.1 games have the interpreter store underBits implicitly - if (rect2.top != 0 && rect2.left != 0 && rect2.height() != 0 && rect2.width() != 0) - gfxw_port_auto_restore_background(s->visual, window, gfx_rect(rect2.left, rect2.top + s->wm_port->_bounds.y, rect2.width(), rect2.height())); + if (restoreRect.top != 0 && restoreRect.left != 0 && restoreRect.height() != 0 && restoreRect.width() != 0) + gfxw_port_auto_restore_background(s->visual, window, gfx_rect(restoreRect.left, restoreRect.top + s->wm_port->_bounds.y, restoreRect.width(), restoreRect.height())); ADD_TO_WINDOW_PORT(window); FULL_REDRAW(); diff --git a/engines/sci/gui32/gui32.h b/engines/sci/gui32/gui32.h index 7f5fe7fe64..a06918260c 100644 --- a/engines/sci/gui32/gui32.h +++ b/engines/sci/gui32/gui32.h @@ -42,7 +42,7 @@ public: reg_t getPort(); void globalToLocal(int16 *x, int16 *y); void localToGlobal(int16 *x, int16 *y); - reg_t newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title); + reg_t newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title); void disposeWindow(uint16 windowPtr, int16 arg2); void display(const char *text, int argc, reg_t *argv); |