[Scummvm-cvs-logs] SF.net SVN: scummvm: [26798] scummvm/trunk/engines/cruise

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu May 10 09:48:13 CEST 2007


Revision: 26798
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26798&view=rev
Author:   fingolfin
Date:     2007-05-10 00:48:13 -0700 (Thu, 10 May 2007)

Log Message:
-----------
Removed lot of unnecessary typedefs; added a NUM_PERSONS constant; renamed _X/_Y vars to avoid conflicts with system headers on various systems (see bug #1716109)

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/actor.cpp
    scummvm/trunk/engines/cruise/actor.h
    scummvm/trunk/engines/cruise/background.h
    scummvm/trunk/engines/cruise/backgroundIncrust.h
    scummvm/trunk/engines/cruise/ctp.h
    scummvm/trunk/engines/cruise/dataLoader.cpp
    scummvm/trunk/engines/cruise/gfxModule.h
    scummvm/trunk/engines/cruise/mainDraw.cpp
    scummvm/trunk/engines/cruise/menu.h
    scummvm/trunk/engines/cruise/object.h
    scummvm/trunk/engines/cruise/overlay.h
    scummvm/trunk/engines/cruise/perso.cpp
    scummvm/trunk/engines/cruise/perso.h
    scummvm/trunk/engines/cruise/script.h
    scummvm/trunk/engines/cruise/stack.h
    scummvm/trunk/engines/cruise/vars.h

Modified: scummvm/trunk/engines/cruise/actor.cpp
===================================================================
--- scummvm/trunk/engines/cruise/actor.cpp	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/actor.cpp	2007-05-10 07:48:13 UTC (rev 26798)
@@ -581,7 +581,7 @@
 }
 
 //computePathfinding(returnVar2, params.X, params.Y, var34, var35, currentActor->stepX, currentActor->stepY);
