mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 21:20:54 +00:00
Added "Flickylist = All" option.
Couldn't get it to default to anything - it was causing crashes, and new years is in ten minutes, so let's do that tomorrow.
This commit is contained in:
parent
311886e582
commit
be140d8143
1 changed files with 23 additions and 4 deletions
|
@ -1013,11 +1013,14 @@ static const struct {
|
||||||
{"DOVE", MT_FLICKY_14},
|
{"DOVE", MT_FLICKY_14},
|
||||||
{"CAT", MT_FLICKY_15},
|
{"CAT", MT_FLICKY_15},
|
||||||
{"CANARY", MT_FLICKY_16},
|
{"CANARY", MT_FLICKY_16},
|
||||||
|
{"a", 0}, // End of normal flickies - a lower case character so will never fastcmp valid with uppercase tmp
|
||||||
//{"FLICKER", MT_FLICKER},
|
//{"FLICKER", MT_FLICKER},
|
||||||
{"SEED", MT_SEED},//MT_CDSEED},
|
{"SEED", MT_SEED},//MT_CDSEED},
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define MAXFLICKIES 64
|
||||||
|
|
||||||
static void readlevelheader(MYFILE *f, INT32 num)
|
static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
{
|
{
|
||||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||||
|
@ -1126,9 +1129,24 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
mapheaderinfo[num-1]->flickies = NULL;
|
mapheaderinfo[num-1]->flickies = NULL;
|
||||||
mapheaderinfo[num-1]->numFlickies = 0;
|
mapheaderinfo[num-1]->numFlickies = 0;
|
||||||
}
|
}
|
||||||
|
else if (fastcmp(word2, "ALL"))
|
||||||
|
{
|
||||||
|
mobjtype_t tmpflickies[MAXFLICKIES];
|
||||||
|
|
||||||
|
for (mapheaderinfo[num-1]->numFlickies = 0;
|
||||||
|
((mapheaderinfo[num-1]->numFlickies < MAXFLICKIES) && FLICKYTYPES[mapheaderinfo[num-1]->numFlickies].type);
|
||||||
|
mapheaderinfo[num-1]->numFlickies++)
|
||||||
|
tmpflickies[mapheaderinfo[num-1]->numFlickies] = FLICKYTYPES[mapheaderinfo[num-1]->numFlickies].type;
|
||||||
|
|
||||||
|
if (mapheaderinfo[num-1]->numFlickies)
|
||||||
|
{
|
||||||
|
size_t newsize = sizeof(mobjtype_t) * mapheaderinfo[num-1]->numFlickies;
|
||||||
|
mapheaderinfo[num-1]->flickies = Z_Realloc(mapheaderinfo[num-1]->flickies, newsize, PU_STATIC, NULL);
|
||||||
|
M_Memcpy(mapheaderinfo[num-1]->flickies, tmpflickies, newsize);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#define MAXFLICKIES 64
|
|
||||||
mobjtype_t tmpflickies[MAXFLICKIES];
|
mobjtype_t tmpflickies[MAXFLICKIES];
|
||||||
mapheaderinfo[num-1]->numFlickies = 0;
|
mapheaderinfo[num-1]->numFlickies = 0;
|
||||||
tmp = strtok(word2,",");
|
tmp = strtok(word2,",");
|
||||||
|
@ -1137,7 +1155,7 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
if (mapheaderinfo[num-1]->numFlickies == MAXFLICKIES) // never going to get above that number
|
if (mapheaderinfo[num-1]->numFlickies == MAXFLICKIES) // never going to get above that number
|
||||||
{
|
{
|
||||||
deh_warning("Level header %d: too many flickies\n", num);
|
deh_warning("Level header %d: too many flickies\n", num);
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fastncmp(tmp, "MT_", 3)) // support for specified mobjtypes...
|
if (fastncmp(tmp, "MT_", 3)) // support for specified mobjtypes...
|
||||||
|
@ -1175,7 +1193,6 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
deh_warning("Level header %d: no valid flicky types found\n", num);
|
deh_warning("Level header %d: no valid flicky types found\n", num);
|
||||||
#undef MAXFLICKIES
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1413,6 +1430,8 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
Z_Free(s);
|
Z_Free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef MAXFLICKIES
|
||||||
|
|
||||||
static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum)
|
static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum)
|
||||||
{
|
{
|
||||||
char *s = Z_Calloc(MAXLINELEN, PU_STATIC, NULL);
|
char *s = Z_Calloc(MAXLINELEN, PU_STATIC, NULL);
|
||||||
|
|
Loading…
Reference in a new issue