aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
authorGregory Montoir2003-10-31 10:11:27 +0000
committerGregory Montoir2003-10-31 10:11:27 +0000
commit55cb72e5faf954e29991dc88a3e161dd59f01a98 (patch)
tree565726012a008a6c9a2b298a0d27ffe7eeb5dfa9 /queen
parent6011bd6cdc0d073b2dd5ef99dc89ce7e50f2a983 (diff)
downloadscummvm-rg350-55cb72e5faf954e29991dc88a3e161dd59f01a98.tar.gz
scummvm-rg350-55cb72e5faf954e29991dc88a3e161dd59f01a98.tar.bz2
scummvm-rg350-55cb72e5faf954e29991dc88a3e161dd59f01a98.zip
add mouse cursor code
svn-id: r11015
Diffstat (limited to 'queen')
-rw-r--r--queen/display.cpp26
-rw-r--r--queen/display.h4
-rw-r--r--queen/graphics.cpp3
3 files changed, 32 insertions, 1 deletions
diff --git a/queen/display.cpp b/queen/display.cpp
index fa29ec0cb7..1b926c27c5 100644
--- a/queen/display.cpp
+++ b/queen/display.cpp
@@ -275,7 +275,7 @@ void Display::palFadeIn(int start, int end, uint16 roomNum) {
}
}
_pals.dirtyMin = 0;
- _pals.dirtyMax = (roomNum >= 114) ? 255 : 223;
+ _pals.dirtyMax = 255; // (roomNum >= 114) ? 255 : 223; // FIXME: only for tests
_pals.scrollable = true;
}
@@ -825,6 +825,30 @@ void Display::waitForTimer() {
}
+void Display::mouseCursorInit(uint8 *buf, uint16 w, uint16 h, uint16 xhs, uint16 yhs) {
+
+ // change transparency color match the one expected by the backend (0xFF)
+ uint16 size = w * h;
+ uint8 *p = buf;
+ while (size--) {
+ if (*p == 255) {
+ *p = 223;
+ }
+ else if (*p == 0) {
+ *p = 255;
+ }
+ ++p;
+ }
+ _system->set_mouse_cursor(buf, w, h, xhs, yhs);
+}
+
+
+void Display::mouseCursorShow(bool show) {
+
+ _system->show_mouse(show);
+}
+
+
const uint8 TextRenderer::FONT[] = {
0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0,
diff --git a/queen/display.h b/queen/display.h
index 23d2030d63..da64ce70b2 100644
--- a/queen/display.h
+++ b/queen/display.h
@@ -104,6 +104,8 @@ public:
void handleTimer();
void waitForTimer();
+ void mouseCursorInit(uint8* buf, uint16 w, uint16 h, uint16 xhs, uint16 yhs);
+ void mouseCursorShow(bool show);
private:
@@ -140,6 +142,8 @@ private:
bool _gotTick;
+ uint8 _mouseCursor[14 * 14];
+
Dynalum _dynalum;
OSystem *_system;
diff --git a/queen/graphics.cpp b/queen/graphics.cpp
index b73533e9b3..52bba6e25c 100644
--- a/queen/graphics.cpp
+++ b/queen/graphics.cpp
@@ -138,6 +138,9 @@ void Graphics::bobSetupControl() {
bankUnpack(3, 3, 17); // Up arrow dialogue
bankUnpack(4, 4, 17); // Down arrow dialogue
bankErase(17);
+
+ BobFrame *bf = &_frames[1];
+ _display->mouseCursorInit(bf->data, bf->width, bf->height, bf->xhotspot, bf->yhotspot);
}