From e6c7544fe296b7dd427265151a6170f3a4eb05bf Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 20 Feb 2011 05:43:04 +0100 Subject: GRAPHICS: Fix cursor palette buffering after RGBA->RGB change. Thanks to clone2727 for noticing this. --- graphics/cursorman.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics/cursorman.cpp') diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp index fe90545280..8f31421a8b 100644 --- a/graphics/cursorman.cpp +++ b/graphics/cursorman.cpp @@ -206,7 +206,7 @@ void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint nu } Palette *pal = _cursorPaletteStack.top(); - uint size = 4 * num; + uint size = 3 * num; if (pal->_size < size) { // Could not re-use the old buffer. Create a new one. @@ -219,7 +219,7 @@ void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint nu pal->_num = num; if (num) { - memcpy(pal->_data, colors, 4 * num); + memcpy(pal->_data, colors, size); g_system->setCursorPalette(pal->_data, pal->_start, pal->_num); } else { g_system->disableCursorPalette(true); @@ -256,7 +256,7 @@ CursorManager::Cursor::~Cursor() { CursorManager::Palette::Palette(const byte *colors, uint start, uint num) { _start = start; _num = num; - _size = 4 * num; + _size = 3 * num; if (num) { _data = new byte[_size]; -- cgit v1.2.3