aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-05-20 10:59:25 +0000
committerTorbjörn Andersson2006-05-20 10:59:25 +0000
commit6cdd98b6179954a6ccfc40a9db5bf106a3a9b9e1 (patch)
treeba2f0a1361f04b6ec44b12d62326786e2c8f24b0 /gui
parent1c7c0039b5483919387943625a04646c5b6b0754 (diff)
downloadscummvm-rg350-6cdd98b6179954a6ccfc40a9db5bf106a3a9b9e1.tar.gz
scummvm-rg350-6cdd98b6179954a6ccfc40a9db5bf106a3a9b9e1.tar.bz2
scummvm-rg350-6cdd98b6179954a6ccfc40a9db5bf106a3a9b9e1.zip
After the GUI has finished, restore the old cursor palette (if any). For this
to work, cursor palette now has to be set using the new "palette manager". See graphics/paletteman.cpp svn-id: r22543
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeNew.cpp5
-rw-r--r--gui/newgui.cpp5
2 files changed, 7 insertions, 3 deletions
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp
index b08dded3ce..0ff6b45fa4 100644
--- a/gui/ThemeNew.cpp
+++ b/gui/ThemeNew.cpp
@@ -27,6 +27,7 @@
#include "graphics/imageman.h"
#include "graphics/imagedec.h"
#include "graphics/colormasks.h"
+#include "graphics/paletteman.h"
#include "common/config-manager.h"
#include "common/file.h"
@@ -383,6 +384,7 @@ void ThemeNew::enable() {
void ThemeNew::disable() {
_system->disableCursorPalette(true);
_system->hideOverlay();
+ PaletteMan.popCursorPalette();
_enabled = false;
}
@@ -1546,9 +1548,8 @@ OverlayColor ThemeNew::calcDimColor(OverlayColor col) {
#pragma mark -
void ThemeNew::setUpCursor() {
- _system->setCursorPalette(_cursorPal, 0, MAX_CURS_COLORS);
+ PaletteMan.pushCursorPalette(_cursorPal, 0, MAX_CURS_COLORS);
_system->setMouseCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
- _system->disableCursorPalette(false);
}
void ThemeNew::createCursor() {
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index edd91e9f39..db45d94e3c 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -22,6 +22,7 @@
#include "common/stdafx.h"
#include "common/system.h"
#include "common/util.h"
+#include "graphics/paletteman.h"
#include "gui/newgui.h"
#include "gui/dialog.h"
#include "gui/eval.h"
@@ -154,7 +155,7 @@ void NewGui::runLoop() {
87, 87, 87, 0
};
- _system->setCursorPalette(palette, 0, 4);
+ PaletteMan.pushCursorPalette(palette, 0, 4);
}
while (!_dialogStack.empty() && activeDialog == _dialogStack.top()) {
@@ -272,6 +273,8 @@ void NewGui::runLoop() {
}
_theme->closeDialog();
+ if (useStandardCurs)
+ PaletteMan.popCursorPalette();
if (didSaveState) {
restoreState();