From 8ec78f4ed0facebe757b7cd120cdf25e65ec014b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Nov 2013 12:35:00 -0400 Subject: TSAGE: Set R2R dialogs to restore the palette after closing --- engines/tsage/graphics.cpp | 7 +++++++ engines/tsage/graphics.h | 1 + engines/tsage/ringworld2/ringworld2_dialogs.cpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index ee015e3315..32810626e7 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -1070,9 +1070,16 @@ bool GfxButton::process(Event &event) { GfxDialog::GfxDialog() { _savedArea = NULL; _defaultButton = NULL; + + // For Return to Ringworld 2, backup palette when showing a dialog + if (g_vm->getGameID() == GType_Ringworld2) + g_system->getPaletteManager()->grabPalette(&_savedPalette[0], 0, 256); } GfxDialog::~GfxDialog() { + if (g_vm->getGameID() == GType_Ringworld2) + g_system->getPaletteManager()->setPalette(&_savedPalette[0], 0, 256); + remove(); } diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index 8d9c4d31b1..497cd76ad6 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -320,6 +320,7 @@ public: GfxElementList _elements; GfxButton *_defaultButton; GfxSurface *_savedArea; + byte _savedPalette[256 * 3]; public: GfxDialog(); virtual ~GfxDialog(); diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp index 4ebbdd602d..7c97aa041c 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp +++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp @@ -344,7 +344,7 @@ CharacterDialog::CharacterDialog() { /*--------------------------------------------------------------------------*/ void HelpDialog::show() { - // Set the palette and change the cursor + // change the cursor R2_GLOBALS._events.setCursor(CURSOR_ARROW); // Create the dialog and draw it -- cgit v1.2.3