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
This commit is contained in:
Torbjörn Andersson 2006-06-15 08:07:20 +00:00
parent e76a4cbc0d
commit 2265872a83

View File

@ -180,8 +180,11 @@ void ThemeNew::deinit() {
void ThemeNew::refresh() { void ThemeNew::refresh() {
init(); init();
resetupGuiRenderer(); resetupGuiRenderer();
if (_enabled) if (_enabled) {
_system->showOverlay(); _system->showOverlay();
PaletteMan.replaceCursorPalette(_cursorPal, 0, MAX_CURS_COLORS);
CursorMan.replaceCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
}
} }
void ThemeNew::enable() { void ThemeNew::enable() {
@ -1610,6 +1613,8 @@ void ThemeNew::createCursor() {
_system->colorToRGB(_colors[kColorTransparency], r, g, b); _system->colorToRGB(_colors[kColorTransparency], r, g, b);
uint16 transparency = RGBToColor<ColorMasks<565> >(r, g, b); uint16 transparency = RGBToColor<ColorMasks<565> >(r, g, b);
delete [] _cursor;
_cursor = new byte[_cursorWidth * _cursorHeight]; _cursor = new byte[_cursorWidth * _cursorHeight];
assert(_cursor); assert(_cursor);
memset(_cursor, 255, sizeof(byte)*_cursorWidth*_cursorHeight); memset(_cursor, 255, sizeof(byte)*_cursorWidth*_cursorHeight);