From a3ff8b5de6026a623c673ed2c4ad1ca8892c5ddc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 4 Jun 2011 14:22:09 +1000 Subject: TSAGE: Moved graphic edge adjustment amount to a global variable This matches what was done in the Ringworld CD version --- engines/tsage/globals.cpp | 1 + engines/tsage/globals.h | 1 + engines/tsage/graphics.cpp | 14 +++++++------- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 764f70240d..bc34c59673 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -54,6 +54,7 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _randomSource("tsage"), _unkColor1(0), _unkColor2(255), _unkColor3(255) { reset(); _stripNum = 0; + _gfxEdgeAdjust = 3; if (_vm->getFeatures() & GF_DEMO) { _gfxFontNumber = 0; diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index e1a089b8e5..8212387ed1 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -68,6 +68,7 @@ public: SequenceManager _sequenceManager; Common::RandomSource _randomSource; int _stripNum; + int _gfxEdgeAdjust; public: Globals(); ~Globals(); diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index d3c0d9b5e2..85ff6d67f5 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -605,7 +605,7 @@ void GfxElement::highlight() { // Scan through the contents of the element, switching any occurances of the foreground // color with the background color and vice versa Rect tempRect(_bounds); - tempRect.collapse(2, 2); + tempRect.collapse(_globals->_gfxEdgeAdjust - 1, _globals->_gfxEdgeAdjust - 1); for (int yp = tempRect.top; yp < tempRect.bottom; ++yp) { byte *lineP = (byte *)surface.getBasePtr(tempRect.left, yp); @@ -637,7 +637,7 @@ void GfxElement::drawFrame() { } Rect tempRect = _bounds; - tempRect.collapse(3, 3); + tempRect.collapse(_globals->_gfxEdgeAdjust, _globals->_gfxEdgeAdjust); tempRect.collapse(-1, -1); gfxManager.fillRect(tempRect, _colors.background); @@ -810,7 +810,7 @@ void GfxButton::setDefaults() { tempRect.right = ((tempRect.right + 15) / 16) * 16; // Set the button bounds to a reduced area - tempRect.collapse(-3, -3); + tempRect.collapse(-_globals->_gfxEdgeAdjust, -_globals->_gfxEdgeAdjust); tempRect.moveTo(_bounds.left, _bounds.top); _bounds = tempRect; } @@ -834,7 +834,7 @@ void GfxButton::draw() { // Display the button's text Rect tempRect(_bounds); - tempRect.collapse(3, 3); + tempRect.collapse(_globals->_gfxEdgeAdjust, _globals->_gfxEdgeAdjust); gfxManager._font.writeLines(_message.c_str(), tempRect, ALIGN_CENTER); gfxManager.unlockSurface(); @@ -895,7 +895,7 @@ void GfxDialog::setDefaults() { // Set the dialog boundaries _gfxManager._bounds = tempRect; - tempRect.collapse(-6, -6); + tempRect.collapse(-_globals->_gfxEdgeAdjust * 2, -_globals->_gfxEdgeAdjust * 2); _bounds = tempRect; } @@ -925,7 +925,7 @@ void GfxDialog::draw() { drawFrame(); // Reset the dialog's graphics manager to only draw within the dialog boundaries - tempRect.translate(6, 6); + tempRect.translate(_globals->_gfxEdgeAdjust * 2, _globals->_gfxEdgeAdjust * 2); _gfxManager._bounds = tempRect; // Draw each element in the dialog in order @@ -962,7 +962,7 @@ void GfxDialog::addElements(GfxElement *ge, ...) { } void GfxDialog::setTopLeft(int xp, int yp) { - _bounds.moveTo(xp - 6, yp - 6); + _bounds.moveTo(xp - _globals->_gfxEdgeAdjust * 2, yp - _globals->_gfxEdgeAdjust * 2); } void GfxDialog::setCenter(int xp, int yp) { -- cgit v1.2.3