Add MAXMUSNAMES constant

This commit is contained in:
wolfy852 2023-02-10 12:59:53 -06:00
parent 504788195e
commit b089696021
3 changed files with 7 additions and 2 deletions

View file

@ -50,6 +50,7 @@
// SRB2Kart
#include "filesrch.h" // refreshdirmenu
#include "k_follower.h"
#include "doomstat.h" // MAXMUSNAMES
// Loops through every constant and operation in word and performs its calculations, returning the final value.
fixed_t get_number(const char *word)
@ -1173,7 +1174,8 @@ void readlevelheader(MYFILE *f, char * name)
do {
deh_strlcpy(mapheaderinfo[num]->musname[j], tmp,
sizeof(mapheaderinfo[num]->musname[j]), va("Level header %d: music", num));
j += 1;
if (j < MAXMUSNAMES)
j++;
} while ((tmp = strtok(NULL,",")) != NULL);
mapheaderinfo[num]->musname_size = j;
}

View file

@ -369,6 +369,8 @@ struct staffbrief_t
tic_t lap;
};
#define MAXMUSNAMES 3 // maximum definable music tracks per level
/** Map header information.
*/
struct mapheader_t

View file

@ -100,6 +100,7 @@
#include "k_director.h" // K_InitDirector
#include "k_specialstage.h"
#include "acs/interface.h"
#include "doomstat.h" // MAXMUSNAMES
// Replay names have time
#if !defined (UNDER_CE)
@ -387,7 +388,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 num)
mapheaderinfo[num]->typeoflevel = 0;
mapheaderinfo[num]->gravity = DEFAULT_GRAVITY;
mapheaderinfo[num]->keywords[0] = '\0';
for (i = 0; i < 3; i++)
for (i = 0; i < MAXMUSNAMES; i++)
{
sprintf(mapheaderinfo[num]->musname[i], "%.5sM", G_BuildMapName(num+1));
mapheaderinfo[num]->musname[i][6] = 0;