//\r
// free up memory from last map\r
//\r
- if (mapon>-1 && mapheaderseg[gvar->ca.mapon])\r
- MM_SetPurge (&(memptr)mapheaderseg[gvar-ca.mapon],3);\r
+// if (gvar->ca.map.mapon>-1 && gvar->ca.map.mapheaderseg[gvar->ca.map.mapon])\r
+// MM_SetPurge (&(memptr)gvar->ca.map.mapheaderseg[gvar-ca.map.mapon],3);\r
for (plane=0;plane<MAPPLANES;plane++)\r
- if (mapsegs[plane])\r
- MM_FreePtr (&(memptr)mapsegs[plane]);\r
+ if (gvar->ca.map.mapsegs[plane])\r
+ MM_FreePtr (&(memptr)gvar->ca.map.mapsegs[plane]);\r
\r
- mapon = mapnum;\r
+ gvar->ca.map.mapon = gvar->ca.map.mapnum;\r
\r
\r
//\r
// load map header\r
// The header will be cached if it is still around\r
//\r
- if (!mapheaderseg[mapnum])\r
+ if (!gvar->ca.map.mapheaderseg[gvar->ca.map.mapnum])\r
{\r
- pos = ((mapfiletype _seg *)tinf)->headeroffsets[mapnum];\r
+ pos = ((__segmement *)tinf)->headeroffsets[gvar->ca.mapnum];\r
if (pos<0) // $FFFFFFFF start is a sparse map\r
- Quit ("CA_CacheMap: Tried to load a non existent map!");\r
+ printf("CA_CacheMap: Tried to load a non existent map!");\r
\r
- MM_GetPtr(&(memptr)mapheaderseg[mapnum],sizeof(maptype));\r
+ MM_GetPtr(&(memptr)gvar->ca.mapheaderseg[mapnum],sizeof(maptype));\r
lseek(maphandle,pos,SEEK_SET);\r
CA_FarRead (maphandle,(memptr)mapheaderseg[mapnum],sizeof(maptype));\r
}\r
//from 16_ca\r
//==========================================================================\r
\r
+#define NUMMAPS 4//39\r
+#define MAPPLANES 3\r
+\r
+typedef struct\r
+{\r
+ __segment *mapsegs[4];\r
+ __segment *mapheaderseg[NUMMAPS];\r
+} mapinfo_t;\r
+\r
typedef struct\r
{\r
int maphandle[4]; // handle to MAPTEMP / GAMEMAPS\r
byte ca_levelbit,ca_levelnum;\r
int mapon, mapnum;\r
handle_t file; //files to open\r
- //unsigned _seg *mapsegs[4];\r
+ mapinfo_t map;\r
//_seg *grsegs[NUMCHUNKS];\r
//byte far grneeded[NUMCHUNKS];\r
//huffnode huffnode;\r