aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorKari Salminen2007-07-06 12:53:58 +0000
committerKari Salminen2007-07-06 12:53:58 +0000
commitceca6a82f1f64c3a9e950628e1930f5f18aceb23 (patch)
tree7b220898ecb2c1c3d0e9b545374a3b0c2b471b7d /engines/agi
parent1332a69b077ae012de92dfd18686d3e90021bd4e (diff)
downloadscummvm-rg350-ceca6a82f1f64c3a9e950628e1930f5f18aceb23.tar.gz
scummvm-rg350-ceca6a82f1f64c3a9e950628e1930f5f18aceb23.tar.bz2
scummvm-rg350-ceca6a82f1f64c3a9e950628e1930f5f18aceb23.zip
Added Amiga-style mouse cursor. Used with Amiga-render mode.
svn-id: r27938
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/graphics.cpp43
-rw-r--r--engines/agi/graphics.h2
2 files changed, 40 insertions, 5 deletions
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 2e32fc49ed..aa9b1a315c 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -746,9 +746,44 @@ static const byte sciMouseCursorPalette[] = {
0xFF, 0xFF, 0xFF, 0x00 // White
};
-void GfxMgr::setCursor() {
- CursorMan.replaceCursorPalette(sciMouseCursorPalette, 1, ARRAYSIZE(sciMouseCursorPalette) / 4);
- CursorMan.replaceCursor(sciMouseCursor, 11, 16, 1, 1, 0);
+/**
+ * An Amiga-style arrow cursor (8x11).
+ * 0 = Transparent.
+ * 1 = Black (#000000 in 24-bit RGB).
+ * 2 = Red (#DE2021 in 24-bit RGB).
+ * 3 = Light red (#FFCFAD in 24-bit RGB).
+ */
+static const byte amigaMouseCursor[] = {
+ 2,3,1,0,0,0,0,0,
+ 2,2,3,1,0,0,0,0,
+ 2,2,2,3,1,0,0,0,
+ 2,2,2,2,3,1,0,0,
+ 2,2,2,2,2,3,1,0,
+ 2,2,2,2,2,2,3,1,
+ 2,0,2,2,3,1,0,0,
+ 0,0,0,2,3,1,0,0,
+ 0,0,0,2,2,3,1,0,
+ 0,0,0,0,2,3,1,0,
+ 0,0,0,0,2,2,3,1
+};
+
+/**
+ * RGBA-palette for the Amiga-style arrow cursor.
+ */
+static const byte amigaMouseCursorPalette[] = {
+ 0x00, 0x00, 0x00, 0x00, // Black
+ 0xDE, 0x20, 0x21, 0x00, // Red
+ 0xFF, 0xCF, 0xAD, 0x00 // Light red
+};
+
+void GfxMgr::setCursor(bool amigaStyleCursor) {
+ if (!amigaStyleCursor) {
+ CursorMan.replaceCursorPalette(sciMouseCursorPalette, 1, ARRAYSIZE(sciMouseCursorPalette) / 4);
+ CursorMan.replaceCursor(sciMouseCursor, 11, 16, 1, 1, 0);
+ } else { // amigaStyleCursor
+ CursorMan.replaceCursorPalette(amigaMouseCursorPalette, 1, ARRAYSIZE(amigaMouseCursorPalette) / 4);
+ CursorMan.replaceCursor(amigaMouseCursor, 8, 11, 1, 1, 0);
+ }
}
/**
@@ -767,7 +802,7 @@ int GfxMgr::initVideo() {
gfxSetPalette();
- setCursor();
+ setCursor(_vm->_renderMode == Common::kRenderAmiga);
return errOK;
}
diff --git a/engines/agi/graphics.h b/engines/agi/graphics.h
index e5ab976b42..b1f9c0e1d7 100644
--- a/engines/agi/graphics.h
+++ b/engines/agi/graphics.h
@@ -87,7 +87,7 @@ public:
void putPixel(int, int, int);
void putBlock(int x1, int y1, int x2, int y2);
void gfxSetPalette();
- void setCursor();
+ void setCursor(bool amigaStyleCursor = false);
int keypress();
int getKey();