[Scummvm-cvs-logs] CVS: scummvm/gob map.h,1.3,1.4 map.cpp,1.5,1.6
Max Horn
fingolfin at users.sourceforge.net
Mon Apr 11 13:04:37 CEST 2005
Update of /cvsroot/scummvm/scummvm/gob
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17561
Modified Files:
map.h map.cpp
Log Message:
cleanup
Index: map.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/map.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- map.h 9 Apr 2005 19:19:54 -0000 1.3
+++ map.h 11 Apr 2005 20:04:14 -0000 1.4
@@ -53,7 +53,6 @@
extern Map_ItemPos map_itemPoses[40];
extern char map_sourceFile[15];
-extern char *map_avoDataPtr;
int16 map_getDirection(int16 x0, int16 y0, int16 x1, int16 y1);
void map_findNearestToGob(void);
Index: map.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/map.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- map.cpp 11 Apr 2005 20:03:12 -0000 1.5
+++ map.cpp 11 Apr 2005 20:04:14 -0000 1.6
@@ -46,7 +46,7 @@
Map_ItemPos map_itemPoses[40];
char map_loadFromAvo;
char map_sourceFile[15];
-char *map_avoDataPtr;
+static char *map_avoDataPtr;
int16 map_getDirection(int16 x0, int16 y0, int16 x1, int16 y1) {
int16 dir;
@@ -516,9 +516,9 @@
savedPtr2 += 2;
if (i == 3)
- gob_goblins[i]->stateMach = (Gob_StateLine *)malloc(sizeof(Gob_StateLine) * 70);
+ gob_goblins[i]->stateMach = (Gob_StateLine *)malloc(szGob_StateLine * 70);
else
- gob_goblins[i]->stateMach = (Gob_StateLine *)malloc(sizeof(Gob_StateLine) * 40);
+ gob_goblins[i]->stateMach = (Gob_StateLine *)malloc(szGob_StateLine * 40);
// FIXME: All is wrong further. We should unwind calls to map_loadDataFromAvo()
map_loadDataFromAvo((char *)gob_goblins[i]->stateMach, 40 * szGob_StateLine);
@@ -542,17 +542,12 @@
map_avoDataPtr += 2;
if (READ_LE_UINT32(map_avoDataPtr) != 0) {
map_avoDataPtr += 4;
- map_loadDataFromAvo((char
- *)(&gob_goblins[i]->
- stateMach[state][col]->
- sndItem), 2);
+ map_loadDataFromAvo((char *)(&gob_goblins[i]->stateMach[state][col]->sndItem), 2);
} else {
map_avoDataPtr += 6;
- gob_goblins[i]->stateMach[state][col]->
- sndItem = -1;
+ gob_goblins[i]->stateMach[state][col]->sndItem = -1;
}
- map_loadDataFromAvo((char *)(&gob_goblins[i]->
- stateMach[state][col]->freq), 6);
+ map_loadDataFromAvo((char *)(&gob_goblins[i]->stateMach[state][col]->freq), 6);
}
}
}
@@ -618,7 +613,7 @@
gob_objects[i]->state = READ_LE_UINT16(savedPtr3);
savedPtr3 += 2;
- gob_objects[i]->stateMach = (Gob_StateLine *)malloc(sizeof(Gob_StateLine) * 40);
+ gob_objects[i]->stateMach = (Gob_StateLine *)malloc(szGob_StateLine * 40);
map_loadDataFromAvo((char *)gob_objects[i]->stateMach, 40 * szGob_StateLine);
map_avoDataPtr += 160;
@@ -654,8 +649,8 @@
gob_objects[10] = (Gob_Object *)malloc(sizeof(Gob_Object));
memset(gob_objects[10], 0, sizeof(Gob_Object));
- gob_objects[10]->stateMach = (Gob_StateLine *)malloc(sizeof(Gob_StateLine) * 40);
- memset(gob_objects[10]->stateMach, 0, sizeof(Gob_StateLine) * 40);
+ gob_objects[10]->stateMach = (Gob_StateLine *)malloc(szGob_StateLine * 40);
+ memset(gob_objects[10]->stateMach, 0, szGob_StateLine * 40);
pState = (Gob_State *)malloc(sizeof(Gob_State));
gob_objects[10]->stateMach[0][0] = pState;
More information about the Scummvm-git-logs
mailing list