//\r
// load the data offsets from ???head.ext\r
//\r
- MM_GetPtr (&(memptr)grstarts,(NUMCHUNKS+1)*FILEPOSSIZE);\r
+ MM_GetPtr (MEMPTR grstarts,(NUMCHUNKS+1)*FILEPOSSIZE);\r
\r
if ((handle = open(GREXT"HEAD."EXT,\r
O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
// load the pic and sprite headers into the arrays in the data segment\r
//\r
#if NUMPICS>0\r
- MM_GetPtr(&(memptr)pictable,NUMPICS*sizeof(pictabletype));\r
+ MM_GetPtr(MEMPTR pictable,NUMPICS*sizeof(pictabletype));\r
CAL_GetGrChunkLength(STRUCTPIC); // position file pointer\r
MM_GetPtr(&compseg,chunkcomplen);\r
CA_FarRead (grhandle,compseg,chunkcomplen);\r
#endif\r
\r
#if NUMPICM>0\r
- MM_GetPtr(&(memptr)picmtable,NUMPICM*sizeof(pictabletype));\r
+ MM_GetPtr(MEMPTR picmtable,NUMPICM*sizeof(pictabletype));\r
CAL_GetGrChunkLength(STRUCTPICM); // position file pointer\r
MM_GetPtr(&compseg,chunkcomplen);\r
CA_FarRead (grhandle,compseg,chunkcomplen);\r
#endif\r
\r
#if NUMSPRITES>0\r
- MM_GetPtr(&(memptr)spritetable,NUMSPRITES*sizeof(spritetabletype));\r
+ MM_GetPtr(MEMPTR spritetable,NUMSPRITES*sizeof(spritetabletype));\r
CAL_GetGrChunkLength(STRUCTSPRITE); // position file pointer\r
MM_GetPtr(&compseg,chunkcomplen);\r
CA_FarRead (grhandle,compseg,chunkcomplen);\r
\r
void CAL_SetupMapFile (global_game_variables_t *gvar)\r
{\r
-/* int handle;\r
+ int handle;\r
long length;\r
\r
//\r
// load maphead.ext (offsets and tileinfo for map file)\r
//\r
#ifndef MAPHEADERLINKED\r
- if ((handle = open("MAPHEAD."EXT,\r
+ if ((handle = open("maphead.mph",\r
O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
- printf("Can't open MAPHEAD."EXT"!");\r
+ Quit (gvar, "Can't open maphead.mph");\r
length = filelength(handle);\r
- MM_GetPtr (&(memptr)tinf,length);\r
- CA_FarRead(handle, tinf, length);\r
+ MM_GetPtr (MEMPTR gvar->ca.tinf,length,gvar);\r
+ CA_FarRead(handle, gvar->ca.tinf, length,gvar);\r
close(handle);\r
-//#else\r
+#else\r
\r
tinf = (byte _seg *)FP_SEG(&maphead);\r
\r
-#endif*/\r
+#endif\r
\r
//\r
// open the data file\r
//TODO: multiple files\r
if ((gvar->ca.file.maphandle[0] = open("data/test.map",\r
O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
- {\r
- printf("Can't open data/test.map!");\r
- }\r
-// #ifdef MAPHEADERLINKED\r
-// if ((maphandle = open("GAMEMAPS."EXT,\r
-// O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
-// Quit (gvar, "Can't open GAMEMAPS."EXT"!");\r
-// //#else\r
-// if ((maphandle = open("MAPTEMP."EXT,\r
-// O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
-// Quit (gvar, "Can't open MAPTEMP."EXT"!");\r
-// #endif\r
+ Quit (gvar, "Can't open data/test.map!");\r
+/*#ifdef MAPHEADERLINKED\r
+ if ((maphandle = open("GAMEMAPS."EXTENSION,\r
+ O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
+ Quit ("Can't open GAMEMAPS."EXTENSION"!");\r
+#else\r
+ if ((maphandle = open("MAPTEMP."EXTENSION,\r
+ O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
+ Quit ("Can't open MAPTEMP."EXTENSION"!");\r
+#endif*/\r
}\r
\r
//==========================================================================\r
O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
Quit (gvar, "Can't open AUDIOHED."EXT"!");\r
length = filelength(handle);\r
- MM_GetPtr (&(memptr)audiostarts,length);\r
+ MM_GetPtr (MEMPTR audiostarts,length);\r
CA_FarRead(handle, (byte far *)audiostarts, length);\r
close(handle);\r
#else\r
unlink("meminfo.16w");\r
gvar->handle.showmemhandle = open("meminfo.16w", O_CREAT | O_WRONLY | O_TEXT);\r
#endif\r
-/*\r
- CAL_SetupGrFile ();\r
- CAL_SetupAudioFile ();*/\r
+\r
+\r
+#ifndef NOMAPS\r
CAL_SetupMapFile (gvar);\r
+#endif\r
+#ifndef NOGRAPHICS\r
+ CAL_SetupGrFile (gvar);\r
+#endif\r
+#ifndef NOAUDIO\r
+ CAL_SetupMapFile (gvar);\r
+#endif\r
\r
gvar->ca.camap.mapon = -1;\r
gvar->ca.ca_levelbit = 1;\r
\r
if (audiosegs[chunk])\r
{\r
- MM_SetPurge (&(memptr)audiosegs[chunk],0);\r
+ MM_SetPurge (MEMPTR audiosegs[chunk],0);\r
return; // allready in memory\r
}\r
\r
\r
#ifndef AUDIOHEADERLINKED\r
\r
- MM_GetPtr (&(memptr)audiosegs[chunk],compressed);\r
+ MM_GetPtr (MEMPTR audiosegs[chunk],compressed);\r
if (mmerror)\r
return;\r
\r
\r
expanded = *(long far *)source;\r
source += 4; // skip over length\r
- MM_GetPtr (&(memptr)audiosegs[chunk],expanded);\r
+ MM_GetPtr (MEMPTR audiosegs[chunk],expanded);\r
if (mmerror)\r
goto done;\r
CAL_HuffExpand (source,audiosegs[chunk],expanded,audiohuffman);\r
\r
for (i=0;i<NUMSOUNDS;i++,start++)\r
if (audiosegs[start])\r
- MM_SetPurge (&(memptr)audiosegs[start],3); // make purgable\r
+ MM_SetPurge (MEMPTR audiosegs[start],3); // make purgable\r
\r
cachein:\r
\r
// if (pos<0) // $FFFFFFFF start is a sparse map\r
// printf("CA_CacheMap: Tried to load a non existent map!");\r
\r
-// MM_GetPtr(&(memptr)gvar->ca.camapheaderseg[mapnum],sizeof(maptype));\r
+// MM_GetPtr(MEMPTR gvar->ca.camapheaderseg[mapnum],sizeof(maptype));\r
// lseek(maphandle,pos,SEEK_SET);\r
// CA_FarRead (maphandle,(memptr)mapheaderseg[mapnum],sizeof(maptype));\r
// }\r
// else\r
-// MM_SetPurge (&(memptr)mapheaderseg[mapnum], 0, &(gvar->mm));\r
+// MM_SetPurge (MEMPTR mapheaderseg[mapnum], 0, &(gvar->mm));\r
\r
//\r
// load the planes in\r
if (!compressed)\r
continue; // the plane is not used in this game\r
\r
- dest = &(memptr)mapsegs[plane];\r
+ dest = MEMPTR mapsegs[plane];\r
MM_GetPtr(dest,size);\r
\r
lseek(maphandle,pos,SEEK_SET);\r