//void CAL_CarmackExpand (unsigned far *source, unsigned far *dest,unsigned length);\r
\r
\r
-/*++++#ifdef THREEBYTEGRSTARTS\r
+#ifdef THREEBYTEGRSTARTS\r
#define FILEPOSSIZE 3\r
//#define GRFILEPOS(c) (*(long far *)(((byte far *)grstarts)+(c)*3)&0xffffff)\r
-long GRFILEPOS(int c)\r
+long GRFILEPOS(int c, global_game_variables_t *gvar)\r
{\r
long value;\r
int offset;\r
\r
offset = c*3;\r
\r
- value = *(long far *)(((byte far *)grstarts)+offset);\r
+ value = *(long far *)(((byte far *)gvar->ca.grstarts)+offset);\r
\r
value &= 0x00ffffffl;\r
\r
};\r
#else\r
#define FILEPOSSIZE 4\r
-#define GRFILEPOS(c) (grstarts[c])\r
-#endif*/\r
+#define GRFILEPOS(c) (gvar->ca.grstarts[c])\r
+#endif\r
\r
/*\r
=============================================================================\r
= CA_CacheMarks\r
=\r
======================\r
-*//*\r
+*//*++++\r
#define MAXEMPTYREAD 1024\r
\r
-void CA_CacheMarks (char *title)\r
+void CAL_CacheMarks (char *title, global_game_variables_t *gvar)\r
{\r
boolean dialog;\r
int i,next,numcache;\r
// go through and make everything not needed purgable\r
//\r
for (i=0;i<NUMCHUNKS;i++)\r
- if (gvar->video.grneeded[i]&ca_levelbit)\r
+ if (gvar->ca.grneeded[i]&(gvar->ca.ca_levelbit))//if (grneeded[i]&ca_levelbit)\r
{\r
- if (grsegs[i]) // its allready in memory, make\r
- MM_SetPurge(&grsegs[i],0); // sure it stays there!\r
+ if (gvar->ca.grsegs[i]) // its allready in memory, make\r
+ MM_SetPurge(gvar->ca.grsegs[i],0,gvar); // sure it stays there!\r
else\r
numcache++;\r
}\r
else\r
{\r
- if (grsegs[i]) // not needed, so make it purgeable\r
- MM_SetPurge(&grsegs[i],3);\r
+ if (gvar->ca.grsegs[i]) // not needed, so make it purgeable\r
+ MM_SetPurge(gvar->ca.grsegs[i],3,gvar);\r
}\r
\r
if (!numcache) // nothing to cache!\r
\r
// MDM begin - (GAMERS EDGE)\r
//\r
- if (!FindFile("EGAGRAPH."EXT,NULL,2))\r
- Quit (gvar, "CA_CacheMarks(): Can't find graphics files.");\r
+// if (!FindFile("EGAGRAPH."EXT,NULL,2))\r
+// Quit (gvar, "CA_CacheMarks(): Can't find graphics files.");\r
//\r
// MDM end\r
\r
bufferstart = bufferend = 0; // nothing good in buffer now\r
\r
for (i=0;i<NUMCHUNKS;i++)\r
- if ( (gvar->video.grneeded[i]&ca_levelbit) && !grsegs[i])\r
+ if ( (gvar->ca.grneeded[i]&(gvar->ca.ca_levelbit)) && !gvar->ca.grsegs[i])\r
{\r
//\r
// update thermometer\r
}\r
\r
lseek(grhandle,pos,SEEK_SET);\r
- CA_FarRead(grhandle,bufferseg,endpos-pos);\r
+ CA_FarRead(grhandle,(gvar->mm.bufferseg),endpos-pos,gvar);\r
bufferstart = pos;\r
bufferend = endpos;\r
source = bufferseg;\r
else\r
{\r
// big chunk, allocate temporary buffer\r
- MM_GetPtr(&bigbufferseg,compressed);\r
+ MM_GetPtr(&bigbufferseg,compressed,gvar);\r
if (mmerror)\r
return;\r
MM_SetLock (&bigbufferseg,true);\r
lseek(grhandle,pos,SEEK_SET);\r
- CA_FarRead(grhandle,bigbufferseg,compressed);\r
+ CA_FarRead(grhandle,bigbufferseg,compressed,gvar);\r
source = bigbufferseg;\r
}\r
\r