[Scummvm-cvs-logs] scummvm master -> a3ff8b5de6026a623c673ed2c4ad1ca8892c5ddc

dreammaster dreammaster at scummvm.org
Sat Jun 4 06:23:51 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a3ff8b5de6 TSAGE: Moved graphic edge adjustment amount to a global variable


Commit: a3ff8b5de6026a623c673ed2c4ad1ca8892c5ddc
    https://github.com/scummvm/scummvm/commit/a3ff8b5de6026a623c673ed2c4ad1ca8892c5ddc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-06-03T21:22:09-07:00

Commit Message:
TSAGE: Moved graphic edge adjustment amount to a global variable

This matches what was done in the Ringworld CD version

Changed paths:
    engines/tsage/globals.cpp
    engines/tsage/globals.h
    engines/tsage/graphics.cpp



diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 764f702..bc34c59 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 e1a089b..8212387 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 d3c0d9b..85ff6d6 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) {






More information about the Scummvm-git-logs mailing list