[Scummvm-cvs-logs] SF.net SVN: scummvm: [24159] scummvm/trunk/engines/agos

kirben at users.sourceforge.net kirben at users.sourceforge.net
Sat Oct 7 05:43:58 CEST 2006


Revision: 24159
          http://svn.sourceforge.net/scummvm/?rev=24159&view=rev
Author:   kirben
Date:     2006-10-06 20:43:51 -0700 (Fri, 06 Oct 2006)

Log Message:
-----------
Minor cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/agos/agos.cpp
    scummvm/trunk/engines/agos/debug.cpp
    scummvm/trunk/engines/agos/vga.cpp
    scummvm/trunk/engines/agos/vga.h

Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp	2006-10-07 03:31:17 UTC (rev 24158)
+++ scummvm/trunk/engines/agos/agos.cpp	2006-10-07 03:43:51 UTC (rev 24159)
@@ -1668,7 +1668,7 @@
 	bb = _curVgaFile1;
 
 	if (getGameType() == GType_FF || getGameType() == GType_PP) {
-		b = bb + READ_LE_UINT16(&((VgaFileHeader_Feeble *) bb)->hdr2_start);
+		b = bb + READ_LE_UINT16(bb + 2);
 		count = READ_LE_UINT16(&((VgaFileHeader2_Feeble *) b)->imageCount);
 		b = bb + READ_LE_UINT16(&((VgaFileHeader2_Feeble *) b)->imageTable);
 
@@ -1680,9 +1680,9 @@
 		assert(READ_LE_UINT16(&((ImageHeader_Feeble *) b)->id) == vga_res_id);
 
 	} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
-		b = bb + READ_BE_UINT16(&((VgaFileHeader_Simon *) bb)->hdr2_start);
-		count = READ_BE_UINT16(&((VgaFileHeader2_Simon *) b)->imageCount);
-		b = bb + READ_BE_UINT16(&((VgaFileHeader2_Simon *) b)->imageTable);
+		b = bb + READ_BE_UINT16(bb + 4);
+		count = READ_BE_UINT16(&((VgaFileHeader2_Common *) b)->imageCount);
+		b = bb + READ_BE_UINT16(&((VgaFileHeader2_Common *) b)->imageTable);
 
 		while (count--) {
 			if (READ_BE_UINT16(&((ImageHeader_Simon *) b)->id) == vga_res_id)
@@ -1694,8 +1694,8 @@
 		b = bb + READ_BE_UINT16(bb + 10);
 		b += 20;
 
-		count = READ_BE_UINT16(&((VgaFileHeader2_WW *) b)->imageCount);
-		b = bb + READ_BE_UINT16(&((VgaFileHeader2_WW *) b)->imageTable);
+		count = READ_BE_UINT16(&((VgaFileHeader2_Common *) b)->imageCount);
+		b = bb + READ_BE_UINT16(&((VgaFileHeader2_Common *) b)->imageTable);
 
 		while (count--) {
 			if (READ_BE_UINT16(&((ImageHeader_WW *) b)->id) == vga_res_id)
@@ -2157,19 +2157,19 @@
 
 	pp = _curVgaFile1;
 	if (getGameType() == GType_FF || getGameType() == GType_PP) {
-		p = pp + READ_LE_UINT16(&((VgaFileHeader_Feeble *) pp)->hdr2_start);
+		p = pp + READ_LE_UINT16(pp + 2);
 		count = READ_LE_UINT16(&((VgaFileHeader2_Feeble *) p)->animationCount);
 		p = pp + READ_LE_UINT16(&((VgaFileHeader2_Feeble *) p)->animationTable);
 	} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
-		p = pp + READ_BE_UINT16(&((VgaFileHeader_Simon *) pp)->hdr2_start);
-		count = READ_BE_UINT16(&((VgaFileHeader2_Simon *) p)->animationCount);
-		p = pp + READ_BE_UINT16(&((VgaFileHeader2_Simon *) p)->animationTable);
+		p = pp + READ_BE_UINT16(pp + 4);
+		count = READ_BE_UINT16(&((VgaFileHeader2_Common *) p)->animationCount);
+		p = pp + READ_BE_UINT16(&((VgaFileHeader2_Common *) p)->animationTable);
 	} else {
 		p = pp + READ_BE_UINT16(pp + 10);
 		p += 20;
 
-		count = READ_BE_UINT16(&((VgaFileHeader2_WW *) p)->animationCount);
-		p = pp + READ_BE_UINT16(&((VgaFileHeader2_WW *) p)->animationTable);
+		count = READ_BE_UINT16(&((VgaFileHeader2_Common *) p)->animationCount);
+		p = pp + READ_BE_UINT16(&((VgaFileHeader2_Common *) p)->animationTable);
 	}
 
 	for (;;) {

Modified: scummvm/trunk/engines/agos/debug.cpp
===================================================================
--- scummvm/trunk/engines/agos/debug.cpp	2006-10-07 03:31:17 UTC (rev 24158)
+++ scummvm/trunk/engines/agos/debug.cpp	2006-10-07 03:43:51 UTC (rev 24159)
@@ -276,9 +276,9 @@
 	int count;
 
 	pp = vga;
-	p = pp + READ_BE_UINT16(&((const VgaFileHeader_Simon *) pp)->hdr2_start);
-	count = READ_BE_UINT16(&((const VgaFileHeader2_Simon *) p)->animationCount);
-	p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Simon *) p)->animationTable);
+	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);
 