-int16 computePathfinding(int16 *pSolution, int16 _X, int16 _Y, int16 destX,
+int16 computePathfinding(int16 *pSolution, int16 x, int16 y, int16 destX,
 	    int16 destY, int16 stepX, int16 stepY, int16 oldPathId) {
 	persoStruct *perso;
 	int num;
@@ -603,14 +603,13 @@
 		int i;
 		int16 *ptr;
 
-		for (i = 0; i < 10; i++)	// 10 = num perso
-		{
+		for (i = 0; i < NUM_PERSONS; i++) {	// 10 = num perso
 			if (!persoTable[i]) {
 				break;
 			}
 		}
 
-		if (i == 10) {
+		if (i == NUM_PERSONS) {
 			pSolution[0] = -1;
 			pSolution[1] = -1;
 
@@ -625,8 +624,8 @@
 		perso->inc_jo1 = stepX;
 		perso->inc_jo2 = stepY;
 
-		*(ptr++) = _X;
-		*(ptr++) = _Y;
+		*(ptr++) = x;
+		*(ptr++) = y;
 		*(ptr++) = pSolution[0] = destX;
 		*(ptr++) = pSolution[1] = destY;
 		*(ptr++) = -1;
@@ -643,7 +642,7 @@
 	ctpVar19 = ctpVar11;
 	flag_aff_chemin = 0;
 
-	if (_X == destX && _Y == destY) {
+	if (x == destX && y == destY) {
 		pSolution[0] = -1;
 		pSolution[1] = -1;
 
@@ -652,12 +651,12 @@
 
 /******* cherche le premier noeud ******/
 
-	getPixel(_X, _Y);
+	getPixel(x, y);
 
 	pSolution[4] = computedVar14;
 
-	x_mouse = _X;
-	y_mouse = _Y;
+	x_mouse = x;
+	y_mouse = y;
 
 	if (!flag_obstacle
 	    || (point_select = point_proche(ctp_routeCoords)) == -1) {
@@ -674,10 +673,10 @@
 /******* cherche le deuxieme noeud ******/
 
 	num = 0;
-	while (num < 10 && persoTable[num] != NULL)
+	while (num < NUM_PERSONS && persoTable[num] != NULL)
 		num++;
 
-	if (num == 10) {
+	if (num == NUM_PERSONS) {
 		pSolution[0] = -1;
 		pSolution[1] = -1;
 		return (-1);

Modified: scummvm/trunk/engines/cruise/actor.h
===================================================================
--- scummvm/trunk/engines/cruise/actor.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/actor.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -35,8 +35,6 @@
 	ANIM_PHASE_END = 4
 };
 
-typedef enum animPhase animPhase;
-
 struct actorStruct {
 	struct actorStruct *next;
 	struct actorStruct *prev;
@@ -62,8 +60,6 @@
 	int16 freeze;
 };
 
-typedef struct actorStruct actorStruct;
-
 extern int raoul_move[][13];
 extern int raoul_end[][13];
 extern int raoul_stat[][13];

Modified: scummvm/trunk/engines/cruise/background.h
===================================================================
--- scummvm/trunk/engines/cruise/background.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/background.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -32,8 +32,6 @@
 	char extention[6];
 };
 
-typedef struct backgroundTableStruct backgroundTableStruct;
-
 extern short int cvtPalette[0x20];
 extern int CVTLoaded;
 extern uint8 *backgroundPtrtable[8];

Modified: scummvm/trunk/engines/cruise/backgroundIncrust.h
===================================================================
--- scummvm/trunk/engines/cruise/backgroundIncrust.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/backgroundIncrust.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -50,8 +50,6 @@
 	uint16 var34;
 };
 
-typedef struct backgroundIncrustStruct backgroundIncrustStruct;
-
 extern backgroundIncrustStruct backgroundIncrustHead;
 
 void resetBackgroundIncrustList(backgroundIncrustStruct * pHead);

Modified: scummvm/trunk/engines/cruise/ctp.h
===================================================================
--- scummvm/trunk/engines/cruise/ctp.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/ctp.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -36,15 +36,11 @@
 	uint16 maxY;		//A
 };
 
-typedef struct ctpVar19SubStruct ctpVar19SubStruct;
-
 struct ctpVar19Struct {
 	struct ctpVar19Struct *field_0;	//0
 	ctpVar19SubStruct subStruct;
 };
 
-typedef struct ctpVar19Struct ctpVar19Struct;
-
 extern ctpVar19Struct *ptr_something;
 extern ctpVar19Struct *polyStruct;
 extern ctpVar19Struct *ctpVar11;

Modified: scummvm/trunk/engines/cruise/dataLoader.cpp
===================================================================
--- scummvm/trunk/engines/cruise/dataLoader.cpp	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/dataLoader.cpp	2007-05-10 07:48:13 UTC (rev 26798)
@@ -37,8 +37,6 @@
 	type_FNT
 };
 
-typedef enum fileTypeEnum fileTypeEnum;
-
 int loadSingleFile;
 
 // TODO: Unify decodeGfxFormat1, decodeGfxFormat4 and decodeGfxFormat5

Modified: scummvm/trunk/engines/cruise/gfxModule.h
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/gfxModule.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -44,9 +44,6 @@
 	uint8 A;
 };
 
-typedef struct gfxModuleDataStruct gfxModuleDataStruct;
-typedef struct palEntry palEntry;
-
 extern gfxModuleDataStruct gfxModuleData;
 extern short globalAtariScreen[320 * 200 / 4];
 

Modified: scummvm/trunk/engines/cruise/mainDraw.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mainDraw.cpp	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/mainDraw.cpp	2007-05-10 07:48:13 UTC (rev 26798)
@@ -38,8 +38,6 @@
 	cellStruct *pCell;
 };
 
-typedef struct autoCellStruct autoCellStruct;
-
 autoCellStruct autoCellHead;
 
 void addAutoCell(int overlayIdx, int idx, int type, int newVal, cellStruct *pObject) {

Modified: scummvm/trunk/engines/cruise/menu.h
===================================================================
--- scummvm/trunk/engines/cruise/menu.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/menu.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -36,8 +36,6 @@
 	menuElementStruct *ptrNextElement;
 };
 
-typedef struct menuStruct menuStruct;
-
 extern menuStruct *menuTable[8];
 
 menuStruct *createMenu(int X, int Y, const char *menuName);

Modified: scummvm/trunk/engines/cruise/object.h
===================================================================
--- scummvm/trunk/engines/cruise/object.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/object.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -35,8 +35,6 @@
 	int width;		// for font: max right border; for sprite: just width
 };
 
-typedef struct gfxEntryStruct gfxEntryStruct;
-
 #define	OBJ_SPRITE 4
 
 struct objectParamsQuery {
@@ -50,8 +48,6 @@
 	int16 var7;
 };
 
-typedef struct objectParamsQuery objectParamsQuery;
-
 objDataStruct *getObjectDataFromOverlay(int ovlIdx, int objIdx);
 int16 getSingleObjectParam(int16 overlayIdx, int16 param2, int16 param3, int16 * returnParam);
 int16 getMultipleObjectParam(int16 overlayIdx, int16 objectIdx, objectParamsQuery * returnParam);

Modified: scummvm/trunk/engines/cruise/overlay.h
===================================================================
--- scummvm/trunk/engines/cruise/overlay.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/overlay.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -35,8 +35,6 @@
 	uint16 offsetToName;
 };
 
-typedef struct importScriptStruct importScriptStruct;
-
 struct exportEntryStruct {
 	uint16 var0;
 	uint16 var2;
@@ -45,8 +43,6 @@
 	uint16 offsetToName;
 };
 
-typedef struct exportEntryStruct exportEntryStruct;
-
 struct ovlData3Struct {
 	uint8 *dataPtr;		//0
 	short int sizeOfData;	//4
@@ -63,16 +59,12 @@
 	short int var1A;
 };
 
-typedef struct ovlData3Struct ovlData3Struct;
-
 struct stringEntryStruct {
 	char *string;
 	short int length;
 	short int idx;
 };
 
-typedef struct stringEntryStruct stringEntryStruct;
-
 struct linkDataStruct {
 	uint16 field_0;
 	uint16 field_2;
@@ -94,8 +86,6 @@
 	int16 field_20;
 };
 
-typedef struct linkDataStruct linkDataStruct;
-
 struct importDataStruct {
 	uint16 var0;		// 0
 	uint16 var1;		// 2
@@ -104,8 +94,6 @@
 	uint16 nameOffset;
 };
 
-typedef struct importDataStruct importDataStruct;
-
 #define MULTIPLE 0
 #define VARIABLE 1
 #define UNIQUE   2
@@ -121,8 +109,6 @@
 	int16 stateTableIdx;
 };
 
