From: sparky4 Date: Thu, 8 Sep 2016 14:47:39 +0000 (-0500) Subject: wwww yakuji wwww ca use to load maps w X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=b76c0985ea68720687947fb46a5a49cebe6cbac2;p=16.git wwww yakuji wwww ca use to load maps w --- diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index cb4b44a7..67bd4f40 100755 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -1077,7 +1077,7 @@ asm mov ds,ax ====================== */ -/*void CAL_SetupMapFile (void) +void CAL_SetupMapFile (global_game_variables_t *gvar) { int handle; long length; @@ -1085,33 +1085,39 @@ asm mov ds,ax // // load maphead.ext (offsets and tileinfo for map file) // -#ifndef MAPHEADERLINKED - if ((handle = open("MAPHEAD."EXT, - O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open MAPHEAD."EXT"!"); - length = filelength(handle); - MM_GetPtr (&(memptr)tinf,length); - CA_FarRead(handle, tinf, length); - close(handle); -#else - - tinf = (byte _seg *)FP_SEG(&maphead); - -#endif +// #ifndef MAPHEADERLINKED +// if ((handle = open("MAPHEAD."EXT, +// O_RDONLY | O_BINARY, S_IREAD)) == -1) +// Quit ("Can't open MAPHEAD."EXT"!"); +// length = filelength(handle); +// MM_GetPtr (&(memptr)tinf,length); +// CA_FarRead(handle, tinf, length); +// close(handle); +// //#else +// +// tinf = (byte _seg *)FP_SEG(&maphead); +// +// #endif // // open the data file // -#ifdef MAPHEADERLINKED - if ((maphandle = open("GAMEMAPS."EXT, +//todo multiple files + if ((gvar->ca.file.maphandles[0] = open("data/test.map", O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open GAMEMAPS."EXT"!"); -#else - if ((maphandle = open("MAPTEMP."EXT, - O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open MAPTEMP."EXT"!"); -#endif -}*/ + { + printf("Can't open data/test.map!"); + } +// #ifdef MAPHEADERLINKED +// if ((maphandle = open("GAMEMAPS."EXT, +// O_RDONLY | O_BINARY, S_IREAD)) == -1) +// Quit ("Can't open GAMEMAPS."EXT"!"); +// //#else +// if ((maphandle = open("MAPTEMP."EXT, +// O_RDONLY | O_BINARY, S_IREAD)) == -1) +// Quit ("Can't open MAPTEMP."EXT"!"); +// #endif +} //========================================================================== @@ -1194,42 +1200,11 @@ void CA_Startup(global_game_variables_t *gvar) unlink("meminfo.16w"); gvar->handle.showmemhandle = open("meminfo.16w", O_CREAT | O_WRONLY | O_TEXT); #endif -/* CAL_SetupMapFile (); +/* CAL_SetupGrFile (); CAL_SetupAudioFile ();*/ -/*++++ -// MDM begin - (GAMERS EDGE) -// - if(!FindFile("AUDIO."EXT,NULL,2)) - Quit("CA_Startup(): Can't find audio files."); -// -// MDM end - -#ifndef NOAUDIO - CAL_SetupAudioFile(); -#endif - -// MDM begin - (GAMERS EDGE) -// - if (!FindFile("GAMEMAPS."EXT,NULL,1)) - Quit("CA_Startup(): Can't find level files."); -// -// MDM end -#ifndef NOMAPS - CAL_SetupMapFile (); -#endif - -// MDM begin - (GAMERS EDGE) -// - if (!FindFile("EGAGRAPH."EXT,NULL,2)) - Quit("CA_Startup(): Can't find graphics files."); -// -// MDM end - -#ifndef NOGRAPHICS - CAL_SetupGrFile (); -#endif*/ + CAL_SetupMapFile (gvar); gvar->ca.mapon = -1; gvar->ca.ca_levelbit = 1; diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 86379ed8..d0e4a463 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -102,7 +102,7 @@ typedef struct { int profilehandle,debughandle,showmemhandle; int heaphandle; -} handle_t; +} loghandle_t; typedef struct { @@ -183,10 +183,16 @@ typedef struct //from 16_ca //========================================================================== +typedef struct +{ + int maphandles[4]; // handle to MAPTEMP / GAMEMAPS +} handle_t; + typedef struct { byte ca_levelbit,ca_levelnum; int mapon; + handle_t file; //files to open //_seg *grsegs[NUMCHUNKS]; //byte far grneeded[NUMCHUNKS]; //huffnode huffnode; @@ -200,7 +206,7 @@ typedef struct video_t video; // video settings variable ca_t ca; // ca stuff byte *pee; // message for fps - handle_t handle; //handles for file logging + loghandle_t handle; //handles for file logging kurokku_t kurokku; //clock struct mminfo_t mm; mminfotype mmi; } global_game_variables_t;