aboutsummaryrefslogtreecommitdiff
path: root/gob
diff options
context:
space:
mode:
authorMax Horn2005-04-11 20:04:14 +0000
committerMax Horn2005-04-11 20:04:14 +0000
commitfa80c6e8bafd311ba3e44a6d6a018a72049f3c3a (patch)
treee054782beacf9d95e35a5c738133aa4613cfa5a6 /gob
parent2ff681b1e9392ec45f85485b79465874c9eb6956 (diff)
downloadscummvm-rg350-fa80c6e8bafd311ba3e44a6d6a018a72049f3c3a.tar.gz
scummvm-rg350-fa80c6e8bafd311ba3e44a6d6a018a72049f3c3a.tar.bz2
scummvm-rg350-fa80c6e8bafd311ba3e44a6d6a018a72049f3c3a.zip
cleanup
svn-id: r17550
Diffstat (limited to 'gob')
-rw-r--r--gob/map.cpp23
-rw-r--r--gob/map.h1
2 files changed, 9 insertions, 15 deletions
diff --git a/gob/map.cpp b/gob/map.cpp
index 63b6b176e4..aa2eada99a 100644
--- a/gob/map.cpp
+++ b/gob/map.cpp
@@ -46,7 +46,7 @@ int16 map_destY;
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 @@ void map_loadMapObjects(char *avjFile) {
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 @@ void map_loadMapObjects(char *avjFile) {
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 @@ void map_loadMapObjects(char *avjFile) {
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 @@ void map_loadMapObjects(char *avjFile) {
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;
diff --git a/gob/map.h b/gob/map.h
index 6a63084b6f..ced34e0325 100644
--- a/gob/map.h
+++ b/gob/map.h
@@ -53,7 +53,6 @@ extern char map_loadFromAvo;
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);