[Scummvm-cvs-logs] CVS: scummvm/scumm script_v72he.cpp,2.111,2.112 scumm.cpp,1.216,1.217 scumm.h,1.488,1.489 vars.cpp,1.103,1.104
Gregory Montoir
cyx at users.sourceforge.net
Sun Sep 19 16:22:00 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2488/scumm
Modified Files:
script_v72he.cpp scumm.cpp scumm.h vars.cpp
Log Message:
slightly updated drawWizImage()
Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.111
retrieving revision 2.112
diff -u -d -r2.111 -r2.112
--- script_v72he.cpp 19 Sep 2004 13:42:25 -0000 2.111
+++ script_v72he.cpp 19 Sep 2004 23:21:09 -0000 2.112
@@ -1401,7 +1401,7 @@
drawWizPolygon(resnum, state, x1, flags);
return NULL;
}
-
+ uint8 *dst = NULL;
const uint8 *dataPtr = getResourceAddress(restype, resnum);
if (dataPtr) {
const uint8 *wizh = findWrappedBlock(MKID('WIZH'), dataPtr, state, 0);
@@ -1420,54 +1420,70 @@
setPaletteFromPtr(pal, 256);
}
if (flags & 2) {
- warning("unhandled Wiz image w/ rmap palette");
- }
- if (flags & 4) {
- warning("printing Wiz image is unimplemented");
- return NULL;
+ const uint8 *rmap = findWrappedBlock(MKID('RMAP'), dataPtr, state, 0);
+ assert(rmap);
+ const uint8 *rgbs = findWrappedBlock(MKID('RGBS'), dataPtr, state, 0);
+ assert(rgbs);
+// drawWizImageHelper1(rmap + 4, _currentPalette, rgbs);
+ warning("drawWizImage() unhandled flag 0x2");
}
-
- uint8 *dst = NULL;
+ uint32 cw, ch;
if (flags & 0x24) { // printing (0x4) or rendering to memory (0x20)
dst = (uint8 *)malloc(width * height);
- memset(dst, 255, width * height); // make transparent
-
if (flags & 0x20) {
- // copy width * height bytes from VAR_117 to dst
+ int color = 255; // FIXME: should be (VAR_WIZ_TCOLOR != 0xFF) ? VAR(VAR_WIZ_TCOLOR) : 5;
+ memset(dst, color, width * height);
// FIXME: dirty hack until missing bits are implemented
Common::Rect rScreen(0, 0, width-1, height-1);
gdi.copyWizImage(dst, wizd, width, height, 0, 0, width, height, &rScreen);
setCursorFromBuffer(dst, width, height, width);
free(dst);
- // FIXME: return a valid pointer for drawWizPolygon (0x20)
return NULL;
}
+ cw = width;
+ ch = height;
+ } else {
+ VirtScreen *pvs = &virtscr[kMainVirtScreen];
+ if (flags & 0x10) {
+ dst = pvs->getPixels(0, pvs->topline);
+ } else {
+ dst = pvs->getBackPixels(0, pvs->topline);
+ }
+ cw = pvs->w;
+ ch = pvs->h;
}
-
- VirtScreen *pvs = &virtscr[kMainVirtScreen];
- if (flags & 0x10) {
- dst = pvs->getPixels(0, pvs->topline);
- } else if (!(flags & 0x20)) {
- dst = pvs->getBackPixels(0, pvs->topline);
+ Common::Rect rScreen(0, 0, cw, ch);
+ if (flags & 0x80) {
+// drawWizImageHelper2(p, wizd, cw, ch, x1, y1, width, height, &rScreen, 0, 2);
+ warning("drawWizImage() unhandled flag 0x80");
+ } else if (flags & 0x100) {
+// drawWizImageHelper2(p, wizd, cw, ch, x1, y1, width, height, &rScreen, 0, 1);
+ warning("drawWizImage() unhandled flag 0x100");
+ } else if (flags & 2) {
+// drawWizImageHelper3(dst, wizd, cw, ch, x1, y1, width, height, rScreen, rmap + 4);
+ } else {
+ gdi.copyWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen);
}
- Common::Rect rScreen(0, 0, pvs->w, pvs->h);
- gdi.copyWizImage(dst, wizd, pvs->w, pvs->h, x1, y1, width, height, &rScreen);
-
- Common::Rect rImage(x1, y1, x1 + width, y1 + height);
- if (rImage.intersects(rScreen)) {
- rImage.clip(rScreen);
- if (flags & 0x18) {
- ++rImage.bottom;
- markRectAsDirty(kMainVirtScreen, rImage);
- } else {
- --rImage.right;
- --rImage.bottom;
- gdi.copyVirtScreenBuffers(rImage);
+ if (flags & 4) {
+ warning("printing Wiz image is unimplemented");
+ dst = NULL;
+ } else {
+ Common::Rect rImage(x1, y1, x1 + width, y1 + height);
+ if (rImage.intersects(rScreen)) {
+ rImage.clip(rScreen);
+ if (flags & 0x18) {
+ ++rImage.bottom;
+ markRectAsDirty(kMainVirtScreen, rImage);
+ } else {
+ --rImage.right;
+ --rImage.bottom;
+ gdi.copyVirtScreenBuffers(rImage);
+ }
}
}
}
- return NULL;
+ return dst;
}
struct PolygonDrawData {
Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -d -r1.216 -r1.217
--- scumm.cpp 19 Sep 2004 12:22:47 -0000 1.216
+++ scumm.cpp 19 Sep 2004 23:21:09 -0000 1.217
@@ -853,6 +853,7 @@
VAR_NUM_SPRITES = 0xFF;
VAR_POLYGONS_ONLY = 0xFF;
VAR_WINDOWS_VERSION = 0xFF;
+ VAR_WIZ_TCOLOR = 0xFF;
// Use g_scumm from error() ONLY
g_scumm = this;
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.488
retrieving revision 1.489
diff -u -d -r1.488 -r1.489
--- scumm.h 19 Sep 2004 00:15:17 -0000 1.488
+++ scumm.h 19 Sep 2004 23:21:09 -0000 1.489
@@ -1337,6 +1337,7 @@
byte VAR_NUM_SPRITES;
byte VAR_POLYGONS_ONLY;
byte VAR_WINDOWS_VERSION;
+ byte VAR_WIZ_TCOLOR;
};
// This is a constant lookup table of reverse bit masks
Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/vars.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- vars.cpp 17 Sep 2004 02:59:38 -0000 1.103
+++ vars.cpp 19 Sep 2004 23:21:09 -0000 1.104
@@ -259,8 +259,10 @@
VAR_NUM_GLOBAL_OBJS = 74;
VAR_POLYGONS_ONLY = 76;
- if (_heversion >= 80)
+ if (_heversion >= 80) {
VAR_WINDOWS_VERSION = 79;
+ VAR_WIZ_TCOLOR = 117;
+ }
if (_heversion >= 90)
VAR_NUM_SPRITES = 106;
}
More information about the Scummvm-git-logs
mailing list