diff --git a/src/d_main.c b/src/d_main.c index 7b7c7a79d..44ae1bd09 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1459,7 +1459,7 @@ void D_SRB2Main(void) // we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant if (num <= NUMMAPS && mapheaderinfo[num - 1]) { - mapheaderinfo[num - 1]->menuflags |= LF2_EXISTSHACK; + mapheaderinfo[num - 1]->alreadyExists = true; } } } @@ -1490,9 +1490,12 @@ void D_SRB2Main(void) // we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant if (num <= NUMMAPS && mapheaderinfo[num - 1]) { - if (mapheaderinfo[num - 1]->menuflags & LF2_EXISTSHACK) + if (mapheaderinfo[num - 1]->alreadyExists != false) + { G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you - mapheaderinfo[num - 1]->menuflags |= LF2_EXISTSHACK; + } + + mapheaderinfo[num - 1]->alreadyExists = true; } CONS_Printf("%s\n", name); diff --git a/src/dehacked.c b/src/dehacked.c index ab938fdf8..0a7038ff8 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1661,26 +1661,7 @@ static void readlevelheader(MYFILE *f, INT32 num) } } - // NiGHTS grades - else if (fastncmp(word, "GRADES", 6)) - { - UINT8 mare = (UINT8)atoi(word + 6); - - if (mare <= 0 || mare > 8) - { - deh_warning("Level header %d: unknown word '%s'", num, word); - continue; - } - - P_AddGradesForMare((INT16)(num-1), mare-1, word2); - } - // Strings that can be truncated - else if (fastcmp(word, "SELECTHEADING")) - { - deh_strlcpy(mapheaderinfo[num-1]->selectheading, word2, - sizeof(mapheaderinfo[num-1]->selectheading), va("Level header %d: selectheading", num)); - } else if (fastcmp(word, "ZONETITLE")) { deh_strlcpy(mapheaderinfo[num-1]->zonttl, word2, @@ -1701,7 +1682,7 @@ static void readlevelheader(MYFILE *f, INT32 num) if (i >= 0 && i <= 99) // 0 for no act number mapheaderinfo[num-1]->actnum = (UINT8)i; else - deh_warning("Level header %d: invalid act number %d", num, i);*/ + deh_warning("Level header %d: invalid act number %d", num, i); } else if (fastcmp(word, "NEXTLEVEL")) { @@ -1786,34 +1767,6 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1); else if (fastcmp(word, "MUSICPOS")) mapheaderinfo[num-1]->muspos = (UINT32)get_number(word2); - else if (fastcmp(word, "MUSICINTERFADEOUT")) - mapheaderinfo[num-1]->musinterfadeout = (UINT32)get_number(word2); - else if (fastcmp(word, "MUSICINTER")) - deh_strlcpy(mapheaderinfo[num-1]->musintername, word2, - sizeof(mapheaderinfo[num-1]->musintername), va("Level header %d: intermission music", num)); - else if (fastcmp(word, "MUSICPOSTBOSS")) - deh_strlcpy(mapheaderinfo[num-1]->muspostbossname, word2, - sizeof(mapheaderinfo[num-1]->muspostbossname), va("Level header %d: post-boss music", num)); - else if (fastcmp(word, "MUSICPOSTBOSSTRACK")) - mapheaderinfo[num-1]->muspostbosstrack = ((UINT16)i - 1); - else if (fastcmp(word, "MUSICPOSTBOSSPOS")) - mapheaderinfo[num-1]->muspostbosspos = (UINT32)get_number(word2); - else if (fastcmp(word, "MUSICPOSTBOSSFADEIN")) - mapheaderinfo[num-1]->muspostbossfadein = (UINT32)get_number(word2); - else if (fastcmp(word, "FORCERESETMUSIC")) - { - // This is a weird one because "FALSE"/"NO" could either apply to "leave to default preference" (cv_resetmusic) - // or "force off". Let's assume it means "force off", and let an unspecified value mean "default preference" - if (fastcmp(word2, "OFF") || word2[0] == 'F' || word2[0] == 'N') i = 0; - else if (fastcmp(word2, "ON") || word2[0] == 'T' || word2[0] == 'Y') i = 1; - else i = -1; // (fastcmp(word2, "DEFAULT")) - - if (i >= -1 && i <= 1) // -1 to force off, 1 to force on, 0 to honor default. - // This behavior can be disabled with cv_resetmusicbyheader - mapheaderinfo[num-1]->musforcereset = (SINT8)i; - else - deh_warning("Level header %d: invalid forceresetmusic option %d", num, i); - } else if (fastcmp(word, "FORCECHARACTER")) { strlcpy(mapheaderinfo[num-1]->forcecharacter, word2, SKINNAMESIZE+1); @@ -1824,14 +1777,10 @@ static void readlevelheader(MYFILE *f, INT32 num) else if (fastcmp(word, "SKYTEXTURE")) deh_strlcpy(mapheaderinfo[num-1]->skytexture, word2, sizeof(mapheaderinfo[num-1]->skytexture), va("Level header %d: sky texture", num)); - else if (fastcmp(word, "INTERSCREEN")) - strncpy(mapheaderinfo[num-1]->interscreen, word2, 8); else if (fastcmp(word, "PRECUTSCENENUM")) mapheaderinfo[num-1]->precutscenenum = (UINT8)i; else if (fastcmp(word, "CUTSCENENUM")) mapheaderinfo[num-1]->cutscenenum = (UINT8)i; - else if (fastcmp(word, "COUNTDOWN")) - mapheaderinfo[num-1]->countdown = (INT16)i; else if (fastcmp(word, "PALETTE")) mapheaderinfo[num-1]->palette = (UINT16)i; else if (fastcmp(word, "ENCOREPAL")) @@ -1845,8 +1794,6 @@ static void readlevelheader(MYFILE *f, INT32 num) else deh_warning("Level header %d: invalid unlockable number %d", num, i); } - else if (fastcmp(word, "LEVELSELECT")) - mapheaderinfo[num-1]->levelselect = (UINT8)i; else if (fastcmp(word, "SKYBOXSCALE")) mapheaderinfo[num-1]->skybox_scalex = mapheaderinfo[num-1]->skybox_scaley = mapheaderinfo[num-1]->skybox_scalez = (INT16)i; else if (fastcmp(word, "SKYBOXSCALEX")) @@ -1855,59 +1802,15 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->skybox_scaley = (INT16)i; else if (fastcmp(word, "SKYBOXSCALEZ")) mapheaderinfo[num-1]->skybox_scalez = (INT16)i; - - else if (fastcmp(word, "BONUSTYPE")) - { - if (fastcmp(word2, "NONE")) i = -1; - else if (fastcmp(word2, "NORMAL")) i = 0; - else if (fastcmp(word2, "BOSS")) i = 1; - else if (fastcmp(word2, "ERZ3")) i = 2; - else if (fastcmp(word2, "NIGHTS")) i = 3; - else if (fastcmp(word2, "NIGHTSLINK")) i = 4; - - if (i >= -1 && i <= 4) // -1 for no bonus. Max is 4. - mapheaderinfo[num-1]->bonustype = (SINT8)i; - else - deh_warning("Level header %d: invalid bonus type number %d", num, i); - } - - // Title card - else if (fastcmp(word, "TITLECARDZIGZAG")) - { - deh_strlcpy(mapheaderinfo[num-1]->ltzzpatch, word2, - sizeof(mapheaderinfo[num-1]->ltzzpatch), va("Level header %d: title card zigzag patch name", num)); - } - else if (fastcmp(word, "TITLECARDZIGZAGTEXT")) - { - deh_strlcpy(mapheaderinfo[num-1]->ltzztext, word2, - sizeof(mapheaderinfo[num-1]->ltzztext), va("Level header %d: title card zigzag text patch name", num)); - } - else if (fastcmp(word, "TITLECARDACTDIAMOND")) - { - deh_strlcpy(mapheaderinfo[num-1]->ltactdiamond, word2, - sizeof(mapheaderinfo[num-1]->ltactdiamond), va("Level header %d: title card act diamond patch name", num)); - } - - else if (fastcmp(word, "MAXBONUSLIVES")) - mapheaderinfo[num-1]->maxbonuslives = (SINT8)i; else if (fastcmp(word, "LEVELFLAGS")) mapheaderinfo[num-1]->levelflags = get_number(word2); else if (fastcmp(word, "MENUFLAGS")) mapheaderinfo[num-1]->menuflags = get_number(word2); - // SRB2Kart - /*else if (fastcmp(word, "AUTOMAP")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->automap = true; - else - mapheaderinfo[num-1]->automap = false; - }*/ else if (fastcmp(word, "MOBJSCALE")) mapheaderinfo[num-1]->mobj_scale = get_number(word2); else if (fastcmp(word, "DEFAULTWAYPOINTRADIUS")) mapheaderinfo[num-1]->default_waypoint_radius = get_number(word2); - // Individual triggers for level flags, for ease of use (and 2.0 compatibility) else if (fastcmp(word, "SCRIPTISFILE")) { @@ -1916,27 +1819,6 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_SCRIPTISFILE; } - else if (fastcmp(word, "SPEEDMUSIC")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->levelflags |= LF_SPEEDMUSIC; - else - mapheaderinfo[num-1]->levelflags &= ~LF_SPEEDMUSIC; - } - else if (fastcmp(word, "NOSSMUSIC")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->levelflags |= LF_NOSSMUSIC; - else - mapheaderinfo[num-1]->levelflags &= ~LF_NOSSMUSIC; - } - else if (fastcmp(word, "NORELOAD")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->levelflags |= LF_NORELOAD; - else - mapheaderinfo[num-1]->levelflags &= ~LF_NORELOAD; - } else if (fastcmp(word, "NOZONE")) { if (i || word2[0] == 'T' || word2[0] == 'Y') @@ -1950,51 +1832,6 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->levelflags |= LF_SECTIONRACE; else mapheaderinfo[num-1]->levelflags &= ~LF_SECTIONRACE; - else if (fastcmp(word, "SAVEGAME")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->levelflags |= LF_SAVEGAME; - else - mapheaderinfo[num-1]->levelflags &= ~LF_SAVEGAME; - } - else if (fastcmp(word, "MIXNIGHTSCOUNTDOWN")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->levelflags |= LF_MIXNIGHTSCOUNTDOWN; - else - mapheaderinfo[num-1]->levelflags &= ~LF_MIXNIGHTSCOUNTDOWN; - } - else if (fastcmp(word, "WARNINGTITLE")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->levelflags |= LF_WARNINGTITLE; - else - mapheaderinfo[num-1]->levelflags &= ~LF_WARNINGTITLE; - } - else if (fastcmp(word, "NOTITLECARD")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->levelflags |= LF_NOTITLECARD; - else - mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; - } - else if (fastcmp(word, "SHOWTITLECARDFOR")) - { - mapheaderinfo[num-1]->levelflags |= LF_NOTITLECARD; - tmp = strtok(word2,","); - do { - if (fastcmp(tmp, "FIRST")) - mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDFIRST; - else if (fastcmp(tmp, "RESPAWN")) - mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRESPAWN; - else if (fastcmp(tmp, "RECORDATTACK")) - mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRECORDATTACK; - else if (fastcmp(tmp, "ALL")) - mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; - else if (!fastcmp(tmp, "NONE")) - deh_warning("Level header %d: unknown titlecard show option %s\n", num, tmp); - - } while((tmp = strtok(NULL,",")) != NULL); } // Individual triggers for menu flags @@ -2012,40 +1849,20 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->menuflags &= ~LF2_HIDEINSTATS; } - else if (fastcmp(word, "RECORDATTACK") || fastcmp(word, "TIMEATTACK")) - { // TIMEATTACK is an accepted alias + else if (fastcmp(word, "TIMEATTACK") || fastcmp(word, "RECORDATTACK")) + { // RECORDATTACK is an accepted alias if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->menuflags |= LF2_RECORDATTACK; + mapheaderinfo[num-1]->menuflags |= LF2_TIMEATTACK; else - mapheaderinfo[num-1]->menuflags &= ~LF2_RECORDATTACK; + mapheaderinfo[num-1]->menuflags &= ~LF2_TIMEATTACK; } - else if (fastcmp(word, "NIGHTSATTACK")) + else if (fastcmp(word, "VISITNEEDED")) { if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->menuflags |= LF2_NIGHTSATTACK; + mapheaderinfo[num-1]->menuflags |= LF2_VISITNEEDED; else - mapheaderinfo[num-1]->menuflags &= LF2_NIGHTSATTACK; + mapheaderinfo[num-1]->menuflags &= ~LF2_VISITNEEDED; } - else if (fastcmp(word, "NOVISITNEEDED")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->menuflags |= LF2_NOVISITNEEDED; - else - mapheaderinfo[num-1]->menuflags &= ~LF2_NOVISITNEEDED; - } - else if (fastcmp(word, "WIDEICON")) - { - if (i || word2[0] == 'T' || word2[0] == 'Y') - mapheaderinfo[num-1]->menuflags |= LF2_WIDEICON; - else - mapheaderinfo[num-1]->menuflags &= ~LF2_WIDEICON; - } - else if (fastcmp(word, "STARTRINGS")) - mapheaderinfo[num-1]->startrings = (UINT16)i; - else if (fastcmp(word, "SPECIALSTAGETIME")) - mapheaderinfo[num-1]->sstimer = i; - else if (fastcmp(word, "SPECIALSTAGESPHERES")) - mapheaderinfo[num-1]->ssspheres = i; else if (fastcmp(word, "GRAVITY")) mapheaderinfo[num-1]->gravity = FLOAT_TO_FIXED(atof(word2)); else @@ -2992,8 +2809,6 @@ static actionpointer_t actionpointers[] = {{A_ThrownRing}, "A_THROWNRING"}, {{A_SetSolidSteam}, "A_SETSOLIDSTEAM"}, {{A_UnsetSolidSteam}, "A_UNSETSOLIDSTEAM"}, - {{A_SignSpin}, "A_SIGNSPIN"}, - {{A_SignPlayer}, "A_SIGNPLAYER"}, {{A_OverlayThink}, "A_OVERLAYTHINK"}, {{A_JetChase}, "A_JETCHASE"}, {{A_JetbThink}, "A_JETBTHINK"}, @@ -3483,20 +3298,10 @@ static void reademblemdata(MYFILE *f, INT32 num) { if (fastcmp(word2, "GLOBAL")) emblemlocations[num-1].type = ET_GLOBAL; - else if (fastcmp(word2, "SKIN")) - emblemlocations[num-1].type = ET_SKIN; - /*else if (fastcmp(word2, "SCORE")) - emblemlocations[num-1].type = ET_SCORE;*/ - else if (fastcmp(word2, "TIME")) - emblemlocations[num-1].type = ET_TIME; - /*else if (fastcmp(word2, "RINGS")) - emblemlocations[num-1].type = ET_RINGS; else if (fastcmp(word2, "MAP")) emblemlocations[num-1].type = ET_MAP; - else if (fastcmp(word2, "NGRADE")) - emblemlocations[num-1].type = ET_NGRADE; - else if (fastcmp(word2, "NTIME")) - emblemlocations[num-1].type = ET_NTIME;*/ + else if (fastcmp(word2, "TIME")) + emblemlocations[num-1].type = ET_TIME; else emblemlocations[num-1].type = (UINT8)value; } @@ -3537,23 +3342,13 @@ static void reademblemdata(MYFILE *f, INT32 num) // Default sprite and color definitions for lazy people like me if (!emblemlocations[num-1].sprite) switch (emblemlocations[num-1].type) { - /*case ET_RINGS: - emblemlocations[num-1].sprite = 'R'; break; - case ET_SCORE: case ET_NGRADE: - emblemlocations[num-1].sprite = 'S'; break;*/ - case ET_TIME: //case ET_NTIME: + case ET_TIME: emblemlocations[num-1].sprite = 'B'; break; default: emblemlocations[num-1].sprite = 'A'; break; } if (!emblemlocations[num-1].color) switch (emblemlocations[num-1].type) { - /*case ET_RINGS: - emblemlocations[num-1].color = SKINCOLOR_GOLD; break; - case ET_SCORE: - emblemlocations[num-1].color = SKINCOLOR_BROWN; break; - case ET_NGRADE: - emblemlocations[num-1].color = SKINCOLOR_TEAL; break;*/ case ET_TIME: //case ET_NTIME: emblemlocations[num-1].color = SKINCOLOR_GREY; break; default: @@ -3696,9 +3491,8 @@ static void readunlockable(MYFILE *f, INT32 num) else { strupr(word2); - if (fastcmp(word, "HEIGHT")) - unlockables[num].height = (UINT16)i; - else if (fastcmp(word, "CONDITIONSET")) + + if (fastcmp(word, "CONDITIONSET")) unlockables[num].conditionset = (UINT8)i; else if (fastcmp(word, "SHOWCONDITIONSET")) unlockables[num].showconditionset = (UINT8)i; @@ -3710,26 +3504,34 @@ static void readunlockable(MYFILE *f, INT32 num) { if (fastcmp(word2, "NONE")) unlockables[num].type = SECRET_NONE; + else if (fastcmp(word2, "HEADER")) + unlockables[num].type = SECRET_HEADER; + else if (fastcmp(word2, "SKIN")) + unlockables[num].type = SECRET_SKIN; + else if (fastcmp(word2, "WARP")) + unlockables[num].type = SECRET_WARP; + else if (fastcmp(word2, "LEVELSELECT")) + unlockables[num].type = SECRET_LEVELSELECT; + else if (fastcmp(word2, "TIMEATTACK")) + unlockables[num].type = SECRET_TIMEATTACK; + else if (fastcmp(word2, "BREAKTHECAPSULES")) + unlockables[num].type = SECRET_BREAKTHECAPSULES; + else if (fastcmp(word2, "SOUNDTEST")) + unlockables[num].type = SECRET_SOUNDTEST; + else if (fastcmp(word2, "CREDITS")) + unlockables[num].type = SECRET_CREDITS; else if (fastcmp(word2, "ITEMFINDER")) unlockables[num].type = SECRET_ITEMFINDER; else if (fastcmp(word2, "EMBLEMHINTS")) unlockables[num].type = SECRET_EMBLEMHINTS; + else if (fastcmp(word2, "ENCORE")) + unlockables[num].type = SECRET_ENCORE; + else if (fastcmp(word2, "HARDSPEED")) + unlockables[num].type = SECRET_HARDSPEED; + else if (fastcmp(word2, "HELLATTACK")) + unlockables[num].type = SECRET_HELLATTACK; else if (fastcmp(word2, "PANDORA")) unlockables[num].type = SECRET_PANDORA; - else if (fastcmp(word2, "CREDITS")) - unlockables[num].type = SECRET_CREDITS; - else if (fastcmp(word2, "RECORDATTACK")) - unlockables[num].type = SECRET_RECORDATTACK; - else if (fastcmp(word2, "NIGHTSMODE")) - unlockables[num].type = SECRET_NIGHTSMODE; - else if (fastcmp(word2, "HEADER")) - unlockables[num].type = SECRET_HEADER; - else if (fastcmp(word2, "LEVELSELECT")) - unlockables[num].type = SECRET_LEVELSELECT; - else if (fastcmp(word2, "WARP")) - unlockables[num].type = SECRET_WARP; - else if (fastcmp(word2, "SOUNDTEST")) - unlockables[num].type = SECRET_SOUNDTEST; else unlockables[num].type = (INT16)i; } @@ -4430,11 +4232,6 @@ static void readmaincfg(MYFILE *f) bootmap = (INT16)value; //titlechanged = true; } - else if (fastcmp(word, "STARTCHAR")) - { - startchar = (INT16)value; - char_on = -1; - } else if (fastcmp(word, "TUTORIALMAP")) { // Support using the actual map name, @@ -11137,19 +10934,13 @@ struct { // Level flags {"LF_SCRIPTISFILE",LF_SCRIPTISFILE}, - {"LF_SPEEDMUSIC",LF_SPEEDMUSIC}, - {"LF_NOSSMUSIC",LF_NOSSMUSIC}, - {"LF_NORELOAD",LF_NORELOAD}, {"LF_NOZONE",LF_NOZONE}, {"LF_SECTIONRACE",LF_SECTIONRACE}, - {"LF_SAVEGAME",LF_SAVEGAME}, // And map flags {"LF2_HIDEINMENU",LF2_HIDEINMENU}, {"LF2_HIDEINSTATS",LF2_HIDEINSTATS}, - {"LF2_RECORDATTACK",LF2_RECORDATTACK}, - {"LF2_NIGHTSATTACK",LF2_NIGHTSATTACK}, - {"LF2_NOVISITNEEDED",LF2_NOVISITNEEDED}, - {"LF2_WIDEICON",LF2_WIDEICON}, + {"LF2_TIMEATTACK",LF2_TIMEATTACK}, + {"LF2_VISITNEEDED",LF2_VISITNEEDED}, // Emeralds {"EMERALD1",EMERALD1}, @@ -11232,13 +11023,9 @@ struct { {"SF_X2AWAYSOUND",SF_X2AWAYSOUND}, // Global emblem var flags - {"GE_NIGHTSPULL",GE_NIGHTSPULL}, - {"GE_NIGHTSITEM",GE_NIGHTSITEM}, // Map emblem var flags - {"ME_ALLEMERALDS",ME_ALLEMERALDS}, - {"ME_ULTIMATE",ME_ULTIMATE}, - {"ME_PERFECT",ME_PERFECT}, + {"ME_ENCORE",ME_ENCORE}, // p_local.h constants {"FLOATSPEED",FLOATSPEED}, @@ -11700,7 +11487,7 @@ static playersprite_t get_sprite2(const char *word) if (!spr2names[i][4] && memcmp(word,spr2names[i],4)==0) return i; deh_warning("Couldn't find sprite named 'SPR2_%s'",word); - return SPR2_STND; + return SPR2_STIL; } static sfxenum_t get_sfx(const char *word) diff --git a/src/doomstat.h b/src/doomstat.h index fa946b8dc..63c0a38e3 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -404,6 +404,9 @@ typedef struct SINT8 musforcereset; ///< Force resetmusic (-1 for default; 0 for force off; 1 for force on) + // SRB2Kart: Keeps track of if a map lump exists, so we can tell when a map is being replaced. + boolean alreadyExists; + // Lua stuff. // (This is not ifdeffed so the map header structure can stay identical, just in case.) UINT8 numCustomOptions; ///< Internal. For Lua custom value support. @@ -412,26 +415,13 @@ typedef struct // level flags #define LF_SCRIPTISFILE (1<<0) ///< True if the script is a file, not a lump. -#define LF_SPEEDMUSIC (1<<1) ///< Speed up act music for super sneakers -#define LF_NOSSMUSIC (1<<2) ///< Disable Super Sonic music -#define LF_NORELOAD (1<<3) ///< Don't reload level on death -#define LF_NOZONE (1<<4) ///< Don't include "ZONE" on level title -#define LF_SECTIONRACE (1<<5) ///< Section race level -#define LF_MIXNIGHTSCOUNTDOWN (1<<6) ///< Play sfx_timeup instead of music change for NiGHTS countdown -#define LF_WARNINGTITLE (1<<7) ///< WARNING! WARNING! WARNING! WARNING! - -#define LF_NOTITLECARDFIRST (1<<8) -#define LF_NOTITLECARDRESPAWN (1<<9) -#define LF_NOTITLECARDRECORDATTACK (1<<10) -#define LF_NOTITLECARD (LF_NOTITLECARDFIRST|LF_NOTITLECARDRESPAWN|LF_NOTITLECARDRECORDATTACK) ///< Don't start the title card at all +#define LF_NOZONE (1<<1) ///< Don't include "ZONE" on level title +#define LF_SECTIONRACE (1<<2) ///< Section race level #define LF2_HIDEINMENU (1<<0) ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS (1<<1) ///< Hide in the statistics screen -#define LF2_RECORDATTACK (1<<2) ///< Show this map in Time Attack -#define LF2_NIGHTSATTACK (1<<3) ///< Show this map in NiGHTS mode menu -#define LF2_NOVISITNEEDED (1<<4) ///< Available in time attack/nights mode without visiting the level -#define LF2_WIDEICON (1<<5) ///< If you're in a circumstance where it fits, use a wide map icon -#define LF2_EXISTSHACK (1<<6) ///< Map lump exists; as noted, a single-bit hack that can be freely movable to other variables without concern. +#define LF2_TIMEATTACK (1<<2) ///< Show this map in Time Attack modes +#define LF2_VISITNEEDED (1<<3) ///< Not available in Time Attack modes until you visit the level extern mapheader_t* mapheaderinfo[NUMMAPS]; @@ -667,7 +657,6 @@ extern SINT8 pickedvote; extern UINT32 timesBeaten; // # of times the game has been beaten. extern UINT32 timesBeatenWithEmeralds; -//extern UINT32 timesBeatenUltimate; // =========================== // Internal parameters, fixed. diff --git a/src/f_finale.c b/src/f_finale.c index 3c82a2684..184129b0b 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -705,7 +705,7 @@ static const char *credits[] = { #define CREDITS_RIGHT ((BASEVIDWIDTH) - 8) static struct { - UINT32 x; + UINT32 x, y; const char *patch; UINT8 colorize; } credits_pics[] = { @@ -768,7 +768,6 @@ void F_StartCredits(void) void F_CreditDrawer(void) { UINT16 i; - INT16 zagpos = (timetonext - finalecount - animtimer) % 32; fixed_t y = (80<>1); //V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); @@ -1031,7 +1030,7 @@ void F_GameEvaluationDrawer(void) V_DrawFixedPatch(x, y, scale, 0, rockpat, colormap[0]); if (trans < 10) { - colormap[1] = R_GetTranslationColormap(TC_BLINK, SKINCOLOR_AQUA, GTC_CACHE); + colormap[1] = R_GetTranslationColormap(TC_BLINK, SKINCOLOR_AQUAMARINE, GTC_CACHE); V_DrawFixedPatch(x, y, scale, trans< INFLECTIONPOINT) diff --git a/src/g_demo.c b/src/g_demo.c index 0e6e60c50..71f23971e 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -2842,7 +2842,7 @@ void G_DoPlayDemo(char *defdemoname) demo_p += 4; // Extrainfo location // ...*map* not loaded? - if (!gamemap || (gamemap > NUMMAPS) || !mapheaderinfo[gamemap-1] || !(mapheaderinfo[gamemap-1]->menuflags & LF2_EXISTSHACK)) + if (!gamemap || (gamemap > NUMMAPS) || !mapheaderinfo[gamemap-1] || !(mapheaderinfo[gamemap-1]->alreadyExists == true)) { snprintf(msg, 1024, M_GetText("%s features a course that is not currently loaded.\n"), pdemoname); CONS_Alert(CONS_ERROR, "%s", msg); diff --git a/src/g_game.c b/src/g_game.c index 3198ae665..395a49410 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2074,9 +2074,9 @@ static inline void G_PlayerFinishLevel(INT32 player) if (legitimateexit && !demo.playback && !mapreset) // (yes you're allowed to unlock stuff this way when the game is modified) { matchesplayed++; - if (M_UpdateUnlockablesAndExtraEmblems(true)) + if (M_UpdateUnlockablesAndExtraEmblems()) S_StartSound(NULL, sfx_ncitem); - G_SaveGameData(true); + G_SaveGameData(); } legitimateexit = false; @@ -3424,20 +3424,8 @@ static void G_UpdateVisited(void) static boolean CanSaveLevel(INT32 mapnum) { - // You can never save in a special stage. - if (G_IsSpecialStage(mapnum)) - return false; - - // If the game is complete for this save slot, then any level can save! - if (gamecomplete) - return true; - - // Be kind with Marathon Mode live event backups. - if (marathonmode) - return true; - - // Any levels that have the savegame flag can save normally. - return (mapheaderinfo[mapnum-1] && (mapheaderinfo[mapnum-1]->levelflags & LF_SAVEGAME)); + // SRB2Kart: + return false; } static void G_HandleSaveLevel(void) @@ -4042,8 +4030,6 @@ void G_SaveGameData(boolean force) INT32 i, j; UINT8 btemp; - //INT32 curmare; - if (!gamedataloaded) return; // If never loaded (-nodata), don't save @@ -4054,13 +4040,6 @@ void G_SaveGameData(boolean force) return; } - if (majormods && !force) - { - free(savebuffer); - save_p = savebuffer = NULL; - return; - } - // Version test WRITEUINT32(save_p, 0xFCAFE211); @@ -4113,7 +4092,6 @@ void G_SaveGameData(boolean force) WRITEUINT32(save_p, timesBeaten); WRITEUINT32(save_p, timesBeatenWithEmeralds); - //WRITEUINT32(save_p, timesBeatenUltimate); // Main records for (i = 0; i < NUMMAPS; i++) @@ -4122,8 +4100,6 @@ void G_SaveGameData(boolean force) { WRITEUINT32(save_p, mainrecords[i]->time); WRITEUINT32(save_p, mainrecords[i]->lap); - //WRITEUINT32(save_p, mainrecords[i]->score); - //WRITEUINT16(save_p, mainrecords[i]->rings); } else { @@ -4133,25 +4109,6 @@ void G_SaveGameData(boolean force) WRITEUINT8(save_p, 0); // compat } - // NiGHTS records - /*for (i = 0; i < NUMMAPS; i++) - { - if (!nightsrecords[i] || !nightsrecords[i]->nummares) - { - WRITEUINT8(save_p, 0); - continue; - } - - WRITEUINT8(save_p, nightsrecords[i]->nummares); - - for (curmare = 0; curmare < (nightsrecords[i]->nummares + 1); ++curmare) - { - WRITEUINT32(save_p, nightsrecords[i]->score[curmare]); - WRITEUINT8(save_p, nightsrecords[i]->grade[curmare]); - WRITEUINT32(save_p, nightsrecords[i]->time[curmare]); - } - }*/ - length = save_p - savebuffer; FIL_WriteFile(va(pandf, srb2home, gamedatafilename), savebuffer, length); diff --git a/src/g_game.h b/src/g_game.h index d5372356d..0473afa47 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -170,7 +170,7 @@ boolean G_IsTitleCardAvailable(void); // Can be called by the startup code or M_Responder, calls P_SetupLevel. void G_LoadGame(UINT32 slot, INT16 mapoverride); -void G_SaveGameData(boolean force); +void G_SaveGameData(void); void G_SaveGame(UINT32 slot, INT16 mapnum); diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index 9b4b1d984..32c2d550d 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -9,7 +9,7 @@ //----------------------------------------------------------------------------- /// \file hw_light.c /// \brief Corona/Dynamic/Static lighting add on by Hurdler -/// !!! Under construction !!!\ +/// !!! Under construction !!! #include "../doomdef.h" diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 515b88b3e..d1106749e 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1162,7 +1162,7 @@ static UINT8 HWR_GetModelSprite2(md2_t *md2, skin_t *skin, UINT8 spr2, player_t return 0; while (!md2->model->spr2frames[spr2].numframes - && spr2 != SPR2_STND + && spr2 != SPR2_STIL && ++i != 32) // recursion limiter { if (spr2 & FF_SPR2SUPER) diff --git a/src/info.c b/src/info.c index b7e698088..08f29d725 100644 --- a/src/info.c +++ b/src/info.c @@ -1564,7 +1564,7 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 1, {A_BossScream}, 0, 0, S_CYBRAKDEMONVILEEXPLOSION1}, //S_CYBRAKDEMONVILEEXPLOSION3, // Metal Sonic - {SPR_PLAY, SPR2_STND, -1, {NULL}, 0, 0, S_METALSONIC_RACE}, // S_METALSONIC_RACE + {SPR_PLAY, SPR2_STIL, -1, {NULL}, 0, 0, S_METALSONIC_RACE}, // S_METALSONIC_RACE {SPR_METL, 4, -1, {NULL}, 0, 0, S_NULL}, // S_METALSONIC_FLOAT {SPR_METL, 16|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_METALSONIC_STUN}, // S_METALSONIC_VECTOR diff --git a/src/k_pwrlv.c b/src/k_pwrlv.c index 363600718..405bc4743 100644 --- a/src/k_pwrlv.c +++ b/src/k_pwrlv.c @@ -327,8 +327,8 @@ void K_PlayerForfeit(UINT8 playernum, boolean pointloss) if (playernum == consoleplayer) { vspowerlevel[powertype] = clientpowerlevels[playernum][powertype]; - if (M_UpdateUnlockablesAndExtraEmblems(true)) + if (M_UpdateUnlockablesAndExtraEmblems()) S_StartSound(NULL, sfx_ncitem); - G_SaveGameData(true); // save your punishment! + G_SaveGameData(); // save your punishment! } } diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index b192f83f2..9b5656db3 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -578,10 +578,10 @@ static int libd_getSprite2Patch(lua_State *L) lua_remove(L, 1); // remove skin now - if (lua_isnumber(L, 1)) // sprite number given, e.g. SPR2_STND + if (lua_isnumber(L, 1)) // sprite number given, e.g. SPR2_STIL { j = lua_tonumber(L, 1); - if (j & FF_SPR2SUPER) // e.g. SPR2_STND|FF_SPR2SUPER + if (j & FF_SPR2SUPER) // e.g. SPR2_STIL|FF_SPR2SUPER { super = true; j &= ~FF_SPR2SUPER; // remove flag so the next check doesn't fail diff --git a/src/m_cheat.c b/src/m_cheat.c index 577865ada..2ed257e6f 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -97,7 +97,7 @@ static UINT8 cheatf_warp(void) if (success) { - G_SaveGameData(true); //G_SetGameModified(false); + G_SaveGameData(); //G_SetGameModified(false); S_StartSound(0, sfx_kc42); } diff --git a/src/m_cond.c b/src/m_cond.c index b42a882e9..7b93d46b0 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -180,15 +180,12 @@ void M_CheckUnlockConditions(void) } } -UINT8 M_UpdateUnlockablesAndExtraEmblems(boolean force) +UINT8 M_UpdateUnlockablesAndExtraEmblems(void) { INT32 i; char cechoText[992] = ""; UINT8 cechoLines = 0; - if (majormods && !force) // SRB2Kart: for enabling unlocks online in modified servers - return false; - M_CheckUnlockConditions(); // Go through extra emblems @@ -425,24 +422,6 @@ UINT8 M_GotEnoughEmblems(INT32 number) return false; } -/*UINT8 M_GotHighEnoughScore(INT32 tscore) -{ - INT32 mscore = 0; - INT32 i; - - for (i = 0; i < NUMMAPS; ++i) - { - if (!mapheaderinfo[i] || !(mapheaderinfo[i]->menuflags & LF2_RECORDATTACK)) - continue; - if (!mainrecords[i]) - continue; - - if ((mscore += mainrecords[i]->score) > tscore) - return true; - } - return false; -}*/ - UINT8 M_GotLowEnoughTime(INT32 tictime) { INT32 curtics = 0; @@ -450,7 +429,7 @@ UINT8 M_GotLowEnoughTime(INT32 tictime) for (i = 0; i < NUMMAPS; ++i) { - if (!mapheaderinfo[i] || !(mapheaderinfo[i]->menuflags & LF2_RECORDATTACK)) + if (!mapheaderinfo[i] || !(mapheaderinfo[i]->menuflags & LF2_TIMEATTACK)) continue; if (!mainrecords[i] || !mainrecords[i]->time) @@ -461,24 +440,6 @@ UINT8 M_GotLowEnoughTime(INT32 tictime) return true; } -/*UINT8 M_GotHighEnoughRings(INT32 trings) -{ - INT32 mrings = 0; - INT32 i; - - for (i = 0; i < NUMMAPS; ++i) - { - if (!mapheaderinfo[i] || !(mapheaderinfo[i]->menuflags & LF2_RECORDATTACK)) - continue; - if (!mainrecords[i]) - continue; - - if ((mrings += mainrecords[i]->rings) > trings) - return true; - } - return false; -}*/ - // ---------------- // Misc Emblem shit // ---------------- diff --git a/src/m_cond.h b/src/m_cond.h index b4d493995..44e74d518 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -153,7 +153,7 @@ void M_ClearSecrets(void); // Updating conditions and unlockables void M_CheckUnlockConditions(void); UINT8 M_CheckCondition(condition_t *cn); -UINT8 M_UpdateUnlockablesAndExtraEmblems(boolean force); +UINT8 M_UpdateUnlockablesAndExtraEmblems(void); void M_SilentUpdateUnlockablesAndEmblems(void); UINT8 M_CheckLevelEmblems(void); UINT8 M_CompletionEmblems(void); diff --git a/src/m_menu.c b/src/m_menu.c index 06e54c01c..0a0159e6a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4326,8 +4326,8 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt) return true;*/ case LLM_TIMEATTACK: case LLM_BREAKTHECAPSULES: - /*if (!(mapheaderinfo[mapnum]->menuflags & LF2_RECORDATTACK)) - return false;*/ + if (!(mapheaderinfo[mapnum]->menuflags & LF2_TIMEATTACK)) + return false; if ((levellistmode == LLM_TIMEATTACK && !(mapheaderinfo[mapnum]->typeoflevel & TOL_RACE)) || (levellistmode == LLM_BREAKTHECAPSULES && !(mapheaderinfo[mapnum]->typeoflevel & TOL_BATTLE))) @@ -4342,11 +4342,8 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt) if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU) return false; // map hell - /*if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED) - return true; - - if (!mapvisited[mapnum]) - return false;*/ + if ((mapheaderinfo[mapnum]->menuflags & LF2_VISITNEEDED) && !mapvisited[mapnum]) + return false; return true; default: diff --git a/src/p_inter.c b/src/p_inter.c index 6cd246c95..e82aae171 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -564,8 +564,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; emblemlocations[special->health-1].collected = true; - M_UpdateUnlockablesAndExtraEmblems(false); - G_SaveGameData(false); + M_UpdateUnlockablesAndExtraEmblems(); + G_SaveGameData(); break; } diff --git a/src/p_mobj.c b/src/p_mobj.c index e568eea61..ada8c8053 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12229,7 +12229,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->flags2 |= MF2_INVERTAIMABLE; break; case MT_FLICKY_08: - mobj->color = (P_RandomChance(FRACUNIT/2) ? SKINCOLOR_RED : SKINCOLOR_AQUA); + mobj->color = (P_RandomChance(FRACUNIT/2) ? SKINCOLOR_RED : SKINCOLOR_AQUAMARINE); break; case MT_BALLOON: mobj->color = SKINCOLOR_RED; diff --git a/src/p_setup.c b/src/p_setup.c index 0e0f1f843..b83698f16 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -343,7 +343,8 @@ void P_DeleteFlickies(INT16 i) static void P_ClearSingleMapHeaderInfo(INT16 i) { const INT16 num = (INT16)(i-1); - INT32 exists = (mapheaderinfo[num]->menuflags & LF2_EXISTSHACK); + + boolean exists = (mapheaderinfo[gamemap-1]->alreadyExists == true); mapheaderinfo[num]->lvlttl[0] = '\0'; mapheaderinfo[num]->selectheading[0] = '\0'; @@ -393,7 +394,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) mapheaderinfo[num]->bonustype = 0; mapheaderinfo[num]->maxbonuslives = -1; mapheaderinfo[num]->levelflags = 0; - mapheaderinfo[num]->menuflags = exists; // see p_setup.c - prevents replacing maps in addons with easier versions + mapheaderinfo[num]->menuflags = 0; mapheaderinfo[num]->mobj_scale = FRACUNIT; mapheaderinfo[num]->default_waypoint_radius = 0; #if 1 // equivalent to "FlickyList = DEMO" @@ -402,6 +403,10 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) P_DeleteFlickies(num); #endif P_DeleteGrades(num); + + // see p_setup.c - prevents replacing maps in addons with different versions + mapheaderinfo[num]->alreadyExists = exists; + mapheaderinfo[num]->customopts = NULL; mapheaderinfo[num]->numCustomOptions = 0; } @@ -4546,9 +4551,12 @@ boolean P_AddWadFile(const char *wadfilename) // we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant if (num <= NUMMAPS && mapheaderinfo[num-1]) { - if (mapheaderinfo[num-1]->menuflags & LF2_EXISTSHACK) + if (mapheaderinfo[num - 1]->alreadyExists != false) + { G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you - mapheaderinfo[num-1]->menuflags |= LF2_EXISTSHACK; + } + + mapheaderinfo[num - 1]->alreadyExists = true; } //If you replaced the map you're on, end the level when done. diff --git a/src/p_spec.c b/src/p_spec.c index e244d2bd1..165a48679 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3113,7 +3113,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) unlocktriggers |= 1 << trigid; // Unlocked something? - if (M_UpdateUnlockablesAndExtraEmblems(false)) + if (M_UpdateUnlockablesAndExtraEmblems()) { S_StartSound(NULL, sfx_s3k68); G_SaveGameData(); // only save if unlocked something diff --git a/src/r_defs.h b/src/r_defs.h index c2685e431..e3f422f80 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -499,6 +499,31 @@ typedef struct mprecipsecnode_s boolean visited; // used in search algorithms } mprecipsecnode_t; +// for now, only used in hardware mode +// maybe later for software as well? +// that's why it's moved here +typedef struct light_s +{ + UINT16 type; // light,... (cfr #define in hwr_light.c) + + float light_xoffset; + float light_yoffset; // y offset to adjust corona's height + + UINT32 corona_color; // color of the light for static lighting + float corona_radius; // radius of the coronas + + UINT32 dynamic_color; // color of the light for dynamic lighting + float dynamic_radius; // radius of the light ball + float dynamic_sqrradius; // radius^2 of the light ball +} light_t; + +typedef struct lightmap_s +{ + float s[2], t[2]; + light_t *light; + struct lightmap_s *next; +} lightmap_t; + // // The lineseg. // diff --git a/src/r_skins.c b/src/r_skins.c index 29d372a0a..61cd1a1a1 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -62,7 +62,7 @@ UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player) return 0; while (!skin->sprites[spr2].numframes - && spr2 != SPR2_STND + && spr2 != SPR2_STIL && ++i < 32) // recursion limiter { if (spr2 & FF_SPR2SUPER) diff --git a/src/y_inter.c b/src/y_inter.c index 95e2f7f99..ec70bafb7 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -962,11 +962,11 @@ static void Y_UpdateRecordReplays(void) if ((earnedEmblems = M_CheckLevelEmblems())) CONS_Printf(M_GetText("\x82" "Earned %hu medal%s for Record Attack records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); - if (M_UpdateUnlockablesAndExtraEmblems(false)) + if (M_UpdateUnlockablesAndExtraEmblems()) S_StartSound(NULL, sfx_ncitem); // SRB2Kart - save here so you NEVER lose your earned times/medals. - G_SaveGameData(false); + G_SaveGameData(); // Update timeattack menu's replay availability. CV_AddValue(&cv_nextmap, 1); @@ -1117,9 +1117,9 @@ static void K_UpdatePowerLevels(void) { CONS_Debug(DBG_GAMELOGIC, "Player %d is you! Saving...\n", i); vspowerlevel[powertype] = clientpowerlevels[i][powertype]; - if (M_UpdateUnlockablesAndExtraEmblems(true)) + if (M_UpdateUnlockablesAndExtraEmblems()) S_StartSound(NULL, sfx_ncitem); - G_SaveGameData(true); + G_SaveGameData(); } } }