-typedef struct objDataStruct objDataStruct;
-
 struct objectParams {
 	int16 X;
 	int16 Y;
@@ -132,8 +118,6 @@
 	int16 state;
 };
 
-typedef struct objectParams objectParams;
-
 struct ovlDataStruct {
 	ovlData3Struct *data3Table;
 	uint8 *ptr1;
@@ -168,8 +152,6 @@
 	unsigned short int scriptNumber;
 };
 
-typedef struct ovlDataStruct ovlDataStruct;
-
 struct overlayStruct {
 	char overlayName[14];
 	ovlDataStruct *ovlData;
@@ -195,8 +177,6 @@
 	short int executeScripts;
 };
 
-typedef struct overlayStruct overlayStruct;
-
 extern overlayStruct overlayTable[90];
 extern int numOfLoadedOverlay;
 

Modified: scummvm/trunk/engines/cruise/perso.cpp
===================================================================
--- scummvm/trunk/engines/cruise/perso.cpp	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/perso.cpp	2007-05-10 07:48:13 UTC (rev 26798)
@@ -27,7 +27,7 @@
 
 namespace Cruise {
 
-persoStruct *persoTable[10];
+persoStruct *persoTable[NUM_PERSONS];
 
 int16 computedVar14;
 
@@ -41,7 +41,7 @@
 void freeAllPerso(void) {
 	int i;
 
-	for (i = 0; i < 10; i++) {
+	for (i = 0; i < NUM_PERSONS; i++) {
 		freePerso(i);
 	}
 

Modified: scummvm/trunk/engines/cruise/perso.h
===================================================================
--- scummvm/trunk/engines/cruise/perso.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/perso.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -27,7 +27,10 @@
 
 namespace Cruise {
 
-#define NUM_NODES 20
+enum {
+	NUM_NODES = 20,
+	NUM_PERSONS = 10
+};
 
 struct persoStruct {
 	int16 inc_droite;	// 2
@@ -41,9 +44,7 @@
 	int16 inc_jo0;		// 2
 };
 
-typedef struct persoStruct persoStruct;
-
-extern persoStruct *persoTable[10];
+extern persoStruct *persoTable[NUM_PERSONS];
 extern int16 computedVar14;
 
 void freePerso(int persoIdx);

Modified: scummvm/trunk/engines/cruise/script.h
===================================================================
--- scummvm/trunk/engines/cruise/script.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/script.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -34,8 +34,6 @@
 	scriptType_REL = 30
 };
 
-typedef enum scriptTypeEnum scriptTypeEnum;
-
 struct scriptInstanceStruct {
 	struct scriptInstanceStruct *nextScriptPtr;
 	int16 var4;
@@ -53,8 +51,6 @@
 	int16 bitMask;
 };
 
-typedef struct scriptInstanceStruct scriptInstanceStruct;
-
 extern scriptInstanceStruct relHead;
 extern scriptInstanceStruct procHead;
 extern scriptInstanceStruct *currentScriptPtr;

Modified: scummvm/trunk/engines/cruise/stack.h
===================================================================
--- scummvm/trunk/engines/cruise/stack.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/stack.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -36,8 +36,6 @@
 	STACK_PTR
 };
 
-typedef enum stackElementTypeEnum stackElementTypeEnum;
-
 struct stackElementStruct {
 	stackElementTypeEnum type;
 
@@ -47,8 +45,6 @@
 	} data;
 };
 
-typedef struct stackElementStruct stackElementStruct;
-
 int16 popVar(void);
 void pushVar(int16 var);
 

Modified: scummvm/trunk/engines/cruise/vars.h
===================================================================
--- scummvm/trunk/engines/cruise/vars.h	2007-05-10 03:02:00 UTC (rev 26797)
+++ scummvm/trunk/engines/cruise/vars.h	2007-05-10 07:48:13 UTC (rev 26798)
@@ -35,8 +35,6 @@
 	int16 var4;
 };
 
