[Scummvm-cvs-logs] CVS: scummvm/saga gfx.cpp,1.66,1.67
Torbjörn Andersson
eriktorbjorn at users.sourceforge.net
Sun Oct 9 12:44:18 CEST 2005
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4202
Modified Files:
gfx.cpp
Log Message:
Apparently, the IHNM crosshair cursor, and the cursor hotspot, are both
hard-coded.
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- gfx.cpp 9 Oct 2005 19:10:58 -0000 1.66
+++ gfx.cpp 9 Oct 2005 19:43:15 -0000 1.67
@@ -53,12 +53,10 @@
_system->showMouse(true);
}
-
Gfx::~Gfx() {
_backBuffer.free();
}
-
void Surface::drawPalette() {
int x;
int y;
@@ -421,28 +419,37 @@
resourceId = RID_IHNM_HOURGLASS_CURSOR;
break;
default:
- // Assume normal cursor
- // TODO: Find the correct resource for it
- resourceId = RID_IHNM_HOURGLASS_CURSOR;
+ resourceId = (uint32)-1;
break;
}
- ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE);
-
byte *resource;
size_t resourceLength;
-
- _vm->_resource->loadResource(context, resourceId, resource, resourceLength);
-
byte *image;
size_t imageLength;
int width, height;
- _vm->decodeBGImage(resource, resourceLength, &image, &imageLength, &width, &height);
+ if (resourceId != (uint32)-1) {
+ ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE);
- // TODO: Hotspot?
+ _vm->_resource->loadResource(context, resourceId, resource, resourceLength);
- _system->setMouseCursor(image, width, height, 0, 0, 0);
+ _vm->decodeBGImage(resource, resourceLength, &image, &imageLength, &width, &height);
+ } else {
+ resource = NULL;
+ width = height = 31;
+ image = (byte *)calloc(width, height);
+
+ for (int i = 0; i < 14; i++) {
+ image[15 * 31 + i] = 1;
+ image[15 * 31 + 30 - i] = 1;
+ image[i * 31 + 15] = 1;
+ image[(30 - i) * 31 + 15] = 1;
+ }
+ }
+
+ // Note: Hard-coded hotspot
+ _system->setMouseCursor(image, width, height, 15, 15, 0);
free(image);
free(resource);
More information about the Scummvm-git-logs
mailing list