mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 09:20:51 +00:00
New "-clipmap" command-line switch to specify sector collision clip maps. This switch works in an additive fashion like -mx and -mh. _clipshape0.map through _clipshape9.map remain loaded by default.
Also, a very minor change in the con/def module code. (int --> int32_t) git-svn-id: https://svn.eduke32.com/eduke32@2495 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d03ec12e92
commit
cf2b9ec940
7 changed files with 176 additions and 48 deletions
|
@ -552,8 +552,8 @@ void initspritelists(void);
|
||||||
int32_t loadboard(char *filename, char flags, int32_t *daposx, int32_t *daposy, int32_t *daposz, int16_t *daang, int16_t *dacursectnum);
|
int32_t loadboard(char *filename, char flags, int32_t *daposx, int32_t *daposy, int32_t *daposz, int16_t *daang, int16_t *dacursectnum);
|
||||||
int32_t loadmaphack(const char *filename);
|
int32_t loadmaphack(const char *filename);
|
||||||
void delete_maphack_lights();
|
void delete_maphack_lights();
|
||||||
#if !defined DEBUG_MAIN_ARRAYS
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
int32_t clipmapinfo_load(const char *filename);
|
int32_t clipmapinfo_load(void);
|
||||||
#endif
|
#endif
|
||||||
int32_t saveboard(const char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, int16_t *daang, int16_t *dacursectnum);
|
int32_t saveboard(const char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, int16_t *daang, int16_t *dacursectnum);
|
||||||
int32_t loadpics(const char *filename, int32_t askedsize);
|
int32_t loadpics(const char *filename, int32_t askedsize);
|
||||||
|
@ -783,7 +783,12 @@ extern char defsfilename[BMAX_PATH];
|
||||||
extern char *g_defNamePtr;
|
extern char *g_defNamePtr;
|
||||||
|
|
||||||
extern char **g_defModules;
|
extern char **g_defModules;
|
||||||
extern int g_defModulesNum;
|
extern int32_t g_defModulesNum;
|
||||||
|
|
||||||
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
|
extern char **g_clipMapFiles;
|
||||||
|
extern int32_t g_clipMapFilesNum;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -128,6 +128,10 @@ static inline float nearbyintf(float x)
|
||||||
# define DEBUG_MAIN_ARRAYS
|
# define DEBUG_MAIN_ARRAYS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined DEBUG_MAIN_ARRAYS
|
||||||
|
# define HAVE_CLIPSHAPE_FEATURE
|
||||||
|
#endif
|
||||||
|
|
||||||
// redefined for apple/ppc, which chokes on stderr when linking...
|
// redefined for apple/ppc, which chokes on stderr when linking...
|
||||||
#define ERRprintf(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
|
#define ERRprintf(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
|
||||||
|
|
||||||
|
|
|
@ -627,10 +627,15 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
// Here used to be the 'whitecol' calculation
|
// Here used to be the 'whitecol' calculation
|
||||||
|
|
||||||
#if !defined DEBUG_MAIN_ARRAYS
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
k = clipmapinfo_load("_clipshape0.map");
|
k = clipmapinfo_load();
|
||||||
if (k>0)
|
if (k>0)
|
||||||
initprintf("There was an error loading the sprite clipping map (status %d).\n", k);
|
initprintf("There was an error loading the sprite clipping map (status %d).\n", k);
|
||||||
|
|
||||||
|
for (i=0; i < g_clipMapFilesNum; ++i)
|
||||||
|
Bfree (g_clipMapFiles[i]);
|
||||||
|
Bfree (g_clipMapFiles);
|
||||||
|
g_clipMapFiles = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
taglab_init();
|
taglab_init();
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
#define CACHEAGETIME 16
|
#define CACHEAGETIME 16
|
||||||
|
|
||||||
#if !defined DEBUG_MAIN_ARRAYS
|
#if !defined DEBUG_MAIN_ARRAYS
|
||||||
# define HAVE_CLIPSHAPE_FEATURE
|
|
||||||
const int32_t engine_main_arrays_are_static = 0; // for Lunatic
|
const int32_t engine_main_arrays_are_static = 0; // for Lunatic
|
||||||
#else
|
#else
|
||||||
const int32_t engine_main_arrays_are_static = 1;
|
const int32_t engine_main_arrays_are_static = 1;
|
||||||
|
@ -1258,15 +1257,19 @@ static void clipmapinfo_init()
|
||||||
numwalls = 0;
|
numwalls = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// loads the clip maps 0 through 9.
|
// loads the clip maps.
|
||||||
// this should be called before any real map is loaded.
|
// this should be called before any real map is loaded.
|
||||||
int32_t clipmapinfo_load(const char *filename)
|
int32_t clipmapinfo_load(void)
|
||||||
{
|
{
|
||||||
int32_t i,k,w, px,py,pz;
|
int32_t i,k,w, px,py,pz;
|
||||||
int16_t ang,cs;
|
int16_t ang,cs;
|
||||||
|
|
||||||
char fn[BMAX_PATH], loadedwhich[32]={0}, *lwcp=loadedwhich;
|
int32_t lwcp = 0;
|
||||||
int32_t slen, fi, fisec[10], fispr[10];
|
int32_t fi;
|
||||||
|
|
||||||
|
int32_t *fisec = NULL;
|
||||||
|
int32_t *fispr = NULL;
|
||||||
|
|
||||||
int32_t ournumsectors=0, ournumwalls=0, ournumsprites=0;
|
int32_t ournumsectors=0, ournumwalls=0, ournumsprites=0;
|
||||||
|
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
@ -1281,29 +1284,29 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bmemset(fisec, 0, sizeof(fisec));
|
fisec = (int32_t *) Bcalloc(g_clipMapFilesNum, sizeof (int32_t));
|
||||||
Bmemset(fispr, 0, sizeof(fispr));
|
assert(fisec);
|
||||||
|
fispr = (int32_t *) Bcalloc(g_clipMapFilesNum, sizeof (int32_t));
|
||||||
Bstrcpy(fn, filename);
|
assert(fispr);
|
||||||
slen = Bstrlen(fn);
|
|
||||||
|
|
||||||
quickloadboard = 1;
|
quickloadboard = 1;
|
||||||
for (fi='0'; fi<='9'; fi++)
|
for (fi = 0; fi < g_clipMapFilesNum; ++fi)
|
||||||
{
|
{
|
||||||
fisec[fi-'0'] = ournumsectors;
|
fisec[fi] = ournumsectors;
|
||||||
fispr[fi-'0'] = ournumsprites;
|
fispr[fi] = ournumsprites;
|
||||||
|
|
||||||
fn[slen-5] = fi;
|
i = loadboard(g_clipMapFiles[fi], 0, &px,&py,&pz, &ang,&cs);
|
||||||
i = loadboard(fn, 0, &px,&py,&pz, &ang,&cs);
|
|
||||||
if (i<0)
|
if (i<0)
|
||||||
continue;
|
continue;
|
||||||
// Numsprites will now be set!
|
// Numsprites will now be set!
|
||||||
|
|
||||||
|
initprintf("Loading clip map: %s\n", g_clipMapFiles[fi]);
|
||||||
|
|
||||||
if (ournumsectors+numsectors>MAXSECTORS ||
|
if (ournumsectors+numsectors>MAXSECTORS ||
|
||||||
ournumwalls+numwalls>MAXWALLS ||
|
ournumwalls+numwalls>MAXWALLS ||
|
||||||
ournumsprites+Numsprites>MAXSPRITES)
|
ournumsprites+Numsprites>MAXSPRITES)
|
||||||
{
|
{
|
||||||
initprintf("clip map: warning: exceeded limits when loading %s, aborting.\n", fn);
|
initprintf("clip map: warning: exceeded limits when loading %s, aborting.\n", g_clipMapFiles[fi]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1329,19 +1332,19 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
ournumwalls += numwalls;
|
ournumwalls += numwalls;
|
||||||
ournumsprites += Numsprites;
|
ournumsprites += Numsprites;
|
||||||
|
|
||||||
if (lwcp != loadedwhich)
|
++lwcp;
|
||||||
{
|
|
||||||
*lwcp++ = ',';
|
|
||||||
*lwcp++ = ' ';
|
|
||||||
}
|
|
||||||
*lwcp++ = fi;
|
|
||||||
*lwcp = 0;
|
|
||||||
}
|
}
|
||||||
quickloadboard = 0;
|
quickloadboard = 0;
|
||||||
|
|
||||||
if (ournumsectors==0 || ournumwalls==0 || ournumsprites==0) // nothing loaded
|
if (ournumsectors==0 || ournumwalls==0 || ournumsprites==0) // nothing loaded
|
||||||
{
|
{
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
|
||||||
|
free(fisec);
|
||||||
|
fisec = NULL;
|
||||||
|
free(fispr);
|
||||||
|
fispr = NULL;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1361,6 +1364,12 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
if (!sectoidx || !sector || !wall)
|
if (!sectoidx || !sector || !wall)
|
||||||
{
|
{
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
|
||||||
|
free(fisec);
|
||||||
|
fisec = NULL;
|
||||||
|
free(fispr);
|
||||||
|
fispr = NULL;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (i=0; i<numsectors; i++)
|
for (i=0; i<numsectors; i++)
|
||||||
|
@ -1400,6 +1409,12 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
if (!sectq || !tempictoidx)
|
if (!sectq || !tempictoidx)
|
||||||
{
|
{
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
|
||||||
|
free(fisec);
|
||||||
|
fisec = NULL;
|
||||||
|
free(fispr);
|
||||||
|
fispr = NULL;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (i=0; i<MAXTILES; i++)
|
for (i=0; i<MAXTILES; i++)
|
||||||
|
@ -1425,13 +1440,19 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
{
|
{
|
||||||
if (sectoidx[k]&CM_SOME)
|
if (sectoidx[k]&CM_SOME)
|
||||||
{
|
{
|
||||||
for (fi=0; fi<9; fi++)
|
for (fi = 0; fi < g_clipMapFilesNum; ++fi)
|
||||||
if (k>=fisec[fi])
|
if (k>=fisec[fi])
|
||||||
break;
|
break;
|
||||||
initprintf("clip map %d: error: tried to chain picnum %d (sprite %d) in sector %d which"
|
initprintf("clip map \"%s\": error: tried to chain picnum %d (sprite %d) in sector %d which"
|
||||||
" already belongs to picnum %d.\n", fi, pn, i-fispr[fi], k-fisec[fi],
|
" already belongs to picnum %d.\n", g_clipMapFiles[fi], pn, i-fispr[fi], k-fisec[fi],
|
||||||
clipinfo[sectoidx[k]].picnum);
|
clipinfo[sectoidx[k]].picnum);
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
|
||||||
|
free(fisec);
|
||||||
|
fisec = NULL;
|
||||||
|
free(fispr);
|
||||||
|
fispr = NULL;
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1449,11 +1470,11 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
{
|
{
|
||||||
if (sprite[i].ang!=1536 && sprite[i].ang!=512)
|
if (sprite[i].ang!=1536 && sprite[i].ang!=512)
|
||||||
{
|
{
|
||||||
for (fi=0; fi<9; fi++)
|
for (fi = 0; fi < g_clipMapFilesNum; ++fi)
|
||||||
if (i>=fispr[fi])
|
if (i>=fispr[fi])
|
||||||
break;
|
break;
|
||||||
initprintf("clip map %d: warning: sprite %d pointing neither northward nor southward. %s will be wrong.\n",
|
initprintf("clip map \"%s\": warning: sprite %d pointing neither northward nor southward. %s will be wrong.\n",
|
||||||
fi, i-fispr[fi], (sprite[i].cstat&48)==32 ? "Scaling and flipping" : "X-flipping");
|
g_clipMapFiles[fi], i-fispr[fi], (sprite[i].cstat&48)==32 ? "Scaling and flipping" : "X-flipping");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1486,12 +1507,18 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
{
|
{
|
||||||
if (outersect>=0 && ns!=outersect)
|
if (outersect>=0 && ns!=outersect)
|
||||||
{
|
{
|
||||||
for (fi=0; fi<9; fi++)
|
for (fi = 0; fi < g_clipMapFilesNum; ++fi)
|
||||||
if (ns>=fisec[fi])
|
if (ns>=fisec[fi])
|
||||||
break;
|
break;
|
||||||
initprintf("clip map %d: error: encountered more than one outer sector (%d and %d)"
|
initprintf("clip map \"%s\": error: encountered more than one outer sector (%d and %d)"
|
||||||
" for sprite %d.\n", fi, outersect-fisec[fi], ns-fisec[fi], i-fispr[fi]);
|
" for sprite %d.\n", g_clipMapFiles[fi], outersect-fisec[fi], ns-fisec[fi], i-fispr[fi]);
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
|
||||||
|
free(fisec);
|
||||||
|
fisec = NULL;
|
||||||
|
free(fispr);
|
||||||
|
fispr = NULL;
|
||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1500,13 +1527,19 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
}
|
}
|
||||||
else if (sectoidx[ns]!=numclipmaps)
|
else if (sectoidx[ns]!=numclipmaps)
|
||||||
{
|
{
|
||||||
for (fi=0; fi<9; fi++)
|
for (fi = 0; fi < g_clipMapFilesNum; ++fi)
|
||||||
if (ns>=fisec[fi])
|
if (ns>=fisec[fi])
|
||||||
break;
|
break;
|
||||||
initprintf("clip map %d: error: encountered sector %d belonging to index %d"
|
initprintf("clip map \"%s\": error: encountered sector %d belonging to index %d"
|
||||||
" while collecting sectors for sprite %d (index %d).\n",
|
" while collecting sectors for sprite %d (index %d).\n",
|
||||||
fi, ns-fisec[fi], sectoidx[ns], i-fispr[fi], numclipmaps);
|
g_clipMapFiles[fi], ns-fisec[fi], sectoidx[ns], i-fispr[fi], numclipmaps);
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
|
||||||
|
free(fisec);
|
||||||
|
fisec = NULL;
|
||||||
|
free(fispr);
|
||||||
|
fispr = NULL;
|
||||||
|
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1518,6 +1551,12 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
{
|
{
|
||||||
initprintf("clip map: INTERNAL ERROR: outersect==-1!\n");
|
initprintf("clip map: INTERNAL ERROR: outersect==-1!\n");
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
|
||||||
|
free(fisec);
|
||||||
|
fisec = NULL;
|
||||||
|
free(fispr);
|
||||||
|
fispr = NULL;
|
||||||
|
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1619,6 +1658,12 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
if (!loadwallinv)
|
if (!loadwallinv)
|
||||||
{
|
{
|
||||||
clipmapinfo_init();
|
clipmapinfo_init();
|
||||||
|
|
||||||
|
free(fisec);
|
||||||
|
fisec = NULL;
|
||||||
|
free(fispr);
|
||||||
|
fispr = NULL;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1683,7 +1728,13 @@ int32_t clipmapinfo_load(const char *filename)
|
||||||
numwalls = 0;
|
numwalls = 0;
|
||||||
initspritelists();
|
initspritelists();
|
||||||
|
|
||||||
initprintf("Loaded clip map%s %s.\n", lwcp==loadedwhich+1?"":"s", loadedwhich);
|
if (lwcp > 0)
|
||||||
|
initprintf("Loaded clip map%s.\n", lwcp==1?"":"s");
|
||||||
|
|
||||||
|
free(fisec);
|
||||||
|
fisec = NULL;
|
||||||
|
free(fispr);
|
||||||
|
fispr = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,9 +98,14 @@ static int32_t g_skipDefaultCons = 0;
|
||||||
static int32_t g_skipDefaultDefs = 0; // primarily for NAM/WWII GI appeasement
|
static int32_t g_skipDefaultDefs = 0; // primarily for NAM/WWII GI appeasement
|
||||||
|
|
||||||
char **g_scriptModules = NULL;
|
char **g_scriptModules = NULL;
|
||||||
int g_scriptModulesNum = 0;
|
int32_t g_scriptModulesNum = 0;
|
||||||
char **g_defModules = NULL;
|
char **g_defModules = NULL;
|
||||||
int g_defModulesNum = 0;
|
int32_t g_defModulesNum = 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
|
char **g_clipMapFiles = NULL;
|
||||||
|
int32_t g_clipMapFilesNum = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#pragma pack(push,1)
|
#pragma pack(push,1)
|
||||||
sound_t g_sounds[MAXSOUNDS];
|
sound_t g_sounds[MAXSOUNDS];
|
||||||
|
@ -8432,6 +8437,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
int32_t i = 1, j, maxlen=0, *lengths;
|
int32_t i = 1, j, maxlen=0, *lengths;
|
||||||
char *c, *k;
|
char *c, *k;
|
||||||
|
char clipshape[16] = "_clipshape0.map";
|
||||||
|
|
||||||
mapster32_fullpath = argv[0];
|
mapster32_fullpath = argv[0];
|
||||||
|
|
||||||
|
@ -8448,6 +8454,16 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
testplay_addparam = Bmalloc(maxlen+argc);
|
testplay_addparam = Bmalloc(maxlen+argc);
|
||||||
testplay_addparam[0] = 0;
|
testplay_addparam[0] = 0;
|
||||||
|
|
||||||
|
// pre-form the default 10 clipmaps
|
||||||
|
for (j = '0'; j<='9'; ++j)
|
||||||
|
{
|
||||||
|
clipshape[10] = j;
|
||||||
|
g_clipMapFiles = (char **) Brealloc (g_clipMapFiles, (g_clipMapFilesNum+1) * sizeof(char *));
|
||||||
|
g_clipMapFiles[g_clipMapFilesNum] = Bmalloc(Bstrlen(clipshape) + 1);
|
||||||
|
Bstrcpy(g_clipMapFiles[g_clipMapFilesNum], clipshape);
|
||||||
|
++g_clipMapFilesNum;
|
||||||
|
}
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
||||||
while (i < argc)
|
while (i < argc)
|
||||||
|
@ -8582,6 +8598,19 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"clipmap"))
|
||||||
|
{
|
||||||
|
if (argc > i+1)
|
||||||
|
{
|
||||||
|
g_clipMapFiles = (char **) Brealloc (g_clipMapFiles, (g_clipMapFilesNum+1) * sizeof(char *));
|
||||||
|
g_clipMapFiles[g_clipMapFilesNum] = Bmalloc(Bstrlen((char *)argv[i+1]) + 1);
|
||||||
|
Bstrcpy(g_clipMapFiles[g_clipMapFilesNum], (char *)argv[i+1]);
|
||||||
|
++g_clipMapFilesNum;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!Bstrcasecmp(c+1,"nm") || !Bstrcasecmp(c+1,"ns"))
|
if (!Bstrcasecmp(c+1,"nm") || !Bstrcasecmp(c+1,"ns"))
|
||||||
{
|
{
|
||||||
COPYARG(i);
|
COPYARG(i);
|
||||||
|
|
|
@ -130,9 +130,14 @@ char *g_gameNamePtr = NULL;
|
||||||
char *g_rtsNamePtr = NULL;
|
char *g_rtsNamePtr = NULL;
|
||||||
|
|
||||||
char **g_scriptModules = NULL;
|
char **g_scriptModules = NULL;
|
||||||
int g_scriptModulesNum = 0;
|
int32_t g_scriptModulesNum = 0;
|
||||||
char **g_defModules = NULL;
|
char **g_defModules = NULL;
|
||||||
int g_defModulesNum = 0;
|
int32_t g_defModulesNum = 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
|
char **g_clipMapFiles = NULL;
|
||||||
|
int32_t g_clipMapFilesNum = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef LUNATIC_ENABLE
|
#ifdef LUNATIC_ENABLE
|
||||||
El_State g_ElState;
|
El_State g_ElState;
|
||||||
|
@ -8583,6 +8588,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
int16_t i = 1, j;
|
int16_t i = 1, j;
|
||||||
char *c, *k;
|
char *c, *k;
|
||||||
|
char clipshape[16] = "_clipshape0.map";
|
||||||
|
|
||||||
ud.fta_on = 1;
|
ud.fta_on = 1;
|
||||||
ud.god = 0;
|
ud.god = 0;
|
||||||
|
@ -8603,6 +8609,16 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
g_player[0].wchoice[8] = 9;
|
g_player[0].wchoice[8] = 9;
|
||||||
g_player[0].wchoice[9] = 1;
|
g_player[0].wchoice[9] = 1;
|
||||||
|
|
||||||
|
// pre-form the default 10 clipmaps
|
||||||
|
for (j = '0'; j<='9'; ++j)
|
||||||
|
{
|
||||||
|
clipshape[10] = j;
|
||||||
|
g_clipMapFiles = (char **) Brealloc (g_clipMapFiles, (g_clipMapFilesNum+1) * sizeof(char *));
|
||||||
|
g_clipMapFiles[g_clipMapFilesNum] = Bmalloc(Bstrlen(clipshape) + 1);
|
||||||
|
Bstrcpy(g_clipMapFiles[g_clipMapFilesNum], clipshape);
|
||||||
|
++g_clipMapFilesNum;
|
||||||
|
}
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
initprintf("Application parameters: ");
|
initprintf("Application parameters: ");
|
||||||
|
@ -8832,6 +8848,19 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"clipmap"))
|
||||||
|
{
|
||||||
|
if (argc > i+1)
|
||||||
|
{
|
||||||
|
g_clipMapFiles = (char **) Brealloc (g_clipMapFiles, (g_clipMapFilesNum+1) * sizeof(char *));
|
||||||
|
g_clipMapFiles[g_clipMapFilesNum] = Bmalloc(Bstrlen((char *)argv[i+1]) + 1);
|
||||||
|
Bstrcpy(g_clipMapFiles[g_clipMapFilesNum], (char *)argv[i+1]);
|
||||||
|
++g_clipMapFilesNum;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!Bstrcasecmp(c+1,"condebug"))
|
if (!Bstrcasecmp(c+1,"condebug"))
|
||||||
{
|
{
|
||||||
g_scriptDebug = 1;
|
g_scriptDebug = 1;
|
||||||
|
@ -10374,9 +10403,14 @@ CLEAN_DIRECTORY:
|
||||||
Bfree(ptr);
|
Bfree(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined DEBUG_MAIN_ARRAYS
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
if ((i = clipmapinfo_load("_clipshape0.map")) > 0)
|
if ((i = clipmapinfo_load()) > 0)
|
||||||
initprintf("There was an error loading the sprite clipping map (status %d).\n", i);
|
initprintf("There was an error loading the sprite clipping map (status %d).\n", i);
|
||||||
|
|
||||||
|
for (i=0; i < g_clipMapFilesNum; ++i)
|
||||||
|
Bfree (g_clipMapFiles[i]);
|
||||||
|
Bfree (g_clipMapFiles);
|
||||||
|
g_clipMapFiles = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OSD_Exec("autoexec.cfg");
|
OSD_Exec("autoexec.cfg");
|
||||||
|
|
|
@ -184,7 +184,7 @@ extern char *g_scriptNamePtr;
|
||||||
extern char *g_gameNamePtr;
|
extern char *g_gameNamePtr;
|
||||||
extern char *g_rtsNamePtr;
|
extern char *g_rtsNamePtr;
|
||||||
extern char **g_scriptModules;
|
extern char **g_scriptModules;
|
||||||
extern int g_scriptModulesNum;
|
extern int32_t g_scriptModulesNum;
|
||||||
extern char CheatStrings[][MAXCHEATLEN];
|
extern char CheatStrings[][MAXCHEATLEN];
|
||||||
extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH];
|
extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH];
|
||||||
extern char boardfilename[BMAX_PATH];
|
extern char boardfilename[BMAX_PATH];
|
||||||
|
|
Loading…
Reference in a new issue