aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/tsage/globals.cpp24
-rw-r--r--engines/tsage/globals.h1
-rw-r--r--engines/tsage/graphics.cpp9
-rw-r--r--engines/tsage/graphics.h1
-rw-r--r--engines/tsage/saveload.h2
5 files changed, 30 insertions, 7 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index e629396501..764f70240d 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -50,10 +50,8 @@ static SavedObject *classFactoryProc(const Common::String &className) {
/*--------------------------------------------------------------------------*/
-Globals::Globals() :
- _dialogCenter(160, 140),
- _gfxManagerInstance(_screenSurface),
- _randomSource("tsage") {
+Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface),
+ _randomSource("tsage"), _unkColor1(0), _unkColor2(255), _unkColor3(255) {
reset();
_stripNum = 0;
@@ -64,19 +62,29 @@ Globals::Globals() :
_fontColors.background = 0;
_fontColors.foreground = 0;
_dialogCenter.y = 80;
+ // Workaround in order to use later version of the engine
+ _unkColor1 = _gfxColors.foreground;
+ _unkColor2 = _gfxColors.foreground;
+ _unkColor3 = _gfxColors.foreground;
} else if ((_vm->getGameID() == GType_Ringworld) && (_vm->getFeatures() & GF_CD)) {
_gfxFontNumber = 50;
_gfxColors.background = 53;
_gfxColors.foreground = 0;
_fontColors.background = 51;
_fontColors.foreground = 54;
- warning("TODO: Check the 3 additional colors");
+ _unkColor1 = 18;
+ _unkColor2 = 18;
+ _unkColor3 = 18;
} else {
_gfxFontNumber = 50;
_gfxColors.background = 53;
_gfxColors.foreground = 18;
_fontColors.background = 51;
_fontColors.foreground = 54;
+ // Workaround in order to use later version of the engine
+ _unkColor1 = _gfxColors.foreground;
+ _unkColor2 = _gfxColors.foreground;
+ _unkColor3 = _gfxColors.foreground;
}
_screenSurface.setScreenSurface();
_gfxManagers.push_back(&_gfxManagerInstance);
@@ -131,6 +139,12 @@ void Globals::synchronize(Serializer &s) {
s.syncAsSint32LE(_gfxColors.foreground);
s.syncAsSint32LE(_fontColors.background);
s.syncAsSint32LE(_fontColors.foreground);
+
+ if (s.getVersion() >= 4) {
+ s.syncAsByte(_unkColor1);
+ s.syncAsByte(_unkColor2);
+ s.syncAsByte(_unkColor3);
+ }
s.syncAsSint16LE(_dialogCenter.x); s.syncAsSint16LE(_dialogCenter.y);
_sceneListeners.synchronize(s);
diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h
index 6b3df587b6..e1a089b8e5 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -51,6 +51,7 @@ public:
int _gfxFontNumber;
GfxColors _gfxColors;
GfxColors _fontColors;
+ byte _unkColor1, _unkColor2, _unkColor3;
SoundManager _soundManager;
Common::Point _dialogCenter;
WalkRegions _walkRegions;
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index cc11343c9c..f69d243f4d 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -589,6 +589,9 @@ void GfxElement::setDefaults() {
_fontNumber = _globals->_gfxFontNumber;
_colors = _globals->_gfxColors;
_fontColors = _globals->_fontColors;
+ _unkColor1 = _globals->_unkColor1;
+ _unkColor2 = _globals->_unkColor2;
+ _unkColor3 = _globals->_unkColor3;
}
/**
@@ -820,7 +823,11 @@ void GfxButton::draw() {
// Set the font and color
gfxManager._font.setFontNumber(_fontNumber);
- gfxManager._font._colors.foreground = this->_colors.foreground;
+
+ //
+ gfxManager._font._colors.foreground = this->_unkColor1;
+ gfxManager._font._colors2.background = this->_unkColor2;
+ gfxManager._font._colors2.foreground = this->_unkColor3;
// Display the button's text
Rect tempRect(_bounds);
diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h
index b269520039..1427be6031 100644
--- a/engines/tsage/graphics.h
+++ b/engines/tsage/graphics.h
@@ -176,6 +176,7 @@ public:
uint16 _fontNumber;
GfxColors _colors;
GfxColors _fontColors;
+ byte _unkColor1, _unkColor2, _unkColor3;
uint16 _keycode;
public:
GfxElement();
diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h
index 51b7696590..a905df2f98 100644
--- a/engines/tsage/saveload.h
+++ b/engines/tsage/saveload.h
@@ -33,7 +33,7 @@ namespace tSage {
typedef void (*SaveNotifierFn)(bool postFlag);
-#define TSAGE_SAVEGAME_VERSION 3
+#define TSAGE_SAVEGAME_VERSION 4
class SavedObject;