mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
Implemented popAllCursors() in CursorManager to ensure that all unnecessary cursors are removed from the cursor stack when returning to the launcher
svn-id: r32642
This commit is contained in:
parent
4d7798825c
commit
4fddafa3e6
@ -83,6 +83,24 @@ void CursorManager::popCursor() {
|
||||
g_system->showMouse(isVisible());
|
||||
}
|
||||
|
||||
|
||||
void CursorManager::popAllCursors() {
|
||||
while (!_cursorStack.empty()) {
|
||||
Cursor *cur = _cursorStack.pop();
|
||||
delete cur;
|
||||
}
|
||||
|
||||
if (g_system->hasFeature(OSystem::kFeatureCursorHasPalette)) {
|
||||
while (!_cursorPaletteStack.empty()) {
|
||||
Palette *pal = _cursorPaletteStack.pop();
|
||||
delete pal;
|
||||
}
|
||||
}
|
||||
|
||||
g_system->showMouse(isVisible());
|
||||
}
|
||||
|
||||
|
||||
void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
|
||||
if (_cursorStack.empty()) {
|
||||
pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
|
||||
|
@ -79,6 +79,14 @@ public:
|
||||
*/
|
||||
void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
|
||||
|
||||
/**
|
||||
* Pop all of the cursors and cursor palettes from their respective stacks.
|
||||
* The purpose is to ensure that all unecessary cursors are removed from the
|
||||
* stack when returning to the launcher from an engine.
|
||||
*
|
||||
*/
|
||||
void popAllCursors();
|
||||
|
||||
/**
|
||||
* Enable/Disable the current cursor palette.
|
||||
*
|
||||
|
@ -364,7 +364,9 @@ void NewGui::restoreState() {
|
||||
void NewGui::openDialog(Dialog *dialog) {
|
||||
_dialogStack.push(dialog);
|
||||
_needRedraw = true;
|
||||
|
||||
|
||||
CursorMan.popAllCursors();
|
||||
|
||||
// We reflow the dialog just before opening it. If the screen changed
|
||||
// since the last time we looked, also refresh the loaded theme,
|
||||
// and reflow all other open dialogs, too.
|
||||
|
Loading…
x
Reference in New Issue
Block a user