diff options
author | Jordi Vilalta Prat | 2009-01-14 02:44:09 +0000 |
---|---|---|
committer | Jordi Vilalta Prat | 2009-01-14 02:44:09 +0000 |
commit | ab82db8f867fc51aae1dad004117fdf70b9ce0a5 (patch) | |
tree | 18294ae5e25bfdb0be4956beb7b8c608ca63d068 | |
parent | be346a6b5f1a02bea8f8079199dddbef9d05b80e (diff) | |
download | scummvm-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
-rw-r--r-- | gui/ThemeEngine.cpp | 5 | ||||
-rw-r--r-- | gui/ThemeEngine.h | 1 |
2 files changed, 4 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; } diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h index b7b4bfaca6..e770f6bdc7 100644 --- a/gui/ThemeEngine.h +++ b/gui/ThemeEngine.h @@ -684,6 +684,7 @@ protected: bool _needPaletteUpdates; uint _cursorWidth, _cursorHeight; byte _cursorPal[4*MAX_CURS_COLORS]; + byte _cursorPalSize; }; } // end of namespace GUI. |