aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/debug.cpp
diff options
context:
space:
mode:
authorTravis Howell2008-12-13 03:12:56 +0000
committerTravis Howell2008-12-13 03:12:56 +0000
commite593015402c6b4990fda584164956132350d720a (patch)
tree1f3b6c0ba181f81b70e1b31bf4659a7b078d09cd /engines/agos/debug.cpp
parent1cc08d8b6a3ee995ff130bf96d6e9217b41b856d (diff)
downloadscummvm-rg350-e593015402c6b4990fda584164956132350d720a.tar.gz
scummvm-rg350-e593015402c6b4990fda584164956132350d720a.tar.bz2
scummvm-rg350-e593015402c6b4990fda584164956132350d720a.zip
Cleanup.
svn-id: r35323
Diffstat (limited to 'engines/agos/debug.cpp')
-rw-r--r--engines/agos/debug.cpp122
1 files changed, 67 insertions, 55 deletions
diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp
index 2cf285d56a..d483275a9f 100644
--- a/engines/agos/debug.cpp
+++ b/engines/agos/debug.cpp
@@ -295,81 +295,93 @@ void AGOSEngine::dumpVgaScriptAlways(const byte *ptr, uint res, uint sprite_id)
printf("; end\n");
}
-void AGOSEngine::dumpVgaFile(const byte *vga) {
+void AGOSEngine_Feeble::dumpVgaFile(const byte *vga) {
const byte *pp;
const byte *p;
int count;
pp = vga;
- if (getGameType() == GType_FF || getGameType() == GType_PP) {
- p = pp + READ_LE_UINT16(pp + 2);
- count = READ_LE_UINT16(&((const VgaFileHeader2_Feeble *) p)->animationCount);
- p = pp + READ_LE_UINT16(&((const VgaFileHeader2_Feeble *) p)->animationTable);
+ p = pp + READ_LE_UINT16(pp + 2);
+ count = READ_LE_UINT16(&((const VgaFileHeader2_Feeble *) p)->animationCount);
+ p = pp + READ_LE_UINT16(&((const VgaFileHeader2_Feeble *) p)->animationTable);
- while (--count >= 0) {
- int id = READ_LE_UINT16(&((const AnimationHeader_Feeble *) p)->id);
+ while (--count >= 0) {
+ int id = READ_LE_UINT16(&((const AnimationHeader_Feeble *) p)->id);
- dumpVgaScriptAlways(vga + READ_LE_UINT16(&((const AnimationHeader_Feeble *) p)->scriptOffs), id / 100, id);
- p += sizeof(AnimationHeader_Feeble);
- }
- } else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
- p = pp + READ_BE_UINT16(pp + 4);
- count = READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->animationCount);
- p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->animationTable);
+ dumpVgaScriptAlways(vga + READ_LE_UINT16(&((const AnimationHeader_Feeble *) p)->scriptOffs), id / 100, id);
+ p += sizeof(AnimationHeader_Feeble);
+ }
- while (--count >= 0) {
- int id = READ_BE_UINT16(&((const AnimationHeader_Simon *) p)->id);
+ pp = vga;
+ p = pp + READ_LE_UINT16(pp + 2);
+ count = READ_LE_UINT16(&((const VgaFileHeader2_Feeble *) p)->imageCount);
+ p = pp + READ_LE_UINT16(&((const VgaFileHeader2_Feeble *) p)->imageTable);
- dumpVgaScriptAlways(vga + READ_BE_UINT16(&((const AnimationHeader_Simon *) p)->scriptOffs), id / 100, id);
- p += sizeof(AnimationHeader_Simon);
- }
- } else {
- p = pp + READ_BE_UINT16(pp + 10) + 20;
- count = READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->animationCount);
- p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->animationTable);
+ while (--count >= 0) {
+ int id = READ_LE_UINT16(&((const ImageHeader_Feeble *) p)->id);
- while (--count >= 0) {
- int id = READ_BE_UINT16(&((const AnimationHeader_WW *) p)->id);
+ dumpVgaScriptAlways(vga + READ_LE_UINT16(&((const ImageHeader_Feeble *) p)->scriptOffs), id / 100, id);
+ p += sizeof(ImageHeader_Feeble);
+ }
+}
- dumpVgaScriptAlways(vga + READ_BE_UINT16(&((const AnimationHeader_WW *) p)->scriptOffs), id / 100, id);
- p += sizeof(AnimationHeader_WW);
- }
+void AGOSEngine_Simon1::dumpVgaFile(const byte *vga) {
+ const byte *pp;
+ const byte *p;
+ int count;
+
+ pp = vga;
+ p = pp + READ_BE_UINT16(pp + 4);
+ count = READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->animationCount);
+ p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->animationTable);
+
+ while (--count >= 0) {
+ int id = READ_BE_UINT16(&((const AnimationHeader_Simon *) p)->id);
+
+ dumpVgaScriptAlways(vga + READ_BE_UINT16(&((const AnimationHeader_Simon *) p)->scriptOffs), id / 100, id);
+ p += sizeof(AnimationHeader_Simon);
}
pp = vga;
- if (getGameType() == GType_FF || getGameType() == GType_PP) {
- p = pp + READ_LE_UINT16(pp + 2);
- count = READ_LE_UINT16(&((const VgaFileHeader2_Feeble *) p)->imageCount);
- p = pp + READ_LE_UINT16(&((const VgaFileHeader2_Feeble *) p)->imageTable);
+ p = pp + READ_BE_UINT16(pp + 4);
+ count = READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->imageCount);
+ p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->imageTable);
- while (--count >= 0) {
- int id = READ_LE_UINT16(&((const ImageHeader_Feeble *) p)->id);
+ while (--count >= 0) {
+ int id = READ_BE_UINT16(&((const ImageHeader_Simon *) p)->id);
- dumpVgaScriptAlways(vga + READ_LE_UINT16(&((const ImageHeader_Feeble *) p)->scriptOffs), id / 100, id);
- p += sizeof(ImageHeader_Feeble);
- }
- } else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
- p = pp + READ_BE_UINT16(pp + 4);
- count = READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->imageCount);
- p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->imageTable);
+ dumpVgaScriptAlways(vga + READ_BE_UINT16(&((const ImageHeader_Simon *) p)->scriptOffs), id / 100, id);
+ p += sizeof(ImageHeader_Simon);
+ }
+}
- while (--count >= 0) {
- int id = READ_BE_UINT16(&((const ImageHeader_Simon *) p)->id);
+void AGOSEngine::dumpVgaFile(const byte *vga) {
+ const byte *pp;
+ const byte *p;
+ int count;
- dumpVgaScriptAlways(vga + READ_BE_UINT16(&((const ImageHeader_Simon *) p)->scriptOffs), id / 100, id);
- p += sizeof(ImageHeader_Simon);
- }
- } else {
- p = pp + READ_BE_UINT16(pp + 10) + 20;
- count = READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->imageCount);
- p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->imageTable);
+ pp = vga;
+ p = pp + READ_BE_UINT16(pp + 10) + 20;
+ count = READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->animationCount);
+ p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->animationTable);
- while (--count >= 0) {
- int id = READ_BE_UINT16(&((const ImageHeader_WW *) p)->id);
+ while (--count >= 0) {
+ int id = READ_BE_UINT16(&((const AnimationHeader_WW *) p)->id);
- dumpVgaScriptAlways(vga + READ_BE_UINT16(&((const ImageHeader_WW *) p)->scriptOffs), id / 100, id);
- p += sizeof(ImageHeader_WW);
- }
+ dumpVgaScriptAlways(vga + READ_BE_UINT16(&((const AnimationHeader_WW *) p)->scriptOffs), id / 100, id);
+ p += sizeof(AnimationHeader_WW);
+ }
+
+ pp = vga;
+ p = pp + READ_BE_UINT16(pp + 10) + 20;
+ count = READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->imageCount);
+ p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Common *) p)->imageTable);
+
+ while (--count >= 0) {
+ int id = READ_BE_UINT16(&((const ImageHeader_WW *) p)->id);
+
+ dumpVgaScriptAlways(vga + READ_BE_UINT16(&((const ImageHeader_WW *) p)->scriptOffs), id / 100, id);
+ p += sizeof(ImageHeader_WW);
}
}