-typedef struct menuElementSubStruct menuElementSubStruct;
-
 struct menuElementStruct {
 	struct menuElementStruct *next;
 	const char *string;
@@ -49,8 +47,6 @@
 	menuElementSubStruct *ptrSub;
 };
 
-typedef struct menuElementStruct menuElementStruct;
-
 typedef int32(*opcodeTypeFunction) (void);
 typedef int16(*opcodeFunction) (void);
 
@@ -83,28 +79,20 @@
 	int16 field_20;
 };
 
-typedef struct mediumVarStruct mediumVarStruct;
-
 struct filesDataStruct {
 	uint8 *field_0;
 	uint8 *field_4;
 };
 
-typedef struct filesDataStruct filesDataStruct;
-
 struct filesData2Struct {
 	int16 field_0;
 	int16 field_2;
 };
 
-typedef struct filesData2Struct filesData2Struct;
-
 struct fileName {
 	uint8 name[13];
 };
 
-typedef struct fileName fileName;
-
 struct setHeaderEntry {
 	int16 field_0;		// offset ptr part 1
 	int16 field_2;		// offset ptr part 2
@@ -116,8 +104,6 @@
 	int16 field_E;
 };
 
-typedef struct setHeaderEntry setHeaderEntry;
-
 struct volumeDataStruct {
 	char ident[10];
 	fileName *ptr;
@@ -125,8 +111,6 @@
 	int32 size;
 };
 
-typedef struct volumeDataStruct volumeDataStruct;
-
 struct fileEntry {
 	uint8 name[14];
 	int32 offset;
@@ -135,8 +119,6 @@
 	int32 unk3;		// unused
 };
 
-typedef struct fileEntry fileEntry;
-
 struct dataFileEntrySub {
 	uint8 *ptr;
 	int16 index;		// sprite index
@@ -148,8 +130,6 @@
 	int16 field_1C;
 };
 
-typedef struct dataFileEntrySub dataFileEntrySub;
-
 struct dataFileEntry {
 	int16 widthInColumn;
 	int16 width;
@@ -158,16 +138,12 @@
 	dataFileEntrySub subData;
 };
 
-typedef struct dataFileEntry dataFileEntry;
-
 struct systemStringsStruct {
 	int8 param;
 	uint8 string[12];
 	uint8 bootScriptName[8];
 };
 
-typedef struct systemStringsStruct systemStringsStruct;
-
 extern filesDataStruct filesData[90];
 extern filesData2Struct filesData2[90];
 


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