diff options
author | Travis Howell | 2003-12-11 09:14:10 +0000 |
---|---|---|
committer | Travis Howell | 2003-12-11 09:14:10 +0000 |
commit | bc00922990e6f51c43d0bc396e1d2841fa017424 (patch) | |
tree | b6f87a6981ea549a961fc56c885ae3b9098b95c7 | |
parent | 813e8fbdab4af97e484a710e2a9abdb4054e47b1 (diff) | |
download | scummvm-rg350-bc00922990e6f51c43d0bc396e1d2841fa017424.tar.gz scummvm-rg350-bc00922990e6f51c43d0bc396e1d2841fa017424.tar.bz2 scummvm-rg350-bc00922990e6f51c43d0bc396e1d2841fa017424.zip |
Change another debug define to key
Dump options should now work on non-win32
svn-id: r11574
-rw-r--r-- | simon/debug.cpp | 23 | ||||
-rw-r--r-- | simon/simon.cpp | 5 | ||||
-rw-r--r-- | simon/simon.h | 2 | ||||
-rw-r--r-- | simon/vga.cpp | 7 |
4 files changed, 20 insertions, 17 deletions
diff --git a/simon/debug.cpp b/simon/debug.cpp index 339e13cca0..fffc53efd7 100644 --- a/simon/debug.cpp +++ b/simon/debug.cpp @@ -354,21 +354,19 @@ void dump_bitmap(const char *filename, byte *offs, int w, int h, int flags, cons } void SimonEngine::dump_single_bitmap(int file, int image, byte *offs, int w, int h, byte base) { -/* Only supported for win32 atm. mkdir doesn't work otherwise. */ -#if defined (WIN32) && !defined(_WIN32_WCE) - char buf[255], buf2[255]; + char buf[255]; struct stat statbuf; - sprintf(buf, "bmp_%d\\%d.bmp", file, image); +#if defined(MACOS_CARBON) + sprintf(buf, ":dumps:File%d_Image%d.bmp", file, image); +#else + sprintf(buf, "dumps/File%d_Image%d.bmp", file, image); +#endif if (stat(buf, &statbuf) == 0) return; - sprintf(buf2, "bmp_%d", file); - mkdir(buf2); - dump_bitmap(buf, offs, w, h, 0, _palette, base); -#endif } void pal_load(byte *pal, const byte *vga1, int a, int b) { @@ -391,8 +389,6 @@ void pal_load(byte *pal, const byte *vga1, int a, int b) { } void SimonEngine::dump_vga_bitmaps(byte *vga, byte *vga1, int res) { -/* Only supported for win32 atm. mkdir doesn't work otherwise. */ -#if defined (WIN32) && !defined(_WIN32_WCE) int i; uint32 offs; @@ -436,12 +432,15 @@ void SimonEngine::dump_vga_bitmaps(byte *vga, byte *vga1, int res) { /* dump bitmap */ { char buf[255]; - sprintf(buf, "bmp_%d\\%d.bmp", res, i); +#if defined(MACOS_CARBON) + sprintf(buf, ":dumps:Res%d_Image%d.bmp", res, i); +#else + sprintf(buf, "dumps/Res%d_Image%d.bmp", res, i); +#endif dump_bitmap(buf, vga + offs, width, height, flags, pal, 0); } } -#endif } void SimonEngine::dump_vga_script_always(byte *ptr, uint res, uint sprite_id) { diff --git a/simon/simon.cpp b/simon/simon.cpp index b32244188a..f6c53049cf 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -321,6 +321,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) _continous_mainscript = 0; _continous_vgascript = 0; _draw_images_debug = 0; + _dump_images = 0; _speech = false; _subtitles = false; _mouse_cursor = 0; @@ -3501,6 +3502,10 @@ void SimonEngine::processSpecialKeys() { if (_debugMode) _draw_images_debug ^= 1; break; + case 'd': + if (_debugMode) + _dump_images ^=1; + break; } _key_pressed = 0; diff --git a/simon/simon.h b/simon/simon.h index 9b6e55a9f6..9ff531e503 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -36,7 +36,6 @@ namespace Simon { /* Various other settings */ //#define DUMP_FILE_NR 8 //#define DUMP_BITMAPS_FILE_NR 8 -//#define DUMP_DRAWN_BITMAPS uint fileReadItemID(File *in); @@ -197,6 +196,7 @@ protected: bool _continous_mainscript; bool _continous_vgascript; bool _draw_images_debug; + bool _dump_images; bool _speech; bool _subtitles; byte _mouse_cursor; diff --git a/simon/vga.cpp b/simon/vga.cpp index 05a4d53a22..8ae84de003 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -628,10 +628,9 @@ void SimonEngine::vc_10_draw() { if (height == 0 || width == 0) return; -#ifdef DUMP_DRAWN_BITMAPS - dump_single_bitmap(_vga_cur_file_id, state.image, state.depack_src, width * 16, height, - state.base_color); -#endif + if (_dump_images) + dump_single_bitmap(_vga_cur_file_id, state.image, state.depack_src, width * 16, height, + state.base_color); if (flags & 0x80 && !(state.e & 0x10)) { if (state.e & 1) { |