mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-25 05:34:27 +00:00
Cleanup.
svn-id: r22635
This commit is contained in:
parent
17fd8e5ed0
commit
21a74b6f41
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user