aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/GuiManager.cpp14
-rw-r--r--gui/ThemeEngine.cpp15
-rw-r--r--gui/ThemeEngine.h3
3 files changed, 32 insertions, 0 deletions
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index cf8b7b2d9d..fcfc02967e 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -135,6 +135,9 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx)
delete _theme;
if (_useStdCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.popCursorFormat();
+#endif
CursorMan.popCursorPalette();
CursorMan.popCursor();
}
@@ -382,6 +385,9 @@ void GuiManager::saveState() {
void GuiManager::restoreState() {
if (_useStdCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.popCursorFormat();
+#endif
CursorMan.popCursor();
CursorMan.popCursorPalette();
}
@@ -424,6 +430,14 @@ void GuiManager::setupCursor() {
87, 87, 87, 0
};
+#ifdef ENABLE_16BIT
+ Graphics::PixelFormat format;
+ format.bytesPerPixel = 1;
+ format.rLoss = format.gLoss = format.bLoss = format.aLoss = 8;
+ format.rShift = format.gShift = format.bShift = format.aShift = 0;
+
+ CursorMan.pushCursorFormat(format);
+#endif
CursorMan.pushCursorPalette(palette, 0, 4);
CursorMan.pushCursor(NULL, 0, 0, 0, 0);
CursorMan.showMouse(true);
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index fe93a1f7d6..5ce7c3dc60 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -434,6 +434,9 @@ void ThemeEngine::refresh() {
_system->showOverlay();
if (_useCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.replaceCursorFormat(_cursorFormat);
+#endif
CursorMan.replaceCursorPalette(_cursorPal, 0, _cursorPalSize);
CursorMan.replaceCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
}
@@ -445,6 +448,9 @@ void ThemeEngine::enable() {
return;
if (_useCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.pushCursorFormat(_system->getScreenFormat());
+#endif
CursorMan.pushCursorPalette(_cursorPal, 0, _cursorPalSize);
CursorMan.pushCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
CursorMan.showMouse(true);
@@ -462,6 +468,9 @@ void ThemeEngine::disable() {
_system->hideOverlay();
if (_useCursor) {
+#ifdef ENABLE_16BIT
+ CursorMan.popCursorFormat();
+#endif
CursorMan.popCursorPalette();
CursorMan.popCursor();
}
@@ -1165,6 +1174,12 @@ bool ThemeEngine::createCursor(const Common::String &filename, int hotspotX, int
if (!cursor)
return false;
+#ifdef ENABLE_16BIT
+ _cursorFormat.bytesPerPixel = 1;
+ _cursorFormat.rLoss = _cursorFormat.gLoss = _cursorFormat.bLoss = _cursorFormat.aLoss = 8;
+ _cursorFormat.rShift = _cursorFormat.gShift = _cursorFormat.bShift = _cursorFormat.aShift = 0;
+#endif
+
// Set up the cursor parameters
_cursorHotspotX = hotspotX;
_cursorHotspotY = hotspotY;
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index a7bec4d9a3..2a7bbcc6ce 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -579,6 +579,9 @@ protected:
ImagesMap _bitmaps;
Graphics::PixelFormat _overlayFormat;
+#ifdef ENABLE_16BIT
+ Graphics::PixelFormat _cursorFormat;
+#endif
/** List of all the dirty screens that must be blitted to the overlay. */
Common::List<Common::Rect> _dirtyScreen;