From e9a8c2d21ae362ea08b1d26857eaba0201f16675 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Sun, 19 Jan 2020 14:30:05 -0300 Subject: [PATCH 01/21] No more losing lives when finished --- src/p_inter.c | 3 ++- src/st_stuff.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 71dcd70a1..5e1f7345c 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2527,7 +2527,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget else if (!target->player->bot && !target->player->spectator && (target->player->lives != INFLIVES) && G_GametypeUsesLives()) { - target->player->lives -= 1; // Lose a life Tails 03-11-2000 + if (!(target->player->pflags & PF_FINISHED)) + target->player->lives -= 1; // Lose a life Tails 03-11-2000 if (target->player->lives <= 0) // Tails 03-14-2000 { diff --git a/src/st_stuff.c b/src/st_stuff.c index 4676506fc..9c9c80164 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -944,7 +944,7 @@ static void ST_drawLivesArea(void) '\x16' | 0x80 | hudinfo[HUD_LIVES].f|V_PERPLAYER|V_HUDTRANS, false); else { - if (stplyr->playerstate == PST_DEAD && !(stplyr->spectator) && (livescount || stplyr->deadtimer < (TICRATE<<1))) + if (stplyr->playerstate == PST_DEAD && !(stplyr->spectator) && (livescount || stplyr->deadtimer < (TICRATE<<1)) && !(stplyr->pflags & PF_FINISHED)) livescount++; if (livescount > 99) livescount = 99; From 9e4c519cad14c7d913da97dc3c23788b32729f35 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Sun, 19 Jan 2020 19:02:03 -0300 Subject: [PATCH 02/21] In-map visual indicator --- src/d_netcmd.c | 12 +++++++++--- src/dehacked.c | 4 ++++ src/hardware/hw_light.c | 1 + src/info.c | 33 ++++++++++++++++++++++++++++++++- src/info.h | 5 +++++ src/p_local.h | 1 + src/p_mobj.c | 29 +++++++++++++++++++++++++++++ src/p_user.c | 27 +++++++++++++++++++++++++++ 8 files changed, 108 insertions(+), 4 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a597bad83..058c95196 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3736,9 +3736,15 @@ static void ExitMove_OnChange(void) if (cv_exitmove.value) { for (i = 0; i < MAXPLAYERS; ++i) - if (playeringame[i] && players[i].mo - && players[i].mo->target && players[i].mo->target->type == MT_SIGN) - P_SetTarget(&players[i].mo->target, NULL); + if (playeringame[i] && players[i].mo) + { + if (players[i].mo->target && players[i].mo->target->type == MT_SIGN) + P_SetTarget(&players[i].mo->target, NULL); + + if (players[i].pflags & PF_FINISHED) + P_GiveFinishFlags(&players[i]); + } + CONS_Printf(M_GetText("Players can now move after completing the level.\n")); } else diff --git a/src/dehacked.c b/src/dehacked.c index 082adda24..b85133b79 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7482,6 +7482,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // Got Flag Sign "S_GOTFLAG", + + // Finish flag + "S_FINISHFLAG", "S_CORK", "S_LHRT", @@ -8601,6 +8604,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_LOCKONINF", // In-level Target "MT_TAG", // Tag Sign "MT_GOTFLAG", // Got Flag sign + "MT_FINISHFLAG", // Finish flag // Ambient Sounds "MT_AWATERA", // Ambient Water Sound 1 diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index 8545a88b3..c5af8d6d3 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -509,6 +509,7 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_LCKN &lspr[NOLIGHT], // SPR_TTAG &lspr[NOLIGHT], // SPR_GFLG + &lspr[NOLIGHT], // SPR_FNSF &lspr[NOLIGHT], // SPR_CORK &lspr[NOLIGHT], // SPR_LHRT diff --git a/src/info.c b/src/info.c index de6ff475c..2947cd624 100644 --- a/src/info.c +++ b/src/info.c @@ -407,6 +407,7 @@ char sprnames[NUMSPRITES + 1][5] = "LCKN", // Target "TTAG", // Tag Sign "GFLG", // Got Flag sign + "FNSF", // Finish flag "CORK", "LHRT", @@ -3348,7 +3349,10 @@ state_t states[NUMSTATES] = {SPR_TTAG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_TTAG // CTF Sign - {SPR_GFLG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG + {SPR_GFLG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG + + // Finish flag + {SPR_FNSF, FF_TRANS30, -1, {NULL}, 0, 0, S_NULL}, // S_FINISHFLAG {SPR_CORK, 0, -1, {NULL}, 0, 0, S_NULL}, // S_CORK {SPR_LHRT, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_LHRT @@ -17994,6 +17998,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, + + { // MT_FINISHFLAG + -1, // doomednum + S_FINISHFLAG, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 4*FRACUNIT, // speed + 8*FRACUNIT, // radius + 8*FRACUNIT, // height + 1, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, // ambient water 1a (large) { // MT_AWATERA diff --git a/src/info.h b/src/info.h index 628335635..b2754fd51 100644 --- a/src/info.h +++ b/src/info.h @@ -670,6 +670,7 @@ typedef enum sprite SPR_LCKN, // Target SPR_TTAG, // Tag Sign SPR_GFLG, // Got Flag sign + SPR_FNSF, // Finish flag SPR_CORK, SPR_LHRT, @@ -3484,6 +3485,9 @@ typedef enum state // Got Flag Sign S_GOTFLAG, + + // Finish flag + S_FINISHFLAG, S_CORK, S_LHRT, @@ -4625,6 +4629,7 @@ typedef enum mobj_type MT_LOCKONINF, // In-level Target MT_TAG, // Tag Sign MT_GOTFLAG, // Got Flag sign + MT_FINISHFLAG, // Finish flag // Ambient Sounds MT_AWATERA, // Ambient Water Sound 1 diff --git a/src/p_local.h b/src/p_local.h index a5f3d313c..888fba5ce 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -159,6 +159,7 @@ void P_GivePlayerLives(player_t *player, INT32 numlives); void P_GiveCoopLives(player_t *player, INT32 numlives, boolean sound); UINT8 P_GetNextEmerald(void); void P_GiveEmerald(boolean spawnObj); +void P_GiveFinishFlags(player_t *player); #if 0 void P_ResetScore(player_t *player); #else diff --git a/src/p_mobj.c b/src/p_mobj.c index a8599ceb5..f53f2a7d5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8006,6 +8006,32 @@ static void P_MobjSceneryThink(mobj_t *mobj) if (strength < 10) mobj->frame |= ((10 - strength) << (FF_TRANSSHIFT)); } + case MT_FINISHFLAG: + { + if (!mobj->target || mobj->target->player->playerstate == PST_DEAD || !cv_exitmove.value) + { + P_RemoveMobj(mobj); + return; + } + + if (!camera.chase) + mobj->flags2 |= MF2_DONTDRAW; + else + mobj->flags2 &= ~MF2_DONTDRAW; + + fixed_t radius = FixedMul(10*mobj->info->speed, mobj->target->scale); + mobj->angle += FixedAngle(mobj->info->speed); + angle_t fa = mobj->angle >> ANGLETOFINESHIFT; + + P_UnsetThingPosition(mobj); + + mobj->x = mobj->target->x + FixedMul(FINECOSINE(fa),radius); + mobj->y = mobj->target->y + FixedMul(FINESINE(fa),radius); + mobj->z = mobj->target->z + mobj->target->height/2; + + P_SetThingPosition(mobj); + P_SetScale(mobj, mobj->target->scale); + } /* FALLTHRU */ default: if (mobj->fuse) @@ -11512,6 +11538,9 @@ void P_AfterPlayerSpawn(INT32 playernum) if (CheckForReverseGravity) P_CheckGravity(mobj, false); + + if (p->pflags & PF_FINISHED) + P_GiveFinishFlags(p); } // spawn it at a playerspawn mapthing diff --git a/src/p_user.c b/src/p_user.c index a1df8a58b..38f7f2719 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -370,6 +370,32 @@ void P_GiveEmerald(boolean spawnObj) } } +// +// P_GiveFinishFlags +// +// Give the player visual indicators +// that they've finished the map. +// +void P_GiveFinishFlags(player_t *player) +{ + if (!player->mo) + return; + + angle_t angle = FixedAngle(player->mo->angle << FRACBITS); + + for (UINT8 i = 0; i < 3; i++) + { + angle_t fa = (angle >> ANGLETOFINESHIFT) & FINEMASK; + fixed_t xoffs = FINECOSINE(fa); + fixed_t yoffs = FINESINE(fa); + mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG); + flag->angle = angle; + angle += FixedAngle(120*FRACUNIT); + + P_SetTarget(&flag->target, player->mo); + } +} + #if 0 // // P_ResetScore @@ -2171,6 +2197,7 @@ void P_DoPlayerFinish(player_t *player) return; player->pflags |= PF_FINISHED; + P_GiveFinishFlags(player); if (netgame) CONS_Printf(M_GetText("%s has completed the level.\n"), player_names[player-players]); From db22d503a4e6931a4773146ca95d9f3e11f58504 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Sun, 19 Jan 2020 21:55:08 -0300 Subject: [PATCH 03/21] HUD visual indicator + property fix --- src/info.c | 2 +- src/st_stuff.c | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index 2947cd624..1ca68eda6 100644 --- a/src/info.c +++ b/src/info.c @@ -18022,7 +18022,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, diff --git a/src/st_stuff.c b/src/st_stuff.c index 9c9c80164..d7e050b5b 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -128,6 +128,7 @@ static patch_t *minus5sec; static patch_t *minicaps; static patch_t *gotrflag; static patch_t *gotbflag; +static patch_t *fnshico; static boolean facefreed[MAXPLAYERS]; @@ -310,6 +311,7 @@ void ST_LoadGraphics(void) bmatcico = W_CachePatchName("BMATCICO", PU_HUDGFX); gotrflag = W_CachePatchName("GOTRFLAG", PU_HUDGFX); gotbflag = W_CachePatchName("GOTBFLAG", PU_HUDGFX); + fnshico = W_CachePatchName("FNSHICO", PU_HUDGFX); nonicon = W_CachePatchName("NONICON", PU_HUDGFX); nonicon2 = W_CachePatchName("NONICON2", PU_HUDGFX); @@ -1432,7 +1434,7 @@ static void ST_drawPowerupHUD(void) UINT16 invulntime = 0; INT32 offs = hudinfo[HUD_POWERUPS].x; const UINT8 q = ((splitscreen && stplyr == &players[secondarydisplayplayer]) ? 1 : 0); - static INT32 flagoffs[2] = {0, 0}, shieldoffs[2] = {0, 0}; + static INT32 flagoffs[2] = {0, 0}, shieldoffs[2] = {0, 0}, finishoffs[2] = {0, 0}; #define ICONSEP (16+4) // matches weapon rings HUD if (F_GetPromptHideHud(hudinfo[HUD_POWERUPS].y)) @@ -1440,6 +1442,26 @@ static void ST_drawPowerupHUD(void) if (stplyr->spectator || stplyr->playerstate != PST_LIVE) return; + +// --------- +// Finish icon +// --------- + + // Let's have a power-like icon to represent finishing the level! + if (stplyr->pflags & PF_FINISHED && cv_exitmove.value) + { + finishoffs[q] = ICONSEP; + V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, fnshico); + } + else if (finishoffs[q]) + { + if (finishoffs[q] > 1) + finishoffs[q] = 2*finishoffs[q]/3; + else + finishoffs[q] = 0; + } + + offs -= finishoffs[q]; // ------- // Shields From 697dbd58e737a2c1e9aea896724e0954a58bf280 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Sun, 19 Jan 2020 21:56:53 -0300 Subject: [PATCH 04/21] Turn cv_exitmove on by default --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 058c95196..36db4008c 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -370,7 +370,7 @@ consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, N static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "1/4"}, {2, "Half"}, {3, "3/4"}, {4, "All"}, {0, NULL}}; consvar_t cv_playersforexit = {"playersforexit", "All", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_exitmove = {"exitmove", "Off", CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_exitmove = {"exitmove", "On", CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; From fed000b724296fbd3c5b771c0e2a2a182e975d4f Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Sun, 19 Jan 2020 23:18:49 -0300 Subject: [PATCH 05/21] Remove Tails pick-up lock --- src/p_map.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index 40fee7b46..3f0ea61ee 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -591,9 +591,12 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails) if (!(tails->pflags & PF_CANCARRY)) return; - + +#if 0 + // To prevent finished players from being thrown into pits. Not that it matters much if (sonic->pflags & PF_FINISHED) return; +#endif if ((sonic->mo->eflags & MFE_VERTICALFLIP) != (tails->mo->eflags & MFE_VERTICALFLIP)) return; // Both should be in same gravity From 431206ebee42371edb72d0b45de25177d4938f47 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Mon, 20 Jan 2020 10:04:44 -0300 Subject: [PATCH 06/21] Die --- src/p_map.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 3f0ea61ee..1c2b4808b 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -591,12 +591,6 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails) if (!(tails->pflags & PF_CANCARRY)) return; - -#if 0 - // To prevent finished players from being thrown into pits. Not that it matters much - if (sonic->pflags & PF_FINISHED) - return; -#endif if ((sonic->mo->eflags & MFE_VERTICALFLIP) != (tails->mo->eflags & MFE_VERTICALFLIP)) return; // Both should be in same gravity From 57492347ed080821711b52d31580298edf56d3ad Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 1 Feb 2020 19:32:08 -0800 Subject: [PATCH 07/21] Don't I_Error on startup files only if a file was added twice --- src/d_main.c | 7 +------ src/p_setup.c | 3 +-- src/w_wad.c | 40 +++++++++++++++++++++++----------------- src/w_wad.h | 7 +++---- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 32972c151..5128e0cdf 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1205,12 +1205,7 @@ void D_SRB2Main(void) // load wad, including the main wad file CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n"); - if (!W_InitMultipleFiles(startupwadfiles, mainwads)) -#ifdef _DEBUG - CONS_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n"); -#else - I_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n"); -#endif + W_InitMultipleFiles(startupwadfiles, mainwads); D_CleanFile(); #ifndef DEVELOP // md5s last updated 06/12/19 (ddmmyy) diff --git a/src/p_setup.c b/src/p_setup.c index 132684163..d7a75c3e0 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3393,10 +3393,9 @@ boolean P_AddWadFile(const char *wadfilename) // UINT16 mapPos, mapNum = 0; // Init file. - if ((numlumps = W_InitFile(wadfilename, false)) == INT16_MAX) + if ((numlumps = W_InitFile(wadfilename, false, false)) == INT16_MAX) { refreshdirmenu |= REFRESHDIR_NOTLOADED; - CONS_Printf(M_GetText("Errors occurred while loading %s; not added.\n"), wadfilename); return false; } else diff --git a/src/w_wad.c b/src/w_wad.c index cfd2db50e..a2d8696cf 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -637,6 +637,21 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) return lumpinfo; } +static UINT16 W_InitFileError (const char *filename, boolean exitworthy) +{ + if (exitworthy) + { +#ifdef _DEBUG + CONS_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n"); +#else + I_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n"); +#endif + } + else + CONS_Printf(M_GetText("Errors occurred while loading %s; not added.\n"), filename); + return INT16_MAX; +} + // Allocate a wadfile, setup the lumpinfo (directory) and // lumpcache, add the wadfile to the current active wadfiles // @@ -648,7 +663,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) // // Can now load dehacked files (.soc) // -UINT16 W_InitFile(const char *filename, boolean mainfile) +UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup) { FILE *handle; lumpinfo_t *lumpinfo = NULL; @@ -681,12 +696,12 @@ UINT16 W_InitFile(const char *filename, boolean mainfile) { CONS_Alert(CONS_ERROR, M_GetText("Maximum wad files reached\n")); refreshdirmenu |= REFRESHDIR_MAX; - return INT16_MAX; + return W_InitFileError(filename, startup); } // open wad file if ((handle = W_OpenWadFile(&filename, true)) == NULL) - return INT16_MAX; + return W_InitFileError(filename, startup); // Check if wad files will overflow fileneededbuffer. Only the filename part // is send in the packet; cf. @@ -701,7 +716,7 @@ UINT16 W_InitFile(const char *filename, boolean mainfile) refreshdirmenu |= REFRESHDIR_MAX; if (handle) fclose(handle); - return INT16_MAX; + return W_InitFileError(filename, startup); } packetsizetally = packetsize; @@ -722,7 +737,7 @@ UINT16 W_InitFile(const char *filename, boolean mainfile) CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), filename); if (handle) fclose(handle); - return INT16_MAX; + return W_InitFileError(filename, false); } } #endif @@ -750,7 +765,7 @@ UINT16 W_InitFile(const char *filename, boolean mainfile) if (lumpinfo == NULL) { fclose(handle); - return INT16_MAX; + return W_InitFileError(filename, startup); } // @@ -822,10 +837,8 @@ UINT16 W_InitFile(const char *filename, boolean mainfile) * backwards, so a later file overrides all earlier ones. * * \param filenames A null-terminated list of files to use. - * \return 1 if base files were loaded, 0 if at least one was missing or - * invalid. */ -INT32 W_InitMultipleFiles(char **filenames, UINT16 mainfiles) +void W_InitMultipleFiles(char **filenames, UINT16 mainfiles) { // open all the files, load headers, and count lumps numwadfiles = 0; @@ -834,15 +847,8 @@ INT32 W_InitMultipleFiles(char **filenames, UINT16 mainfiles) for (; *filenames; filenames++) { //CONS_Debug(DBG_SETUP, "Loading %s\n", *filenames); - if (W_InitFile(*filenames, numwadfiles < mainfiles) == INT16_MAX) - { - CONS_Printf(M_GetText("Errors occurred while loading %s; not added.\n"), *filenames); - if (numwadfiles < mainfiles) - return 0; - } + W_InitFile(*filenames, numwadfiles < mainfiles, true); } - - return 1; } /** Make sure a lump number is valid. diff --git a/src/w_wad.h b/src/w_wad.h index 0a0da7681..eaab6f74b 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -127,11 +127,10 @@ void W_Shutdown(void); // Opens a WAD file. Returns the FILE * handle for the file, or NULL if not found or could not be opened FILE *W_OpenWadFile(const char **filename, boolean useerrors); // Load and add a wadfile to the active wad files, returns numbers of lumps, INT16_MAX on error -UINT16 W_InitFile(const char *filename, boolean mainfile); +UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup); -// W_InitMultipleFiles returns 1 if all is okay, 0 otherwise, -// so that it stops with a message if a file was not found, but not if all is okay. -INT32 W_InitMultipleFiles(char **filenames, UINT16 mainfiles); +// W_InitMultipleFiles exits if a file was not found, but not if all is okay. +void W_InitMultipleFiles(char **filenames, UINT16 mainfiles); const char *W_CheckNameForNumPwad(UINT16 wad, UINT16 lump); const char *W_CheckNameForNum(lumpnum_t lumpnum); From fed8167a813c28f24caa963fe9b9e11715d7be8e Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 8 Feb 2020 11:13:20 -0600 Subject: [PATCH 08/21] Allow more options for when the titlecard shows up --- src/dehacked.c | 21 +++++++++++++++++++++ src/doomstat.h | 22 +++++++++++++--------- src/f_wipe.c | 3 +-- src/g_game.c | 13 ++++++++++++- 4 files changed, 47 insertions(+), 12 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 45f00b8cf..5f35864e2 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1831,6 +1831,24 @@ static void readlevelheader(MYFILE *f, INT32 num) 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 + deh_warning("Level header %d: unknown titlecard show option %s\n", num, tmp); + + } while((tmp = strtok(NULL,",")) != NULL); + } // Individual triggers for menu flags else if (fastcmp(word, "HIDDEN")) @@ -9372,6 +9390,9 @@ struct { {"LF_NOZONE",LF_NOZONE}, {"LF_SAVEGAME",LF_SAVEGAME}, {"LF_MIXNIGHTSCOUNTDOWN",LF_MIXNIGHTSCOUNTDOWN}, + {"LF_NOTITLECARDFIRST",LF_NOTITLECARDFIRST}, + {"LF_NOTITLECARDRESPAWN",LF_NOTITLECARDRESPAWN}, + {"LF_NOTITLECARDRECORDATTACK",LF_NOTITLECARDRECORDATTACK}, {"LF_NOTITLECARD",LF_NOTITLECARD}, {"LF_WARNINGTITLE",LF_WARNINGTITLE}, // And map flags diff --git a/src/doomstat.h b/src/doomstat.h index c7c12632a..ea4efaede 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -351,15 +351,19 @@ typedef struct } mapheader_t; // level flags -#define LF_SCRIPTISFILE 1 ///< True if the script is a file, not a lump. -#define LF_SPEEDMUSIC 2 ///< Speed up act music for super sneakers -#define LF_NOSSMUSIC 4 ///< Disable Super Sonic music -#define LF_NORELOAD 8 ///< Don't reload level on death -#define LF_NOZONE 16 ///< Don't include "ZONE" on level title -#define LF_SAVEGAME 32 ///< Save the game upon loading this level -#define LF_MIXNIGHTSCOUNTDOWN 64 ///< Play sfx_timeup instead of music change for NiGHTS countdown -#define LF_WARNINGTITLE 128 ///< WARNING! WARNING! WARNING! WARNING! -#define LF_NOTITLECARD 256 ///< Don't start the title card +#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_SAVEGAME 1<<5 ///< Save the game upon loading this 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 LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen diff --git a/src/f_wipe.c b/src/f_wipe.c index a350e0f36..f8b24d387 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -192,8 +192,7 @@ void F_WipeStageTitle(void) // draw level title if ((WipeStageTitle && st_overlay) && (wipestyle == WIPESTYLE_COLORMAP) - && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) - && *mapheaderinfo[gamemap-1]->lvlttl != '\0') + && G_IsTitleCardAvailable()) { ST_runTitleCard(); ST_drawWipeTitleCard(); diff --git a/src/g_game.c b/src/g_game.c index 8383782cb..e0bb5179c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1928,13 +1928,22 @@ void G_PreLevelTitleCard(void) wipestyleflags = WSF_CROSSFADE; } +static boolean titlecardforreload = false; + // // Returns true if the current level has a title card. // boolean G_IsTitleCardAvailable(void) { // The current level header explicitly disabled the title card. - if (mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) + UINT16 titleflag = LF_NOTITLECARDFIRST; + + if (modeattacking) + titleflag = LF_NOTITLECARDRECORDATTACK; + else if (titlecardforreload) + titleflag = LF_NOTITLECARDRESPAWN; + + if (mapheaderinfo[gamemap-1]->levelflags & titleflag) return false; // The current gametype doesn't have a title card. @@ -3024,7 +3033,9 @@ void G_DoReborn(INT32 playernum) #ifdef HAVE_BLUA LUAh_MapChange(gamemap); #endif + titlecardforreload = true; G_DoLoadLevel(true); + titlecardforreload = false; if (metalrecording) G_BeginMetal(); return; From 19cdb002aba11d24d7fe57dd290d7cd254b0c945 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 9 Feb 2020 17:53:13 -0600 Subject: [PATCH 09/21] More fixes for titlecard option stuff --- src/doomstat.h | 22 +++++++++++----------- src/g_game.c | 2 +- src/st_stuff.c | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index ea4efaede..1a46e9b4c 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -351,18 +351,18 @@ typedef struct } mapheader_t; // 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_SAVEGAME 1<<5 ///< Save the game upon loading this 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_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_SAVEGAME (1<<5) ///< Save the game upon loading this 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_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 LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu diff --git a/src/g_game.c b/src/g_game.c index e0bb5179c..e7a5e9279 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1938,7 +1938,7 @@ boolean G_IsTitleCardAvailable(void) // The current level header explicitly disabled the title card. UINT16 titleflag = LF_NOTITLECARDFIRST; - if (modeattacking) + if (modeattacking != ATTACKING_NONE) titleflag = LF_NOTITLECARDRECORDATTACK; else if (titlecardforreload) titleflag = LF_NOTITLECARDRESPAWN; diff --git a/src/st_stuff.c b/src/st_stuff.c index d99d564c8..3a140e4ee 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -2625,7 +2625,7 @@ static void ST_overlayDrawer(void) // Check for a valid level title // If the HUD is enabled // And, if Lua is running, if the HUD library has the stage title enabled - if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) && *mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) + if (G_IsTitleCardAvailable() && *mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) { stagetitle = true; ST_preDrawTitleCard(); From d9e2256a3c30dce3ee35cb37085579cea88f7878 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Fri, 14 Feb 2020 22:30:37 -0500 Subject: [PATCH 10/21] Add six new skin colors --- src/dehacked.c | 6 ++++++ src/doomdef.h | 6 ++++++ src/r_draw.c | 20 +++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 45f00b8cf..b82ff4aef 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8989,9 +8989,11 @@ static const char *COLOR_ENUMS[] = { // Desaturated "AETHER", // SKINCOLOR_AETHER, "SLATE", // SKINCOLOR_SLATE, + "BLUEBELL", // SKINCOLOR_BLUEBELL, "PINK", // SKINCOLOR_PINK, "YOGURT", // SKINCOLOR_YOGURT, "BROWN", // SKINCOLOR_BROWN, + "BRONZE", // SKINCOLOR_BRONZE, "TAN", // SKINCOLOR_TAN, "BEIGE", // SKINCOLOR_BEIGE, "MOSS", // SKINCOLOR_MOSS, @@ -9004,9 +9006,11 @@ static const char *COLOR_ENUMS[] = { "RED", // SKINCOLOR_RED, "CRIMSON", // SKINCOLOR_CRIMSON, "FLAME", // SKINCOLOR_FLAME, + "KETCHUP", // SKINCOLOR_KETCHUP, "PEACHY", // SKINCOLOR_PEACHY, "QUAIL", // SKINCOLOR_QUAIL, "SUNSET", // SKINCOLOR_SUNSET, + "COPPER", // SKINCOLOR_COPPER, "APRICOT", // SKINCOLOR_APRICOT, "ORANGE", // SKINCOLOR_ORANGE, "RUST", // SKINCOLOR_RUST, @@ -9016,6 +9020,7 @@ static const char *COLOR_ENUMS[] = { "OLIVE", // SKINCOLOR_OLIVE, "LIME", // SKINCOLOR_LIME, "PERIDOT", // SKINCOLOR_PERIDOT, + "APPLE", // SKINCOLOR_APPLE, "GREEN", // SKINCOLOR_GREEN, "FOREST", // SKINCOLOR_FOREST, "EMERALD", // SKINCOLOR_EMERALD, @@ -9042,6 +9047,7 @@ static const char *COLOR_ENUMS[] = { "VIOLET", // SKINCOLOR_VIOLET, "LILAC", // SKINCOLOR_LILAC, "PLUM", // SKINCOLOR_PLUM, + "RASPBERRY", // SKINCOLOR_RASPBERRY, "ROSY", // SKINCOLOR_ROSY, // Super special awesome Super flashing colors! diff --git a/src/doomdef.h b/src/doomdef.h index 3d02871e4..57696083f 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -253,9 +253,11 @@ typedef enum // Desaturated SKINCOLOR_AETHER, SKINCOLOR_SLATE, + SKINCOLOR_BLUEBELL, SKINCOLOR_PINK, SKINCOLOR_YOGURT, SKINCOLOR_BROWN, + SKINCOLOR_BRONZE, SKINCOLOR_TAN, SKINCOLOR_BEIGE, SKINCOLOR_MOSS, @@ -268,9 +270,11 @@ typedef enum SKINCOLOR_RED, SKINCOLOR_CRIMSON, SKINCOLOR_FLAME, + SKINCOLOR_KETCHUP, SKINCOLOR_PEACHY, SKINCOLOR_QUAIL, SKINCOLOR_SUNSET, + SKINCOLOR_COPPER, SKINCOLOR_APRICOT, SKINCOLOR_ORANGE, SKINCOLOR_RUST, @@ -280,6 +284,7 @@ typedef enum SKINCOLOR_OLIVE, SKINCOLOR_LIME, SKINCOLOR_PERIDOT, + SKINCOLOR_APPLE, SKINCOLOR_GREEN, SKINCOLOR_FOREST, SKINCOLOR_EMERALD, @@ -306,6 +311,7 @@ typedef enum SKINCOLOR_VIOLET, SKINCOLOR_LILAC, SKINCOLOR_PLUM, + SKINCOLOR_RASPBERRY, SKINCOLOR_ROSY, // SKINCOLOR_? - one left before we bump up against 0x39, which isn't a HARD limit anymore but would be excessive diff --git a/src/r_draw.c b/src/r_draw.c index 743965cfb..918c5f206 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -153,9 +153,11 @@ const UINT8 Color_Index[MAXTRANSLATIONS-1][16] = { // Desaturated {0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x91, 0x91, 0x91, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xaf}, // SKINCOLOR_AETHER {0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0xaa, 0xaa, 0xaa, 0xab, 0xac, 0xac, 0xad, 0xad, 0xae, 0xaf}, // SKINCOLOR_SLATE + {0x90, 0x91, 0x92, 0x93, 0x94, 0x94, 0x95, 0xac, 0xac, 0xad, 0xad, 0xa8, 0xa8, 0xa9, 0xfd, 0xfe}, // SKINCOLOR_BLUEBELL {0xd0, 0xd0, 0xd1, 0xd1, 0xd2, 0xd2, 0xd3, 0xd3, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0x2b, 0x2c, 0x2e}, // SKINCOLOR_PINK {0xd0, 0x30, 0xd8, 0xd9, 0xda, 0xdb, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe3, 0xe6, 0xe8, 0xe9}, // SKINCOLOR_YOGURT {0xdf, 0xe0, 0xe1, 0xe2, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef}, // SKINCOLOR_BROWN + {0xde, 0xe0, 0xe1, 0xe4, 0xe7, 0xe9, 0xeb, 0xec, 0xed, 0xed, 0xed, 0x19, 0x19, 0x1b, 0x1d, 0x1e}, // SKINCOLOR_BRONZE {0x51, 0x51, 0x54, 0x54, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0xf5, 0xf5, 0xf9, 0xf9, 0xed, 0xed}, // SKINCOLOR_TAN {0x54, 0x55, 0x56, 0x56, 0xf2, 0xf3, 0xf3, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfb, 0xed, 0xed}, // SKINCOLOR_BEIGE {0x58, 0x58, 0x59, 0x59, 0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5d, 0x5d, 0x5e, 0x5e, 0x5f, 0x5f}, // SKINCOLOR_MOSS @@ -168,9 +170,11 @@ const UINT8 Color_Index[MAXTRANSLATIONS-1][16] = { {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x47, 0x2e, 0x2f}, // SKINCOLOR_RED {0x27, 0x27, 0x28, 0x28, 0x29, 0x2a, 0x2b, 0x2b, 0x2c, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f, 0x1f}, // SKINCOLOR_CRIMSON {0x31, 0x32, 0x33, 0x36, 0x22, 0x22, 0x25, 0x25, 0x25, 0xcd, 0xcf, 0xcf, 0xc5, 0xc5, 0xc7, 0xc7}, // SKINCOLOR_FLAME + {0x48, 0x49, 0x40, 0x33, 0x34, 0x36, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2b, 0x2c, 0x47, 0x2e, 0x2f}, // SKINCOLOR_KETCHUP {0xd0, 0x30, 0x31, 0x31, 0x32, 0x32, 0xdc, 0xdc, 0xdc, 0xd3, 0xd4, 0xd4, 0xcc, 0xcd, 0xce, 0xcf}, // SKINCOLOR_PEACHY {0xd8, 0xd9, 0xdb, 0xdc, 0xde, 0xdf, 0xd5, 0xd5, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0x1d, 0x1f}, // SKINCOLOR_QUAIL {0x51, 0x52, 0x40, 0x40, 0x34, 0x36, 0xd5, 0xd5, 0xd6, 0xd7, 0xcf, 0xcf, 0xc6, 0xc6, 0xc7, 0xfe}, // SKINCOLOR_SUNSET + {0x58, 0x54, 0x40, 0x34, 0x35, 0x38, 0x3a, 0x3c, 0x3d, 0x2a, 0x2b, 0x2c, 0x2c, 0xba, 0xba, 0xbb}, // SKINCOLOR_COPPER {0x00, 0xd8, 0xd9, 0xda, 0xdb, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e}, // SKINCOLOR_APRICOT {0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x2c}, // SKINCOLOR_ORANGE {0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3f, 0x2c, 0x2d, 0x47, 0x2e, 0x2f, 0x2f}, // SKINCOLOR_RUST @@ -180,6 +184,7 @@ const UINT8 Color_Index[MAXTRANSLATIONS-1][16] = { {0x4b, 0x4b, 0x4c, 0x4c, 0x4d, 0x4e, 0xe7, 0xe7, 0xe9, 0xc5, 0xc5, 0xc6, 0xc6, 0xc7, 0xc7, 0xfd}, // SKINCOLOR_OLIVE {0x50, 0x51, 0x52, 0x53, 0x48, 0xbc, 0xbd, 0xbe, 0xbe, 0xbf, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f}, // SKINCOLOR_LIME {0x58, 0x58, 0xbc, 0xbc, 0xbd, 0xbd, 0xbe, 0xbe, 0xbe, 0xbf, 0x5e, 0x5e, 0x5f, 0x5f, 0x77, 0x77}, // SKINCOLOR_PERIDOT + {0x49, 0x49, 0xbc, 0xbd, 0xbe, 0xbe, 0xbe, 0x67, 0x69, 0x6a, 0x6b, 0x6b, 0x6c, 0x6d, 0x6d, 0x6d}, // SKINCOLOR_APPLE {0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f}, // SKINCOLOR_GREEN {0x65, 0x66, 0x67, 0x68, 0x69, 0x69, 0x6a, 0x6b, 0x6b, 0x6c, 0x6d, 0x6d, 0x6e, 0x6e, 0x6e, 0x6f}, // SKINCOLOR_FOREST {0x70, 0x70, 0x71, 0x71, 0x72, 0x72, 0x73, 0x73, 0x73, 0x74, 0x75, 0x75, 0x76, 0x76, 0x77, 0x77}, // SKINCOLOR_EMERALD @@ -206,6 +211,7 @@ const UINT8 Color_Index[MAXTRANSLATIONS-1][16] = { {0xd0, 0xd1, 0xd2, 0xca, 0xcc, 0xb8, 0xb9, 0xb9, 0xba, 0xa8, 0xa8, 0xa9, 0xa9, 0xfd, 0xfe, 0xfe}, // SKINCOLOR_VIOLET {0x00, 0xd0, 0xd1, 0xd2, 0xd3, 0xc1, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc5, 0xc6, 0xc6, 0xfe, 0x1f}, // SKINCOLOR_LILAC {0xc8, 0xd3, 0xd5, 0xd6, 0xd7, 0xce, 0xcf, 0xb9, 0xb9, 0xba, 0xba, 0xa9, 0xa9, 0xa9, 0xfd, 0xfe}, // SKINCOLOR_PLUM + {0xc8, 0xc9, 0xca, 0xcb, 0xcb, 0xcc, 0xcd, 0xcd, 0xce, 0xb9, 0xb9, 0xba, 0xba, 0xbb, 0xfe, 0xfe}, // SKINCOLOR_RASPBERRY {0xfc, 0xc8, 0xc8, 0xc9, 0xc9, 0xca, 0xca, 0xcb, 0xcb, 0xcc, 0xcc, 0xcd, 0xcd, 0xce, 0xce, 0xcf}, // SKINCOLOR_ROSY // {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, // SKINCOLOR_? @@ -285,9 +291,11 @@ const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = // Desaturated "Aether", // SKINCOLOR_AETHER, "Slate", // SKINCOLOR_SLATE, + "Bluebell", // SKINCOLOR_BLUEBELL, "Pink", // SKINCOLOR_PINK, "Yogurt", // SKINCOLOR_YOGURT, - "Brown", // SKINCOLOR_BROWN, + "Brown", // SKINCOLOR_BROWN, + "Bronze", // SKINCOLOR_BRONZE, "Tan", // SKINCOLOR_TAN, "Beige", // SKINCOLOR_BEIGE, "Moss", // SKINCOLOR_MOSS, @@ -300,9 +308,11 @@ const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = "Red", // SKINCOLOR_RED, "Crimson", // SKINCOLOR_CRIMSON, "Flame", // SKINCOLOR_FLAME, + "Ketchup", // SKINCOLOR_KETCHUP, "Peachy", // SKINCOLOR_PEACHY, "Quail", // SKINCOLOR_QUAIL, "Sunset", // SKINCOLOR_SUNSET, + "Copper", // SKINCOLOR_COPPER, "Apricot", // SKINCOLOR_APRICOT, "Orange", // SKINCOLOR_ORANGE, "Rust", // SKINCOLOR_RUST, @@ -312,6 +322,7 @@ const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = "Olive", // SKINCOLOR_OLIVE, "Lime", // SKINCOLOR_LIME, "Peridot", // SKINCOLOR_PERIDOT, + "Apple", // SKINCOLOR_APPLE, "Green", // SKINCOLOR_GREEN, "Forest", // SKINCOLOR_FOREST, "Emerald", // SKINCOLOR_EMERALD, @@ -338,6 +349,7 @@ const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = "Violet", // SKINCOLOR_VIOLET, "Lilac", // SKINCOLOR_LILAC, "Plum", // SKINCOLOR_PLUM, + "Raspberry", // SKINCOLOR_RASPBERRY, "Rosy", // SKINCOLOR_ROSY, // Super behaves by different rules (one name per 5 colours), and will be accessed exclusively via R_GetSuperColorByName instead of R_GetColorByName. @@ -375,9 +387,11 @@ const UINT8 Color_Opposite[MAXSKINCOLORS - 1][2] = // Desaturated {SKINCOLOR_GREY, 15}, // SKINCOLOR_AETHER, {SKINCOLOR_SILVER, 12}, // SKINCOLOR_SLATE, + {SKINCOLOR_COPPER, 4}, // SKINCOLOR_BLUEBELL, {SKINCOLOR_AZURE, 9}, // SKINCOLOR_PINK, {SKINCOLOR_RUST, 7}, // SKINCOLOR_YOGURT, {SKINCOLOR_TAN, 2}, // SKINCOLOR_BROWN, + {SKINCOLOR_KETCHUP, 0}, // SKINCOLOR_BRONZE, {SKINCOLOR_BROWN, 12}, // SKINCOLOR_TAN, {SKINCOLOR_MOSS, 5}, // SKINCOLOR_BEIGE, {SKINCOLOR_BEIGE, 13}, // SKINCOLOR_MOSS, @@ -390,9 +404,11 @@ const UINT8 Color_Opposite[MAXSKINCOLORS - 1][2] = {SKINCOLOR_GREEN, 10}, // SKINCOLOR_RED, {SKINCOLOR_ICY, 10}, // SKINCOLOR_CRIMSON, {SKINCOLOR_PURPLE, 8}, // SKINCOLOR_FLAME, + {SKINCOLOR_BRONZE, 8}, // SKINCOLOR_KETCHUP, {SKINCOLOR_TEAL, 7}, // SKINCOLOR_PEACHY, {SKINCOLOR_WAVE, 5}, // SKINCOLOR_QUAIL, {SKINCOLOR_SAPPHIRE, 5}, // SKINCOLOR_SUNSET, + {SKINCOLOR_BLUEBELL, 5}, // SKINCOLOR_COPPER {SKINCOLOR_CYAN, 4}, // SKINCOLOR_APRICOT, {SKINCOLOR_BLUE, 4}, // SKINCOLOR_ORANGE, {SKINCOLOR_YOGURT, 8}, // SKINCOLOR_RUST, @@ -402,6 +418,7 @@ const UINT8 Color_Opposite[MAXSKINCOLORS - 1][2] = {SKINCOLOR_DUSK, 3}, // SKINCOLOR_OLIVE, {SKINCOLOR_MAGENTA, 9}, // SKINCOLOR_LIME, {SKINCOLOR_COBALT, 2}, // SKINCOLOR_PERIDOT, + {SKINCOLOR_RASPBERRY, 13}, // SKINCOLOR_APPLE, {SKINCOLOR_RED, 6}, // SKINCOLOR_GREEN, {SKINCOLOR_SALMON, 9}, // SKINCOLOR_FOREST, {SKINCOLOR_RUBY, 4}, // SKINCOLOR_EMERALD, @@ -428,6 +445,7 @@ const UINT8 Color_Opposite[MAXSKINCOLORS - 1][2] = {SKINCOLOR_MINT, 6}, // SKINCOLOR_VIOLET, {SKINCOLOR_VAPOR, 4}, // SKINCOLOR_LILAC, {SKINCOLOR_MINT, 7}, // SKINCOLOR_PLUM, + {SKINCOLOR_APPLE, 13}, // SKINCOLOR_RASPBERRY {SKINCOLOR_AQUA, 1} // SKINCOLOR_ROSY, }; From 2b615aa09c7a7923cbf70b9ea624309f428a7a76 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 15 Feb 2020 17:34:21 -0500 Subject: [PATCH 11/21] Add prefoppoistecolor support to save cards --- src/m_menu.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 916de03fa..367a4dd4b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8068,8 +8068,16 @@ static void M_DrawLoadGameData(void) col = 134; else { - col = charskin->prefcolor - 1; - col = Color_Index[Color_Opposite[col][0]-1][Color_Opposite[col][1]]; + if (charskin->prefoppositecolor) + { + col = charskin->prefoppositecolor - 1; + col = Color_Index[col][Color_Opposite[Color_Opposite[col][0] - 1][1]]; + } + else + { + col = charskin->prefcolor - 1; + col = Color_Index[Color_Opposite[col][0]-1][Color_Opposite[col][1]]; + } } V_DrawFill(x+6, y+64, 72, 50, col); From 2b678aaef0fe7e439ab859e820b6baf1725b425d Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 15 Feb 2020 17:35:00 -0500 Subject: [PATCH 12/21] New Lua functions: R_GetColorByName and R_GetNameByColor --- src/lua_baselib.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 66bd30e32..2ef45ac96 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -20,6 +20,7 @@ #endif #include "z_zone.h" #include "r_main.h" +#include "r_draw.h" #include "r_things.h" #include "m_random.h" #include "s_sound.h" @@ -2313,8 +2314,26 @@ static int lib_rTextureNumForName(lua_State *L) return 1; } -// S_SOUND +// R_DRAW //////////// +static int lib_rGetColorByName(lua_State *L) +{ + const char* colorname = luaL_checkstring(L, 1); + //HUDSAFE + lua_pushinteger(L, R_GetColorByName(colorname)); + return 1; +} + +// Lua exclusive function, returns the name of a color from the SKINCOLOR_ constant. +// SKINCOLOR_GREEN > "Green" for example +static int lib_rGetNameByColor(lua_State *L) +{ + UINT8 colornum = (UINT8)luaL_checkinteger(L, 1); + if (!colornum || colornum >= MAXSKINCOLORS) + return luaL_error(L, "skincolor %d out of range (1 - %d).", colornum, MAXSKINCOLORS-1); + lua_pushstring(L, Color_Names[colornum]); + return 1; +} static int lib_sStartSound(lua_State *L) { @@ -3153,6 +3172,10 @@ static luaL_Reg lib[] = { {"R_CheckTextureNumForName",lib_rCheckTextureNumForName}, {"R_TextureNumForName",lib_rTextureNumForName}, + // r_draw + {"R_GetColorByName", lib_rGetColorByName}, + {"R_GetNameByColor", lib_rGetNameByColor}, + // s_sound {"S_StartSound",lib_sStartSound}, {"S_StartSoundAtVolume",lib_sStartSoundAtVolume}, From 45ab4244fc9609f314d2088497e97002e65ab953 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 15 Feb 2020 17:55:25 -0500 Subject: [PATCH 13/21] Restore this that got shifted. --- src/lua_baselib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 2ef45ac96..b16ac6a60 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2335,6 +2335,8 @@ static int lib_rGetNameByColor(lua_State *L) return 1; } +// S_SOUND +//////////// static int lib_sStartSound(lua_State *L) { const void *origin = NULL; From ae53c146e6302227134d29d17800b37a6871398f Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 16 Feb 2020 21:32:03 -0600 Subject: [PATCH 14/21] Allow SHOWTITLECARDFOR = NONE --- src/dehacked.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 63cfc8d41..875518b40 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1841,7 +1841,7 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRECORDATTACK; else if (fastcmp(tmp, "ALL")) mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; - else + else if (!fastcmp(tmp, "NONE")) deh_warning("Level header %d: unknown titlecard show option %s\n", num, tmp); } while((tmp = strtok(NULL,",")) != NULL); From 0fbff66e25a96872364d3870f0f7dc04e05c1fac Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 1 Feb 2020 20:02:14 -0600 Subject: [PATCH 15/21] Let scripters see if player just launched from slope --- src/d_player.h | 1 + src/dehacked.c | 3 ++- src/p_mobj.c | 9 +++++++-- src/p_slopes.c | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index db55a9913..7ff4ce2a2 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -278,6 +278,7 @@ typedef enum pw_nights_linkfreeze, pw_nocontrol, //for linedef exec 427 + pw_justlaunched, // Launched off a slope this tic (0=none, 1=standard launch, 2=half-pipe launch) NUMPOWERS } powertype_t; diff --git a/src/dehacked.c b/src/dehacked.c index 6093d6fd6..aa6acdb69 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9138,7 +9138,8 @@ static const char *const POWERS_LIST[] = { "NIGHTS_LINKFREEZE", //for linedef exec 427 - "NOCONTROL" + "NOCONTROL", + "JUSTLAUNCHED", }; static const char *const HUDITEMS_LIST[] = { diff --git a/src/p_mobj.c b/src/p_mobj.c index 10898f70e..03ca56aa8 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1997,8 +1997,12 @@ void P_XYMovement(mobj_t *mo) { mo->momz = transfermomz; mo->standingslope = NULL; - if (player && (player->pflags & PF_SPINNING)) - player->pflags |= PF_THOKKED; + if (player) + { + player->powers[pw_justlaunched] = 2; + if (player->pflags & PF_SPINNING) + player->pflags |= PF_THOKKED; + } } } #endif @@ -3922,6 +3926,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) // Needed for gravity boots P_CheckGravity(mobj, false); + mobj->player->powers[pw_justlaunched] = 0; if (mobj->momx || mobj->momy) { P_XYMovement(mobj); diff --git a/src/p_slopes.c b/src/p_slopes.c index d584bb92d..6d5930882 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -726,6 +726,9 @@ void P_SlopeLaunch(mobj_t *mo) //CONS_Printf("Launched off of slope.\n"); mo->standingslope = NULL; + + if (mo->player) + mo->player->powers[pw_justlaunched] = 1; } // From 9e83e2751df383c0f6fb1bcd4d68554f89a86271 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 17 Feb 2020 00:36:10 -0300 Subject: [PATCH 16/21] Clear setrenderneeded after calling VID_CheckRenderer --- src/d_main.c | 4 +++- src/sdl/i_video.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 2ff0042fd..6616dfaa6 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1291,12 +1291,14 @@ void D_SRB2Main(void) // Lactozilla: Does the render mode need to change? if ((setrenderneeded != 0) && (setrenderneeded != rendermode)) { + CONS_Printf("Switching the renderer...\n"); needpatchflush = true; needpatchrecache = true; VID_CheckRenderer(); SCR_ChangeRendererCVars(setrenderneeded); + D_CheckRendererState(); + setrenderneeded = 0; } - D_CheckRendererState(); wipegamestate = gamestate; diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 13e2423c4..7af1863ab 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1499,7 +1499,6 @@ void VID_CheckRenderer(void) { I_StartupHardwareGraphics(); R_InitHardwareMode(); - HWR_Switch(); } #endif } From b3933c7842ccff52c1c5b61fbb904459f86dd654 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 17 Feb 2020 22:59:36 -0300 Subject: [PATCH 17/21] Fix R_CacheRotSprite not working with PNG lumps --- src/r_patch.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/r_patch.c b/src/r_patch.c index 80c0f846f..4304f3eab 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -1212,14 +1212,23 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp INT32 width, height, leftoffset; fixed_t ca, sa; lumpnum_t lump = sprframe->lumppat[rot]; + size_t lumplength; if (lump == LUMPERROR) return; + + patch = (patch_t *)W_CacheLumpNum(lump, PU_STATIC); + lumplength = W_LumpLength(lump); + +#ifndef NO_PNG_LUMPS + if (R_IsLumpPNG((UINT8 *)patch, lumplength)) + patch = R_PNGToPatch((UINT8 *)patch, lumplength, NULL); + else +#endif // Because there's something wrong with SPR_DFLM, I guess if (!R_CheckIfPatch(lump)) return; - patch = (patch_t *)W_CacheLumpNum(lump, PU_STATIC); width = patch->width; height = patch->height; leftoffset = patch->leftoffset; From 369fd8e35f430abaef47e744f1f869e59fbd92ee Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 17 Feb 2020 23:06:38 -0300 Subject: [PATCH 18/21] Fix LUAh_SeenPlayer not working --- src/lua_hooklib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 306bf6839..f9dad6cb7 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -1594,7 +1594,7 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend) hook_p hookp; boolean hasSeenPlayer = true; if (!gL || !(hooksAvailable[hook_SeenPlayer/8] & (1<<(hook_SeenPlayer%8)))) - return 0; + return true; lua_settop(gL, 0); hud_running = true; // local hook From c76a8e8a58fbd89813b8c5940dbb972dca4cf429 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Tue, 18 Feb 2020 22:19:09 -0300 Subject: [PATCH 19/21] Standards --- src/p_mobj.c | 57 ++++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index f53f2a7d5..299083b03 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7996,6 +7996,37 @@ static void P_MobjSceneryThink(mobj_t *mobj) mobj->frame = (mobj->frame & ~FF_TRANSMASK) | ((10 - (mobj->fuse*2)) << (FF_TRANSSHIFT)); } break; + case MT_FINISHFLAG: + { + if (!mobj->target || mobj->target->player->playerstate == PST_DEAD || !cv_exitmove.value) + { + P_RemoveMobj(mobj); + return; + } + + if (!camera.chase) + mobj->flags2 |= MF2_DONTDRAW; + else + mobj->flags2 &= ~MF2_DONTDRAW; + + P_UnsetThingPosition(mobj); + { + fixed_t radius = FixedMul(10*mobj->info->speed, mobj->target->scale); + angle_t fa; + + mobj->angle += FixedAngle(mobj->info->speed); + + fa = mobj->angle >> ANGLETOFINESHIFT; + + mobj->x = mobj->target->x + FixedMul(FINECOSINE(fa),radius); + mobj->y = mobj->target->y + FixedMul(FINESINE(fa),radius); + mobj->z = mobj->target->z + mobj->target->height/2; + } + P_SetThingPosition(mobj); + + P_SetScale(mobj, mobj->target->scale); + } + break; case MT_VWREF: case MT_VWREB: { @@ -8006,32 +8037,6 @@ static void P_MobjSceneryThink(mobj_t *mobj) if (strength < 10) mobj->frame |= ((10 - strength) << (FF_TRANSSHIFT)); } - case MT_FINISHFLAG: - { - if (!mobj->target || mobj->target->player->playerstate == PST_DEAD || !cv_exitmove.value) - { - P_RemoveMobj(mobj); - return; - } - - if (!camera.chase) - mobj->flags2 |= MF2_DONTDRAW; - else - mobj->flags2 &= ~MF2_DONTDRAW; - - fixed_t radius = FixedMul(10*mobj->info->speed, mobj->target->scale); - mobj->angle += FixedAngle(mobj->info->speed); - angle_t fa = mobj->angle >> ANGLETOFINESHIFT; - - P_UnsetThingPosition(mobj); - - mobj->x = mobj->target->x + FixedMul(FINECOSINE(fa),radius); - mobj->y = mobj->target->y + FixedMul(FINESINE(fa),radius); - mobj->z = mobj->target->z + mobj->target->height/2; - - P_SetThingPosition(mobj); - P_SetScale(mobj, mobj->target->scale); - } /* FALLTHRU */ default: if (mobj->fuse) From ec67e776dcb0c388e50814caa0ade52d465500bc Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Tue, 18 Feb 2020 22:50:22 -0300 Subject: [PATCH 20/21] Standards 2 --- src/p_user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 38f7f2719..85fa32acf 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -378,11 +378,11 @@ void P_GiveEmerald(boolean spawnObj) // void P_GiveFinishFlags(player_t *player) { + angle_t angle = FixedAngle(player->mo->angle << FRACBITS); + if (!player->mo) return; - - angle_t angle = FixedAngle(player->mo->angle << FRACBITS); - + for (UINT8 i = 0; i < 3; i++) { angle_t fa = (angle >> ANGLETOFINESHIFT) & FINEMASK; From 4a8de7cb55dda9dbc4eb86319ce0c3300fec07ee Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Tue, 18 Feb 2020 22:55:40 -0300 Subject: [PATCH 21/21] Enough --- src/p_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 85fa32acf..c9efe7596 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -379,11 +379,12 @@ void P_GiveEmerald(boolean spawnObj) void P_GiveFinishFlags(player_t *player) { angle_t angle = FixedAngle(player->mo->angle << FRACBITS); + UINT8 i; if (!player->mo) return; - for (UINT8 i = 0; i < 3; i++) + for (i = 0; i < 3; i++) { angle_t fa = (angle >> ANGLETOFINESHIFT) & FINEMASK; fixed_t xoffs = FINECOSINE(fa);