aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-05-20 08:29:50 +0000
committerTorbjörn Andersson2006-05-20 08:29:50 +0000
commit22fb1e48ef192c331c224593e73fb817a2e582c0 (patch)
tree4f881a8e3a117d83fb855f0df8a17d1f30b70a65
parent87ee8db10d27e760f095e30db79ab14e9fb56ad9 (diff)
downloadscummvm-rg350-22fb1e48ef192c331c224593e73fb817a2e582c0.tar.gz
scummvm-rg350-22fb1e48ef192c331c224593e73fb817a2e582c0.tar.bz2
scummvm-rg350-22fb1e48ef192c331c224593e73fb817a2e582c0.zip
Set a cursor palette for the classic theme, as well. Otherwise we'll get the
wrong colours in many games. svn-id: r22540
-rw-r--r--gui/newgui.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index a863f6e3c2..edd91e9f39 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -146,6 +146,17 @@ void NewGui::runLoop() {
int i;
bool useStandardCurs = !_theme->ownCursor();
+ if (useStandardCurs) {
+ const byte palette[] = {
+ 255, 255, 255, 0,
+ 255, 255, 255, 0,
+ 171, 171, 171, 0,
+ 87, 87, 87, 0
+ };
+
+ _system->setCursorPalette(palette, 0, 4);
+ }
+
while (!_dialogStack.empty() && activeDialog == _dialogStack.top()) {
activeDialog->handleTickle();
@@ -305,21 +316,17 @@ void NewGui::closeTopDialog() {
_needRedraw = true;
}
-//
-// Draw the mouse cursor (animated). This is mostly ripped from the cursor code in gfx.cpp
-// We could plug in a different cursor here if we like to.
-//
+// Draw the mouse cursor (animated). This is pretty much the same as in old
+// SCUMM games, but the code no longer resembles what we have in cursor.cpp
+// very much. We could plug in a different cursor here if we like to.
+
void NewGui::animateCursor() {
int time = _system->getMillis();
if (time > _cursorAnimateTimer + kCursorAnimateDelay) {
- const byte colors[4] = { 15, 15, 7, 8 };
- const byte color = colors[_cursorAnimateCounter];
- int i;
-
- for (i = 0; i < 15; i++) {
+ for (int i = 0; i < 15; i++) {
if ((i < 6) || (i > 8)) {
- _cursor[16 * 7 + i] = color;
- _cursor[16 * i + 7] = color;
+ _cursor[16 * 7 + i] = _cursorAnimateCounter;
+ _cursor[16 * i + 7] = _cursorAnimateCounter;
}
}