[Scummvm-cvs-logs] CVS: scummvm/scumm resource_v7he.cpp,1.20,1.21
Max Horn
fingolfin at users.sourceforge.net
Sat Mar 12 10:02:49 CET 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28071
Modified Files:
resource_v7he.cpp
Log Message:
clean up
Index: resource_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v7he.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- resource_v7he.cpp 17 Feb 2005 23:01:00 -0000 1.20
+++ resource_v7he.cpp 12 Mar 2005 18:02:19 -0000 1.21
@@ -99,33 +99,27 @@
void Win32ResExtractor::setCursor(int id) {
char buf[20];
- byte *cursorRes = 0, *cursor = 0;
+ byte *cursorRes = 0;
int cursorsize;
- int w = 0, h = 0, hotspot_x = 0, hotspot_y = 0, keycolor = 0;
+ int keycolor = 0;
CachedCursor *cc = findCachedCursor(id);
if (cc != NULL) {
debug(7, "Found cursor %d in cache slot %d", id, cc - _cursorCache);
- _vm->setCursorHotspot(cc->hotspot_x, cc->hotspot_y);
- _vm->setCursorFromBuffer(cc->bitmap, cc->w, cc->h, cc->w);
} else {
- snprintf(buf, 20, "%d", id);
- cursorsize = extractResource("group_cursor", buf, &cursorRes);
- convertIcons(cursorRes, cursorsize, &cursor, &w, &h, &hotspot_x, &hotspot_y, &keycolor);
+ snprintf(buf, sizeof(buf), "%d", id);
cc = getCachedCursorSlot();
assert(cc && !cc->valid);
+ cursorsize = extractResource("group_cursor", buf, &cursorRes);
+ convertIcons(cursorRes, cursorsize, &cc->bitmap, &cc->w, &cc->h, &cc->hotspot_x, &cc->hotspot_y, &keycolor);
debug(7, "Adding cursor %d to cache slot %d", id, cc - _cursorCache);
- _vm->setCursorHotspot(hotspot_x, hotspot_y);
- _vm->setCursorFromBuffer(cursor, w, h, w);
free(cursorRes);
cc->valid = true;
cc->id = id;
- cc->bitmap = cursor;
- cc->w = w;
- cc->h = h;
- cc->hotspot_x = hotspot_x;
- cc->hotspot_y = hotspot_y;
cc->last_used = g_system->getMillis();
}
+
+ _vm->setCursorHotspot(cc->hotspot_x, cc->hotspot_y);
+ _vm->setCursorFromBuffer(cc->bitmap, cc->w, cc->h, cc->w);
}
int Win32ResExtractor::extractResource(const char *resType, char *resName, byte **data) {
More information about the Scummvm-git-logs
mailing list