[Scummvm-cvs-logs] CVS: scummvm/queen graphics.cpp,1.37,1.38 display.h,1.12,1.13 display.cpp,1.17,1.18
Gregory Montoir
cyx at users.sourceforge.net
Fri Oct 31 02:12:25 CET 2003
Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv14087
Modified Files:
graphics.cpp display.h display.cpp
Log Message:
add mouse cursor code
Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- graphics.cpp 28 Oct 2003 12:42:35 -0000 1.37
+++ graphics.cpp 31 Oct 2003 10:11:27 -0000 1.38
@@ -138,6 +138,9 @@
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);
}
Index: display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- display.h 29 Oct 2003 13:06:10 -0000 1.12
+++ display.h 31 Oct 2003 10:11:27 -0000 1.13
@@ -104,6 +104,8 @@
void handleTimer();
void waitForTimer();
+ void mouseCursorInit(uint8* buf, uint16 w, uint16 h, uint16 xhs, uint16 yhs);
+ void mouseCursorShow(bool show);
private:
@@ -139,6 +141,8 @@
uint16 _bdWidth, _bdHeight;
bool _gotTick;
+
+ uint8 _mouseCursor[14 * 14];
Dynalum _dynalum;
OSystem *_system;
Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- display.cpp 29 Oct 2003 13:06:10 -0000 1.17
+++ display.cpp 31 Oct 2003 10:11:27 -0000 1.18
@@ -275,7 +275,7 @@
}
}
_pals.dirtyMin = 0;
- _pals.dirtyMax = (roomNum >= 114) ? 255 : 223;
+ _pals.dirtyMax = 255; // (roomNum >= 114) ? 255 : 223; // FIXME: only for tests
_pals.scrollable = true;
}
@@ -822,6 +822,30 @@
_system->delay_msecs(10);
while (_system->poll_event(&event));
}
+}
+
+
+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);
}
More information about the Scummvm-git-logs
mailing list