diff options
-rw-r--r-- | graphics/paletteman.cpp | 14 | ||||
-rw-r--r-- | graphics/paletteman.h | 10 |
2 files changed, 11 insertions, 13 deletions
diff --git a/graphics/paletteman.cpp b/graphics/paletteman.cpp index 23bd7534a7..ffd9d3fef2 100644 --- a/graphics/paletteman.cpp +++ b/graphics/paletteman.cpp @@ -57,9 +57,7 @@ void PaletteManager::popCursorPalette() { if (_cursorPaletteStack.empty()) return; - Palette *pal; - - pal = _cursorPaletteStack.pop(); + Palette *pal = _cursorPaletteStack.pop(); delete pal; if (_cursorPaletteStack.empty()) { @@ -70,7 +68,7 @@ void PaletteManager::popCursorPalette() { pal = _cursorPaletteStack.top(); if (pal->_num) - g_system->setCursorPalette(pal->_colors, pal->_start, pal->_num); + g_system->setCursorPalette(pal->_data, pal->_start, pal->_num); else g_system->disableCursorPalette(true); } @@ -89,8 +87,8 @@ void PaletteManager::replaceCursorPalette(const byte *colors, uint start, uint n if (pal->_size < size) { // Could not re-use the old buffer. Create a new one. - delete pal->_colors; - pal->_colors = new byte[size]; + delete pal->_data; + pal->_data = new byte[size]; pal->_size = size; } @@ -98,8 +96,8 @@ void PaletteManager::replaceCursorPalette(const byte *colors, uint start, uint n pal->_num = num; if (num) { - memcpy(pal->_colors, colors, 4 * num); - g_system->setCursorPalette(pal->_colors, pal->_start, pal->_num); + memcpy(pal->_data, colors, 4 * num); + g_system->setCursorPalette(pal->_data, pal->_start, pal->_num); } else { g_system->disableCursorPalette(true); } diff --git a/graphics/paletteman.h b/graphics/paletteman.h index 6f04c09fec..425cb50447 100644 --- a/graphics/paletteman.h +++ b/graphics/paletteman.h @@ -72,7 +72,7 @@ private: PaletteManager(); struct Palette { - byte *_colors; + byte *_data; uint _start; uint _num; uint _size; @@ -83,15 +83,15 @@ private: _size = 4 * num; if (num) { - _colors = new byte[_size]; - memcpy(_colors, colors, _size); + _data = new byte[_size]; + memcpy(_data, colors, _size); } else { - _colors = NULL; + _data = NULL; } } ~Palette() { - delete [] _colors; + delete [] _data; } }; |