aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2002-11-29 16:06:15 +0000
committerTravis Howell2002-11-29 16:06:15 +0000
commit7dd2bd4dc626e740d3fc86ca1d5c5665c6a69b7f (patch)
treebfb3738c6d1038a7d682b41a8e4fb12f23d1763b /simon
parent9cf9e0ec419f0a704ee36654d4d68d2d242a9c5f (diff)
downloadscummvm-rg350-7dd2bd4dc626e740d3fc86ca1d5c5665c6a69b7f.tar.gz
scummvm-rg350-7dd2bd4dc626e740d3fc86ca1d5c5665c6a69b7f.tar.bz2
scummvm-rg350-7dd2bd4dc626e740d3fc86ca1d5c5665c6a69b7f.zip
Fix dump_vga_bitmaps and restrict to win32 only
svn-id: r5750
Diffstat (limited to 'simon')
-rw-r--r--simon/debug.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/simon/debug.cpp b/simon/debug.cpp
index 8039762772..a6e9281f06 100644
--- a/simon/debug.cpp
+++ b/simon/debug.cpp
@@ -401,9 +401,8 @@ void pal_load(byte *pal, const byte *vga1, int a, int b) {
}
void SimonState::dump_vga_bitmaps(byte *vga, byte *vga1, int res) {
-#if 0
- // FIXME - this whole function doesn't compile on OS X and contains obvious bugs.
- // E.g. offs is read but never set, same for width.
+/* Only supported for win32 atm. mkdir doesn't work otherwise. */
+#if defined (WIN32) && !defined(_WIN32_WCE)
int i;
uint32 offs;
@@ -419,32 +418,26 @@ void SimonState::dump_vga_bitmaps(byte *vga, byte *vga1, int res) {
pal_load(pal, vga1, 5, 3);
}
-#if 0
{
char buf[255], buf2[255];
sprintf(buf, "bmp_%d", res);
- mkdir(buf2); // FIXME - WTF is this ???
- // First off, mkdir() is not very portable.
- // Secondly, the Unix version of mkdir() has two arguments.
- // Third, the buf2 is *never* set to anything.
- // Fourth, why not use a sizeof 256 instead of 255?
+ mkdir(buf2);
}
-#endif
int width, height, flags;
-// i = 538;
+ i = 538;
for(i=1; ; i++) {
p2 = vga + i * 8;
- //offs = swap32(*(uint32*)p2);
+ offs = TO_BE_32(*(uint32*)p2);
/* try to detect end of images.
* assume the end when offset >= 200kb */
if (offs >= 200*1024)
return;
- //width = swap16(*(uint16*)(p2+6));
+ width = TO_BE_16(*(uint16*)(p2+6));
height = p2[5];
flags = p2[4];