@@ -287,9 +287,9 @@
 	}
 
 	pp = vga;
-	p = pp + READ_BE_UINT16(&((const VgaFileHeader_Simon *) pp)->hdr2_start);
-	count = READ_BE_UINT16(&((const VgaFileHeader2_Simon *) p)->imageCount);
-	p = pp + READ_BE_UINT16(&((const VgaFileHeader2_Simon *) 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_BE_UINT16(&((const ImageHeader_Simon *) p)->id);

Modified: scummvm/trunk/engines/agos/vga.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga.cpp	2006-10-07 03:31:17 UTC (rev 24158)
+++ scummvm/trunk/engines/agos/vga.cpp	2006-10-07 03:43:51 UTC (rev 24159)
@@ -444,7 +444,7 @@
 
 	bb = _curVgaFile1;
 	if (getGameType() == GType_FF || getGameType() == GType_PP) {
-		b = bb + READ_LE_UINT16(&((VgaFileHeader_Feeble *) bb)->hdr2_start);
+		b = bb + READ_LE_UINT16(bb + 2);
 		count = READ_LE_UINT16(&((VgaFileHeader2_Feeble *) b)->imageCount);
 		b = bb + READ_LE_UINT16(&((VgaFileHeader2_Feeble *) b)->imageTable);
 
@@ -455,9 +455,9 @@
 		}
 		assert(READ_LE_UINT16(&((ImageHeader_Feeble *) b)->id) == num);
 	} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
-		b = bb + READ_BE_UINT16(&((VgaFileHeader_Simon *) bb)->hdr2_start);
-		count = READ_BE_UINT16(&((VgaFileHeader2_Simon *) b)->imageCount);
-		b = bb + READ_BE_UINT16(&((VgaFileHeader2_Simon *) b)->imageTable);
+		b = bb + READ_BE_UINT16(bb + 4);
+		count = READ_BE_UINT16(&((VgaFileHeader2_Common *) b)->imageCount);
+		b = bb + READ_BE_UINT16(&((VgaFileHeader2_Common *) b)->imageTable);
 
 		while (count--) {
 			if (READ_BE_UINT16(&((ImageHeader_Simon *) b)->id) == num)
@@ -469,8 +469,8 @@
 		b = bb + READ_BE_UINT16(bb + 10);
 		b += 20;
 
-		count = READ_BE_UINT16(&((VgaFileHeader2_WW *) b)->imageCount);
-		b = bb + READ_BE_UINT16(&((VgaFileHeader2_WW *) b)->imageTable);
+		count = READ_BE_UINT16(&((VgaFileHeader2_Common *) b)->imageCount);
+		b = bb + READ_BE_UINT16(&((VgaFileHeader2_Common *) b)->imageTable);
 
 		while (count--) {
 			if (READ_BE_UINT16(&((ImageHeader_WW *) b)->id) == num)
@@ -571,7 +571,7 @@
 
 	pp = _curVgaFile1;
 	if (getGameType() == GType_FF || getGameType() == GType_PP) {
-		p = pp + READ_LE_UINT16(&((VgaFileHeader_Feeble *) pp)->hdr2_start);
+		p = pp + READ_LE_UINT16(pp + 2);
 		count = READ_LE_UINT16(&((VgaFileHeader2_Feeble *) p)->animationCount);
 		p = pp + READ_LE_UINT16(&((VgaFileHeader2_Feeble *) p)->animationTable);
 
@@ -582,9 +582,9 @@
 		}
 		assert(READ_LE_UINT16(&((AnimationHeader_Feeble *) p)->id) == vgaSpriteId);
 	} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
-		p = pp + READ_BE_UINT16(&((VgaFileHeader_Simon *) pp)->hdr2_start);
-		count = READ_BE_UINT16(&((VgaFileHeader2_Simon *) p)->animationCount);
-		p = pp + READ_BE_UINT16(&((VgaFileHeader2_Simon *) p)->animationTable);
+		p = pp + READ_BE_UINT16(pp + 4);
+		count = READ_BE_UINT16(&((VgaFileHeader2_Common *) p)->animationCount);
+		p = pp + READ_BE_UINT16(&((VgaFileHeader2_Common *) p)->animationTable);
 
 		while (count--) {
 			if (READ_BE_UINT16(&((AnimationHeader_Simon *) p)->id) == vgaSpriteId)
@@ -596,8 +596,8 @@
 		p = pp + READ_BE_UINT16(pp + 10);
 		p += 20;
 
-		count = READ_BE_UINT16(&((VgaFileHeader2_WW *) p)->animationCount);
-		p = pp + READ_BE_UINT16(&((VgaFileHeader2_WW *) p)->animationTable);
+		count = READ_BE_UINT16(&((VgaFileHeader2_Common *) p)->animationCount);
+		p = pp + READ_BE_UINT16(&((VgaFileHeader2_Common *) p)->animationTable);
 
 		while (count--) {
 			if (READ_BE_UINT16(&((AnimationHeader_WW *) p)->id) == vgaSpriteId)

Modified: scummvm/trunk/engines/agos/vga.h
===================================================================
--- scummvm/trunk/engines/agos/vga.h	2006-10-07 03:31:17 UTC (rev 24158)
+++ scummvm/trunk/engines/agos/vga.h	2006-10-07 03:43:51 UTC (rev 24159)
@@ -29,12 +29,6 @@
 #include "common/pack-start.h"	// START STRUCT PACKING
 
 // Feeble Files
-struct VgaFileHeader_Feeble {
-	uint16 x_1;
-	uint16 hdr2_start;
-	uint16 x_2, x_3;
-};
-
 struct VgaFileHeader2_Feeble {
 	uint16 imageCount;
 	uint16 x_2;
@@ -60,24 +54,6 @@
 };
 
 // Simon 1/2
-struct VgaFileHeader_Simon {
-	uint16 x_1, x_2;
-	uint16 hdr2_start;
-	uint16 x_3, x_4;
-};
-
-struct VgaFileHeader2_Simon {
-	uint16 x_1;
-	uint16 imageCount;
-	uint16 x_2;
-	uint16 animationCount;
-	uint16 x_3;
-	uint16 imageTable;
-	uint16 x_4;
-	uint16 animationTable;
-	uint16 x_5;
-};
-
 struct ImageHeader_Simon {
 	uint16 id;
 	uint16 x_1;
@@ -92,19 +68,7 @@
 };
 
 
-// Waxworks
-struct VgaFileHeader2_WW {
-	uint16 x_1;
-	uint16 imageCount;
-	uint16 x_2;
-	uint16 animationCount;
-	uint16 x_3;
-	uint16 imageTable;
-	uint16 x_4;
-	uint16 animationTable;
-	uint16 x_5;
-};
-
+// Elvira 1/2 and Waxworks
 struct ImageHeader_WW {
 	uint16 id;
 	uint16 x_1;
@@ -119,6 +83,18 @@
 	uint16 scriptOffs;
 };
 
+// Common
+struct VgaFileHeader2_Common {
+	uint16 x_1;
+	uint16 imageCount;
+	uint16 x_2;
+	uint16 animationCount;
+	uint16 x_3;
+	uint16 imageTable;
+	uint16 x_4;
+	uint16 animationTable;
+	uint16 x_5;
+};
 
 #include "common/pack-end.h"	// END STRUCT PACKING
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list