aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeEngine.cpp
diff options
context:
space:
mode:
authorJordi Vilalta Prat2009-01-14 02:44:09 +0000
committerJordi Vilalta Prat2009-01-14 02:44:09 +0000
commitab82db8f867fc51aae1dad004117fdf70b9ce0a5 (patch)
tree18294ae5e25bfdb0be4956beb7b8c608ca63d068 /gui/ThemeEngine.cpp
parentbe346a6b5f1a02bea8f8079199dddbef9d05b80e (diff)
downloadscummvm-rg350-ab82db8f867fc51aae1dad004117fdf70b9ce0a5.tar.gz
scummvm-rg350-ab82db8f867fc51aae1dad004117fdf70b9ce0a5.tar.bz2
scummvm-rg350-ab82db8f867fc51aae1dad004117fdf70b9ce0a5.zip
Use the current palette size for the theme mouse cursor instead of using the maximum (fixes a valgrind warning)
svn-id: r35857
Diffstat (limited to 'gui/ThemeEngine.cpp')
-rw-r--r--gui/ThemeEngine.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 9e0820b1c6..dcb5a8bb05 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -220,7 +220,7 @@ void ThemeEngine::refresh() {
_system->showOverlay();
if (_useCursor) {
- CursorMan.replaceCursorPalette(_cursorPal, 0, MAX_CURS_COLORS);
+ CursorMan.replaceCursorPalette(_cursorPal, 0, _cursorPalSize);
CursorMan.replaceCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
}
}
@@ -231,7 +231,7 @@ void ThemeEngine::enable() {
return;
if (_useCursor) {
- CursorMan.pushCursorPalette(_cursorPal, 0, MAX_CURS_COLORS);
+ CursorMan.pushCursorPalette(_cursorPal, 0, _cursorPalSize);
CursorMan.pushCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
CursorMan.showMouse(true);
}
@@ -1002,6 +1002,7 @@ bool ThemeEngine::createCursor(const Common::String &filename, int hotspotX, int
}
_useCursor = true;
+ _cursorPalSize = colorsFound;
return true;
}