aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-06-15 08:07:20 +0000
committerTorbjörn Andersson2006-06-15 08:07:20 +0000
commit2265872a8362e7d27b5eff9f5d5a3e00a0199d70 (patch)
tree912a978d1b48334c44aa1d6f6dafbf8ded202515
parente76a4cbc0d8305bec70cb8861b9016b83446d3cb (diff)
downloadscummvm-rg350-2265872a8362e7d27b5eff9f5d5a3e00a0199d70.tar.gz
scummvm-rg350-2265872a8362e7d27b5eff9f5d5a3e00a0199d70.tar.bz2
scummvm-rg350-2265872a8362e7d27b5eff9f5d5a3e00a0199d70.zip
Delete the old cursor buffer before allocating a new one. If the theme is
enabled by the time it's refreshed, replace the cursor. svn-id: r23122
-rw-r--r--gui/ThemeNew.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp
index 00545da33d..c02ff2e1d9 100644
--- a/gui/ThemeNew.cpp
+++ b/gui/ThemeNew.cpp
@@ -180,8 +180,11 @@ void ThemeNew::deinit() {
void ThemeNew::refresh() {
init();
resetupGuiRenderer();
- if (_enabled)
+ if (_enabled) {
_system->showOverlay();
+ PaletteMan.replaceCursorPalette(_cursorPal, 0, MAX_CURS_COLORS);
+ CursorMan.replaceCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
+ }
}
void ThemeNew::enable() {
@@ -1610,6 +1613,8 @@ void ThemeNew::createCursor() {
_system->colorToRGB(_colors[kColorTransparency], r, g, b);
uint16 transparency = RGBToColor<ColorMasks<565> >(r, g, b);
+ delete [] _cursor;
+
_cursor = new byte[_cursorWidth * _cursorHeight];
assert(_cursor);
memset(_cursor, 255, sizeof(byte)*_cursorWidth*_cursorHeight);