[Scummvm-cvs-logs] SF.net SVN: scummvm: [23080] scummvm/branches/branch-0-9-0/gui
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Tue Jun 13 11:32:56 CEST 2006
Revision: 23080
Author: eriktorbjorn
Date: 2006-06-13 02:32:47 -0700 (Tue, 13 Jun 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23080&view=rev
Log Message:
-----------
Let the [cursor] palettet manager handle disableCursorPalette(), too, to avoid
cursor glitch in at least some HE games.
Modified Paths:
--------------
scummvm/branches/branch-0-9-0/engines/scumm/he/wiz_he.cpp
scummvm/branches/branch-0-9-0/graphics/paletteman.cpp
scummvm/branches/branch-0-9-0/graphics/paletteman.h
scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp
Modified: scummvm/branches/branch-0-9-0/engines/scumm/he/wiz_he.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/he/wiz_he.cpp 2006-06-13 08:10:54 UTC (rev 23079)
+++ scummvm/branches/branch-0-9-0/engines/scumm/he/wiz_he.cpp 2006-06-13 09:32:47 UTC (rev 23080)
@@ -24,6 +24,7 @@
#include "common/stdafx.h"
#include "common/system.h"
+#include "graphics/paletteman.h"
#include "scumm/he/intern_he.h"
#include "scumm/resource.h"
#include "scumm/scumm.h"
@@ -1526,8 +1527,7 @@
_vm->setCursorHotspot(x, y);
// Since we set up cursor palette for default cursor, disable it now
- if (_vm->_system->hasFeature(OSystem::kFeatureCursorHasPalette))
- _vm->_system->disableCursorPalette(true);
+ PaletteMan.disableCursorPalette(true);
free(cursor);
}
Modified: scummvm/branches/branch-0-9-0/graphics/paletteman.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/graphics/paletteman.cpp 2006-06-13 08:10:54 UTC (rev 23079)
+++ scummvm/branches/branch-0-9-0/graphics/paletteman.cpp 2006-06-13 09:32:47 UTC (rev 23080)
@@ -37,6 +37,19 @@
}
}
+void PaletteManager::disableCursorPalette(bool disable) {
+ if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
+ return;
+
+ if (_cursorPaletteStack.empty())
+ return;
+
+ Palette *pal = _cursorPaletteStack.top();
+ pal->_disabled = disable;
+
+ g_system->disableCursorPalette(true);
+}
+
void PaletteManager::pushCursorPalette(const byte *colors, uint start, uint num) {
if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
return;
@@ -67,7 +80,7 @@
pal = _cursorPaletteStack.top();
- if (pal->_num)
+ if (pal->_num && !pal->_disabled)
g_system->setCursorPalette(pal->_data, pal->_start, pal->_num);
else
g_system->disableCursorPalette(true);
Modified: scummvm/branches/branch-0-9-0/graphics/paletteman.h
===================================================================
--- scummvm/branches/branch-0-9-0/graphics/paletteman.h 2006-06-13 08:10:54 UTC (rev 23079)
+++ scummvm/branches/branch-0-9-0/graphics/paletteman.h 2006-06-13 09:32:47 UTC (rev 23080)
@@ -32,6 +32,13 @@
class PaletteManager : public Common::Singleton<PaletteManager> {
public:
/**
+ * Enable/Disable the current cursor palette.
+ *
+ * @param disable
+ */
+ void disableCursorPalette(bool disable);
+
+ /**
* Push a new cursor palette onto the stack, and set it in the backend.
* The palette entries from 'start' till (start+num-1) will be replaced
* so a full palette updated is accomplished via start=0, num=256.
@@ -77,6 +84,8 @@
uint _num;
uint _size;
+ bool _disabled;
+
Palette(const byte *colors, uint start, uint num) {
_start = start;
_num = num;
@@ -88,6 +97,8 @@
} else {
_data = NULL;
}
+
+ _disabled = false;
}
~Palette() {
Modified: scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp 2006-06-13 08:10:54 UTC (rev 23079)
+++ scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp 2006-06-13 09:32:47 UTC (rev 23080)
@@ -195,7 +195,6 @@
}
void ThemeNew::disable() {
- _system->disableCursorPalette(true);
_system->hideOverlay();
PaletteMan.popCursorPalette();
_enabled = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list