"Monitor" parameter for cups

- Defaults to 1, AKA Sonic 1/2 monitor
- Set to 2 for Sonic 3k monitor
- Supports a range of 1-9 and A-Z
- Permits fine-grained rapid-prototype stretch goal Chaotix monitor stuff later in development
This commit is contained in:
toaster 2023-03-13 16:18:07 +00:00 committed by GenericHeroGuy
parent 6db125c0f3
commit 2c3fc38f27
3 changed files with 12 additions and 1 deletions

View file

@ -3501,7 +3501,16 @@ void readcupheader(MYFILE *f, cupheader_t *cup)
i = atoi(word2); // used for numerical settings
strupr(word2);
if (fastcmp(word, "ICON"))
if (fastcmp(word, "MONITOR"))
{
if (i > 0 && i < 10)
cup->monitor = i;
else if (!word2[0] || word2[1] != '\0' || word2[0] == '0')
deh_warning("%s Cup: Invalid monitor type \"%s\" (should be 1-9 or A-Z)\n", cup->name, word2);
else
cup->monitor = (word2[0] - 'A') + 10;
}
else if (fastcmp(word, "ICON"))
{
deh_strlcpy(cup->icon, word2,
sizeof(cup->icon), va("%s Cup: icon", cup->name));

View file

@ -534,6 +534,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
{
cup = Z_Calloc(sizeof (cupheader_t), PU_STATIC, NULL);
cup->id = numkartcupheaders;
cup->monitor = 1;
deh_strlcpy(cup->name, word2,
sizeof(cup->name), va("Cup header %s: name", word2));
if (prev != NULL)

View file

@ -357,6 +357,7 @@ struct mapheader_lighting_t
struct cupheader_t
{
UINT16 id; ///< Cup ID
UINT8 monitor; ///< Monitor graphic 1-9 or A-Z
char name[15]; ///< Cup title (14 chars)
char icon[9]; ///< Name of the icon patch
char *levellist[CUPCACHE_MAX]; ///< List of levels that belong to this cup