From ffc274643cc90cfad28c1c64b5c6d80c535e723a Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 18 Jan 2020 00:23:47 -0800 Subject: [PATCH 001/112] Let "+" command line parameters specify more than one argument Previously each parameter after the first would be quoted into one argument to pass to the command buffer. --- src/m_argv.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/m_argv.c b/src/m_argv.c index 935f4b9e3..129706127 100644 --- a/src/m_argv.c +++ b/src/m_argv.c @@ -92,36 +92,21 @@ const char *M_GetNextParm(void) void M_PushSpecialParameters(void) { INT32 i; - char s[256]; - boolean onetime = false; - for (i = 1; i < myargc; i++) { if (myargv[i][0] == '+') { - strcpy(s, &myargv[i][1]); + COM_BufAddText(&myargv[i][1]); i++; // get the parameters of the command too for (; i < myargc && myargv[i][0] != '+' && myargv[i][0] != '-'; i++) { - strcat(s, " "); - if (!onetime) - { - strcat(s, "\""); - onetime = true; - } - strcat(s, myargv[i]); + COM_BufAddText(va(" \"%s\"", myargv[i])); } - if (onetime) - { - strcat(s, "\""); - onetime = false; - } - strcat(s, "\n"); // push it - COM_BufAddText(s); + COM_BufAddText("\n"); i--; } } 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 002/112] 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 003/112] 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 004/112] 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 005/112] 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 006/112] 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 007/112] 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 5b08e1802dea504b52df6c5e21e311eaa06a3030 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 20 Jan 2020 23:14:26 -0800 Subject: [PATCH 008/112] Trim the trailing zeros off floats for cvars --- src/command.c | 14 +++++++++++--- src/m_menu.c | 3 ++- src/m_misc.c | 17 +++++++++++++++++ src/m_misc.h | 6 ++++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/command.c b/src/command.c index b9ceba3cc..199115519 100644 --- a/src/command.c +++ b/src/command.c @@ -823,8 +823,13 @@ static void COM_Help_f(void) if (!stricmp(cvar->PossibleValue[MINVAL].strvalue, "MIN")) { if (floatmode) - CONS_Printf(" range from %f to %f\n", FIXED_TO_FLOAT(cvar->PossibleValue[MINVAL].value), - FIXED_TO_FLOAT(cvar->PossibleValue[MAXVAL].value)); + { + float fu = FIXED_TO_FLOAT(cvar->PossibleValue[MINVAL].value); + float ck = FIXED_TO_FLOAT(cvar->PossibleValue[MAXVAL].value); + CONS_Printf(" range from %ld%s to %ld%s\n", + (long)fu, M_Ftrim(fu), + (long)ck, M_Ftrim(ck)); + } else CONS_Printf(" range from %d to %d\n", cvar->PossibleValue[MINVAL].value, cvar->PossibleValue[MAXVAL].value); @@ -973,7 +978,10 @@ static void COM_Add_f(void) } if (( cvar->flags & CV_FLOAT )) - CV_Set(cvar, va("%f", FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2)))); + { + float n =FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2)); + CV_Set(cvar, va("%ld%s", (long)n, M_Ftrim(n))); + } else CV_AddValue(cvar, atoi(COM_Argv(2))); } diff --git a/src/m_menu.c b/src/m_menu.c index 0d19a6a43..934495733 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2915,7 +2915,8 @@ static void M_ChangeCvar(INT32 choice) || !(currentMenu->menuitems[itemOn].status & IT_CV_INTEGERSTEP)) { char s[20]; - sprintf(s,"%f",FIXED_TO_FLOAT(cv->value)+(choice)*(1.0f/16.0f)); + float n = FIXED_TO_FLOAT(cv->value)+(choice)*(1.0f/16.0f); + sprintf(s,"%ld%s",(long)n,M_Ftrim(n)); CV_Set(cv,s); } else diff --git a/src/m_misc.c b/src/m_misc.c index 43d531110..ae8466ac8 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -2581,3 +2581,20 @@ int M_JumpWordReverse(const char *line, int offset) offset--; return offset; } + +const char * M_Ftrim (double f) +{ + static char dig[9];/* "0." + 6 digits (6 is printf's default) */ + int i; + /* I know I said it's the default, but just in case... */ + sprintf(dig, "%.6g", modf(f, &f)); + if (dig[0]) + { + for (i = strlen(dig); dig[i] == '0'; --i) + ; + dig[i + 1] = '\0'; + return &dig[1];/* skip the 0 */ + } + else + return ""; +} diff --git a/src/m_misc.h b/src/m_misc.h index 3fb9f031a..ad12517c1 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -109,6 +109,12 @@ int M_JumpWord (const char *s); /* E.g. cursor = M_JumpWordReverse(line, cursor); */ int M_JumpWordReverse (const char *line, int offset); +/* +Return dot and then the fractional part of a float, without +trailing zeros, or "" if the fractional part is zero. +*/ +const char * M_Ftrim (double); + // counting bits, for weapon ammo code, usually FUNCMATH UINT8 M_CountBits(UINT32 num, UINT8 size); From e8760fe5dd6ec67c21fc1659458bc0078819d730 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Wed, 22 Jan 2020 23:08:57 +0100 Subject: [PATCH 009/112] Update Lua I/O support to 2.2 --- src/CMakeLists.txt | 1 + src/blua/Makefile.cfg | 1 + src/blua/linit.c | 1 + src/blua/liolib.c | 720 ++++++++++++++++++++++++++++++++++++++++++ src/blua/lualib.h | 3 + src/d_clisrv.c | 26 ++ src/d_clisrv.h | 6 + src/d_main.c | 3 + src/d_net.c | 8 + src/d_netcmd.c | 4 +- src/d_netcmd.h | 1 + src/d_netfil.c | 252 ++++++++++++++- src/d_netfil.h | 40 +++ 13 files changed, 1058 insertions(+), 8 deletions(-) create mode 100644 src/blua/liolib.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e8c9c3182..4971736ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -279,6 +279,7 @@ if(${SRB2_CONFIG_HAVE_BLUA}) blua/lfunc.c blua/lgc.c blua/linit.c + blua/liolib.c blua/llex.c blua/lmem.c blua/lobject.c diff --git a/src/blua/Makefile.cfg b/src/blua/Makefile.cfg index 8d2e73714..659faf3c8 100644 --- a/src/blua/Makefile.cfg +++ b/src/blua/Makefile.cfg @@ -18,6 +18,7 @@ OBJS:=$(OBJS) \ $(OBJDIR)/ldo.o \ $(OBJDIR)/lfunc.o \ $(OBJDIR)/linit.o \ + $(OBJDIR)/liolib.o \ $(OBJDIR)/llex.o \ $(OBJDIR)/lmem.o \ $(OBJDIR)/lobject.o \ diff --git a/src/blua/linit.c b/src/blua/linit.c index 52b02dbe7..d17390b20 100644 --- a/src/blua/linit.c +++ b/src/blua/linit.c @@ -17,6 +17,7 @@ static const luaL_Reg lualibs[] = { {"", luaopen_base}, {LUA_TABLIBNAME, luaopen_table}, + {LUA_IOLIBNAME, luaopen_io}, {LUA_STRLIBNAME, luaopen_string}, {NULL, NULL} }; diff --git a/src/blua/liolib.c b/src/blua/liolib.c new file mode 100644 index 000000000..6ebde08a3 --- /dev/null +++ b/src/blua/liolib.c @@ -0,0 +1,720 @@ +/* +** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $ +** Standard I/O (and system) library +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include +#include + +#define liolib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" +#include "../i_system.h" +#include "../g_game.h" +#include "../d_netfil.h" +#include "../lua_libs.h" +#include "../byteptr.h" +#include "../lua_script.h" +#include "../m_misc.h" + + +#define IO_INPUT 1 +#define IO_OUTPUT 2 + +#define FILELIMIT (1024 * 1024) // Size limit for reading/writing files + +#define FMT_FILECALLBACKID "file_callback_%d" + + +static const char *const fnames[] = {"input", "output"}; +static const char *whitelist[] = { // Allow scripters to write files of these types to SRB2's folder + ".txt", + ".sav2", + ".cfg", + ".png", + ".bmp" +}; + + +static int pushresult (lua_State *L, int i, const char *filename) { + int en = errno; /* calls to Lua API may change this value */ + if (i) { + lua_pushboolean(L, 1); + return 1; + } + else { + lua_pushnil(L); + if (filename) + lua_pushfstring(L, "%s: %s", filename, strerror(en)); + else + lua_pushfstring(L, "%s", strerror(en)); + lua_pushinteger(L, en); + return 3; + } +} + + +static void fileerror (lua_State *L, int arg, const char *filename) { + lua_pushfstring(L, "%s: %s", filename, strerror(errno)); + luaL_argerror(L, arg, lua_tostring(L, -1)); +} + + +#define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) + + +static int io_type (lua_State *L) { + void *ud; + luaL_checkany(L, 1); + ud = lua_touserdata(L, 1); + lua_getfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE); + if (ud == NULL || !lua_getmetatable(L, 1) || !lua_rawequal(L, -2, -1)) + lua_pushnil(L); /* not a file */ + else if (*((FILE **)ud) == NULL) + lua_pushliteral(L, "closed file"); + else + lua_pushliteral(L, "file"); + return 1; +} + + +static FILE *tofile (lua_State *L) { + FILE **f = tofilep(L); + if (*f == NULL) + luaL_error(L, "attempt to use a closed file"); + return *f; +} + + + +/* +** When creating file handles, always creates a `closed' file handle +** before opening the actual file; so, if there is a memory error, the +** file is not left opened. +*/ +static FILE **newfile (lua_State *L) { + FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *)); + *pf = NULL; /* file handle is currently `closed' */ + luaL_getmetatable(L, LUA_FILEHANDLE); + lua_setmetatable(L, -2); + return pf; +} + + +/* +** function to (not) close the standard files stdin, stdout, and stderr +*/ +static int io_noclose (lua_State *L) { + lua_pushnil(L); + lua_pushliteral(L, "cannot close standard file"); + return 2; +} + + +/* +** function to close regular files +*/ +static int io_fclose (lua_State *L) { + FILE **p = tofilep(L); + int ok = (fclose(*p) == 0); + *p = NULL; + return pushresult(L, ok, NULL); +} + + +static int aux_close (lua_State *L) { + lua_getfenv(L, 1); + lua_getfield(L, -1, "__close"); + return (lua_tocfunction(L, -1))(L); +} + + +static int io_gc (lua_State *L) { + FILE *f = *tofilep(L); + /* ignore closed files */ + if (f != NULL) + aux_close(L); + return 0; +} + + +static int io_tostring (lua_State *L) { + FILE *f = *tofilep(L); + if (f == NULL) + lua_pushliteral(L, "file (closed)"); + else + lua_pushfstring(L, "file (%p)", f); + return 1; +} + + +// Create directories in the path +void MakePathDirs(char *path) +{ + char *c; + + for (c = path; *c; c++) + if (*c == '/' || *c == '\\') + { + char sep = *c; + *c = '\0'; + I_mkdir(path, 0755); + *c = sep; + } +} + + +static int io_open (lua_State *L) { + FILE **pf; + const char *filename = luaL_checkstring(L, 1); + boolean pass = false; + size_t i; + int length = strlen(filename); + const char *mode = luaL_optstring(L, 2, "r"); + luafiletransfer_t *filetransfer; + + if (strchr(filename, '\\')) + { + luaL_error(L, "access denied to %s: \\ is not allowed, use / instead", filename); + return pushresult(L,0,filename); + } + + for (i = 0; i < (sizeof (whitelist) / sizeof(const char *)); i++) + if (!stricmp(&filename[length - strlen(whitelist[i])], whitelist[i])) + { + pass = true; + break; + } + if (strstr(filename, "./") + || strstr(filename, "..") || strchr(filename, ':') + || filename[0] == '/' + || !pass) + { + luaL_error(L, "access denied to %s", filename); + return pushresult(L,0,filename); + } + + luaL_checktype(L, 4, LUA_TFUNCTION); + + if (lua_isnil(L, 3) && (strchr(mode, 'r') || strchr(mode, '+'))) // Synched reading + { + AddLuaFileTransfer(filename, mode); + + /*pf = newfile(L); + *pf = fopen(realfilename, mode); + return (*pf == NULL) ? pushresult(L, 0, filename) : 1;*/ + } + else // Local I/O + { + char *realfilename = va("%s" PATHSEP "%s", luafiledir, filename); + player_t *player = *((player_t **)luaL_checkudata(L, 3, META_PLAYER)); + + if (!player) + return LUA_ErrInvalid(L, "player_t"); + + if (player != &players[consoleplayer]) + return 0; + + if (client && strnicmp(filename, "shared/", strlen("shared/"))) + I_Error("Access denied to %s\n" + "Clients can only access files stored in luafiles/shared/\n", + filename); + + // Prevent access if the file is being downloaded + for (filetransfer = luafiletransfers; filetransfer; filetransfer = filetransfer->next) + if (!stricmp(filetransfer->filename, filename)) + I_Error("Access denied to %s\n" + "Files can't be opened while being downloaded\n", + filename); + + MakePathDirs(realfilename); + + // The callback is the last argument, no need to push it again + + // Push the first argument (file handle) on the stack + pf = newfile(gL); // Create and push the file handle + *pf = fopen(realfilename, mode); // Open the file + if (!*pf) + { + lua_pop(gL, 1); + lua_pushnil(gL); + } + + // Push the second argument (file name) on the stack + lua_pushstring(gL, filename); + + // Call the callback + LUA_Call(gL, 2); + + // Close the file + if (*pf) + { + fclose(*pf); + *pf = NULL; + } + } + + return 0; // !!! Todo: error handling? +} + + +void Got_LuaFile(UINT8 **cp, INT32 playernum) +{ + FILE **pf; + boolean success = READUINT8(*cp); // The first (and only) byte indicates whether the file could be opened + + if (playernum != serverplayer) + { + CONS_Alert(CONS_WARNING, M_GetText("Illegal luafile command received from %s\n"), player_names[playernum]); + if (server) + SendKick(playernum, KICK_MSG_CON_FAIL); + return; + } + + if (!luafiletransfers) + I_Error("No Lua file transfer\n"); + + // Retrieve the callback and push it on the stack + lua_pushfstring(gL, FMT_FILECALLBACKID, luafiletransfers->id); + lua_gettable(gL, LUA_REGISTRYINDEX); + + // Push the first argument (file handle or nil) on the stack + if (success) + { + pf = newfile(gL); // Create and push the file handle + *pf = fopen(luafiletransfers->realfilename, luafiletransfers->mode); // Open the file + if (!*pf) + I_Error("Can't open file \"%s\"\n", luafiletransfers->realfilename); // The file SHOULD exist + } + else + lua_pushnil(gL); + + // Push the second argument (file name) on the stack + lua_pushstring(gL, luafiletransfers->filename); + + // Call the callback + LUA_Call(gL, 2); + + if (success) + { + // Close the file + if (*pf) + { + fclose(*pf); + *pf = NULL; + } + + if (client) + remove(luafiletransfers->realfilename); + } + + RemoveLuaFileTransfer(); + + if (server && luafiletransfers) + { + if (FIL_FileOK(luafiletransfers->realfilename)) + SV_PrepareSendLuaFileToNextNode(); + else + { + // Send a net command with 0 as its first byte to indicate the file couldn't be opened + UINT8 success = 0; + SendNetXCmd(XD_LUAFILE, &success, 1); + } + } +} + + +void StoreLuaFileCallback(INT32 id) +{ + lua_pushfstring(gL, FMT_FILECALLBACKID, id); + lua_pushvalue(gL, 4); // Parameter 4 is the callback + lua_settable(gL, LUA_REGISTRYINDEX); // registry[callbackid] = callback +} + + +void RemoveLuaFileCallback(INT32 id) +{ + lua_pushfstring(gL, FMT_FILECALLBACKID, id); + lua_pushnil(gL); + lua_settable(gL, LUA_REGISTRYINDEX); // registry[callbackid] = nil +} + +static int io_tmpfile (lua_State *L) { + FILE **pf = newfile(L); + *pf = tmpfile(); + return (*pf == NULL) ? pushresult(L, 0, NULL) : 1; +} + + +static FILE *getiofile (lua_State *L, int findex) { + FILE *f; + lua_rawgeti(L, LUA_ENVIRONINDEX, findex); + f = *(FILE **)lua_touserdata(L, -1); + if (f == NULL) + luaL_error(L, "standard %s file is closed", fnames[findex - 1]); + return f; +} + + +static int g_iofile (lua_State *L, int f, const char *mode) { + if (!lua_isnoneornil(L, 1)) { + const char *filename = lua_tostring(L, 1); + if (filename) { + FILE **pf = newfile(L); + *pf = fopen(filename, mode); + if (*pf == NULL) + fileerror(L, 1, filename); + } + else { + tofile(L); /* check that it's a valid file handle */ + lua_pushvalue(L, 1); + } + lua_rawseti(L, LUA_ENVIRONINDEX, f); + } + /* return current value */ + lua_rawgeti(L, LUA_ENVIRONINDEX, f); + return 1; +} + + +static int io_input (lua_State *L) { + return g_iofile(L, IO_INPUT, "r"); +} + + +static int io_output (lua_State *L) { + return g_iofile(L, IO_OUTPUT, "w"); +} + + +static int io_readline (lua_State *L); + + +static void aux_lines (lua_State *L, int idx, int toclose) { + lua_pushvalue(L, idx); + lua_pushboolean(L, toclose); /* close/not close file when finished */ + lua_pushcclosure(L, io_readline, 2); +} + + +static int f_lines (lua_State *L) { + tofile(L); /* check that it's a valid file handle */ + aux_lines(L, 1, 0); + return 1; +} + + +static int io_lines (lua_State *L) { + if (lua_isnoneornil(L, 1)) { /* no arguments? */ + /* will iterate over default input */ + lua_rawgeti(L, LUA_ENVIRONINDEX, IO_INPUT); + return f_lines(L); + } + else { + const char *filename = luaL_checkstring(L, 1); + FILE **pf = newfile(L); + *pf = fopen(filename, "r"); + if (*pf == NULL) + fileerror(L, 1, filename); + aux_lines(L, lua_gettop(L), 1); + return 1; + } +} + + +/* +** {====================================================== +** READ +** ======================================================= +*/ + + +static int read_number (lua_State *L, FILE *f) { + lua_Number d; + if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { + lua_pushnumber(L, d); + return 1; + } + else return 0; /* read fails */ +} + + +static int test_eof (lua_State *L, FILE *f) { + int c = getc(f); + ungetc(c, f); + lua_pushlstring(L, NULL, 0); + return (c != EOF); +} + + +static int read_line (lua_State *L, FILE *f) { + luaL_Buffer b; + luaL_buffinit(L, &b); + for (;;) { + size_t l; + char *p = luaL_prepbuffer(&b); + if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ + luaL_pushresult(&b); /* close buffer */ + return (lua_objlen(L, -1) > 0); /* check whether read something */ + } + l = strlen(p); + if (l == 0 || p[l-1] != '\n') + luaL_addsize(&b, l); + else { + luaL_addsize(&b, l - 1); /* do not include `eol' */ + luaL_pushresult(&b); /* close buffer */ + return 1; /* read at least an `eol' */ + } + } +} + + +static int read_chars (lua_State *L, FILE *f, size_t n) { + size_t rlen; /* how much to read */ + size_t nr; /* number of chars actually read */ + luaL_Buffer b; + luaL_buffinit(L, &b); + rlen = LUAL_BUFFERSIZE; /* try to read that much each time */ + do { + char *p = luaL_prepbuffer(&b); + if (rlen > n) rlen = n; /* cannot read more than asked */ + nr = fread(p, sizeof(char), rlen, f); + luaL_addsize(&b, nr); + n -= nr; /* still have to read `n' chars */ + } while (n > 0 && nr == rlen); /* until end of count or eof */ + luaL_pushresult(&b); /* close buffer */ + return (n == 0 || lua_objlen(L, -1) > 0); +} + + +static int g_read (lua_State *L, FILE *f, int first) { + int nargs = lua_gettop(L) - 1; + int success; + int n; + clearerr(f); + if (nargs == 0) { /* no arguments? */ + success = read_line(L, f); + n = first+1; /* to return 1 result */ + } + else { /* ensure stack space for all results and for auxlib's buffer */ + luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); + success = 1; + for (n = first; nargs-- && success; n++) { + if (lua_type(L, n) == LUA_TNUMBER) { + size_t l = (size_t)lua_tointeger(L, n); + success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); + } + else { + const char *p = lua_tostring(L, n); + luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); + switch (p[1]) { + case 'n': /* number */ + success = read_number(L, f); + break; + case 'l': /* line */ + success = read_line(L, f); + break; + case 'a': /* file */ + read_chars(L, f, ~((size_t)0)); /* read MAX_SIZE_T chars */ + success = 1; /* always success */ + break; + default: + return luaL_argerror(L, n, "invalid format"); + } + } + } + } + if (ferror(f)) + return pushresult(L, 0, NULL); + if (!success) { + lua_pop(L, 1); /* remove last result */ + lua_pushnil(L); /* push nil instead */ + } + return n - first; +} + + +static int io_read (lua_State *L) { + return g_read(L, getiofile(L, IO_INPUT), 1); +} + + +static int f_read (lua_State *L) { + return g_read(L, tofile(L), 2); +} + + +static int io_readline (lua_State *L) { + FILE *f = *(FILE **)lua_touserdata(L, lua_upvalueindex(1)); + int sucess; + if (f == NULL) /* file is already closed? */ + luaL_error(L, "file is already closed"); + sucess = read_line(L, f); + if (ferror(f)) + return luaL_error(L, "%s", strerror(errno)); + if (sucess) return 1; + else { /* EOF */ + if (lua_toboolean(L, lua_upvalueindex(2))) { /* generator created file? */ + lua_settop(L, 0); + lua_pushvalue(L, lua_upvalueindex(1)); + aux_close(L); /* close it */ + } + return 0; + } +} + +/* }====================================================== */ + + +static int g_write (lua_State *L, FILE *f, int arg) { + int nargs = lua_gettop(L) - 1; + int status = 1; + size_t count; + for (; nargs--; arg++) { + if (lua_type(L, arg) == LUA_TNUMBER) { + /* optimization: could be done exactly as for strings */ + status = status && + fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0; + } + else { + size_t l; + const char *s = luaL_checklstring(L, arg, &l); + count += l; + if (ftell(f) + l > FILELIMIT) + { + luaL_error(L,"write limit bypassed in file. Changes have been discarded."); + break; + } + status = status && (fwrite(s, sizeof(char), l, f) == l); + } + } + return pushresult(L, status, NULL); +} + + +static int io_write (lua_State *L) { + return g_write(L, getiofile(L, IO_OUTPUT), 1); +} + + +static int f_write (lua_State *L) { + return g_write(L, tofile(L), 2); +} + + +static int f_seek (lua_State *L) { + static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END}; + static const char *const modenames[] = {"set", "cur", "end", NULL}; + FILE *f = tofile(L); + int op = luaL_checkoption(L, 2, "cur", modenames); + long offset = luaL_optlong(L, 3, 0); + op = fseek(f, offset, mode[op]); + if (op) + return pushresult(L, 0, NULL); /* error */ + else { + lua_pushinteger(L, ftell(f)); + return 1; + } +} + + +static int f_setvbuf (lua_State *L) { + static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; + static const char *const modenames[] = {"no", "full", "line", NULL}; + FILE *f = tofile(L); + int op = luaL_checkoption(L, 2, NULL, modenames); + lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); + int res = setvbuf(f, NULL, mode[op], sz); + return pushresult(L, res == 0, NULL); +} + + + +static int io_flush (lua_State *L) { + return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); +} + + +static int f_flush (lua_State *L) { + return pushresult(L, fflush(tofile(L)) == 0, NULL); +} + + +static const luaL_Reg iolib[] = { + {"flush", io_flush}, + {"input", io_input}, + {"lines", io_lines}, + {"open", io_open}, + {"output", io_output}, + {"read", io_read}, + {"tmpfile", io_tmpfile}, + {"type", io_type}, + {"write", io_write}, + {NULL, NULL} +}; + + +static const luaL_Reg flib[] = { + {"flush", f_flush}, + {"lines", f_lines}, + {"read", f_read}, + {"seek", f_seek}, + {"setvbuf", f_setvbuf}, + {"write", f_write}, + {"__gc", io_gc}, + {"__tostring", io_tostring}, + {NULL, NULL} +}; + + +static void createmeta (lua_State *L) { + luaL_newmetatable(L, LUA_FILEHANDLE); /* create metatable for file handles */ + lua_pushvalue(L, -1); /* push metatable */ + lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */ + luaL_register(L, NULL, flib); /* file methods */ +} + + +static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) { + *newfile(L) = f; + if (k > 0) { + lua_pushvalue(L, -1); + lua_rawseti(L, LUA_ENVIRONINDEX, k); + } + lua_pushvalue(L, -2); /* copy environment */ + lua_setfenv(L, -2); /* set it */ + lua_setfield(L, -3, fname); +} + + +static void newfenv (lua_State *L, lua_CFunction cls) { + lua_createtable(L, 0, 1); + lua_pushcfunction(L, cls); + lua_setfield(L, -2, "__close"); +} + + +LUALIB_API int luaopen_io (lua_State *L) { + createmeta(L); + /* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */ + newfenv(L, io_fclose); + lua_replace(L, LUA_ENVIRONINDEX); + /* open library */ + luaL_register(L, LUA_IOLIBNAME, iolib); + /* create (and set) default files */ + newfenv(L, io_noclose); /* close function for default files */ + createstdfile(L, stdin, IO_INPUT, "stdin"); + createstdfile(L, stdout, IO_OUTPUT, "stdout"); + createstdfile(L, stderr, 0, "stderr"); + lua_pop(L, 1); /* pop environment for default files */ + return 1; +} + diff --git a/src/blua/lualib.h b/src/blua/lualib.h index 6ebe27287..4ea97edf3 100644 --- a/src/blua/lualib.h +++ b/src/blua/lualib.h @@ -21,6 +21,9 @@ LUALIB_API int (luaopen_base) (lua_State *L); #define LUA_TABLIBNAME "table" LUALIB_API int (luaopen_table) (lua_State *L); +#define LUA_IOLIBNAME "io" +LUALIB_API int (luaopen_io) (lua_State *L); + #define LUA_STRLIBNAME "string" LUALIB_API int (luaopen_string) (lua_State *L); diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 8b87672bf..6b0f49544 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3164,6 +3164,8 @@ void D_QuitNetGame(void) // abort send/receive of files CloseNetFile(); + RemoveLuaFileTransfers(); + waitingforluafiletransfer = false; if (server) { @@ -3534,6 +3536,10 @@ static void HandleConnect(SINT8 node) SV_SendRefuse(node, M_GetText("Too many players from\nthis node.")); else if (netgame && !netbuffer->u.clientcfg.localplayers) // Stealth join? SV_SendRefuse(node, M_GetText("No players from\nthis node.")); +#ifdef HAVE_BLUA + else if (luafiletransfers) + SV_SendRefuse(node, M_GetText("The server is broadcasting a file\nrequested by a Lua script.\nPlease wait a bit and then\ntry rejoining.")); +#endif else { #ifndef NONET @@ -4117,6 +4123,20 @@ static void HandlePacketFromPlayer(SINT8 node) Net_CloseConnection(node); nodeingame[node] = false; break; +#ifdef HAVE_BLUA + case PT_ASKLUAFILE: + if (server && luafiletransfers && luafiletransfers->nodestatus[node] == LFTNS_ASKED) + { + char *name = va("%s" PATHSEP "%s", luafiledir, luafiletransfers->filename); + boolean textmode = !strchr(luafiletransfers->mode, 'b'); + SV_SendLuaFile(node, name, textmode); + } + break; + case PT_HASLUAFILE: + if (server && luafiletransfers && luafiletransfers->nodestatus[node] == LFTNS_SENDING) + SV_HandleLuaFileSent(node); + break; +#endif // -------------------------------------------- CLIENT RECEIVE ---------- case PT_RESYNCHEND: // Only accept PT_RESYNCHEND from the server. @@ -4244,6 +4264,12 @@ static void HandlePacketFromPlayer(SINT8 node) if (client) Got_Filetxpak(); break; +#ifdef HAVE_BLUA + case PT_SENDINGLUAFILE: + if (client) + CL_PrepareDownloadLuaFile(); + break; +#endif default: DEBFILE(va("UNKNOWN PACKET TYPE RECEIVED %d from host %d\n", netbuffer->packettype, node)); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 408d0f8dd..4aaa9be6b 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -67,6 +67,12 @@ typedef enum PT_RESYNCHEND, // Player is now resynched and is being requested to remake the gametic PT_RESYNCHGET, // Player got resynch packet +#ifdef HAVE_BLUA + PT_SENDINGLUAFILE, // Server telling a client Lua needs to open a file + PT_ASKLUAFILE, // Client telling the server they don't have the file + PT_HASLUAFILE, // Client telling the server they have the file +#endif + // Add non-PT_CANFAIL packet types here to avoid breaking MS compatibility. PT_CANFAIL, // This is kind of a priority. Anything bigger than CANFAIL diff --git a/src/d_main.c b/src/d_main.c index 15d3c8041..b4eebb275 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1113,6 +1113,7 @@ void D_SRB2Main(void) // can't use sprintf since there is %u in savegamename strcatbf(savegamename, srb2home, PATHSEP); + snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", srb2home); #else snprintf(srb2home, sizeof srb2home, "%s", userhome); snprintf(downloaddir, sizeof downloaddir, "%s", userhome); @@ -1123,6 +1124,8 @@ void D_SRB2Main(void) // can't use sprintf since there is %u in savegamename strcatbf(savegamename, userhome, PATHSEP); + + snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", userhome); #endif } diff --git a/src/d_net.c b/src/d_net.c index 573c9cfe9..ddb991235 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -715,6 +715,10 @@ void Net_CloseConnection(INT32 node) InitNode(&nodes[node]); SV_AbortSendFiles(node); +#ifdef HAVE_BLUA + if (server) + SV_AbortLuaFileTransfer(node); +#endif I_NetFreeNodenum(node); #endif } @@ -799,6 +803,10 @@ static const char *packettypename[NUMPACKETTYPE] = "RESYNCHEND", "RESYNCHGET", + "SENDINGLUAFILE", + "ASKLUAFILE", + "HASLUAFILE", + "FILEFRAGMENT", "TEXTCMD", "TEXTCMD2", diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a597bad83..42b560a85 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -417,7 +417,8 @@ const char *netxcmdnames[MAXNETXCMD - 1] = "SUICIDE", #ifdef HAVE_BLUA "LUACMD", - "LUAVAR" + "LUAVAR", + "LUAFILE" #endif }; @@ -453,6 +454,7 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_RUNSOC, Got_RunSOCcmd); #ifdef HAVE_BLUA RegisterNetXCmd(XD_LUACMD, Got_Luacmd); + RegisterNetXCmd(XD_LUAFILE, Got_LuaFile); #endif // Remote Administration diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 8f857c6db..5f3967a67 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -145,6 +145,7 @@ typedef enum #ifdef HAVE_BLUA XD_LUACMD, // 22 XD_LUAVAR, // 23 + XD_LUAFILE, // 24 #endif MAXNETXCMD } netxcmd_t; diff --git a/src/d_netfil.c b/src/d_netfil.c index 93b4b1990..5ceec2aaa 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -69,6 +69,7 @@ typedef struct filetx_s UINT32 size; // Size of the file UINT8 fileid; INT32 node; // Destination + boolean textmode; // For files requested by Lua without the "b" option struct filetx_s *next; // Next file in the list } filetx_t; @@ -94,6 +95,13 @@ char downloaddir[512] = "DOWNLOAD"; INT32 lastfilenum = -1; #endif +#ifdef HAVE_BLUA +luafiletransfer_t *luafiletransfers = NULL; +boolean waitingforluafiletransfer = false; +char luafiledir[256] = "luafiles"; +#endif + + /** Fills a serverinfo packet with information about wad files loaded. * * \todo Give this function a better name since it is in global scope. @@ -159,6 +167,7 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr) fileneeded[i].file = NULL; // The file isn't open yet READSTRINGN(p, fileneeded[i].filename, MAX_WADPATH); // The next bytes are the file name READMEM(p, fileneeded[i].md5sum, 16); // The last 16 bytes are the file checksum + fileneeded[i].textmode = false; } } @@ -170,6 +179,7 @@ void CL_PrepareDownloadSaveGame(const char *tmpsave) fileneeded[0].file = NULL; memset(fileneeded[0].md5sum, 0, 16); strcpy(fileneeded[0].filename, tmpsave); + fileneeded[0].textmode = false; } /** Checks the server to see if we CAN download all the files, @@ -448,6 +458,164 @@ void CL_LoadServerFiles(void) } } +#ifdef HAVE_BLUA +void AddLuaFileTransfer(const char *filename, const char *mode) +{ + luafiletransfer_t **prevnext; // A pointer to the "next" field of the last transfer in the list + luafiletransfer_t *filetransfer; + static INT32 id; + + //CONS_Printf("AddLuaFileTransfer \"%s\"\n", filename); + + // Find the last transfer in the list and set a pointer to its "next" field + prevnext = &luafiletransfers; + while (*prevnext) + prevnext = &((*prevnext)->next); + + // Allocate file transfer information and append it to the transfer list + filetransfer = malloc(sizeof(luafiletransfer_t)); + if (!filetransfer) + I_Error("AddLuaFileTransfer: Out of memory\n"); + *prevnext = filetransfer; + filetransfer->next = NULL; + + // Allocate the file name + filetransfer->filename = strdup(filename); + if (!filetransfer->filename) + I_Error("AddLuaFileTransfer: Out of memory\n"); + + // Create and allocate the real file name + if (server) + filetransfer->realfilename = strdup(va("%s" PATHSEP "%s", + luafiledir, filename)); + else + filetransfer->realfilename = strdup(va("%s" PATHSEP "shared" PATHSEP "$$$%d%d.tmp", + luafiledir, rand(), rand())); + if (!filetransfer->realfilename) + I_Error("AddLuaFileTransfer: Out of memory\n"); + + strlcpy(filetransfer->mode, mode, sizeof(filetransfer->mode)); + + if (server) + { + INT32 i; + + // Set status to "waiting" for everyone + for (i = 0; i < MAXNETNODES; i++) + filetransfer->nodestatus[i] = LFTNS_WAITING; + + if (!luafiletransfers->next) // Only if there is no transfer already going on + { + if (FIL_FileOK(filetransfer->realfilename)) + SV_PrepareSendLuaFileToNextNode(); + else + { + // Send a net command with 0 as its first byte to indicate the file couldn't be opened + UINT8 success = 0; + SendNetXCmd(XD_LUAFILE, &success, 1); + } + } + } + + // Store the callback so it can be called once everyone has the file + filetransfer->id = id; + StoreLuaFileCallback(id); + id++; + + if (waitingforluafiletransfer) + { + waitingforluafiletransfer = false; + CL_PrepareDownloadLuaFile(); + } +} + +void SV_PrepareSendLuaFileToNextNode(void) +{ + INT32 i; + UINT8 success = 1; + + // Find a client to send the file to + for (i = 1; i < MAXNETNODES; i++) + if (nodeingame[i] && luafiletransfers->nodestatus[i] == LFTNS_WAITING) // Node waiting + { + // Tell the client we're about to send them the file + netbuffer->packettype = PT_SENDINGLUAFILE; + if (!HSendPacket(i, true, 0, 0)) + I_Error("Failed to send a PT_SENDINGLUAFILE packet\n"); // !!! Todo: Handle failure a bit better lol + + luafiletransfers->nodestatus[i] = LFTNS_ASKED; + + return; + } + + // No client found, everyone has the file + // Send a net command with 1 as its first byte to indicate the file could be opened + SendNetXCmd(XD_LUAFILE, &success, 1); +} + +void SV_HandleLuaFileSent(UINT8 node) +{ + luafiletransfers->nodestatus[node] = LFTNS_SENT; + SV_PrepareSendLuaFileToNextNode(); +} + +void RemoveLuaFileTransfer(void) +{ + luafiletransfer_t *filetransfer = luafiletransfers; + + RemoveLuaFileCallback(filetransfer->id); + + luafiletransfers = filetransfer->next; + + free(filetransfer->filename); + free(filetransfer->realfilename); + free(filetransfer); +} + +void RemoveLuaFileTransfers(void) +{ + while (luafiletransfers) + RemoveLuaFileTransfer(); +} + +void SV_AbortLuaFileTransfer(INT32 node) +{ + if (luafiletransfers + && (luafiletransfers->nodestatus[node] == LFTNS_ASKED + || luafiletransfers->nodestatus[node] == LFTNS_SENDING)) + { + luafiletransfers->nodestatus[node] = LFTNS_WAITING; + SV_PrepareSendLuaFileToNextNode(); + } +} + +void CL_PrepareDownloadLuaFile(void) +{ + // If there is no transfer in the list, this normally means the server + // called io.open before us, so we have to wait until we call it too + if (!luafiletransfers) + { + waitingforluafiletransfer = true; + return; + } + + // Tell the server we are ready to receive the file + netbuffer->packettype = PT_ASKLUAFILE; + HSendPacket(servernode, true, 0, 0); + + fileneedednum = 1; + fileneeded[0].status = FS_REQUESTED; + fileneeded[0].totalsize = UINT32_MAX; + fileneeded[0].file = NULL; + memset(fileneeded[0].md5sum, 0, 16); + strcpy(fileneeded[0].filename, luafiletransfers->realfilename); + fileneeded[0].textmode = !strchr(luafiletransfers->mode, 'b'); + + // Make sure all directories in the file path exist + MakePathDirs(fileneeded[0].filename); +} +#endif + // Number of files to send // Little optimization to quickly test if there is a file in the queue static INT32 filestosend = 0; @@ -458,6 +626,7 @@ static INT32 filestosend = 0; * \param filename The file to send * \param fileid ??? * \sa SV_SendRam + * \sa SV_SendLuaFile * */ static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid) @@ -548,6 +717,7 @@ static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid) * \param freemethod How to free the block after it has been sent * \param fileid ??? * \sa SV_SendFile + * \sa SV_SendLuaFile * */ void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod, UINT8 fileid) @@ -579,6 +749,57 @@ void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod, UI filestosend++; } +#ifdef HAVE_BLUA +/** Adds a file requested by Lua to the file list for a node + * + * \param node The node to send the file to + * \param filename The file to send + * \sa SV_SendFile + * \sa SV_SendRam + * + */ +boolean SV_SendLuaFile(INT32 node, const char *filename, boolean textmode) +{ + filetx_t **q; // A pointer to the "next" field of the last file in the list + filetx_t *p; // The new file request + //INT32 i; + //char wadfilename[MAX_WADPATH]; + + luafiletransfers->nodestatus[node] = LFTNS_SENDING; + + // Find the last file in the list and set a pointer to its "next" field + q = &transfer[node].txlist; + while (*q) + q = &((*q)->next); + + // Allocate a file request and append it to the file list + p = *q = (filetx_t *)malloc(sizeof (filetx_t)); + if (!p) + I_Error("SV_SendLuaFile: No more memory\n"); + + // Initialise with zeros + memset(p, 0, sizeof (filetx_t)); + + // Allocate the file name + p->id.filename = (char *)malloc(MAX_WADPATH); // !!! + if (!p->id.filename) + I_Error("SV_SendLuaFile: No more memory\n"); + + // Set the file name and get rid of the path + strlcpy(p->id.filename, filename, MAX_WADPATH); // !!! + //nameonly(p->id.filename); + + // Open in text mode if required by the Lua script + p->textmode = textmode; + + DEBFILE(va("Sending Lua file %s to %d\n", filename, node)); + p->ram = SF_FILE; // It's a file, we need to close it and free its name once we're done sending it + p->next = NULL; // End of list + filestosend++; + return true; +} +#endif + /** Stops sending a file for a node, and removes the file request from the list, * either because the file has been fully sent or because the node was disconnected * @@ -684,7 +905,7 @@ void SV_FileSendTicker(void) long filesize; transfer[i].currentfile = - fopen(f->id.filename, "rb"); + fopen(f->id.filename, f->textmode ? "r" : "rb"); if (!transfer[i].currentfile) I_Error("File %s does not exist", @@ -715,11 +936,20 @@ void SV_FileSendTicker(void) size = f->size-transfer[i].position; if (ram) M_Memcpy(p->data, &f->id.ram[transfer[i].position], size); - else if (fread(p->data, 1, size, transfer[i].currentfile) != size) - I_Error("SV_FileSendTicker: can't read %s byte on %s at %d because %s", sizeu1(size), f->id.filename, transfer[i].position, M_FileError(transfer[i].currentfile)); + else + { + size_t n = fread(p->data, 1, size, transfer[i].currentfile); + if (n != size) // Either an error or Windows turning CR-LF into LF + { + if (f->textmode && feof(transfer[i].currentfile)) + size = n; + else if (fread(p->data, 1, size, transfer[i].currentfile) != size) + I_Error("SV_FileSendTicker: can't read %s byte on %s at %d because %s", sizeu1(size), f->id.filename, transfer[i].position, M_FileError(transfer[i].currentfile)); + } + } p->position = LONG(transfer[i].position); // Put flag so receiver knows the total size - if (transfer[i].position + size == f->size) + if (transfer[i].position + size == f->size || (f->textmode && feof(transfer[i].currentfile))) p->position |= LONG(0x80000000); p->fileid = f->fileid; p->size = SHORT((UINT16)size); @@ -728,7 +958,7 @@ void SV_FileSendTicker(void) if (HSendPacket(i, true, 0, FILETXHEADER + size)) // Reliable SEND { // Success transfer[i].position = (UINT32)(transfer[i].position + size); - if (transfer[i].position == f->size) // Finish? + if (transfer[i].position == f->size || (f->textmode && feof(transfer[i].currentfile))) // Finish? SV_EndFileSend(i); } else @@ -772,7 +1002,7 @@ void Got_Filetxpak(void) { if (file->file) I_Error("Got_Filetxpak: already open file\n"); - file->file = fopen(filename, "wb"); + file->file = fopen(filename, file->textmode ? "w" : "wb"); if (!file->file) I_Error("Can't create file %s: %s", filename, strerror(errno)); CONS_Printf("\r%s...\n",filename); @@ -793,7 +1023,7 @@ void Got_Filetxpak(void) } // We can receive packet in the wrong order, anyway all os support gaped file fseek(file->file, pos, SEEK_SET); - if (fwrite(netbuffer->u.filetxpak.data,size,1,file->file) != 1) + if (size && fwrite(netbuffer->u.filetxpak.data,size,1,file->file) != 1) I_Error("Can't write to %s: %s\n",filename, M_FileError(file->file)); file->currentsize += size; @@ -805,6 +1035,14 @@ void Got_Filetxpak(void) file->status = FS_FOUND; CONS_Printf(M_GetText("Downloading %s...(done)\n"), filename); +#ifdef HAVE_BLUA + if (luafiletransfers) + { + // Tell the server we have received the file + netbuffer->packettype = PT_HASLUAFILE; + HSendPacket(servernode, true, 0, 0); + } +#endif } } else diff --git a/src/d_netfil.h b/src/d_netfil.h index 17aeb8b7e..0d0b16975 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -13,6 +13,7 @@ #ifndef __D_NETFIL__ #define __D_NETFIL__ +#include "d_net.h" #include "w_wad.h" typedef enum @@ -43,6 +44,7 @@ typedef struct UINT32 currentsize; UINT32 totalsize; filestatus_t status; // The value returned by recsearch + boolean textmode; // For files requested by Lua without the "b" option } fileneeded_t; extern INT32 fileneedednum; @@ -70,6 +72,44 @@ boolean CL_CheckDownloadable(void); boolean CL_SendRequestFile(void); boolean Got_RequestFilePak(INT32 node); +#ifdef HAVE_BLUA +typedef enum +{ + LFTNS_WAITING, // This node is waiting for the server to send the file + LFTNS_ASKED, // The server has told the node they're ready to send the file + LFTNS_SENDING, // The server is sending the file to this node + LFTNS_SENT // The node already has the file +} luafiletransfernodestatus_t; + +typedef struct luafiletransfer_s +{ + char *filename; + char *realfilename; + char mode[4]; // rb+/wb+/ab+ + null character + INT32 id; // Callback ID + luafiletransfernodestatus_t nodestatus[MAXNETNODES]; + struct luafiletransfer_s *next; +} luafiletransfer_t; + +extern luafiletransfer_t *luafiletransfers; +extern boolean waitingforluafiletransfer; +extern char luafiledir[256]; + +void AddLuaFileTransfer(const char *filename, const char *mode); +void SV_PrepareSendLuaFileToNextNode(void); +boolean SV_SendLuaFile(INT32 node, const char *filename, boolean textmode); +void SV_PrepareSendLuaFile(const char *filename); +void SV_HandleLuaFileSent(UINT8 node); +void RemoveLuaFileTransfer(void); +void RemoveLuaFileTransfers(void); +void SV_AbortLuaFileTransfer(INT32 node); +void CL_PrepareDownloadLuaFile(void); +void Got_LuaFile(UINT8 **cp, INT32 playernum); +void StoreLuaFileCallback(INT32 id); +void RemoveLuaFileCallback(INT32 id); +void MakePathDirs(char *path); +#endif + void SV_AbortSendFiles(INT32 node); void CloseNetFile(void); From 3b22a84296a239859adba85f6b27f4947631cff4 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 24 Jan 2020 02:47:51 +0100 Subject: [PATCH 010/112] Split open() into open() and openlocal() open() for normal, consistency-friendly reading, openlocal() for writing and local reading. --- src/blua/liolib.c | 122 +++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index 6ebde08a3..dc425f3c0 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -137,6 +137,14 @@ static int aux_close (lua_State *L) { } +static int io_close (lua_State *L) { + if (lua_isnone(L, 1)) + lua_rawgeti(L, LUA_ENVIRONINDEX, IO_OUTPUT); + tofile(L); /* make sure argument is a file */ + return aux_close(L); +} + + static int io_gc (lua_State *L) { FILE *f = *tofilep(L); /* ignore closed files */ @@ -172,14 +180,11 @@ void MakePathDirs(char *path) } -static int io_open (lua_State *L) { - FILE **pf; - const char *filename = luaL_checkstring(L, 1); +static int CheckFileName(lua_State *L, const char *filename) +{ + int length = strlen(filename); boolean pass = false; size_t i; - int length = strlen(filename); - const char *mode = luaL_optstring(L, 2, "r"); - luafiletransfer_t *filetransfer; if (strchr(filename, '\\')) { @@ -202,67 +207,60 @@ static int io_open (lua_State *L) { return pushresult(L,0,filename); } - luaL_checktype(L, 4, LUA_TFUNCTION); + return 0; +} - if (lua_isnil(L, 3) && (strchr(mode, 'r') || strchr(mode, '+'))) // Synched reading - { - AddLuaFileTransfer(filename, mode); +static int io_open (lua_State *L) { + const char *filename = luaL_checkstring(L, 1); + const char *mode = luaL_optstring(L, 2, "r"); + int checkresult; - /*pf = newfile(L); - *pf = fopen(realfilename, mode); - return (*pf == NULL) ? pushresult(L, 0, filename) : 1;*/ - } - else // Local I/O - { - char *realfilename = va("%s" PATHSEP "%s", luafiledir, filename); - player_t *player = *((player_t **)luaL_checkudata(L, 3, META_PLAYER)); + checkresult = CheckFileName(L, filename); + if (checkresult) + return checkresult; - if (!player) - return LUA_ErrInvalid(L, "player_t"); + luaL_checktype(L, 3, LUA_TFUNCTION); - if (player != &players[consoleplayer]) - return 0; + if (!(strchr(mode, 'r') || strchr(mode, '+'))) + luaL_error(L, "open() is only for reading, use openlocal() for writing"); - if (client && strnicmp(filename, "shared/", strlen("shared/"))) + AddLuaFileTransfer(filename, mode); + + return 0; +} + + +static int io_openlocal (lua_State *L) { + FILE **pf; + const char *filename = luaL_checkstring(L, 1); + const char *mode = luaL_optstring(L, 2, "r"); + luafiletransfer_t *filetransfer; + int checkresult; + + checkresult = CheckFileName(L, filename); + if (checkresult) + return checkresult; + + char *realfilename = va("%s" PATHSEP "%s", luafiledir, filename); + + if (client && strnicmp(filename, "shared/", strlen("shared/"))) + I_Error("Access denied to %s\n" + "Clients can only access files stored in luafiles/shared/\n", + filename); + + // Prevent access if the file is being downloaded + for (filetransfer = luafiletransfers; filetransfer; filetransfer = filetransfer->next) + if (!stricmp(filetransfer->filename, filename)) I_Error("Access denied to %s\n" - "Clients can only access files stored in luafiles/shared/\n", - filename); + "Files can't be opened while being downloaded\n", + filename); - // Prevent access if the file is being downloaded - for (filetransfer = luafiletransfers; filetransfer; filetransfer = filetransfer->next) - if (!stricmp(filetransfer->filename, filename)) - I_Error("Access denied to %s\n" - "Files can't be opened while being downloaded\n", - filename); + MakePathDirs(realfilename); - MakePathDirs(realfilename); - - // The callback is the last argument, no need to push it again - - // Push the first argument (file handle) on the stack - pf = newfile(gL); // Create and push the file handle - *pf = fopen(realfilename, mode); // Open the file - if (!*pf) - { - lua_pop(gL, 1); - lua_pushnil(gL); - } - - // Push the second argument (file name) on the stack - lua_pushstring(gL, filename); - - // Call the callback - LUA_Call(gL, 2); - - // Close the file - if (*pf) - { - fclose(*pf); - *pf = NULL; - } - } - - return 0; // !!! Todo: error handling? + // Open and return the file + pf = newfile(L); + *pf = fopen(realfilename, mode); + return (*pf == NULL) ? pushresult(L, 0, filename) : 1; } @@ -335,7 +333,7 @@ void Got_LuaFile(UINT8 **cp, INT32 playernum) void StoreLuaFileCallback(INT32 id) { lua_pushfstring(gL, FMT_FILECALLBACKID, id); - lua_pushvalue(gL, 4); // Parameter 4 is the callback + lua_pushvalue(gL, 3); // Parameter 3 is the callback lua_settable(gL, LUA_REGISTRYINDEX); // registry[callbackid] = callback } @@ -347,6 +345,7 @@ void RemoveLuaFileCallback(INT32 id) lua_settable(gL, LUA_REGISTRYINDEX); // registry[callbackid] = nil } + static int io_tmpfile (lua_State *L) { FILE **pf = newfile(L); *pf = tmpfile(); @@ -649,10 +648,12 @@ static int f_flush (lua_State *L) { static const luaL_Reg iolib[] = { + {"close", io_close}, {"flush", io_flush}, {"input", io_input}, {"lines", io_lines}, {"open", io_open}, + {"openlocal", io_openlocal}, {"output", io_output}, {"read", io_read}, {"tmpfile", io_tmpfile}, @@ -663,6 +664,7 @@ static const luaL_Reg iolib[] = { static const luaL_Reg flib[] = { + {"close", io_close}, {"flush", f_flush}, {"lines", f_lines}, {"read", f_read}, From e0f0984fcc8e5d1f4e6881b1826662f24ff1b4e9 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 24 Jan 2020 17:11:00 +0100 Subject: [PATCH 011/112] Rename "luafiles/shared/" to "luafiles/client/" --- src/blua/liolib.c | 4 ++-- src/d_netfil.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index dc425f3c0..244c13d15 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -243,9 +243,9 @@ static int io_openlocal (lua_State *L) { char *realfilename = va("%s" PATHSEP "%s", luafiledir, filename); - if (client && strnicmp(filename, "shared/", strlen("shared/"))) + if (client && strnicmp(filename, "client/", strlen("client/"))) I_Error("Access denied to %s\n" - "Clients can only access files stored in luafiles/shared/\n", + "Clients can only access files stored in luafiles/client/\n", filename); // Prevent access if the file is being downloaded diff --git a/src/d_netfil.c b/src/d_netfil.c index 5ceec2aaa..71449caca 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -489,7 +489,7 @@ void AddLuaFileTransfer(const char *filename, const char *mode) filetransfer->realfilename = strdup(va("%s" PATHSEP "%s", luafiledir, filename)); else - filetransfer->realfilename = strdup(va("%s" PATHSEP "shared" PATHSEP "$$$%d%d.tmp", + filetransfer->realfilename = strdup(va("%s" PATHSEP "client" PATHSEP "$$$%d%d.tmp", luafiledir, rand(), rand())); if (!filetransfer->realfilename) I_Error("AddLuaFileTransfer: Out of memory\n"); From 9658ef2c5bf4becdb8ab9473686d1726683510a1 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 24 Jan 2020 17:51:20 +0100 Subject: [PATCH 012/112] Add .dat and .csv to whitelisted file extensions --- src/blua/liolib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index 244c13d15..4ef3b4274 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -36,11 +36,13 @@ static const char *const fnames[] = {"input", "output"}; static const char *whitelist[] = { // Allow scripters to write files of these types to SRB2's folder - ".txt", - ".sav2", + ".bmp", ".cfg", + ".csv", + ".dat", ".png", - ".bmp" + ".sav2", + ".txt", }; From 51947319ee7ab0bed90128c41acf03e056468dd2 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 24 Jan 2020 23:24:54 +0100 Subject: [PATCH 013/112] Fix two compiler warnings --- src/blua/liolib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index 4ef3b4274..489a4ae16 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -268,8 +268,8 @@ static int io_openlocal (lua_State *L) { void Got_LuaFile(UINT8 **cp, INT32 playernum) { - FILE **pf; - boolean success = READUINT8(*cp); // The first (and only) byte indicates whether the file could be opened + FILE **pf = NULL; + UINT8 success = READUINT8(*cp); // The first (and only) byte indicates whether the file could be opened if (playernum != serverplayer) { From 16c7981bb8dc4af071e4dbbf8ad0bc4867ce31bf Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 24 Jan 2020 23:34:39 +0100 Subject: [PATCH 014/112] Fix the compiler warning fix --- src/blua/liolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index 489a4ae16..74bedc060 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -325,7 +325,7 @@ void Got_LuaFile(UINT8 **cp, INT32 playernum) else { // Send a net command with 0 as its first byte to indicate the file couldn't be opened - UINT8 success = 0; + success = 0; SendNetXCmd(XD_LUAFILE, &success, 1); } } From 2d142f734faadd67b07e9527dfabcdf80e7a85f3 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sat, 25 Jan 2020 01:37:50 +0100 Subject: [PATCH 015/112] Remove all potentially dangerous functions Basically any function that calls fopen() is gone, except the ones created by me. And no access to stdin/stdout/stderr through io.read()/io.write(). Not really harmful but why would you want that in SRB2. --- src/blua/liolib.c | 87 ----------------------------------------------- 1 file changed, 87 deletions(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index 74bedc060..e1a64c8d8 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -64,12 +64,6 @@ static int pushresult (lua_State *L, int i, const char *filename) { } -static void fileerror (lua_State *L, int arg, const char *filename) { - lua_pushfstring(L, "%s: %s", filename, strerror(errno)); - luaL_argerror(L, arg, lua_tostring(L, -1)); -} - - #define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) @@ -355,47 +349,6 @@ static int io_tmpfile (lua_State *L) { } -static FILE *getiofile (lua_State *L, int findex) { - FILE *f; - lua_rawgeti(L, LUA_ENVIRONINDEX, findex); - f = *(FILE **)lua_touserdata(L, -1); - if (f == NULL) - luaL_error(L, "standard %s file is closed", fnames[findex - 1]); - return f; -} - - -static int g_iofile (lua_State *L, int f, const char *mode) { - if (!lua_isnoneornil(L, 1)) { - const char *filename = lua_tostring(L, 1); - if (filename) { - FILE **pf = newfile(L); - *pf = fopen(filename, mode); - if (*pf == NULL) - fileerror(L, 1, filename); - } - else { - tofile(L); /* check that it's a valid file handle */ - lua_pushvalue(L, 1); - } - lua_rawseti(L, LUA_ENVIRONINDEX, f); - } - /* return current value */ - lua_rawgeti(L, LUA_ENVIRONINDEX, f); - return 1; -} - - -static int io_input (lua_State *L) { - return g_iofile(L, IO_INPUT, "r"); -} - - -static int io_output (lua_State *L) { - return g_iofile(L, IO_OUTPUT, "w"); -} - - static int io_readline (lua_State *L); @@ -413,24 +366,6 @@ static int f_lines (lua_State *L) { } -static int io_lines (lua_State *L) { - if (lua_isnoneornil(L, 1)) { /* no arguments? */ - /* will iterate over default input */ - lua_rawgeti(L, LUA_ENVIRONINDEX, IO_INPUT); - return f_lines(L); - } - else { - const char *filename = luaL_checkstring(L, 1); - FILE **pf = newfile(L); - *pf = fopen(filename, "r"); - if (*pf == NULL) - fileerror(L, 1, filename); - aux_lines(L, lua_gettop(L), 1); - return 1; - } -} - - /* ** {====================================================== ** READ @@ -543,11 +478,6 @@ static int g_read (lua_State *L, FILE *f, int first) { } -static int io_read (lua_State *L) { - return g_read(L, getiofile(L, IO_INPUT), 1); -} - - static int f_read (lua_State *L) { return g_read(L, tofile(L), 2); } @@ -601,11 +531,6 @@ static int g_write (lua_State *L, FILE *f, int arg) { } -static int io_write (lua_State *L) { - return g_write(L, getiofile(L, IO_OUTPUT), 1); -} - - static int f_write (lua_State *L) { return g_write(L, tofile(L), 2); } @@ -638,12 +563,6 @@ static int f_setvbuf (lua_State *L) { } - -static int io_flush (lua_State *L) { - return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); -} - - static int f_flush (lua_State *L) { return pushresult(L, fflush(tofile(L)) == 0, NULL); } @@ -651,16 +570,10 @@ static int f_flush (lua_State *L) { static const luaL_Reg iolib[] = { {"close", io_close}, - {"flush", io_flush}, - {"input", io_input}, - {"lines", io_lines}, {"open", io_open}, {"openlocal", io_openlocal}, - {"output", io_output}, - {"read", io_read}, {"tmpfile", io_tmpfile}, {"type", io_type}, - {"write", io_write}, {NULL, NULL} }; From 5a330803ec5bea2ca7b6b30bf7972b11753b571d Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Wed, 29 Jan 2020 13:47:55 -0300 Subject: [PATCH 016/112] Local Color Table for GIF movie mode --- src/d_netcmd.c | 1 + src/m_anigif.c | 89 ++++++++++++++++++++++++++++++++++++++------------ src/m_anigif.h | 2 +- 3 files changed, 71 insertions(+), 21 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 23ec00b2e..8d36cb058 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -669,6 +669,7 @@ void D_RegisterClientCommands(void) // GIF variables CV_RegisterVar(&cv_gif_optimize); CV_RegisterVar(&cv_gif_downscale); + CV_RegisterVar(&cv_gif_localcolortable); #ifdef WALLSPLATS CV_RegisterVar(&cv_splats); diff --git a/src/m_anigif.c b/src/m_anigif.c index 32fc2746d..bd90f6675 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -19,6 +19,7 @@ #include "v_video.h" #include "i_video.h" #include "m_misc.h" +#include "st_stuff.h" // st_palette #ifdef HWRENDER #include "hardware/hw_main.h" @@ -29,10 +30,12 @@ consvar_t cv_gif_optimize = {"gif_optimize", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_gif_downscale = {"gif_downscale", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_gif_localcolortable = {"gif_localcolortable", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifdef HAVE_ANIGIF static boolean gif_optimize = false; // So nobody can do something dumb static boolean gif_downscale = false; // like changing cvars mid output +static boolean gif_localcolortable = false; static RGBA_t *gif_palette = NULL; static FILE *gif_out = NULL; @@ -393,6 +396,41 @@ const UINT8 gifhead_nsid[19] = {0x21,0xFF,0x0B, // extension block + size 0x4E,0x45,0x54,0x53,0x43,0x41,0x50,0x45,0x32,0x2E,0x30, // NETSCAPE2.0 0x03,0x01,0xFF,0xFF,0x00}; // sub-block, repetitions + +// +// GIF_setpalette +// determine the gif palette. +// +static void GIF_setpalette(void) +{ + // In hardware mode, uses the master palette + size_t palnum = (rendermode == render_soft) ? ((gif_localcolortable) ? max(st_palette, 0) : 0) : 0; + gif_palette = ((cv_screenshot_colorprofile.value +#ifdef HWRENDER + && (rendermode == render_soft) +#endif + ) ? &pLocalPalette[palnum*256] + : &pMasterPalette[palnum*256]); +} + +// +// GIF_palwrite +// writes the gif palette. +// used both for the header and the local color table. +// +static UINT8 *GIF_palwrite(UINT8 *p) +{ + INT32 i; + RGBA_t *pal = gif_palette; + for (i = 0; i < 256; i++) + { + WRITEUINT8(p, pal[i].s.red); + WRITEUINT8(p, pal[i].s.green); + WRITEUINT8(p, pal[i].s.blue); + } + return p; +} + // // GIF_headwrite // writes the gif header to the currently open output file. @@ -402,8 +440,10 @@ static void GIF_headwrite(void) { UINT8 *gifhead = Z_Malloc(800, PU_STATIC, NULL); UINT8 *p = gifhead; - INT32 i; + UINT8 *last_p; UINT16 rwidth, rheight; + size_t totalbytes; + INT32 i; if (!gif_out) return; @@ -423,30 +463,37 @@ static void GIF_headwrite(void) rwidth = vid.width; rheight = vid.height; } + + last_p = p; WRITEUINT16(p, rwidth); WRITEUINT16(p, rheight); // colors, aspect, etc - WRITEUINT8(p, 0xF7); + WRITEUINT8(p, (gif_localcolortable ? 0xF0 : 0xF7)); // (0xF7 = 1111 0111) WRITEUINT8(p, 0x00); WRITEUINT8(p, 0x00); + // Lactozilla: should be 800 without a local color table + totalbytes = sizeof(gifhead_base) + sizeof(gifhead_nsid) + (p - last_p); + // write color table + if (!gif_localcolortable) { - RGBA_t *pal = gif_palette; - for (i = 0; i < 256; i++) - { - WRITEUINT8(p, pal[i].s.red); - WRITEUINT8(p, pal[i].s.green); - WRITEUINT8(p, pal[i].s.blue); - } + p = GIF_palwrite(p); + totalbytes += (256 * 3); + } + else + { + // write a dummy palette + for (i = 0; i < 6; i++, totalbytes++) + WRITEUINT8(p, 0); } // write extension block WRITEMEM(p, gifhead_nsid, sizeof(gifhead_nsid)); // write to file and be done with it! - fwrite(gifhead, 1, 800, gif_out); + fwrite(gifhead, 1, totalbytes, gif_out); Z_Free(gifhead); } @@ -566,7 +613,15 @@ static void GIF_framewrite(void) WRITEUINT16(p, (UINT16)(blity / scrbuf_downscaleamt)); WRITEUINT16(p, (UINT16)(blitw / scrbuf_downscaleamt)); WRITEUINT16(p, (UINT16)(blith / scrbuf_downscaleamt)); - WRITEUINT8(p, 0); // no local table of colors + + if (!gif_localcolortable) + WRITEUINT8(p, 0); // no local table of colors + else + { + WRITEUINT8(p, 0x87); // (0x87 = 1000 0111) + GIF_setpalette(); + p = GIF_palwrite(p); + } scrbuf_pos = movie_screen + blitx + (blity * vid.width); scrbuf_writeend = scrbuf_pos + (blitw - 1) + ((blith - 1) * vid.width); @@ -638,15 +693,9 @@ INT32 GIF_open(const char *filename) gif_optimize = (!!cv_gif_optimize.value); gif_downscale = (!!cv_gif_downscale.value); - - // GIF color table - // In hardware mode, uses the master palette - gif_palette = ((cv_screenshot_colorprofile.value -#ifdef HWRENDER - && (rendermode == render_soft) -#endif - ) ? pLocalPalette - : pMasterPalette); + gif_localcolortable = (!!cv_gif_localcolortable.value); + if (!gif_localcolortable) + GIF_setpalette(); GIF_headwrite(); gif_frames = 0; diff --git a/src/m_anigif.h b/src/m_anigif.h index 9bdf2cc7f..9eb6faa75 100644 --- a/src/m_anigif.h +++ b/src/m_anigif.h @@ -27,6 +27,6 @@ void GIF_frame(void); INT32 GIF_close(void); #endif -extern consvar_t cv_gif_optimize, cv_gif_downscale; +extern consvar_t cv_gif_optimize, cv_gif_downscale, cv_gif_localcolortable; #endif From 99c755c186705f5161cc6d13b9fbe74753239f5a Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Wed, 29 Jan 2020 13:52:02 -0300 Subject: [PATCH 017/112] Update the Screenshot Options menu --- src/m_menu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index f8c14dd69..52889c630 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1443,6 +1443,7 @@ static menuitem_t OP_ScreenshotOptionsMenu[] = {IT_STRING|IT_CVAR, NULL, "Region Optimizing", &cv_gif_optimize, 95}, {IT_STRING|IT_CVAR, NULL, "Downscaling", &cv_gif_downscale, 100}, + {IT_STRING|IT_CVAR, NULL, "Local Color Table", &cv_gif_localcolortable, 105}, {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memorya, 95}, {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_levela, 100}, @@ -1457,9 +1458,9 @@ enum op_movie_folder = 11, op_screenshot_capture = 12, op_screenshot_gif_start = 13, - op_screenshot_gif_end = 14, - op_screenshot_apng_start = 15, - op_screenshot_apng_end = 18, + op_screenshot_gif_end = 15, + op_screenshot_apng_start = 16, + op_screenshot_apng_end = 19, }; static menuitem_t OP_EraseDataMenu[] = From 999e72ab325301d248837f5337eb8f90143231ef Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Wed, 29 Jan 2020 13:56:39 -0300 Subject: [PATCH 018/112] Uh --- src/m_anigif.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/m_anigif.c b/src/m_anigif.c index bd90f6675..82e118527 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -434,7 +434,6 @@ static UINT8 *GIF_palwrite(UINT8 *p) // // GIF_headwrite // writes the gif header to the currently open output file. -// NOTE that this code does not accomodate for palette changes. // static void GIF_headwrite(void) { From 85211dcc09c922e0d42b4eeea387dcecc8e989ae Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Wed, 29 Jan 2020 17:31:27 -0300 Subject: [PATCH 019/112] Only write a Local Color Table if the frame's palette differs from the header's palette --- src/m_anigif.c | 73 +++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/src/m_anigif.c b/src/m_anigif.c index 82e118527..f917a7b26 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -35,8 +35,12 @@ consvar_t cv_gif_localcolortable = {"gif_localcolortable", "On", CV_SAVE, CV_On #ifdef HAVE_ANIGIF static boolean gif_optimize = false; // So nobody can do something dumb static boolean gif_downscale = false; // like changing cvars mid output + +// Palette handling static boolean gif_localcolortable = false; -static RGBA_t *gif_palette = NULL; +static boolean gif_colorprofile = false; +static RGBA_t *gif_headerpalette = NULL; +static RGBA_t *gif_framepalette = NULL; static FILE *gif_out = NULL; static INT32 gif_frames = 0; @@ -398,14 +402,13 @@ const UINT8 gifhead_nsid[19] = {0x21,0xFF,0x0B, // extension block + size // -// GIF_setpalette -// determine the gif palette. +// GIF_getpalette +// determine the palette for the current frame. // -static void GIF_setpalette(void) +static RGBA_t *GIF_getpalette(size_t palnum) { // In hardware mode, uses the master palette - size_t palnum = (rendermode == render_soft) ? ((gif_localcolortable) ? max(st_palette, 0) : 0) : 0; - gif_palette = ((cv_screenshot_colorprofile.value + return ((gif_colorprofile #ifdef HWRENDER && (rendermode == render_soft) #endif @@ -416,12 +419,11 @@ static void GIF_setpalette(void) // // GIF_palwrite // writes the gif palette. -// used both for the header and the local color table. +// used both for the header and local color tables. // -static UINT8 *GIF_palwrite(UINT8 *p) +static UINT8 *GIF_palwrite(UINT8 *p, RGBA_t *pal) { INT32 i; - RGBA_t *pal = gif_palette; for (i = 0; i < 256; i++) { WRITEUINT8(p, pal[i].s.red); @@ -439,10 +441,7 @@ static void GIF_headwrite(void) { UINT8 *gifhead = Z_Malloc(800, PU_STATIC, NULL); UINT8 *p = gifhead; - UINT8 *last_p; UINT16 rwidth, rheight; - size_t totalbytes; - INT32 i; if (!gif_out) return; @@ -463,36 +462,22 @@ static void GIF_headwrite(void) rheight = vid.height; } - last_p = p; WRITEUINT16(p, rwidth); WRITEUINT16(p, rheight); // colors, aspect, etc - WRITEUINT8(p, (gif_localcolortable ? 0xF0 : 0xF7)); // (0xF7 = 1111 0111) + WRITEUINT8(p, 0xF7); // (0xF7 = 1111 0111) WRITEUINT8(p, 0x00); WRITEUINT8(p, 0x00); - // Lactozilla: should be 800 without a local color table - totalbytes = sizeof(gifhead_base) + sizeof(gifhead_nsid) + (p - last_p); - // write color table - if (!gif_localcolortable) - { - p = GIF_palwrite(p); - totalbytes += (256 * 3); - } - else - { - // write a dummy palette - for (i = 0; i < 6; i++, totalbytes++) - WRITEUINT8(p, 0); - } + p = GIF_palwrite(p, gif_headerpalette); // write extension block WRITEMEM(p, gifhead_nsid, sizeof(gifhead_nsid)); // write to file and be done with it! - fwrite(gifhead, 1, totalbytes, gif_out); + fwrite(gifhead, 1, 800, gif_out); Z_Free(gifhead); } @@ -514,7 +499,7 @@ static void hwrconvert(void) INT32 x, y; size_t i = 0; - InitColorLUT(gif_palette); + InitColorLUT(gif_framepalette); for (y = 0; y < vid.height; y++) { @@ -540,6 +525,7 @@ static void GIF_framewrite(void) UINT8 *p; UINT8 *movie_screen = screens[2]; INT32 blitx, blity, blitw, blith; + boolean palchanged; if (!gifframe_data) gifframe_data = Z_Malloc(gifframe_size, PU_STATIC, NULL); @@ -548,8 +534,18 @@ static void GIF_framewrite(void) if (!gif_out) return; + // Lactozilla: Compare the header's palette with the current frame's palette and see if it changed. + if (gif_localcolortable) + { + gif_framepalette = GIF_getpalette((rendermode == render_soft) ? ((gif_localcolortable) ? max(st_palette, 0) : 0) : 0); + palchanged = memcmp(gif_headerpalette, gif_framepalette, sizeof(RGBA_t) * 256); + } + else + palchanged = false; + // Compare image data (for optimizing GIF) - if (gif_optimize && gif_frames > 0) + // If the palette has changed, the entire frame is considered to be different. + if (gif_optimize && gif_frames > 0 && (!palchanged)) { // before blit movie_screen points to last frame, cur_screen points to this frame UINT8 *cur_screen = screens[0]; @@ -617,9 +613,14 @@ static void GIF_framewrite(void) WRITEUINT8(p, 0); // no local table of colors else { - WRITEUINT8(p, 0x87); // (0x87 = 1000 0111) - GIF_setpalette(); - p = GIF_palwrite(p); + if (palchanged) + { + // The palettes are different, so write the Local Color Table! + WRITEUINT8(p, 0x87); // (0x87 = 1000 0111) + p = GIF_palwrite(p, gif_framepalette); + } + else + WRITEUINT8(p, 0); // They are equal, no Local Color Table needed. } scrbuf_pos = movie_screen + blitx + (blity * vid.width); @@ -693,8 +694,8 @@ INT32 GIF_open(const char *filename) gif_optimize = (!!cv_gif_optimize.value); gif_downscale = (!!cv_gif_downscale.value); gif_localcolortable = (!!cv_gif_localcolortable.value); - if (!gif_localcolortable) - GIF_setpalette(); + gif_colorprofile = (!!cv_screenshot_colorprofile.value); + gif_headerpalette = GIF_getpalette(0); GIF_headwrite(); gif_frames = 0; From 93b64a8d7d319bb3932739c36898a61ad2dfffbb Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sat, 24 Aug 2019 09:27:37 -0500 Subject: [PATCH 020/112] Create V_DrawThinStringAtFixed() for new "thin-fixed" option in v.drawString() --- src/lua_hudlib.c | 5 +++ src/v_video.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ src/v_video.h | 1 + 3 files changed, 97 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 235010f2a..0290eedeb 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -116,6 +116,7 @@ enum align { align_small, align_smallright, align_thin, + align_thinfixed, align_thinright }; static const char *const align_opt[] = { @@ -126,6 +127,7 @@ static const char *const align_opt[] = { "small", "small-right", "thin", + "thin-fixed", "thin-right", NULL}; @@ -743,6 +745,9 @@ static int libd_drawString(lua_State *L) case align_thinright: V_DrawRightAlignedThinString(x, y, flags, str); break; + case align_thinfixed: + V_DrawThinStringAtFixed(x, y, flags, str); + break; } return 0; } diff --git a/src/v_video.c b/src/v_video.c index 4785a1541..fa8d2cd37 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2511,6 +2511,97 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) } } +// Draws a thin string at a fixed_t location. +void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + fixed_t cx = x, cy = y; + INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0; + const char *ch = string; + INT32 spacewidth = 2, charwidth = 0; + + INT32 lowercase = (option & V_ALLOWLOWERCASE); + option &= ~V_FLIP; // which is also shared with V_ALLOWLOWERCASE... + + if (option & V_NOSCALESTART) + { + dupx = vid.dupx; + dupy = vid.dupy; + scrwidth = vid.width; + } + else + { + dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + scrwidth -= left; + } + + switch (option & V_SPACINGMASK) + { + case V_MONOSPACE: + spacewidth = 8; + /* FALLTHRU */ + case V_OLDSPACING: + charwidth = 8; + break; + case V_6WIDTHSPACE: + spacewidth = 6; + default: + break; + } + + for (;;ch++) + { + if (!*ch) + break; + if (*ch & 0x80) //color ignoring + continue; + if (*ch == '\n') + { + cx = x; + + if (option & V_RETURN8) + cy += (8*dupy)<= HU_FONTSIZE || !tny_font[c]) + { + cx += (spacewidth * dupx)<width)*(dupx/2); + } + else + w = SHORT(tny_font[c]->width) * dupx; + + if ((cx>>FRACBITS) > scrwidth) + break; + if ((cx>>FRACBITS)+left + w < 0) //left boundary check + { + cx += w< Date: Sat, 24 Aug 2019 11:45:32 -0500 Subject: [PATCH 021/112] Create V_DrawSmallStringAtFixed() for new "small-fixed" option in v.drawString() --- src/lua_hudlib.c | 5 +++ src/v_video.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ src/v_video.h | 1 + 3 files changed, 97 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 0290eedeb..914b2fecf 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -114,6 +114,7 @@ enum align { align_right, align_fixed, align_small, + align_smallfixed, align_smallright, align_thin, align_thinfixed, @@ -125,6 +126,7 @@ static const char *const align_opt[] = { "right", "fixed", "small", + "small-fixed", "small-right", "thin", "thin-fixed", @@ -735,6 +737,9 @@ static int libd_drawString(lua_State *L) case align_small: V_DrawSmallString(x, y, flags, str); break; + case align_smallfixed: + V_DrawSmallStringAtFixed(x, y, flags, str); + break; case align_smallright: V_DrawRightAlignedSmallString(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index fa8d2cd37..98a87fd6f 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2511,6 +2511,97 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) } } +// Draws a small string at a fixed_t location. +void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + fixed_t cx = x, cy = y; + INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0; + const char *ch = string; + INT32 spacewidth = 2, charwidth = 0; + + INT32 lowercase = (option & V_ALLOWLOWERCASE); + option &= ~V_FLIP; // which is also shared with V_ALLOWLOWERCASE... + + if (option & V_NOSCALESTART) + { + dupx = vid.dupx; + dupy = vid.dupy; + scrwidth = vid.width; + } + else + { + dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + scrwidth -= left; + } + + switch (option & V_SPACINGMASK) + { + case V_MONOSPACE: + spacewidth = 4; + /* FALLTHRU */ + case V_OLDSPACING: + charwidth = 4; + break; + case V_6WIDTHSPACE: + spacewidth = 3; + default: + break; + } + + for (;;ch++) + { + if (!*ch) + break; + if (*ch & 0x80) //color ignoring + continue; + if (*ch == '\n') + { + cx = x; + + if (option & V_RETURN8) + cy += (4*dupy)<= HU_FONTSIZE || !hu_font[c]) + { + cx += (spacewidth * dupx)<width)*(dupx/4); + } + else + w = SHORT(hu_font[c]->width) * dupx / 2; + + if ((cx>>FRACBITS) > scrwidth) + break; + if ((cx>>FRACBITS)+left + w < 0) //left boundary check + { + cx += w< Date: Tue, 27 Aug 2019 02:27:25 -0500 Subject: [PATCH 022/112] Add V_COLORMAP support for small-fixed and thin-fixed text. --- src/v_video.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 98a87fd6f..aaa796e8b 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2517,6 +2517,8 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st fixed_t cx = x, cy = y; INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0; const char *ch = string; + INT32 charflags = 0; + const UINT8 *colormap = NULL; INT32 spacewidth = 2, charwidth = 0; INT32 lowercase = (option & V_ALLOWLOWERCASE); @@ -2536,6 +2538,8 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st scrwidth -= left; } + charflags = (option & V_CHARCOLORMASK); + switch (option & V_SPACINGMASK) { case V_MONOSPACE: @@ -2554,8 +2558,13 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st { if (!*ch) break; - if (*ch & 0x80) //color ignoring + if (*ch & 0x80) //color parsing -x 2.16.09 + { + // manually set flags override color codes + if (!(option & V_CHARCOLORMASK)) + charflags = ((*ch & 0x7f) << V_CHARCOLORSHIFT) & V_CHARCOLORMASK; continue; + } if (*ch == '\n') { cx = x; @@ -2596,7 +2605,9 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st continue; } - V_DrawSciencePatch(cx + (center< Date: Tue, 27 Aug 2019 02:57:19 -0500 Subject: [PATCH 023/112] Create V_DrawCenteredSmallString() for new "small-center" option in v.drawString() --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 7 +++++++ src/v_video.h | 1 + 3 files changed, 13 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 914b2fecf..e0d3c52fa 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -115,6 +115,7 @@ enum align { align_fixed, align_small, align_smallfixed, + align_smallcenter, align_smallright, align_thin, align_thinfixed, @@ -127,6 +128,7 @@ static const char *const align_opt[] = { "fixed", "small", "small-fixed", + "small-center", "small-right", "thin", "thin-fixed", @@ -740,6 +742,9 @@ static int libd_drawString(lua_State *L) case align_smallfixed: V_DrawSmallStringAtFixed(x, y, flags, str); break; + case align_smallcenter: + V_DrawCenteredSmallString(x, y, flags, str); + break; case align_smallright: V_DrawRightAlignedSmallString(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index aaa796e8b..973cbc0c4 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2299,6 +2299,13 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string) } } +void V_DrawCenteredSmallString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x -= V_SmallStringWidth(string, option)/2; + V_DrawSmallString(x, y, option, string); +} + + void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *string) { x -= V_SmallStringWidth(string, option); diff --git a/src/v_video.h b/src/v_video.h index 06397d409..6f03c4d8f 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -205,6 +205,7 @@ void V_DrawRightAlignedString(INT32 x, INT32 y, INT32 option, const char *string // draw a string using the hu_font, 0.5x scale void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string); +void V_DrawCenteredSmallString(INT32 x, INT32 y, INT32 option, const char *string); void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *string); // draw a string using the tny_font From 426ccc9203cb61b6d16e84e457256a5f8ff0a9b4 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Tue, 27 Aug 2019 03:05:03 -0500 Subject: [PATCH 024/112] Create V_DrawCenteredThinString() for new "thin-center" option in v.drawString() --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 6 ++++++ src/v_video.h | 1 + 3 files changed, 12 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index e0d3c52fa..12b894bf2 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -119,6 +119,7 @@ enum align { align_smallright, align_thin, align_thinfixed, + align_thincenter, align_thinright }; static const char *const align_opt[] = { @@ -132,6 +133,7 @@ static const char *const align_opt[] = { "small-right", "thin", "thin-fixed", + "thin-center", "thin-right", NULL}; @@ -752,6 +754,9 @@ static int libd_drawString(lua_State *L) case align_thin: V_DrawThinString(x, y, flags, str); break; + case align_thincenter: + V_DrawCenteredThinString(x, y, flags, str); + break; case align_thinright: V_DrawRightAlignedThinString(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index 973cbc0c4..1e4217e4e 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2411,6 +2411,12 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string) } } +void V_DrawCenteredThinString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x -= V_ThinStringWidth(string, option)/2; + V_DrawThinString(x, y, option, string); +} + void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *string) { x -= V_ThinStringWidth(string, option); diff --git a/src/v_video.h b/src/v_video.h index 6f03c4d8f..9a0fe51d4 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -210,6 +210,7 @@ void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *s // draw a string using the tny_font void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string); +void V_DrawCenteredThinString(INT32 x, INT32 y, INT32 option, const char *string); void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *string); void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); From dc1871a74f2c4affc4727725015fc1758d1bbcd0 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Tue, 27 Aug 2019 03:25:28 -0500 Subject: [PATCH 025/112] Create V_DrawRightAlignedStringAtFixed() for new "fixed-right" option in v.drawString() --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 6 ++++++ src/v_video.h | 3 +++ 3 files changed, 14 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 12b894bf2..ed8e1b676 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -113,6 +113,7 @@ enum align { align_center, align_right, align_fixed, + align_fixedright, align_small, align_smallfixed, align_smallcenter, @@ -127,6 +128,7 @@ static const char *const align_opt[] = { "center", "right", "fixed", + "fixed-right", "small", "small-fixed", "small-center", @@ -737,6 +739,9 @@ static int libd_drawString(lua_State *L) case align_fixed: V_DrawStringAtFixed(x, y, flags, str); break; + case align_fixedright: + V_DrawRightAlignedStringAtFixed(x, y, flags, str); + break; // hu_font, 0.5x scale case align_small: V_DrawSmallString(x, y, flags, str); diff --git a/src/v_video.c b/src/v_video.c index 1e4217e4e..1b95d0145 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2524,6 +2524,12 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) } } +void V_DrawRightAlignedStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= V_StringWidth(string, option)< Date: Tue, 27 Aug 2019 03:28:45 -0500 Subject: [PATCH 026/112] Fixed v_video.h declaration for V_DrawRightAlignedStringAtFixed() --- src/v_video.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v_video.h b/src/v_video.h index cf096ae4b..0c8477adc 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -215,7 +215,7 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st // draw a string using the hu_font at fixed_t coordinates void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); -void V_DrawRightAlignedStringAtFixed(INT32 x, INT32 y, INT32 option, const char *string); +void V_DrawRightAlignedStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); From 9f50b6ef73952e88bfdfe7e5d6e7384f72ec6c2e Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Tue, 27 Aug 2019 03:36:12 -0500 Subject: [PATCH 027/112] Create V_DrawCenteredStringAtFixed() for new "fixed-center" option in v.drawString() --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 6 ++++++ src/v_video.h | 1 + 3 files changed, 12 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index ed8e1b676..906afede8 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -113,6 +113,7 @@ enum align { align_center, align_right, align_fixed, + align_fixedcenter, align_fixedright, align_small, align_smallfixed, @@ -128,6 +129,7 @@ static const char *const align_opt[] = { "center", "right", "fixed", + "fixed-center", "fixed-right", "small", "small-fixed", @@ -739,6 +741,9 @@ static int libd_drawString(lua_State *L) case align_fixed: V_DrawStringAtFixed(x, y, flags, str); break; + case align_fixedcenter: + V_DrawCenteredStringAtFixed(x, y, flags, str); + break; case align_fixedright: V_DrawRightAlignedStringAtFixed(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index 1b95d0145..d4aad6a64 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2524,6 +2524,12 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) } } +void V_DrawCenteredStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= (V_StringWidth(string, option) / 2)< Date: Tue, 27 Aug 2019 22:44:19 -0500 Subject: [PATCH 028/112] Create V_DrawSmallThinString() for new "small-thin" option in v.drawString() Note this has some major limitations to prevent squished text. It defaults to using V_MONOSPACE|V_OLDSPACING and you cannot change the size of characters. V_6WIDTHSPACE seems to act exactly the same as V_OLDSPACING too. --- src/lua_hudlib.c | 5 ++ src/v_video.c | 205 +++++++++++++++++++++++++++++++++++++++++++++++ src/v_video.h | 3 + 3 files changed, 213 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 906afede8..c10bc2efd 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -119,6 +119,7 @@ enum align { align_smallfixed, align_smallcenter, align_smallright, + align_smallthin, align_thin, align_thinfixed, align_thincenter, @@ -135,6 +136,7 @@ static const char *const align_opt[] = { "small-fixed", "small-center", "small-right", + "small-thin", "thin", "thin-fixed", "thin-center", @@ -760,6 +762,9 @@ static int libd_drawString(lua_State *L) case align_smallright: V_DrawRightAlignedSmallString(x, y, flags, str); break; + case align_smallthin: + V_DrawSmallThinString(x, y, flags, str); + break; // tny_font case align_thin: V_DrawThinString(x, y, flags, str); diff --git a/src/v_video.c b/src/v_video.c index d4aad6a64..7a51c9088 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2423,6 +2423,211 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st V_DrawThinString(x, y, option, string); } +// +// Write a string using the tny_font, 0.5x scale +// NOTE: the text is centered for screens larger than the base width +// +/* +void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) +{ + INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, center = 0, left = 0; + const char *ch = string; + INT32 charflags = 0; + const UINT8 *colormap = NULL; + INT32 spacewidth = 2, charwidth = 0; + + INT32 lowercase = (option & V_ALLOWLOWERCASE); + option &= ~V_FLIP; // which is also shared with V_ALLOWLOWERCASE... + + if (option & V_NOSCALESTART) + { + dupx = vid.dupx; + dupy = vid.dupy; + scrwidth = vid.width; + } + else + { + dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/4; + scrwidth -= left; + } + + charflags = (option & V_CHARCOLORMASK); + + switch (option & V_SPACINGMASK) + { + case V_MONOSPACE: + spacewidth = 3; + // FALLTHRU + case V_OLDSPACING: + charwidth = 3; + break; + case V_6WIDTHSPACE: + spacewidth = 2; + default: + break; + } + + for (;;ch++) + { + if (!*ch) + break; + if (*ch & 0x80) //color parsing -x 2.16.09 + { + // manually set flags override color codes + if (!(option & V_CHARCOLORMASK)) + charflags = ((*ch & 0x7f) << V_CHARCOLORSHIFT) & V_CHARCOLORMASK; + continue; + } + if (*ch == '\n') + { + cx = x; + + if (option & V_RETURN8) + cy += 4*dupy; + else + cy += 6*dupy; + + continue; + } + + c = *ch; + if (!lowercase || !tny_font[c-HU_FONTSTART]) + c = toupper(c); + c -= HU_FONTSTART; + + if (c < 0 || c >= HU_FONTSIZE || !tny_font[c]) + { + cx += spacewidth * dupx; + continue; + } + + if (charwidth) + { + w = charwidth * dupx; + center = w/2 - SHORT(tny_font[c]->width)*dupx/4; + } + else + w = SHORT(tny_font[c]->width) * dupx / 2; + if (cx > scrwidth) + break; + if (cx+left + w < 0) //left boundary check + { + cx += w; + continue; + } + + colormap = V_GetStringColormap(charflags); + V_DrawFixedPatch((cx + center)<= HU_FONTSIZE || !tny_font[c]) + { + cx += spacewidth * dupx; + continue; + } + + if (charwidth) + { + w = charwidth * dupx; + center = w/2 - SHORT(tny_font[c]->width)*dupx/4; + } + else + w = SHORT(tny_font[c]->width) * dupx / 2; + + if (cx > scrwidth) + break; + if (cx+left + w < 0) //left boundary check + { + cx += w; + continue; + } + + colormap = V_GetStringColormap(charflags); + V_DrawFixedPatch((cx + center)< Date: Tue, 27 Aug 2019 22:48:16 -0500 Subject: [PATCH 029/112] remove large commented broken version of V_DrawSmallThinString() lol --- src/v_video.c | 97 --------------------------------------------------- 1 file changed, 97 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 7a51c9088..33608de44 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2427,103 +2427,6 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st // Write a string using the tny_font, 0.5x scale // NOTE: the text is centered for screens larger than the base width // -/* -void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) -{ - INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, center = 0, left = 0; - const char *ch = string; - INT32 charflags = 0; - const UINT8 *colormap = NULL; - INT32 spacewidth = 2, charwidth = 0; - - INT32 lowercase = (option & V_ALLOWLOWERCASE); - option &= ~V_FLIP; // which is also shared with V_ALLOWLOWERCASE... - - if (option & V_NOSCALESTART) - { - dupx = vid.dupx; - dupy = vid.dupy; - scrwidth = vid.width; - } - else - { - dupx = dupy = 1; - scrwidth = vid.width/vid.dupx; - left = (scrwidth - BASEVIDWIDTH)/4; - scrwidth -= left; - } - - charflags = (option & V_CHARCOLORMASK); - - switch (option & V_SPACINGMASK) - { - case V_MONOSPACE: - spacewidth = 3; - // FALLTHRU - case V_OLDSPACING: - charwidth = 3; - break; - case V_6WIDTHSPACE: - spacewidth = 2; - default: - break; - } - - for (;;ch++) - { - if (!*ch) - break; - if (*ch & 0x80) //color parsing -x 2.16.09 - { - // manually set flags override color codes - if (!(option & V_CHARCOLORMASK)) - charflags = ((*ch & 0x7f) << V_CHARCOLORSHIFT) & V_CHARCOLORMASK; - continue; - } - if (*ch == '\n') - { - cx = x; - - if (option & V_RETURN8) - cy += 4*dupy; - else - cy += 6*dupy; - - continue; - } - - c = *ch; - if (!lowercase || !tny_font[c-HU_FONTSTART]) - c = toupper(c); - c -= HU_FONTSTART; - - if (c < 0 || c >= HU_FONTSIZE || !tny_font[c]) - { - cx += spacewidth * dupx; - continue; - } - - if (charwidth) - { - w = charwidth * dupx; - center = w/2 - SHORT(tny_font[c]->width)*dupx/4; - } - else - w = SHORT(tny_font[c]->width) * dupx / 2; - if (cx > scrwidth) - break; - if (cx+left + w < 0) //left boundary check - { - cx += w; - continue; - } - - colormap = V_GetStringColormap(charflags); - V_DrawFixedPatch((cx + center)< Date: Sat, 7 Sep 2019 17:37:21 -0500 Subject: [PATCH 030/112] Create V_DrawRightAlignedThinStringAtFixed() for new "thin-fixed-right" option in v.drawString() These function names are starting to become rediculous... --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 6 ++++++ src/v_video.h | 3 +++ 3 files changed, 14 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index c10bc2efd..61c1ea141 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -122,6 +122,7 @@ enum align { align_smallthin, align_thin, align_thinfixed, + align_thinfixedright, align_thincenter, align_thinright }; @@ -139,6 +140,7 @@ static const char *const align_opt[] = { "small-thin", "thin", "thin-fixed", + "thin-fixed-right", "thin-center", "thin-right", NULL}; @@ -778,6 +780,9 @@ static int libd_drawString(lua_State *L) case align_thinfixed: V_DrawThinStringAtFixed(x, y, flags, str); break; + case align_thinfixedright: + V_DrawRightAlignedThinStringAtFixed(x, y, flags, str); + break; } return 0; } diff --git a/src/v_video.c b/src/v_video.c index 33608de44..c59bebf34 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2848,6 +2848,12 @@ void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *str } } +void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= V_ThinStringWidth(string, option)< Date: Sat, 7 Sep 2019 17:41:03 -0500 Subject: [PATCH 031/112] Fixed V_DrawRightAlignedThinStringAtFixed declaration to use fixed_t for positioning. --- src/v_video.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v_video.h b/src/v_video.h index fcf71e9d1..311ec8310 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -225,7 +225,7 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st // draw a string using the tny_font at fixed_t coordinates void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); -void V_DrawRightAlignedThinStringAtFixed(INT32 x, INT32 y, INT32 option, const char *string); +void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); // Draw tall nums, used for menu, HUD, intermission void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num); From f7085fc1710a9cdaa51e3906441c5fb32081065e Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sat, 7 Sep 2019 17:55:33 -0500 Subject: [PATCH 032/112] Create V_DrawCenteredThinStringAtFixed() for new "thin-fixed-center" option in v.drawString() --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 6 ++++++ src/v_video.h | 1 + 3 files changed, 12 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 61c1ea141..bf03b351b 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -122,6 +122,7 @@ enum align { align_smallthin, align_thin, align_thinfixed, + align_thinfixedcenter, align_thinfixedright, align_thincenter, align_thinright @@ -140,6 +141,7 @@ static const char *const align_opt[] = { "small-thin", "thin", "thin-fixed", + "thin-fixed-center", "thin-fixed-right", "thin-center", "thin-right", @@ -780,6 +782,9 @@ static int libd_drawString(lua_State *L) case align_thinfixed: V_DrawThinStringAtFixed(x, y, flags, str); break; + case align_thinfixedcenter: + V_DrawCenteredThinStringAtFixed(x, y, flags, str); + break; case align_thinfixedright: V_DrawRightAlignedThinStringAtFixed(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index c59bebf34..d80b507bc 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2848,6 +2848,12 @@ void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *str } } +void V_DrawCenteredThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= (V_ThinStringWidth(string, option) / 2)< Date: Mon, 9 Sep 2019 19:49:04 -0500 Subject: [PATCH 033/112] Create V_DrawRightAlignedSmallStringAtFixed() for new "small-fixed-right" option in v.drawString() --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 6 ++++++ src/v_video.h | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index bf03b351b..7a633f757 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -117,6 +117,7 @@ enum align { align_fixedright, align_small, align_smallfixed, + align_smallfixedright, align_smallcenter, align_smallright, align_smallthin, @@ -136,6 +137,7 @@ static const char *const align_opt[] = { "fixed-right", "small", "small-fixed", + "small-fixed-right", "small-center", "small-right", "small-thin", @@ -760,6 +762,9 @@ static int libd_drawString(lua_State *L) case align_smallfixed: V_DrawSmallStringAtFixed(x, y, flags, str); break; + case align_smallfixedright: + V_DrawRightAlignedSmallStringAtFixed(x, y, flags, str); + break; case align_smallcenter: V_DrawCenteredSmallString(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index d80b507bc..dba9ed2dc 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2746,6 +2746,12 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st } } +void V_DrawRightAlignedSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= V_SmallStringWidth(string, option)< Date: Mon, 9 Sep 2019 20:41:34 -0500 Subject: [PATCH 034/112] Create V_DrawCenteredSmallStringAtFixed() for new "small-fixed-center" option in v.drawString() --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 6 ++++++ src/v_video.h | 1 + 3 files changed, 12 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 7a633f757..f890f62c0 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -117,6 +117,7 @@ enum align { align_fixedright, align_small, align_smallfixed, + align_smallfixedcenter, align_smallfixedright, align_smallcenter, align_smallright, @@ -137,6 +138,7 @@ static const char *const align_opt[] = { "fixed-right", "small", "small-fixed", + "small-fixed-center", "small-fixed-right", "small-center", "small-right", @@ -762,6 +764,9 @@ static int libd_drawString(lua_State *L) case align_smallfixed: V_DrawSmallStringAtFixed(x, y, flags, str); break; + case align_smallfixedcenter: + V_DrawCenteredSmallStringAtFixed(x, y, flags, str); + break; case align_smallfixedright: V_DrawRightAlignedSmallStringAtFixed(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index dba9ed2dc..a4c1bf6ba 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2746,6 +2746,12 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st } } +void V_DrawCenteredSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= (V_SmallStringWidth(string, option) / 2)< Date: Mon, 9 Sep 2019 21:25:52 -0500 Subject: [PATCH 035/112] Create V_DrawSmallThinStringAtFixed() for new "small-thin-fixed" option in v.drawString() I removed the limitation present in "small-thin" by converting all relevant variables to fixed_t's and using FixedMul() and FixedDiv() when necessary. Who'da thunk it would actually work? --- src/lua_hudlib.c | 5 +++ src/v_video.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++ src/v_video.h | 2 + 3 files changed, 109 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index f890f62c0..935a41b43 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -122,6 +122,7 @@ enum align { align_smallcenter, align_smallright, align_smallthin, + align_smallthinfixed, align_thin, align_thinfixed, align_thinfixedcenter, @@ -143,6 +144,7 @@ static const char *const align_opt[] = { "small-center", "small-right", "small-thin", + "small-thin-fixed", "thin", "thin-fixed", "thin-fixed-center", @@ -779,6 +781,9 @@ static int libd_drawString(lua_State *L) case align_smallthin: V_DrawSmallThinString(x, y, flags, str); break; + case align_smallthinfixed: + V_DrawSmallThinStringAtFixed(x, y, flags, str); + break; // tny_font case align_thin: V_DrawThinString(x, y, flags, str); diff --git a/src/v_video.c b/src/v_video.c index a4c1bf6ba..3e64c7748 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2872,6 +2872,108 @@ void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, con V_DrawThinStringAtFixed(x, y, option, string); } +// Draws a small string at a fixed_t location. +void V_DrawSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + fixed_t cx = x, cy = y; + INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0; + const char *ch = string; + INT32 charflags = 0; + const UINT8 *colormap = NULL; + INT32 spacewidth = 2<= HU_FONTSIZE || !tny_font[c]) + { + cx += FixedMul(spacewidth, dupx); + continue; + } + + if (charwidth) + { + w = FixedMul(charwidth, dupx); + center = w/2 - SHORT(tny_font[c]->width)*(dupx/4); + } + else + w = SHORT(tny_font[c]->width) * dupx / 2; + + if (cx > scrwidth) + break; + if (cx+left + w < 0) //left boundary check + { + cx += w; + continue; + } + + colormap = V_GetStringColormap(charflags); + + V_DrawFixedPatch(cx + center, cy, FRACUNIT/2, option, tny_font[c], colormap); + + cx += w; + } +} + // Draws a tallnum. Replaces two functions in y_inter and st_stuff void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num) { diff --git a/src/v_video.h b/src/v_video.h index 33328de8c..f1e33e154 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -231,6 +231,8 @@ void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *str void V_DrawCenteredThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); +void V_DrawSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); + // Draw tall nums, used for menu, HUD, intermission void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num); void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits); From c858d9fd4dffccb1c7f79b4add4b3103e870b4ac Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sat, 28 Sep 2019 13:01:58 -0500 Subject: [PATCH 036/112] Make V_DrawSmallThinString() a less precise wrapper for V_DrawSmallThinStringAtFixed() to fix rounding errors. --- src/v_video.c | 104 ++------------------------------------------------ 1 file changed, 4 insertions(+), 100 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 3e64c7748..2333631fb 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2427,108 +2427,12 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st // Write a string using the tny_font, 0.5x scale // NOTE: the text is centered for screens larger than the base width // +// Literally a wrapper. ~Golden void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) { - INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, center = 0, left = 0; - const char *ch = string; - INT32 charflags = 0; - const UINT8 *colormap = NULL; - INT32 spacewidth = 2, charwidth = 0; - - INT32 lowercase = (option & V_ALLOWLOWERCASE); - option &= ~V_FLIP; // which is also shared with V_ALLOWLOWERCASE... - - if (option & V_NOSCALESTART) - { - dupx = vid.dupx; - dupy = vid.dupy; - scrwidth = vid.width; - } - else - { - dupx = dupy = 1; - scrwidth = vid.width/vid.dupx; - left = (scrwidth - BASEVIDWIDTH)/2; - scrwidth -= left; - } - - charflags = (option & V_CHARCOLORMASK); - - // Monospace only + spacing changes, otherwise the characters are squished together. ~Golden - switch (option & V_SPACINGMASK) - { - case V_MONOSPACE: - spacewidth = 3; - /* FALLTHRU */ - case V_OLDSPACING: - charwidth = 3; - break; - case V_6WIDTHSPACE: - spacewidth = 2; - charwidth = 3; - break; - default: - spacewidth = 3; - charwidth = 3; - break; - } - - for (;;ch++) - { - if (!*ch) - break; - if (*ch & 0x80) //color parsing -x 2.16.09 - { - // manually set flags override color codes - if (!(option & V_CHARCOLORMASK)) - charflags = ((*ch & 0x7f) << V_CHARCOLORSHIFT) & V_CHARCOLORMASK; - continue; - } - if (*ch == '\n') - { - cx = x; - - if (option & V_RETURN8) - cy += 4*dupy; - else - cy += 6*dupy; - - continue; - } - - c = *ch; - if (!lowercase) - c = toupper(c); - c -= HU_FONTSTART; - - // character does not exist or is a space - if (c < 0 || c >= HU_FONTSIZE || !tny_font[c]) - { - cx += spacewidth * dupx; - continue; - } - - if (charwidth) - { - w = charwidth * dupx; - center = w/2 - SHORT(tny_font[c]->width)*dupx/4; - } - else - w = SHORT(tny_font[c]->width) * dupx / 2; - - if (cx > scrwidth) - break; - if (cx+left + w < 0) //left boundary check - { - cx += w; - continue; - } - - colormap = V_GetStringColormap(charflags); - V_DrawFixedPatch((cx + center)< Date: Tue, 8 Oct 2019 21:54:18 -0500 Subject: [PATCH 037/112] Create V_DrawRightAlignedSmallThinStringAtFixed() for new "small-thin-fixed-right" option in v.drawString() You guys have no idea how long this took to code. --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 22 ++++++++++++++++++++++ src/v_video.h | 4 ++++ 3 files changed, 31 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 935a41b43..e5c384949 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -123,6 +123,7 @@ enum align { align_smallright, align_smallthin, align_smallthinfixed, + align_smallthinfixedright, align_thin, align_thinfixed, align_thinfixedcenter, @@ -145,6 +146,7 @@ static const char *const align_opt[] = { "small-right", "small-thin", "small-thin-fixed", + "small-thin-fixed-right", "thin", "thin-fixed", "thin-fixed-center", @@ -784,6 +786,9 @@ static int libd_drawString(lua_State *L) case align_smallthinfixed: V_DrawSmallThinStringAtFixed(x, y, flags, str); break; + case align_smallthinfixedright: + V_DrawRightAlignedSmallThinStringAtFixed(x, y, flags, str); + break; // tny_font case align_thin: V_DrawThinString(x, y, flags, str); diff --git a/src/v_video.c b/src/v_video.c index 2333631fb..a90735927 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2435,6 +2435,13 @@ void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) V_DrawSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); } +/*void V_DrawRightAlignedSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x <<= FRACBITS; + y <<= FRACBITS; + V_DrawRightAlignedSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); +}*/ + // Draws a string at a fixed_t location. void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) { @@ -2878,6 +2885,12 @@ void V_DrawSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char } } +void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= V_SmallThinStringWidth(string, option)/2; + V_DrawSmallThinStringAtFixed(x, y, option, string); +} + // Draws a tallnum. Replaces two functions in y_inter and st_stuff void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num) { @@ -3435,6 +3448,15 @@ INT32 V_ThinStringWidth(const char *string, INT32 option) return w; } +// +// Find string width from tny_font chars, 0.5x scale +// +INT32 V_SmallThinStringWidth(const char *string, INT32 option) +{ + INT32 w = V_ThinStringWidth(string, option)< Date: Tue, 8 Oct 2019 22:03:43 -0500 Subject: [PATCH 038/112] Create V_DrawCenteredSmallThinStringAtFixed() for new "small-thin-fixed-center" option in v.drawString() Thankfully "center" is just "right" but with the X offset divided by 2. --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 6 ++++++ src/v_video.h | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index e5c384949..60d4d1c21 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -123,6 +123,7 @@ enum align { align_smallright, align_smallthin, align_smallthinfixed, + align_smallthinfixedcenter, align_smallthinfixedright, align_thin, align_thinfixed, @@ -146,6 +147,7 @@ static const char *const align_opt[] = { "small-right", "small-thin", "small-thin-fixed", + "small-thin-fixed-center", "small-thin-fixed-right", "thin", "thin-fixed", @@ -786,6 +788,9 @@ static int libd_drawString(lua_State *L) case align_smallthinfixed: V_DrawSmallThinStringAtFixed(x, y, flags, str); break; + case align_smallthinfixedcenter: + V_DrawCenteredSmallThinStringAtFixed(x, y, flags, str); + break; case align_smallthinfixedright: V_DrawRightAlignedSmallThinStringAtFixed(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index a90735927..cdacd8127 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2885,6 +2885,12 @@ void V_DrawSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char } } +void V_DrawCenteredSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= V_SmallThinStringWidth(string, option)/4; + V_DrawSmallThinStringAtFixed(x, y, option, string); +} + void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) { x -= V_SmallThinStringWidth(string, option)/2; diff --git a/src/v_video.h b/src/v_video.h index 5b038419f..9c7d67b11 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -233,7 +233,8 @@ void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, con // draw a string using the tny_font at fixed_t coordinates, 0.5x scale void V_DrawSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); -void V_DrawRightAlignedSmallThinStringAtFixed(INT32 x, INT32 y, INT32 option, const char *string); +void V_DrawCenteredSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); +void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); // Draw tall nums, used for menu, HUD, intermission void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num); From 7d9f1381601ba303ae8ebf53008893ac2d7de6c2 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Tue, 8 Oct 2019 22:11:40 -0500 Subject: [PATCH 039/112] Make V_DrawRightAlignedSmallThinString() a less precise wrapper for V_DrawRightAlignedSmallThinStringAtFixed() for new "small-thin-right" option in v.drawString() --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 4 ++-- src/v_video.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 60d4d1c21..5c2cd6e32 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -122,6 +122,7 @@ enum align { align_smallcenter, align_smallright, align_smallthin, + align_smallthinright, align_smallthinfixed, align_smallthinfixedcenter, align_smallthinfixedright, @@ -146,6 +147,7 @@ static const char *const align_opt[] = { "small-center", "small-right", "small-thin", + "small-thin-right", "small-thin-fixed", "small-thin-fixed-center", "small-thin-fixed-right", @@ -785,6 +787,9 @@ static int libd_drawString(lua_State *L) case align_smallthin: V_DrawSmallThinString(x, y, flags, str); break; + case align_smallthinright: + V_DrawRightAlignedSmallThinString(x, y, flags, str); + break; case align_smallthinfixed: V_DrawSmallThinStringAtFixed(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index cdacd8127..e7cf845d8 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2435,12 +2435,12 @@ void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) V_DrawSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); } -/*void V_DrawRightAlignedSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) +void V_DrawRightAlignedSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) { x <<= FRACBITS; y <<= FRACBITS; V_DrawRightAlignedSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); -}*/ +} // Draws a string at a fixed_t location. void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) diff --git a/src/v_video.h b/src/v_video.h index 9c7d67b11..169687183 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -215,6 +215,7 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st // draw a string using the tny_font, 0.5x scale void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string); +void V_DrawRightAlignedSmallThinString(INT32 x, INT32 y, INT32 option, const char *string); // draw a string using the hu_font at fixed_t coordinates void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string); From fe179331560aab088385bcb7c22b025226aaec29 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Tue, 8 Oct 2019 22:16:50 -0500 Subject: [PATCH 040/112] Make V_DrawCenteredSmallThinString() a less precise wrapper for V_DrawCenteredSmallThinStringAtFixed() for new "small-thin-center" option in v.drawString() --- src/lua_hudlib.c | 5 +++++ src/v_video.c | 7 +++++++ src/v_video.h | 1 + 3 files changed, 13 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 5c2cd6e32..d15fe2cea 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -122,6 +122,7 @@ enum align { align_smallcenter, align_smallright, align_smallthin, + align_smallthincenter, align_smallthinright, align_smallthinfixed, align_smallthinfixedcenter, @@ -147,6 +148,7 @@ static const char *const align_opt[] = { "small-center", "small-right", "small-thin", + "small-thin-center", "small-thin-right", "small-thin-fixed", "small-thin-fixed-center", @@ -787,6 +789,9 @@ static int libd_drawString(lua_State *L) case align_smallthin: V_DrawSmallThinString(x, y, flags, str); break; + case align_smallthincenter: + V_DrawCenteredSmallThinString(x, y, flags, str); + break; case align_smallthinright: V_DrawRightAlignedSmallThinString(x, y, flags, str); break; diff --git a/src/v_video.c b/src/v_video.c index e7cf845d8..8a4a3a030 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2435,6 +2435,13 @@ void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) V_DrawSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); } +void V_DrawCenteredSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x <<= FRACBITS; + y <<= FRACBITS; + V_DrawCenteredSmallThinStringAtFixed((fixed_t)x, (fixed_t)y, option, string); +} + void V_DrawRightAlignedSmallThinString(INT32 x, INT32 y, INT32 option, const char *string) { x <<= FRACBITS; diff --git a/src/v_video.h b/src/v_video.h index 169687183..1e7af29d2 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -215,6 +215,7 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st // draw a string using the tny_font, 0.5x scale void V_DrawSmallThinString(INT32 x, INT32 y, INT32 option, const char *string); +void V_DrawCenteredSmallThinString(INT32 x, INT32 y, INT32 option, const char *string); void V_DrawRightAlignedSmallThinString(INT32 x, INT32 y, INT32 option, const char *string); // draw a string using the hu_font at fixed_t coordinates From 57492347ed080821711b52d31580298edf56d3ad Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 1 Feb 2020 19:32:08 -0800 Subject: [PATCH 041/112] 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 af66a2e5fabe616142c84fab0d35bbab40d9451c Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 3 Feb 2020 02:12:55 -0300 Subject: [PATCH 042/112] Restore some functionality that went missing --- src/m_menu.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index d4ac61eb0..507d768cc 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -320,6 +320,7 @@ menu_t OP_DataOptionsDef, OP_ScreenshotOptionsDef, OP_EraseDataDef; menu_t OP_ServerOptionsDef; menu_t OP_MonitorToggleDef; static void M_ScreenshotOptions(INT32 choice); +static void M_SetupScreenshotMenu(void); static void M_EraseData(INT32 choice); static void M_Addons(INT32 choice); @@ -358,7 +359,6 @@ static void M_DrawMonitorToggles(void); static void M_OGL_DrawFogMenu(void); #endif #ifndef NONET -static void M_DrawScreenshotMenu(void); static void M_DrawConnectMenu(void); static void M_DrawMPMainMenu(void); static void M_DrawRoomMenu(void); @@ -1454,6 +1454,7 @@ static menuitem_t OP_ScreenshotOptionsMenu[] = enum { op_screenshot_colorprofile = 1, + op_screenshot_storagelocation = 3, op_screenshot_folder = 4, op_movie_folder = 11, op_screenshot_capture = 12, @@ -3673,6 +3674,9 @@ void M_Ticker(void) if (--vidm_testingmode == 0) setmodeneeded = vidm_previousmode + 1; } + + if (currentMenu == &OP_ScreenshotOptionsDef) + M_SetupScreenshotMenu(); } // @@ -11090,9 +11094,27 @@ static void M_ScreenshotOptions(INT32 choice) Screenshot_option_Onchange(); Moviemode_mode_Onchange(); + M_SetupScreenshotMenu(); M_SetupNextMenu(&OP_ScreenshotOptionsDef); } +static void M_SetupScreenshotMenu(void) +{ + menuitem_t *item = &OP_ScreenshotOptionsMenu[op_screenshot_colorprofile]; + +#ifdef HWRENDER + // Hide some options based on render mode + if (rendermode == render_opengl) + { + item->status = IT_GRAYEDOUT; + if ((currentMenu == &OP_ScreenshotOptionsDef) && (itemOn == op_screenshot_colorprofile)) // Can't select that + itemOn = op_screenshot_storagelocation; + } + else +#endif + item->status = (IT_STRING | IT_CVAR); +} + // ============= // JOYSTICK MENU // ============= @@ -11953,6 +11975,15 @@ static void M_HandleVideoMode(INT32 ch) static void M_DrawScreenshotMenu(void) { M_DrawGenericScrollMenu(); +#ifdef HWRENDER + if ((rendermode == render_opengl) && (itemOn < 7)) // where it starts to go offscreen; change this number if you change the layout of the screenshot menu + { + INT32 y = currentMenu->y+currentMenu->menuitems[op_screenshot_colorprofile].alphaKey*2; + if (itemOn == 6) + y -= 10; + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, y, V_REDMAP, "Yes"); + } +#endif } // =============== From d1e8744583b9a868665b4b3a5e4803a29829f7a0 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 3 Feb 2020 02:24:22 -0300 Subject: [PATCH 043/112] What --- src/m_anigif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_anigif.c b/src/m_anigif.c index 5394f569a..faa8f29e1 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -537,7 +537,7 @@ static void GIF_framewrite(void) // Lactozilla: Compare the header's palette with the current frame's palette and see if it changed. if (gif_localcolortable) { - gif_framepalette = GIF_getpalette(gif_localcolortable ? max(st_palette, 0) : 0); + gif_framepalette = GIF_getpalette(max(st_palette, 0)); palchanged = memcmp(gif_headerpalette, gif_framepalette, sizeof(RGBA_t) * 256); } else From 2eaf02d234ab0287af9fbd41b50ca2015121cca7 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 3 Feb 2020 19:42:37 +0100 Subject: [PATCH 044/112] Let Lua access spectators mobjs --- src/lua_playerlib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 1dd4c45b5..9ce1fed9b 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -97,6 +97,10 @@ static int player_get(lua_State *L) lua_pushboolean(L, true); else if (fastcmp(field,"name")) lua_pushstring(L, player_names[plr-players]); + else if (fastcmp(field,"realmo")) + LUA_PushUserdata(L, plr->mo, META_MOBJ); + // Kept for backward-compatibility + // Should be fixed to work like "realmo" later else if (fastcmp(field,"mo")) { if (plr->spectator) @@ -396,7 +400,7 @@ static int player_set(lua_State *L) if (hud_running) return luaL_error(L, "Do not alter player_t in HUD rendering code!"); - if (fastcmp(field,"mo")) { + if (fastcmp(field,"mo") || fastcmp(field,"realmo")) { mobj_t *newmo = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ)); plr->mo->player = NULL; // remove player pointer from old mobj (newmo->player = plr)->mo = newmo; // set player pointer for new mobj, and set new mobj as the player's mobj From fed8167a813c28f24caa963fe9b9e11715d7be8e Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 8 Feb 2020 11:13:20 -0600 Subject: [PATCH 045/112] 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 598daac0939018e4c361aa69dcdeef087e11e0ab Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 8 Feb 2020 20:29:28 -0300 Subject: [PATCH 046/112] allow models for skin/sprites with same name --- src/hardware/hw_md2.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index d1d6e91a2..50c169815 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -521,15 +521,10 @@ void HWR_InitModels(void) { if (stricmp(name, sprnames[i]) == 0) { - //if (stricmp(name, "PLAY") == 0) - //continue; - - //CONS_Debug(DBG_RENDER, " Found: %s %s %f %f\n", name, filename, scale, offset); md2_models[i].scale = scale; md2_models[i].offset = offset; md2_models[i].notfound = false; strcpy(md2_models[i].filename, filename); - goto md2found; } } @@ -537,18 +532,14 @@ void HWR_InitModels(void) { if (stricmp(name, skins[s].name) == 0) { - //CONS_Printf(" Found: %s %s %f %f\n", name, filename, scale, offset); md2_playermodels[s].skin = s; md2_playermodels[s].scale = scale; md2_playermodels[s].offset = offset; md2_playermodels[s].notfound = false; strcpy(md2_playermodels[s].filename, filename); - goto md2found; } } - // no sprite/player skin name found?!? - //CONS_Printf("Unknown sprite/player skin %s detected in models.dat\n", name); -md2found: + // move on to next line... continue; } @@ -591,7 +582,6 @@ void HWR_AddPlayerModel(int skin) // For skins that were added after startup } } - //CONS_Printf("Model for player skin %s not found\n", skins[skin].name); md2_playermodels[skin].notfound = true; playermd2found: fclose(f); @@ -635,7 +625,6 @@ void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after s } } - //CONS_Printf("MD2 for sprite %s not found\n", sprnames[spritenum]); md2_models[spritenum].notfound = true; spritemd2found: fclose(f); From d0d7fd15899b28734309ce37e9091e5561a7abf5 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sun, 9 Feb 2020 16:11:52 -0300 Subject: [PATCH 047/112] Don't add a TOL_ twice. --- src/dehacked.c | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 45f00b8cf..1c4be1d03 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -585,17 +585,26 @@ static void readfreeslots(MYFILE *f) continue; // Copy in the spr2 name and increment free_spr2. if (free_spr2 < NUMPLAYERSPRITES) { - CONS_Printf("Sprite SPR2_%s allocated.\n",word); strncpy(spr2names[free_spr2],word,4); spr2defaults[free_spr2] = 0; spr2names[free_spr2++][4] = 0; } else - CONS_Alert(CONS_WARNING, "Ran out of free SPR2 slots!\n"); + deh_warning("Ran out of free SPR2 slots!\n"); } else if (fastcmp(type, "TOL")) { - if (lastcustomtol > 31) - CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n"); + // Search if we already have a typeoflevel by that name... + for (i = 0; i < numtolinfo; i++) + if (fastcmp(word, TYPEOFLEVEL[i].name)) + break; + + // We found it? Then don't allocate another one. + if (i < numtolinfo) + continue; + + // We don't, so freeslot it. + if (lastcustomtol > 31) // Unless you have way too many, since they're flags. + deh_warning("Ran out of free typeoflevel slots!\n"); else { G_AddTOL((1< 31) - CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n"); - else - { - UINT32 newtol = (1<= numtolinfo) { + if (lastcustomtol > 31) // Unless you have way too many, since they're flags. + CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n"); + else { + UINT32 newtol = (1< Date: Sun, 9 Feb 2020 17:53:13 -0600 Subject: [PATCH 048/112] 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 6b8195dbc175b978c5da6d6b7c7c34a48d3a3daf Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 11 Feb 2020 23:54:39 -0300 Subject: [PATCH 049/112] player model prefix --- src/hardware/hw_md2.c | 79 ++++++++++++++++++++++++++++++------------- src/hardware/hw_md2.h | 2 ++ 2 files changed, 57 insertions(+), 24 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 50c169815..33bed3e46 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -476,7 +476,7 @@ void HWR_InitModels(void) size_t i; INT32 s; FILE *f; - char name[18], filename[32]; + char name[22], filename[32]; float scale, offset; CONS_Printf("HWR_InitModels()...\n"); @@ -509,37 +509,51 @@ void HWR_InitModels(void) nomd2s = true; return; } - while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4) + + while (fscanf(f, "%23s %31s %f %f", name, filename, &scale, &offset) == 4) { - if (stricmp(name, "PLAY") == 0) + char *skinname = name; + size_t len = strlen(name); + + // check for the skin model prefix. + if (strnicmp(name, PLAYERMODELPREFIX, 4) == 0 && len > 4) { - CONS_Printf("Model for sprite PLAY detected in models.dat, use a player skin instead!\n"); - continue; + skinname += 4; + goto addskinmodel; } - for (i = 0; i < NUMSPRITES; i++) + // add sprite model + if (len == 4) // must be 4 characters long exactly. otherwise it's not a sprite name. { - if (stricmp(name, sprnames[i]) == 0) + for (i = 0; i < NUMSPRITES; i++) { - md2_models[i].scale = scale; - md2_models[i].offset = offset; - md2_models[i].notfound = false; - strcpy(md2_models[i].filename, filename); + if (stricmp(name, sprnames[i]) == 0) + { + md2_models[i].scale = scale; + md2_models[i].offset = offset; + md2_models[i].notfound = false; + strcpy(md2_models[i].filename, filename); + goto modelfound; + } } } +addskinmodel: + // add skin model for (s = 0; s < MAXSKINS; s++) { - if (stricmp(name, skins[s].name) == 0) + if (stricmp(skinname, skins[s].name) == 0) { md2_playermodels[s].skin = s; md2_playermodels[s].scale = scale; md2_playermodels[s].offset = offset; md2_playermodels[s].notfound = false; strcpy(md2_playermodels[s].filename, filename); + goto modelfound; } } +modelfound: // move on to next line... continue; } @@ -549,7 +563,7 @@ void HWR_InitModels(void) void HWR_AddPlayerModel(int skin) // For skins that were added after startup { FILE *f; - char name[18], filename[32]; + char name[22], filename[32]; float scale, offset; if (nomd2s) @@ -568,31 +582,37 @@ void HWR_AddPlayerModel(int skin) // For skins that were added after startup return; } - // Check for any model that match the names of player skins! - while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4) + // Check for any models that match the names of player skins! + while (fscanf(f, "%23s %31s %f %f", name, filename, &scale, &offset) == 4) { - if (stricmp(name, skins[skin].name) == 0) + // ignore the skin model prefix. + char *skinname = name; + if (!strnicmp(name, PLAYERMODELPREFIX, 4)) + skinname += 4; + + if (stricmp(skinname, skins[skin].name) == 0) { md2_playermodels[skin].skin = skin; md2_playermodels[skin].scale = scale; md2_playermodels[skin].offset = offset; md2_playermodels[skin].notfound = false; strcpy(md2_playermodels[skin].filename, filename); - goto playermd2found; + goto playermodelfound; } } md2_playermodels[skin].notfound = true; -playermd2found: +playermodelfound: fclose(f); } void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after startup { FILE *f; - // name[18] is used to check for names in the models.dat file that match with sprites or player skins + // name[22] is used to check for names in the models.dat file that match with sprites or player skins // sprite names are always 4 characters long, and names is for player skins can be up to 19 characters long - char name[18], filename[32]; + // PLAYERMODELPREFIX is 4 characters long + char name[22], filename[32]; float scale, offset; if (nomd2s) @@ -612,21 +632,32 @@ void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after s return; } - // Check for any MD2s that match the names of sprite names! - while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4) + // Check for any models that match the names of sprite names! + while (fscanf(f, "%23s %31s %f %f", name, filename, &scale, &offset) == 4) { + // length of the sprite name + size_t len = strlen(name); + + // check for the skin model prefix. + if (!strnicmp(name, PLAYERMODELPREFIX, 4)) + continue; // that's not a sprite... + + // must be 4 characters long exactly. otherwise it's not a sprite name. + if (len != 4) + continue; + if (stricmp(name, sprnames[spritenum]) == 0) { md2_models[spritenum].scale = scale; md2_models[spritenum].offset = offset; md2_models[spritenum].notfound = false; strcpy(md2_models[spritenum].filename, filename); - goto spritemd2found; + goto spritemodelfound; } } md2_models[spritenum].notfound = true; -spritemd2found: +spritemodelfound: fclose(f); } diff --git a/src/hardware/hw_md2.h b/src/hardware/hw_md2.h index 6f5985a44..40dbdf079 100644 --- a/src/hardware/hw_md2.h +++ b/src/hardware/hw_md2.h @@ -49,4 +49,6 @@ void HWR_AddPlayerModel(INT32 skin); void HWR_AddSpriteModel(size_t spritenum); boolean HWR_DrawModel(gr_vissprite_t *spr); +#define PLAYERMODELPREFIX "SKIN" + #endif // _HW_MD2_H_ From 7bc58c4c0e569c552a8c82dd450d802b83fd711b Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Wed, 12 Feb 2020 13:41:30 -0300 Subject: [PATCH 050/112] Add MAXTOL --- src/dehacked.c | 56 +++++++++++--------------------------------------- src/doomstat.h | 9 ++++---- src/g_game.c | 42 +++++++++++++++++++++++++++++++------ 3 files changed, 53 insertions(+), 54 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 958eaad32..79d0b46dd 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -594,21 +594,21 @@ static void readfreeslots(MYFILE *f) else if (fastcmp(type, "TOL")) { // Search if we already have a typeoflevel by that name... - for (i = 0; i < numtolinfo; i++) + for (i = 0; TYPEOFLEVEL[i].name; i++) if (fastcmp(word, TYPEOFLEVEL[i].name)) break; // We found it? Then don't allocate another one. - if (i < numtolinfo) + if (TYPEOFLEVEL[i].name) continue; // We don't, so freeslot it. - if (lastcustomtol > 31) // Unless you have way too many, since they're flags. + if (lastcustomtol == MAXTOL) // Unless you have way too many, since they're flags. deh_warning("Ran out of free typeoflevel slots!\n"); else { - G_AddTOL((1<= numtolinfo) { - if (lastcustomtol > 31) // Unless you have way too many, since they're flags. + if (TYPEOFLEVEL[i].name == NULL) { + if (lastcustomtol == MAXTOL) // Unless you have way too many, since they're flags. CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n"); else { - UINT32 newtol = (1< Date: Wed, 12 Feb 2020 13:59:08 -0300 Subject: [PATCH 051/112] Cast Moment --- src/dehacked.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 79d0b46dd..4d1147276 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -603,7 +603,7 @@ static void readfreeslots(MYFILE *f) continue; // We don't, so freeslot it. - if (lastcustomtol == MAXTOL) // Unless you have way too many, since they're flags. + if (lastcustomtol == (UINT32)MAXTOL) // Unless you have way too many, since they're flags. deh_warning("Ran out of free typeoflevel slots!\n"); else { @@ -10454,7 +10454,7 @@ static inline int lib_freeslot(lua_State *L) // We don't, so allocate a new one. if (TYPEOFLEVEL[i].name == NULL) { - if (lastcustomtol == MAXTOL) // Unless you have way too many, since they're flags. + if (lastcustomtol == (UINT32)MAXTOL) // Unless you have way too many, since they're flags. CONS_Alert(CONS_WARNING, "Ran out of free typeoflevel slots!\n"); else { CONS_Printf("TypeOfLevel TOL_%s allocated.\n",word); From d9e2256a3c30dce3ee35cb37085579cea88f7878 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Fri, 14 Feb 2020 22:30:37 -0500 Subject: [PATCH 052/112] 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 a98e84faa04accaef39d50095308132183ce0bde Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 15 Feb 2020 12:40:41 -0300 Subject: [PATCH 053/112] change prefix to "PLAYER" --- src/hardware/hw_md2.c | 52 +++++++++++++++++++++++++------------------ src/hardware/hw_md2.h | 2 +- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 33bed3e46..6c4801cc7 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -476,8 +476,9 @@ void HWR_InitModels(void) size_t i; INT32 s; FILE *f; - char name[22], filename[32]; + char name[24], filename[32]; float scale, offset; + size_t prefixlen; CONS_Printf("HWR_InitModels()...\n"); for (s = 0; s < MAXSKINS; s++) @@ -510,15 +511,18 @@ void HWR_InitModels(void) return; } - while (fscanf(f, "%23s %31s %f %f", name, filename, &scale, &offset) == 4) + // length of the player model prefix + prefixlen = strlen(PLAYERMODELPREFIX); + + while (fscanf(f, "%25s %31s %f %f", name, filename, &scale, &offset) == 4) { char *skinname = name; size_t len = strlen(name); - // check for the skin model prefix. - if (strnicmp(name, PLAYERMODELPREFIX, 4) == 0 && len > 4) + // check for the player model prefix. + if (!strnicmp(name, PLAYERMODELPREFIX, prefixlen) && (len > prefixlen)) { - skinname += 4; + skinname += prefixlen; goto addskinmodel; } @@ -539,7 +543,7 @@ void HWR_InitModels(void) } addskinmodel: - // add skin model + // add player model for (s = 0; s < MAXSKINS; s++) { if (stricmp(skinname, skins[s].name) == 0) @@ -563,8 +567,9 @@ modelfound: void HWR_AddPlayerModel(int skin) // For skins that were added after startup { FILE *f; - char name[22], filename[32]; + char name[24], filename[32]; float scale, offset; + size_t prefixlen; if (nomd2s) return; @@ -582,13 +587,18 @@ void HWR_AddPlayerModel(int skin) // For skins that were added after startup return; } + // length of the player model prefix + prefixlen = strlen(PLAYERMODELPREFIX); + // Check for any models that match the names of player skins! - while (fscanf(f, "%23s %31s %f %f", name, filename, &scale, &offset) == 4) + while (fscanf(f, "%25s %31s %f %f", name, filename, &scale, &offset) == 4) { - // ignore the skin model prefix. char *skinname = name; - if (!strnicmp(name, PLAYERMODELPREFIX, 4)) - skinname += 4; + size_t len = strlen(name); + + // ignore the player model prefix. + if (!strnicmp(name, PLAYERMODELPREFIX, prefixlen) && (len > prefixlen)) + skinname += prefixlen; if (stricmp(skinname, skins[skin].name) == 0) { @@ -609,10 +619,10 @@ playermodelfound: void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after startup { FILE *f; - // name[22] is used to check for names in the models.dat file that match with sprites or player skins + // name[24] is used to check for names in the models.dat file that match with sprites or player skins // sprite names are always 4 characters long, and names is for player skins can be up to 19 characters long - // PLAYERMODELPREFIX is 4 characters long - char name[22], filename[32]; + // PLAYERMODELPREFIX is 6 characters long + char name[24], filename[32]; float scale, offset; if (nomd2s) @@ -633,19 +643,17 @@ void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after s } // Check for any models that match the names of sprite names! - while (fscanf(f, "%23s %31s %f %f", name, filename, &scale, &offset) == 4) + while (fscanf(f, "%25s %31s %f %f", name, filename, &scale, &offset) == 4) { // length of the sprite name size_t len = strlen(name); - - // check for the skin model prefix. - if (!strnicmp(name, PLAYERMODELPREFIX, 4)) - continue; // that's not a sprite... - - // must be 4 characters long exactly. otherwise it's not a sprite name. - if (len != 4) + if (len != 4) // must be 4 characters long exactly. otherwise it's not a sprite name. continue; + // check for the player model prefix. + if (!strnicmp(name, PLAYERMODELPREFIX, strlen(PLAYERMODELPREFIX))) + continue; // that's not a sprite... + if (stricmp(name, sprnames[spritenum]) == 0) { md2_models[spritenum].scale = scale; diff --git a/src/hardware/hw_md2.h b/src/hardware/hw_md2.h index 40dbdf079..3bbe30053 100644 --- a/src/hardware/hw_md2.h +++ b/src/hardware/hw_md2.h @@ -49,6 +49,6 @@ void HWR_AddPlayerModel(INT32 skin); void HWR_AddSpriteModel(size_t spritenum); boolean HWR_DrawModel(gr_vissprite_t *spr); -#define PLAYERMODELPREFIX "SKIN" +#define PLAYERMODELPREFIX "PLAYER" #endif // _HW_MD2_H_ From 2b615aa09c7a7923cbf70b9ea624309f428a7a76 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 15 Feb 2020 17:34:21 -0500 Subject: [PATCH 054/112] 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 055/112] 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 056/112] 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 057/112] 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 058/112] 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 059/112] 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 b6089ccdaf9746446b229c14cdb34c0c3ad24544 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 27 Jan 2020 01:57:55 -0300 Subject: [PATCH 060/112] Fix -OGLlib --- src/i_video.h | 13 +++++++++-- src/screen.c | 2 +- src/sdl/i_video.c | 58 +++++++++++++++++++++++++++++++++++++++-------- src/sdl/ogl_sdl.c | 8 +++---- 4 files changed, 65 insertions(+), 16 deletions(-) diff --git a/src/i_video.h b/src/i_video.h index 76b984d25..8f87a360e 100644 --- a/src/i_video.h +++ b/src/i_video.h @@ -32,10 +32,13 @@ typedef enum render_none = 3 // for dedicated server } rendermode_t; -/** \brief currect render mode +/** \brief current render mode */ extern rendermode_t rendermode; +/** \brief hardware renderer loaded +*/ +extern boolean hwrenderloaded; /** \brief use highcolor modes if true */ @@ -44,6 +47,9 @@ extern boolean highcolor; /** \brief setup video mode */ void I_StartupGraphics(void); + +/** \brief setup hardware mode +*/ void I_StartupHardwareGraphics(void); /** \brief restore old video mode @@ -82,9 +88,12 @@ INT32 VID_GetModeForSize(INT32 w, INT32 h); \param modenum video mode to set to - \return currect video mode + \return current video mode */ INT32 VID_SetMode(INT32 modenum); + +/** \brief Checks the render state +*/ void VID_CheckRenderer(void); /** \brief The VID_GetModeName function diff --git a/src/screen.c b/src/screen.c index fcf6c6b0b..b5faaef7e 100644 --- a/src/screen.c +++ b/src/screen.c @@ -464,7 +464,7 @@ void SCR_ChangeRenderer(void) { target_renderer = cv_renderer.value; #ifdef HWRENDER - if (M_CheckParm("-opengl")) + if (M_CheckParm("-opengl") && hwrenderloaded) target_renderer = rendermode = render_opengl; else #endif diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 13e2423c4..a37e94fad 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -93,7 +93,8 @@ static INT32 numVidModes = -1; */ static char vidModeName[33][32]; // allow 33 different modes -rendermode_t rendermode=render_soft; +rendermode_t rendermode = render_soft; +static rendermode_t chosenrendermode = render_soft; // set by command line arguments boolean highcolor = false; @@ -103,6 +104,7 @@ static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff static consvar_t cv_alwaysgrabmouse = {"alwaysgrabmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; UINT8 graphics_started = 0; // Is used in console.c and screen.c +boolean hwrenderloaded = false; // To disable fullscreen at startup; is set in VID_PrepareModeList boolean allow_fullscreen = false; @@ -1468,14 +1470,44 @@ static SDL_bool Impl_CreateContext(void) return SDL_TRUE; } +#ifdef HWRENDER +static void VID_CheckGLLoaded(rendermode_t oldrender) +{ + if (!hwrenderloaded) // Well, it didn't work the first time anyway. + { + CONS_Alert(CONS_ERROR, "OpenGL never loaded\n"); + rendermode = oldrender; + if (chosenrendermode == render_opengl) // fallback to software + rendermode = render_soft; + if (setrenderneeded) + { + CV_StealthSetValue(&cv_renderer, oldrender); + CV_StealthSetValue(&cv_newrenderer, oldrender); + setrenderneeded = 0; + } + } +} +#endif + void VID_CheckRenderer(void) { + rendermode_t oldrenderer = rendermode; + if (dedicated) return; +#ifdef HWRENDER + if (!graphics_started) + VID_CheckGLLoaded(oldrenderer); +#endif + if (setrenderneeded) { rendermode = setrenderneeded; +#ifdef HWRENDER + if (setrenderneeded == render_opengl) + VID_CheckGLLoaded(oldrenderer); +#endif Impl_CreateContext(); } @@ -1498,9 +1530,15 @@ void VID_CheckRenderer(void) else if (rendermode == render_opengl) { I_StartupHardwareGraphics(); - R_InitHardwareMode(); - HWR_Switch(); + // Needs to check if switching failed somehow, too. + if (rendermode == render_opengl) + { + R_InitHardwareMode(); + HWR_Switch(); + } } +#else + (void)oldrenderer; #endif } @@ -1665,10 +1703,10 @@ void I_StartupGraphics(void) #ifdef HWRENDER if (M_CheckParm("-opengl")) - rendermode = render_opengl; + chosenrendermode = rendermode = render_opengl; else if (M_CheckParm("-software")) #endif - rendermode = render_soft; + chosenrendermode = rendermode = render_soft; usesdl2soft = M_CheckParm("-softblit"); borderlesswindow = M_CheckParm("-borderless"); @@ -1764,13 +1802,15 @@ void I_StartupHardwareGraphics(void) HWD.pfnMakeScreenTexture= hwSym("MakeScreenTexture",NULL); HWD.pfnMakeScreenFinalTexture=hwSym("MakeScreenFinalTexture",NULL); HWD.pfnDrawScreenFinalTexture=hwSym("DrawScreenFinalTexture",NULL); - // check gl renderer lib - if (HWD.pfnGetRenderVersion() != VERSION) - I_Error("%s", M_GetText("The version of the renderer doesn't match the version of the executable\nBe sure you have installed SRB2 properly.\n")); + if (!HWD.pfnInit(I_Error)) // let load the OpenGL library + { rendermode = render_soft; + setrenderneeded = 0; + } else - glstartup = true; + hwrenderloaded = true; + glstartup = true; } #endif } diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index 6c0dd35a5..3e02e4ec3 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -128,15 +128,15 @@ boolean LoadGL(void) return SetupGLfunc(); else { - I_OutputMsg("Could not load GLU Library: %s\n", GLULibname); + CONS_Alert(CONS_ERROR, "Could not load GLU Library: %s\n", GLULibname); if (!M_CheckParm ("-GLUlib")) - I_OutputMsg("If you know what is the GLU library's name, use -GLUlib\n"); + CONS_Alert(CONS_ERROR, "If you know what is the GLU library's name, use -GLUlib\n"); } } else { - I_OutputMsg("Could not load GLU Library\n"); - I_OutputMsg("If you know what is the GLU library's name, use -GLUlib\n"); + CONS_Alert(CONS_ERROR, "Could not load GLU Library\n"); + CONS_Alert(CONS_ERROR, "If you know what is the GLU library's name, use -GLUlib\n"); } #endif return SetupGLfunc(); From cca366552519495e120ce798e1dd82930f4f16a2 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 15 Feb 2020 13:51:32 -0300 Subject: [PATCH 061/112] Fallback to Software if the renderer version doesn't match --- src/sdl/i_video.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index a37e94fad..4b30fc676 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1803,13 +1803,19 @@ void I_StartupHardwareGraphics(void) HWD.pfnMakeScreenFinalTexture=hwSym("MakeScreenFinalTexture",NULL); HWD.pfnDrawScreenFinalTexture=hwSym("DrawScreenFinalTexture",NULL); - if (!HWD.pfnInit(I_Error)) // let load the OpenGL library + if (HWD.pfnGetRenderVersion() != VERSION) + { + CONS_Alert(CONS_ERROR, M_GetText("The version of the renderer doesn't match the version of the executable\nBe sure you have installed SRB2 properly.\n")); + hwrenderloaded = false; + } + else + hwrenderloaded = HWD.pfnInit(I_Error); // let load the OpenGL library + + if (!hwrenderloaded) { rendermode = render_soft; setrenderneeded = 0; } - else - hwrenderloaded = true; glstartup = true; } #endif From 6c5db5f4628f199206e1183414716839d563a5d5 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 15 Feb 2020 14:25:28 -0300 Subject: [PATCH 062/112] Missing comment --- src/sdl/i_video.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 4b30fc676..afaaa2775 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1803,6 +1803,7 @@ void I_StartupHardwareGraphics(void) HWD.pfnMakeScreenFinalTexture=hwSym("MakeScreenFinalTexture",NULL); HWD.pfnDrawScreenFinalTexture=hwSym("DrawScreenFinalTexture",NULL); + // check gl renderer lib if (HWD.pfnGetRenderVersion() != VERSION) { CONS_Alert(CONS_ERROR, M_GetText("The version of the renderer doesn't match the version of the executable\nBe sure you have installed SRB2 properly.\n")); From 07afd7520fb53bc110c5c97a890e82e5f8b67854 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 15 Feb 2020 14:10:55 -0300 Subject: [PATCH 063/112] Only initialise OpenGL if you actually intend to use it. --- src/i_video.h | 3 ++- src/sdl/i_video.c | 24 +++++++++++++++--------- src/sdl/ogl_sdl.c | 4 ++-- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/i_video.h b/src/i_video.h index 8f87a360e..294b7ef84 100644 --- a/src/i_video.h +++ b/src/i_video.h @@ -37,8 +37,9 @@ typedef enum extern rendermode_t rendermode; /** \brief hardware renderer loaded + 0 = never loaded, 1 = loaded successfully, -1 = failed loading */ -extern boolean hwrenderloaded; +extern INT32 hwrenderloaded; /** \brief use highcolor modes if true */ diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index afaaa2775..18cce3eab 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -104,7 +104,7 @@ static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff static consvar_t cv_alwaysgrabmouse = {"alwaysgrabmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; UINT8 graphics_started = 0; // Is used in console.c and screen.c -boolean hwrenderloaded = false; +INT32 hwrenderloaded = 0; // To disable fullscreen at startup; is set in VID_PrepareModeList boolean allow_fullscreen = false; @@ -1473,7 +1473,7 @@ static SDL_bool Impl_CreateContext(void) #ifdef HWRENDER static void VID_CheckGLLoaded(rendermode_t oldrender) { - if (!hwrenderloaded) // Well, it didn't work the first time anyway. + if (hwrenderloaded == -1) // Well, it didn't work the first time anyway. { CONS_Alert(CONS_ERROR, "OpenGL never loaded\n"); rendermode = oldrender; @@ -1505,8 +1505,13 @@ void VID_CheckRenderer(void) { rendermode = setrenderneeded; #ifdef HWRENDER - if (setrenderneeded == render_opengl) + if (rendermode == render_opengl) + { VID_CheckGLLoaded(oldrenderer); + // Initialise OpenGL before calling SDLSetMode!!! + if (hwrenderloaded != 1) + I_StartupHardwareGraphics(); + } #endif Impl_CreateContext(); } @@ -1522,14 +1527,14 @@ void VID_CheckRenderer(void) bufSurface = NULL; } #ifdef HWRENDER - HWR_FreeTextureCache(); + if (hwrenderloaded == 1) // Only if OpenGL ever loaded! + HWR_FreeTextureCache(); #endif SCR_SetDrawFuncs(); } #ifdef HWRENDER else if (rendermode == render_opengl) { - I_StartupHardwareGraphics(); // Needs to check if switching failed somehow, too. if (rendermode == render_opengl) { @@ -1714,7 +1719,8 @@ void I_StartupGraphics(void) //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); VID_Command_ModeList_f(); #ifdef HWRENDER - I_StartupHardwareGraphics(); + if (chosenrendermode == render_opengl) + I_StartupHardwareGraphics(); #endif // Fury: we do window initialization after GL setup to allow @@ -1807,12 +1813,12 @@ void I_StartupHardwareGraphics(void) if (HWD.pfnGetRenderVersion() != VERSION) { CONS_Alert(CONS_ERROR, M_GetText("The version of the renderer doesn't match the version of the executable\nBe sure you have installed SRB2 properly.\n")); - hwrenderloaded = false; + hwrenderloaded = -1; } else - hwrenderloaded = HWD.pfnInit(I_Error); // let load the OpenGL library + hwrenderloaded = HWD.pfnInit(I_Error) ? 1 : -1; // let load the OpenGL library - if (!hwrenderloaded) + if (hwrenderloaded == -1) { rendermode = render_soft; setrenderneeded = 0; diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index 3e02e4ec3..6654a75a0 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -95,10 +95,10 @@ boolean LoadGL(void) if (SDL_GL_LoadLibrary(OGLLibname) != 0) { - I_OutputMsg("Could not load OpenGL Library: %s\n" + CONS_Alert(CONS_ERROR, "Could not load OpenGL Library: %s\n" "Falling back to Software mode.\n", SDL_GetError()); if (!M_CheckParm ("-OGLlib")) - I_OutputMsg("If you know what is the OpenGL library's name, use -OGLlib\n"); + CONS_Alert(CONS_ERROR, "If you know what is the OpenGL library's name, use -OGLlib\n"); return 0; } From 3fa4db891f9ef693acf6c8e1668dc038e2fb310e Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 17 Feb 2020 01:13:13 -0300 Subject: [PATCH 064/112] Always load the GL library! --- src/sdl/i_video.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 18cce3eab..b50790f77 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1719,8 +1719,7 @@ void I_StartupGraphics(void) //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); VID_Command_ModeList_f(); #ifdef HWRENDER - if (chosenrendermode == render_opengl) - I_StartupHardwareGraphics(); + I_StartupHardwareGraphics(); #endif // Fury: we do window initialization after GL setup to allow From 9d9de3aff6e5272c62e1c243732ea5af3820a356 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 15 Feb 2020 14:38:16 -0300 Subject: [PATCH 065/112] Only set OpenGL as the target renderer if it loaded successfully --- src/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index b5faaef7e..9c1af11a8 100644 --- a/src/screen.c +++ b/src/screen.c @@ -464,7 +464,7 @@ void SCR_ChangeRenderer(void) { target_renderer = cv_renderer.value; #ifdef HWRENDER - if (M_CheckParm("-opengl") && hwrenderloaded) + if (M_CheckParm("-opengl") && (hwrenderloaded == 1)) target_renderer = rendermode = render_opengl; else #endif From 7ddad9c9ec9fac004d9c19a5a8a97da7c07d3d74 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 15 Feb 2020 21:08:06 -0300 Subject: [PATCH 066/112] Remove redundant check --- src/sdl/i_video.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index b50790f77..fa1de19f2 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1535,12 +1535,8 @@ void VID_CheckRenderer(void) #ifdef HWRENDER else if (rendermode == render_opengl) { - // Needs to check if switching failed somehow, too. - if (rendermode == render_opengl) - { - R_InitHardwareMode(); - HWR_Switch(); - } + R_InitHardwareMode(); + HWR_Switch(); } #else (void)oldrenderer; From 04ee6ca12c29fbb7a1a9ec2ca6288d1d60adda5e Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 15 Feb 2020 22:11:54 -0300 Subject: [PATCH 067/112] Don't call HWR_Switch twice --- src/sdl/i_video.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index fa1de19f2..ca7b56592 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1534,10 +1534,7 @@ void VID_CheckRenderer(void) } #ifdef HWRENDER else if (rendermode == render_opengl) - { R_InitHardwareMode(); - HWR_Switch(); - } #else (void)oldrenderer; #endif From 8da832986c31debdbba610997634febb880eac08 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 15 Feb 2020 22:23:05 -0300 Subject: [PATCH 068/112] Don't center the window when changing renderers --- src/sdl/i_video.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index ca7b56592..bacb4f771 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -176,7 +176,7 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen); //static void Impl_SetWindowName(const char *title); static void Impl_SetWindowIcon(void); -static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) +static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen, SDL_bool reposition) { static SDL_bool wasfullscreen = SDL_FALSE; Uint32 rmask; @@ -205,10 +205,13 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) } // Reposition window only in windowed mode SDL_SetWindowSize(window, width, height); - SDL_SetWindowPosition(window, - SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)), - SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)) - ); + if (reposition) + { + SDL_SetWindowPosition(window, + SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)), + SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)) + ); + } } } else @@ -1491,6 +1494,7 @@ static void VID_CheckGLLoaded(rendermode_t oldrender) void VID_CheckRenderer(void) { + SDL_bool rendererchanged = SDL_FALSE; rendermode_t oldrenderer = rendermode; if (dedicated) @@ -1504,6 +1508,8 @@ void VID_CheckRenderer(void) if (setrenderneeded) { rendermode = setrenderneeded; + rendererchanged = SDL_TRUE; + #ifdef HWRENDER if (rendermode == render_opengl) { @@ -1511,12 +1517,15 @@ void VID_CheckRenderer(void) // Initialise OpenGL before calling SDLSetMode!!! if (hwrenderloaded != 1) I_StartupHardwareGraphics(); + else if (hwrenderloaded == -1) + rendererchanged = SDL_FALSE; } #endif + Impl_CreateContext(); } - SDLSetMode(vid.width, vid.height, USE_FULLSCREEN); + SDLSetMode(vid.width, vid.height, USE_FULLSCREEN, (rendererchanged ? SDL_FALSE : SDL_TRUE)); Impl_VideoSetupBuffer(); if (rendermode == render_soft) From 07d71778dc8093b88f5c5665f55b83fb042e4ae0 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sat, 1 Feb 2020 22:11:21 -0500 Subject: [PATCH 069/112] FIX COLOR BUG --- src/hardware/hw_data.h | 1 - src/hardware/hw_md2.c | 57 ++++++++++++++++++------------------------ src/p_setup.c | 5 ++++ src/w_wad.c | 2 +- src/z_zone.c | 2 ++ src/z_zone.h | 1 + 6 files changed, 33 insertions(+), 35 deletions(-) diff --git a/src/hardware/hw_data.h b/src/hardware/hw_data.h index f525e041f..ef57426a4 100644 --- a/src/hardware/hw_data.h +++ b/src/hardware/hw_data.h @@ -48,7 +48,6 @@ struct GLMipmap_s struct GLMipmap_s *nextcolormap; const UINT8 *colormap; - INT32 tcindex; // opengl struct GLMipmap_s *nextmipmap; // opengl : liste of all texture in opengl driver diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index a107a6d05..f24976c60 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1020,32 +1020,13 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT // mostly copied from HWR_GetMappedPatch, hence the similarities and comment GLMipmap_t *grmip, *newmip; - if ((colormap == colormaps || colormap == NULL) && (skinnum > TC_DEFAULT)) + if (colormap == colormaps || colormap == NULL) { // Don't do any blending HWD.pfnSetTexture(gpatch->mipmap); return; } - // search for the mipmap - // skip the first (no colormap translated) - for (grmip = gpatch->mipmap; grmip->nextcolormap; ) - { - grmip = grmip->nextcolormap; - if (grmip->colormap == colormap || (skinnum < TC_DEFAULT && grmip->tcindex == skinnum)) - { - if (grmip->downloaded && grmip->grInfo.data) - { - HWD.pfnSetTexture(grmip); // found the colormap, set it to the correct texture - Z_ChangeTag(grmip->grInfo.data, PU_HWRMODELTEXTURE); - return; - } - } - } - - // If here, the blended texture has not been created - // So we create it - if ((blendgpatch && blendgpatch->mipmap->grInfo.format) && (gpatch->width != blendgpatch->width || gpatch->height != blendgpatch->height)) { @@ -1054,21 +1035,39 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT return; } + // search for the mipmap + // skip the first (no colormap translated) + for (grmip = gpatch->mipmap; grmip->nextcolormap; ) + { + grmip = grmip->nextcolormap; + if (grmip->colormap == colormap) + { + if (grmip->downloaded && grmip->grInfo.data) + { + HWD.pfnSetTexture(grmip); // found the colormap, set it to the correct texture + Z_ChangeTag(grmip->grInfo.data, PU_HWRMODELTEXTURE_UNLOCKED); + return; + } + } + } + + // If here, the blended texture has not been created + // So we create it + //BP: WARNING: don't free it manually without clearing the cache of harware renderer // (it have a liste of mipmap) // this malloc is cleared in HWR_FreeTextureCache // (...) unfortunately z_malloc fragment alot the memory :(so malloc is better newmip = calloc(1, sizeof (*newmip)); if (newmip == NULL) - I_Error("%s: Out of memory", "HWR_GetMappedPatch"); + I_Error("%s: Out of memory", "HWR_GetBlendedTexture"); grmip->nextcolormap = newmip; newmip->colormap = colormap; - newmip->tcindex = skinnum; HWR_CreateBlendedTexture(gpatch, blendgpatch, newmip, skinnum, color); HWD.pfnSetTexture(newmip); - Z_ChangeTag(newmip->grInfo.data, PU_HWRMODELTEXTURE); + Z_ChangeTag(newmip->grInfo.data, PU_HWRMODELTEXTURE_UNLOCKED); } #define NORMALFOG 0x00000000 @@ -1298,7 +1297,7 @@ boolean HWR_DrawModel(gr_vissprite_t *spr) if (gpatch && gpatch->mipmap->grInfo.format) // else if meant that if a texture couldn't be loaded, it would just end up using something else's texture { - INT32 skinnum = INT32_MAX; + INT32 skinnum = TC_DEFAULT; if ((spr->mobj->flags & (MF_ENEMY|MF_BOSS)) && (spr->mobj->flags2 & MF2_FRET) && !(spr->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash" { @@ -1329,15 +1328,7 @@ boolean HWR_DrawModel(gr_vissprite_t *spr) } // Translation or skin number found - if (skinnum != INT32_MAX) - { - HWR_GetBlendedTexture(gpatch, (GLPatch_t *)md2->blendgrpatch, skinnum, spr->colormap, (skincolors_t)spr->mobj->color); - } - else - { - // Sorry nothing - HWD.pfnSetTexture(gpatch->mipmap); - } + HWR_GetBlendedTexture(gpatch, (GLPatch_t *)md2->blendgrpatch, skinnum, spr->colormap, (skincolors_t)spr->mobj->color); } else { diff --git a/src/p_setup.c b/src/p_setup.c index c291dc7c3..64671c1ee 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3699,10 +3699,15 @@ void HWR_SetupLevel(void) // Meaning, they had memory allocated and marked with the PU_LEVEL tag. // Level textures are only reloaded after R_LoadTextures, which is // when the texture list is loaded. + + // Sal: Unfortunately, NOT freeing them causes the dreaded Color Bug. + HWR_FreeMipmapCache(); + #ifdef ALAM_LIGHTING // BP: reset light between levels (we draw preview frame lights on current frame) HWR_ResetLights(); #endif + // Correct missing sidedefs & deep water trick HWR_CorrectSWTricks(); HWR_CreatePlanePolygons((INT32)numnodes - 1); diff --git a/src/w_wad.c b/src/w_wad.c index e544378c8..bfadd9081 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1475,7 +1475,7 @@ void W_FlushCachedPatches(void) Z_FreeTag(PU_HWRPATCHINFO); Z_FreeTag(PU_HWRMODELTEXTURE); Z_FreeTag(PU_HWRCACHE); - Z_FreeTags(PU_HWRCACHE_UNLOCKED, PU_HWRPATCHINFO_UNLOCKED); + Z_FreeTags(PU_HWRCACHE_UNLOCKED, PU_HWRMODELTEXTURE_UNLOCKED); } needpatchflush = false; } diff --git a/src/z_zone.c b/src/z_zone.c index e0e37312a..8cd2f7ead 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -519,6 +519,7 @@ void Z_FlushCachedPatches(void) Z_FreeTag(PU_HWRCACHE); Z_FreeTag(PU_HWRCACHE_UNLOCKED); Z_FreeTag(PU_HWRPATCHINFO_UNLOCKED); + Z_FreeTag(PU_HWRMODELTEXTURE_UNLOCKED); } // happens before a renderer switch @@ -816,6 +817,7 @@ static void Command_Memfree_f(void) CONS_Printf(M_GetText("HW Texture cache : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRCACHE)>>10)); CONS_Printf(M_GetText("Plane polygons : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPLANE)>>10)); CONS_Printf(M_GetText("HW Texture used : %7d KB\n"), HWR_GetTextureUsed()>>10); + CONS_Printf(M_GetText("HW model textures : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRMODELTEXTURE)>>10)); } #endif diff --git a/src/z_zone.h b/src/z_zone.h index 9e5f74343..250885e10 100644 --- a/src/z_zone.h +++ b/src/z_zone.h @@ -64,6 +64,7 @@ enum // 'second-level' cache for graphics // stored in hardware format and downloaded as needed PU_HWRPATCHINFO_UNLOCKED = 103, // 'unlocked' PU_HWRPATCHINFO memory + PU_HWRMODELTEXTURE_UNLOCKED = 104, // 'unlocked' PU_HWRMODELTEXTURE memory }; // From 067a2667e3dcc83261961b403acd4338fb6a0245 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 8 Feb 2020 18:27:44 -0300 Subject: [PATCH 070/112] move hw texture used to be always below. --- src/z_zone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/z_zone.c b/src/z_zone.c index 8cd2f7ead..e06f7bf1a 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -816,8 +816,8 @@ static void Command_Memfree_f(void) CONS_Printf(M_GetText("Mipmap patches : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPATCHCOLMIPMAP)>>10)); CONS_Printf(M_GetText("HW Texture cache : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRCACHE)>>10)); CONS_Printf(M_GetText("Plane polygons : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRPLANE)>>10)); - CONS_Printf(M_GetText("HW Texture used : %7d KB\n"), HWR_GetTextureUsed()>>10); CONS_Printf(M_GetText("HW model textures : %7s KB\n"), sizeu1(Z_TagUsage(PU_HWRMODELTEXTURE)>>10)); + CONS_Printf(M_GetText("HW Texture used : %7d KB\n"), HWR_GetTextureUsed()>>10); } #endif From cac5f9d1714676f53fbe0f35531db17a3bc9ebfd Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 17 Feb 2020 12:14:51 -0300 Subject: [PATCH 071/112] add -nogl parm --- src/d_main.c | 9 ++++++++- src/m_menu.c | 28 ++++++++++++++++++++++++++-- src/screen.c | 14 ++++++++++++++ src/sdl/i_video.c | 11 +++++++---- 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 6616dfaa6..d9f67675c 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1291,11 +1291,18 @@ void D_SRB2Main(void) // Lactozilla: Does the render mode need to change? if ((setrenderneeded != 0) && (setrenderneeded != rendermode)) { - CONS_Printf("Switching the renderer...\n"); + CONS_Printf(M_GetText("Switching the renderer...\n")); + Z_PreparePatchFlush(); + + // set needpatchflush / needpatchrecache true for D_CheckRendererState needpatchflush = true; needpatchrecache = true; + + // Set cv_renderer to the new render mode VID_CheckRenderer(); SCR_ChangeRendererCVars(setrenderneeded); + + // check the renderer's state, and then clear setrenderneeded D_CheckRendererState(); setrenderneeded = 0; } diff --git a/src/m_menu.c b/src/m_menu.c index 97c04ebd5..0349ed3bc 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -310,6 +310,7 @@ static void M_AssignJoystick(INT32 choice); static void M_ChangeControl(INT32 choice); // Video & Sound +static void M_VideoOptions(INT32 choice); menu_t OP_VideoOptionsDef, OP_VideoModeDef, OP_ColorOptionsDef; #ifdef HWRENDER static void M_OpenGLOptionsMenu(void); @@ -1031,7 +1032,7 @@ static menuitem_t OP_MainMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Player 2 Controls...", &OP_P2ControlsDef, 20}, {IT_CVAR | IT_STRING, NULL, "Controls per key", &cv_controlperkey, 30}, - {IT_SUBMENU | IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 50}, + {IT_CALL | IT_STRING, NULL, "Video Options...", M_VideoOptions, 50}, {IT_SUBMENU | IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 60}, {IT_CALL | IT_STRING, NULL, "Server Options...", M_ServerOptions, 80}, @@ -1282,6 +1283,16 @@ static menuitem_t OP_Camera2ExtendedOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 126}, }; +enum +{ + op_video_resolution = 1, +#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) + op_video_fullscreen, +#endif + op_video_vsync, + op_video_renderer, +}; + static menuitem_t OP_VideoOptionsMenu[] = { {IT_HEADER, NULL, "Screen", NULL, 0}, @@ -2078,6 +2089,20 @@ menu_t OP_PlaystyleDef = { 0, 0, 0, NULL }; +static void M_VideoOptions(INT32 choice) +{ + (void)choice; +#ifdef HWRENDER + if (hwrenderloaded == -1) + { + OP_VideoOptionsMenu[op_video_renderer].status = (IT_TRANSTEXT | IT_PAIR); + OP_VideoOptionsMenu[op_video_renderer].patch = "Renderer"; + OP_VideoOptionsMenu[op_video_renderer].text = "Software"; + } + +#endif + M_SetupNextMenu(&OP_VideoOptionsDef); +} menu_t OP_VideoOptionsDef = { @@ -12005,7 +12030,6 @@ static void M_VideoModeMenu(INT32 choice) static void M_DrawMainVideoMenu(void) { - M_DrawGenericScrollMenu(); if (itemOn < 8) // where it starts to go offscreen; change this number if you change the layout of the video menu { diff --git a/src/screen.c b/src/screen.c index 9c1af11a8..9c61f5689 100644 --- a/src/screen.c +++ b/src/screen.c @@ -450,6 +450,20 @@ static int target_renderer = 0; void SCR_ActuallyChangeRenderer(void) { setrenderneeded = target_renderer; + +#ifdef HWRENDER + // Well, it didn't even load anyway. + if ((hwrenderloaded == -1) && (setrenderneeded == render_opengl)) + { + if (M_CheckParm("-nogl")) + CONS_Alert(CONS_ERROR, "OpenGL rendering was disabled!\n"); + else + CONS_Alert(CONS_ERROR, "OpenGL never loaded\n"); + setrenderneeded = 0; + return; + } +#endif + // setting the same renderer twice WILL crash your game, so let's not, please if (rendermode == setrenderneeded) setrenderneeded = 0; diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index bacb4f771..1dbaf06bd 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1440,7 +1440,7 @@ static SDL_bool Impl_CreateContext(void) { // Renderer-specific stuff #ifdef HWRENDER - if (rendermode == render_opengl) + if ((rendermode == render_opengl) && (hwrenderloaded != -1)) { if (!sdlglcontext) sdlglcontext = SDL_GL_CreateContext(window); @@ -1478,7 +1478,6 @@ static void VID_CheckGLLoaded(rendermode_t oldrender) { if (hwrenderloaded == -1) // Well, it didn't work the first time anyway. { - CONS_Alert(CONS_ERROR, "OpenGL never loaded\n"); rendermode = oldrender; if (chosenrendermode == render_opengl) // fallback to software rendermode = render_soft; @@ -1587,7 +1586,8 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) flags |= SDL_WINDOW_BORDERLESS; #ifdef HWRENDER - flags |= SDL_WINDOW_OPENGL; + if (hwrenderloaded != -1) + flags |= SDL_WINDOW_OPENGL; #endif // Create a window @@ -1721,7 +1721,10 @@ void I_StartupGraphics(void) //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); VID_Command_ModeList_f(); #ifdef HWRENDER - I_StartupHardwareGraphics(); + if (M_CheckParm("-nogl")) + hwrenderloaded = -1; // Don't call SDL_GL_LoadLibrary + else + I_StartupHardwareGraphics(); #endif // Fury: we do window initialization after GL setup to allow From a9a0601c84bcddbef577a458ced27e652b4df44c Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 17 Feb 2020 16:37:13 -0800 Subject: [PATCH 072/112] Revert "Revert "Let the console open in menus"" This reverts commit 705cf9fd4078ce34857d98043023612e9205773c. --- src/console.c | 11 +---------- src/d_main.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/console.c b/src/console.c index 59d2b3e6c..8746bf036 100644 --- a/src/console.c +++ b/src/console.c @@ -613,15 +613,6 @@ void CON_Ticker(void) con_tick++; con_tick &= 7; - // if the menu is open then close the console. - if (menuactive && con_destlines) - { - consoletoggle = false; - con_destlines = 0; - CON_ClearHUD(); - I_UpdateMouseGrab(); - } - // console key was pushed if (consoletoggle) { @@ -793,7 +784,7 @@ boolean CON_Responder(event_t *ev) // check other keys only if console prompt is active if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!! { - if (bindtable[key]) + if (! menuactive && bindtable[key]) { COM_BufAddText(bindtable[key]); COM_BufAddText("\n"); diff --git a/src/d_main.c b/src/d_main.c index 2ff0042fd..149fb3071 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -188,14 +188,14 @@ void D_ProcessEvents(void) continue; } - // Menu input - if (M_Responder(ev)) - continue; // menu ate the event - // console input if (CON_Responder(ev)) continue; // ate the event + // Menu input + if (M_Responder(ev)) + continue; // menu ate the event + G_Responder(ev); } } @@ -502,13 +502,12 @@ static void D_Display(void) // vid size change is now finished if it was on... vid.recalc = 0; - // FIXME: draw either console or menu, not the two - if (gamestate != GS_TIMEATTACK) - CON_Drawer(); - M_Drawer(); // menu is drawn even on top of everything // focus lost moved to M_Drawer + if (gamestate != GS_TIMEATTACK) + CON_Drawer(); + // // wipe update // From b2733eba73146c9b87ebdcff26cc0e10d4107408 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 15 Feb 2020 17:08:07 -0800 Subject: [PATCH 073/112] Draw console in the Record/NiGHTS Attack menus (cherry picked from commit 4efd915d28d0f193528d141b04c5f88b84877f97) --- src/d_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 149fb3071..6b5164894 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -505,8 +505,7 @@ static void D_Display(void) M_Drawer(); // menu is drawn even on top of everything // focus lost moved to M_Drawer - if (gamestate != GS_TIMEATTACK) - CON_Drawer(); + CON_Drawer(); // // wipe update From b78fc670d0824e2054d102706813087d0086c331 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 17 Feb 2020 17:10:29 -0800 Subject: [PATCH 074/112] Don't let console open with menu keys while the menu is open --- src/d_main.c | 8 ++++---- src/m_menu.c | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 6b5164894..cff6b8805 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -188,14 +188,14 @@ void D_ProcessEvents(void) continue; } - // console input - if (CON_Responder(ev)) - continue; // ate the event - // Menu input if (M_Responder(ev)) continue; // menu ate the event + // console input + if (CON_Responder(ev)) + continue; // ate the event + G_Responder(ev); } } diff --git a/src/m_menu.c b/src/m_menu.c index dbe5d854f..687f87051 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3150,6 +3150,9 @@ boolean M_Responder(event_t *ev) if (gamestate == GS_TITLESCREEN && finalecount < TICRATE) return false; + if (CON_Ready()) + return false; + if (noFurtherInput) { // Ignore input after enter/escape/other buttons @@ -3509,6 +3512,7 @@ boolean M_Responder(event_t *ev) return false; default: + CON_Responder(ev); break; } From b3933c7842ccff52c1c5b61fbb904459f86dd654 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 17 Feb 2020 22:59:36 -0300 Subject: [PATCH 075/112] 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 076/112] 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 e3ba369ae4dd239b93c2aa812f0eb8e1b227aa42 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 17 Feb 2020 19:38:14 -0800 Subject: [PATCH 077/112] Fix M_Ftrim - Use '%f' instead of '%g' to avoid going scientific. Should also fix some compiler warnings. - The trailing zero trimming code is now useful. It started on the terminating byte before and wouldn't have done anything with '%g' anyway. - Use the absolute fractional value to avoid a sign. --- src/m_misc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/m_misc.c b/src/m_misc.c index 3dfeef81e..d762712b6 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -2618,14 +2618,15 @@ const char * M_Ftrim (double f) static char dig[9];/* "0." + 6 digits (6 is printf's default) */ int i; /* I know I said it's the default, but just in case... */ - sprintf(dig, "%.6g", modf(f, &f)); - if (dig[0]) + sprintf(dig, "%.6f", fabs(modf(f, &f))); + /* trim trailing zeroes */ + for (i = strlen(dig)-1; dig[i] == '0'; --i) + ; + if (dig[i] == '.')/* :NOTHING: */ + return ""; + else { - for (i = strlen(dig); dig[i] == '0'; --i) - ; dig[i + 1] = '\0'; return &dig[1];/* skip the 0 */ } - else - return ""; } 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 078/112] 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 079/112] 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 080/112] 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); From ebc1809da987b47746a537ee5bdaa8824b6c7b3f Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Wed, 19 Feb 2020 22:01:33 +0100 Subject: [PATCH 081/112] Fix bad tabulation --- src/d_netfil.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 71449caca..413eef1ef 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -477,21 +477,21 @@ void AddLuaFileTransfer(const char *filename, const char *mode) if (!filetransfer) I_Error("AddLuaFileTransfer: Out of memory\n"); *prevnext = filetransfer; - filetransfer->next = NULL; + filetransfer->next = NULL; - // Allocate the file name - filetransfer->filename = strdup(filename); - if (!filetransfer->filename) + // Allocate the file name + filetransfer->filename = strdup(filename); + if (!filetransfer->filename) I_Error("AddLuaFileTransfer: Out of memory\n"); - // Create and allocate the real file name + // Create and allocate the real file name if (server) filetransfer->realfilename = strdup(va("%s" PATHSEP "%s", luafiledir, filename)); else filetransfer->realfilename = strdup(va("%s" PATHSEP "client" PATHSEP "$$$%d%d.tmp", luafiledir, rand(), rand())); - if (!filetransfer->realfilename) + if (!filetransfer->realfilename) I_Error("AddLuaFileTransfer: Out of memory\n"); strlcpy(filetransfer->mode, mode, sizeof(filetransfer->mode)); @@ -556,7 +556,7 @@ void SV_PrepareSendLuaFileToNextNode(void) void SV_HandleLuaFileSent(UINT8 node) { luafiletransfers->nodestatus[node] = LFTNS_SENT; - SV_PrepareSendLuaFileToNextNode(); + SV_PrepareSendLuaFileToNextNode(); } void RemoveLuaFileTransfer(void) @@ -1036,7 +1036,7 @@ void Got_Filetxpak(void) CONS_Printf(M_GetText("Downloading %s...(done)\n"), filename); #ifdef HAVE_BLUA - if (luafiletransfers) + if (luafiletransfers) { // Tell the server we have received the file netbuffer->packettype = PT_HASLUAFILE; From 20d054a679acdf70971ad0e90d992dc942fe3679 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Wed, 19 Feb 2020 22:37:30 +0100 Subject: [PATCH 082/112] Minor code cleanup --- src/d_clisrv.c | 2 +- src/d_netfil.c | 4 ++-- src/d_netfil.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6b0f49544..9f0d2439e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3164,7 +3164,7 @@ void D_QuitNetGame(void) // abort send/receive of files CloseNetFile(); - RemoveLuaFileTransfers(); + RemoveAllLuaFileTransfers(); waitingforluafiletransfer = false; if (server) diff --git a/src/d_netfil.c b/src/d_netfil.c index 413eef1ef..1d1e7d203 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -506,7 +506,7 @@ void AddLuaFileTransfer(const char *filename, const char *mode) if (!luafiletransfers->next) // Only if there is no transfer already going on { - if (FIL_FileOK(filetransfer->realfilename)) + if (FIL_ReadFileOK(filetransfer->realfilename)) SV_PrepareSendLuaFileToNextNode(); else { @@ -572,7 +572,7 @@ void RemoveLuaFileTransfer(void) free(filetransfer); } -void RemoveLuaFileTransfers(void) +void RemoveAllLuaFileTransfers(void) { while (luafiletransfers) RemoveLuaFileTransfer(); diff --git a/src/d_netfil.h b/src/d_netfil.h index 0d0b16975..0473b5f44 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -101,7 +101,7 @@ boolean SV_SendLuaFile(INT32 node, const char *filename, boolean textmode); void SV_PrepareSendLuaFile(const char *filename); void SV_HandleLuaFileSent(UINT8 node); void RemoveLuaFileTransfer(void); -void RemoveLuaFileTransfers(void); +void RemoveAllLuaFileTransfers(void); void SV_AbortLuaFileTransfer(INT32 node); void CL_PrepareDownloadLuaFile(void); void Got_LuaFile(UINT8 **cp, INT32 playernum); From 7060083db5b119718c1bc1988d0f7801e61e4af6 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 19 Feb 2020 14:08:45 -0800 Subject: [PATCH 083/112] Update copyright year to 2020 --- src/Makefile | 2 +- src/am_map.c | 2 +- src/am_map.h | 2 +- src/apng.c | 2 +- src/apng.h | 2 +- src/asm_defs.inc | 2 +- src/b_bot.c | 2 +- src/b_bot.h | 2 +- src/byteptr.h | 2 +- src/command.c | 2 +- src/command.h | 2 +- src/console.c | 2 +- src/console.h | 2 +- src/d_clisrv.c | 2 +- src/d_clisrv.h | 2 +- src/d_event.h | 2 +- src/d_main.c | 4 ++-- src/d_main.h | 2 +- src/d_net.c | 2 +- src/d_net.h | 2 +- src/d_netcmd.c | 2 +- src/d_netcmd.h | 2 +- src/d_netfil.c | 2 +- src/d_netfil.h | 2 +- src/d_player.h | 2 +- src/d_think.h | 2 +- src/d_ticcmd.h | 2 +- src/dehacked.c | 2 +- src/dehacked.h | 2 +- src/djgppdos/rdb-s.h | 2 +- src/doomdata.h | 2 +- src/doomdef.h | 2 +- src/doomstat.h | 2 +- src/doomtype.h | 2 +- src/endian.h | 2 +- src/f_finale.c | 2 +- src/f_finale.h | 2 +- src/f_wipe.c | 2 +- src/g_game.c | 2 +- src/g_game.h | 2 +- src/g_input.c | 2 +- src/g_input.h | 2 +- src/g_state.h | 2 +- src/hardware/r_opengl/r_opengl.c | 2 +- src/hu_stuff.c | 2 +- src/hu_stuff.h | 2 +- src/i_addrinfo.c | 2 +- src/i_addrinfo.h | 2 +- src/i_joy.h | 2 +- src/i_net.h | 2 +- src/i_sound.h | 2 +- src/i_system.h | 2 +- src/i_tcp.c | 2 +- src/i_tcp.h | 2 +- src/i_video.h | 2 +- src/info.c | 2 +- src/info.h | 2 +- src/keys.h | 2 +- src/lua_baselib.c | 2 +- src/lua_blockmaplib.c | 2 +- src/lua_consolelib.c | 2 +- src/lua_hook.h | 2 +- src/lua_hooklib.c | 2 +- src/lua_hud.h | 2 +- src/lua_hudlib.c | 2 +- src/lua_infolib.c | 2 +- src/lua_libs.h | 2 +- src/lua_maplib.c | 2 +- src/lua_mathlib.c | 2 +- src/lua_mobjlib.c | 2 +- src/lua_playerlib.c | 2 +- src/lua_script.c | 2 +- src/lua_script.h | 2 +- src/lua_skinlib.c | 2 +- src/lua_thinkerlib.c | 2 +- src/m_aatree.c | 2 +- src/m_aatree.h | 2 +- src/m_anigif.c | 2 +- src/m_anigif.h | 2 +- src/m_argv.c | 2 +- src/m_argv.h | 2 +- src/m_bbox.c | 2 +- src/m_bbox.h | 2 +- src/m_cheat.c | 2 +- src/m_cheat.h | 2 +- src/m_cond.c | 2 +- src/m_cond.h | 2 +- src/m_dllist.h | 2 +- src/m_fixed.c | 2 +- src/m_fixed.h | 2 +- src/m_menu.c | 2 +- src/m_menu.h | 2 +- src/m_misc.c | 2 +- src/m_misc.h | 2 +- src/m_queue.c | 2 +- src/m_queue.h | 2 +- src/m_random.c | 2 +- src/m_random.h | 2 +- src/m_swap.h | 2 +- src/mserv.c | 2 +- src/mserv.h | 2 +- src/p_ceilng.c | 2 +- src/p_enemy.c | 2 +- src/p_floor.c | 2 +- src/p_inter.c | 2 +- src/p_lights.c | 2 +- src/p_local.h | 2 +- src/p_map.c | 2 +- src/p_maputl.c | 2 +- src/p_maputl.h | 2 +- src/p_mobj.c | 2 +- src/p_mobj.h | 2 +- src/p_polyobj.c | 2 +- src/p_polyobj.h | 2 +- src/p_pspr.h | 2 +- src/p_saveg.c | 2 +- src/p_saveg.h | 2 +- src/p_setup.c | 2 +- src/p_setup.h | 2 +- src/p_sight.c | 2 +- src/p_slopes.c | 2 +- src/p_slopes.h | 2 +- src/p_spec.c | 2 +- src/p_spec.h | 2 +- src/p_telept.c | 2 +- src/p_tick.c | 2 +- src/p_tick.h | 2 +- src/p_user.c | 2 +- src/r_bsp.c | 2 +- src/r_bsp.h | 2 +- src/r_data.c | 2 +- src/r_data.h | 2 +- src/r_defs.h | 2 +- src/r_draw.c | 2 +- src/r_draw.h | 2 +- src/r_draw16.c | 2 +- src/r_draw8.c | 2 +- src/r_draw8_npo2.c | 2 +- src/r_local.h | 2 +- src/r_main.c | 2 +- src/r_main.h | 2 +- src/r_patch.c | 2 +- src/r_patch.h | 4 ++-- src/r_plane.c | 2 +- src/r_plane.h | 2 +- src/r_portal.c | 2 +- src/r_portal.h | 2 +- src/r_segs.c | 2 +- src/r_segs.h | 2 +- src/r_sky.c | 2 +- src/r_sky.h | 2 +- src/r_splats.c | 2 +- src/r_splats.h | 2 +- src/r_state.h | 2 +- src/r_things.c | 2 +- src/r_things.h | 2 +- src/s_sound.c | 2 +- src/s_sound.h | 2 +- src/screen.c | 2 +- src/screen.h | 2 +- src/sdl/i_system.c | 2 +- src/sdl/i_video.c | 2 +- src/sdl/mixer_sound.c | 2 +- src/sdl/ogl_sdl.c | 2 +- src/sdl/ogl_sdl.h | 2 +- src/sdl/sdl_sound.c | 2 +- src/sdl/sdlmain.h | 2 +- src/sounds.c | 2 +- src/sounds.h | 2 +- src/st_stuff.c | 2 +- src/st_stuff.h | 2 +- src/strcasestr.c | 2 +- src/string.c | 3 +-- src/tables.c | 2 +- src/tables.h | 2 +- src/tmap.nas | 2 +- src/tmap.s | 2 +- src/tmap_asm.s | 2 +- src/tmap_mmx.nas | 2 +- src/tmap_vc.nas | 2 +- src/v_video.c | 2 +- src/v_video.h | 2 +- src/vid_copy.s | 2 +- src/w_wad.c | 2 +- src/w_wad.h | 2 +- src/win32/Srb2win.rc | 2 +- src/y_inter.c | 2 +- src/y_inter.h | 2 +- src/z_zone.c | 2 +- src/z_zone.h | 2 +- 190 files changed, 192 insertions(+), 193 deletions(-) diff --git a/src/Makefile b/src/Makefile index c30c236de..9f368217c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ # GNU Make makefile for SRB2 ############################################################################# # Copyright (C) 1998-2000 by DooM Legacy Team. -# Copyright (C) 2003-2019 by Sonic Team Junior. +# Copyright (C) 2003-2020 by Sonic Team Junior. # # This program is free software distributed under the # terms of the GNU General Public License, version 2. diff --git a/src/am_map.c b/src/am_map.c index b2c7de442..234df1abd 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/am_map.h b/src/am_map.h index 0560207bb..1c8fa70e4 100644 --- a/src/am_map.h +++ b/src/am_map.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/apng.c b/src/apng.c index 694b3d1e8..0abbe541d 100644 --- a/src/apng.c +++ b/src/apng.c @@ -1,5 +1,5 @@ /* -Copyright 2019, James R. +Copyright 2019-2020, James R. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/apng.h b/src/apng.h index 0f22dca6d..a8b5c8f24 100644 --- a/src/apng.h +++ b/src/apng.h @@ -1,5 +1,5 @@ /* -Copyright 2019, James R. +Copyright 2019-2020, James R. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/asm_defs.inc b/src/asm_defs.inc index 82149f70e..ec286b0bd 100644 --- a/src/asm_defs.inc +++ b/src/asm_defs.inc @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/b_bot.c b/src/b_bot.c index f83aaa34c..4f904b672 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2007-2016 by John "JTE" Muniz. -// Copyright (C) 2011-2019 by Sonic Team Junior. +// Copyright (C) 2011-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/b_bot.h b/src/b_bot.h index 54ef300a3..2806bd68f 100644 --- a/src/b_bot.h +++ b/src/b_bot.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2007-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/byteptr.h b/src/byteptr.h index 57fe9cb75..933c2af34 100644 --- a/src/byteptr.h +++ b/src/byteptr.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/command.c b/src/command.c index cb6803b57..d1eea6052 100644 --- a/src/command.c +++ b/src/command.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/command.h b/src/command.h index e7371b2fa..404052ce4 100644 --- a/src/command.h +++ b/src/command.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/console.c b/src/console.c index 59d2b3e6c..8af560b36 100644 --- a/src/console.c +++ b/src/console.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/console.h b/src/console.h index 7a55c4b92..2be92d62b 100644 --- a/src/console.h +++ b/src/console.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 77118110e..7f417b595 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_clisrv.h b/src/d_clisrv.h index df93fe31d..10a1d714d 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_event.h b/src/d_event.h index c61b9460a..3cce8fad1 100644 --- a/src/d_event.h +++ b/src/d_event.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_main.c b/src/d_main.c index ae706ea91..32b714715 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -1035,7 +1035,7 @@ void D_SRB2Main(void) // Print GPL notice for our console users (Linux) CONS_Printf( "\n\nSonic Robo Blast 2\n" - "Copyright (C) 1998-2019 by Sonic Team Junior\n\n" + "Copyright (C) 1998-2020 by Sonic Team Junior\n\n" "This program comes with ABSOLUTELY NO WARRANTY.\n\n" "This is free software, and you are welcome to redistribute it\n" "and/or modify it under the terms of the GNU General Public License\n" diff --git a/src/d_main.h b/src/d_main.h index b0cd3cb88..81de0634d 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_net.c b/src/d_net.c index 573c9cfe9..f7848f16e 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_net.h b/src/d_net.h index c6fe4a27f..ed4f66284 100644 --- a/src/d_net.h +++ b/src/d_net.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_netcmd.c b/src/d_netcmd.c index bac297f8e..24bdde0f6 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_netcmd.h b/src/d_netcmd.h index f258cde62..2b0ddd185 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_netfil.c b/src/d_netfil.c index 93b4b1990..3926ff14d 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_netfil.h b/src/d_netfil.h index 17aeb8b7e..8214ccd4c 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_player.h b/src/d_player.h index db55a9913..8e6702b7b 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_think.h b/src/d_think.h index c56551c21..4bdac4627 100644 --- a/src/d_think.h +++ b/src/d_think.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h index 337be1ff0..0a8012bb1 100644 --- a/src/d_ticcmd.h +++ b/src/d_ticcmd.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/dehacked.c b/src/dehacked.c index 4d1147276..78c3fa3c4 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/dehacked.h b/src/dehacked.h index 2b34377fd..80c31f3de 100644 --- a/src/dehacked.h +++ b/src/dehacked.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/djgppdos/rdb-s.h b/src/djgppdos/rdb-s.h index b7a994fc9..2d460c935 100644 --- a/src/djgppdos/rdb-s.h +++ b/src/djgppdos/rdb-s.h @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// Copyright (C) 2005-2019 by Sonic Team Junior. +// Copyright (C) 2005-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/doomdata.h b/src/doomdata.h index f6e7cb584..c2ee50c2e 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/doomdef.h b/src/doomdef.h index 071090285..f98ab709b 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/doomstat.h b/src/doomstat.h index cf02e4389..59e7ba0d5 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/doomtype.h b/src/doomtype.h index 6365f851e..571e930e0 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/endian.h b/src/endian.h index 76f3ef6e8..24d8e35cd 100644 --- a/src/endian.h +++ b/src/endian.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/f_finale.c b/src/f_finale.c index 66f963bbb..c98d49842 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/f_finale.h b/src/f_finale.h index efc2de2e6..63319d7d6 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/f_wipe.c b/src/f_wipe.c index a350e0f36..fb0803a34 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/g_game.c b/src/g_game.c index 989722010..3352f0fbe 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/g_game.h b/src/g_game.h index a4afac163..c4c40d84b 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/g_input.c b/src/g_input.c index ed7bc5cb6..ecce4d83c 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/g_input.h b/src/g_input.h index f7f952d72..a7484c7ad 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/g_state.h b/src/g_state.h index e82a34935..3320ebc47 100644 --- a/src/g_state.h +++ b/src/g_state.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index becce9fa3..833e9bd11 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// Copyright (C) 1998-2019 by Sonic Team Junior. +// Copyright (C) 1998-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/hu_stuff.c b/src/hu_stuff.c index bf2432f5d..74b68ce69 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 3502a1b2d..9e3c66747 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_addrinfo.c b/src/i_addrinfo.c index dd3b5ab0f..e77774549 100644 --- a/src/i_addrinfo.c +++ b/src/i_addrinfo.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2011-2019 by Sonic Team Junior. +// Copyright (C) 2011-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_addrinfo.h b/src/i_addrinfo.h index 3108c422e..7ae006719 100644 --- a/src/i_addrinfo.h +++ b/src/i_addrinfo.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2011-2019 by Sonic Team Junior. +// Copyright (C) 2011-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_joy.h b/src/i_joy.h index 5f9b63712..2a2797fc4 100644 --- a/src/i_joy.h +++ b/src/i_joy.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_net.h b/src/i_net.h index e96891d9d..5d93f191e 100644 --- a/src/i_net.h +++ b/src/i_net.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_sound.h b/src/i_sound.h index fbaa93053..4bd05d234 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_system.h b/src/i_system.h index a60b56310..b38748244 100644 --- a/src/i_system.h +++ b/src/i_system.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_tcp.c b/src/i_tcp.c index 502eb6732..34cad1765 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_tcp.h b/src/i_tcp.h index ea8b0a94f..738b8b4d1 100644 --- a/src/i_tcp.h +++ b/src/i_tcp.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_video.h b/src/i_video.h index 76b984d25..2993a6916 100644 --- a/src/i_video.h +++ b/src/i_video.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/info.c b/src/info.c index 20bd73498..03a7a6d2b 100644 --- a/src/info.c +++ b/src/info.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/info.h b/src/info.h index 59b8eb68d..cda87eb72 100644 --- a/src/info.h +++ b/src/info.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/keys.h b/src/keys.h index 8819aaa86..6cdd7956c 100644 --- a/src/keys.h +++ b/src/keys.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 66bd30e32..a74b165cd 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_blockmaplib.c b/src/lua_blockmaplib.c index 7f7dc9560..78a9e75a1 100644 --- a/src/lua_blockmaplib.c +++ b/src/lua_blockmaplib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2016 by Iestyn "Monster Iestyn" Jealous. -// Copyright (C) 2016-2019 by Sonic Team Junior. +// Copyright (C) 2016-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index 48f2e20a8..923722eb8 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_hook.h b/src/lua_hook.h index 94d2239f7..265700e4f 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index f9dad6cb7..efed9adb7 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_hud.h b/src/lua_hud.h index a00a5cb02..4a7c596c8 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2014-2016 by John "JTE" Muniz. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index dbab801df..d35c84d64 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2014-2016 by John "JTE" Muniz. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 7a2465ef7..6760b4203 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_libs.h b/src/lua_libs.h index 6a908d03d..f217d4b2a 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 99ee1d145..0344fd5bb 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_mathlib.c b/src/lua_mathlib.c index 9115c7321..d2a959dde 100644 --- a/src/lua_mathlib.c +++ b/src/lua_mathlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 90733b2c6..a7bd8da94 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 1dd4c45b5..fbf0d1523 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_script.c b/src/lua_script.c index 2538fb711..e539192cc 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_script.h b/src/lua_script.h index 8f27dcb4c..6caccd69b 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c index a4ab075b4..3ade06042 100644 --- a/src/lua_skinlib.c +++ b/src/lua_skinlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2014-2016 by John "JTE" Muniz. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/lua_thinkerlib.c b/src/lua_thinkerlib.c index 1462b26ef..ddb5abf72 100644 --- a/src/lua_thinkerlib.c +++ b/src/lua_thinkerlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_aatree.c b/src/m_aatree.c index efa92cbe0..c0bb739f8 100644 --- a/src/m_aatree.c +++ b/src/m_aatree.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_aatree.h b/src/m_aatree.h index af95f91b8..b784eb17a 100644 --- a/src/m_aatree.h +++ b/src/m_aatree.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_anigif.c b/src/m_anigif.c index faa8f29e1..ce2ca20b9 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh. // Copyright (C) 2013 by "Ninji". -// Copyright (C) 2013-2019 by Sonic Team Junior. +// Copyright (C) 2013-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_anigif.h b/src/m_anigif.h index 9eb6faa75..4bb45b67d 100644 --- a/src/m_anigif.h +++ b/src/m_anigif.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 2013-2019 by Sonic Team Junior. +// Copyright (C) 2013-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_argv.c b/src/m_argv.c index 129706127..acb74cff4 100644 --- a/src/m_argv.c +++ b/src/m_argv.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_argv.h b/src/m_argv.h index 57c3f9d50..ca97d9b12 100644 --- a/src/m_argv.h +++ b/src/m_argv.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_bbox.c b/src/m_bbox.c index 5af1b4ef8..02d534164 100644 --- a/src/m_bbox.c +++ b/src/m_bbox.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_bbox.h b/src/m_bbox.h index dce3cf15a..9b63c61b6 100644 --- a/src/m_bbox.h +++ b/src/m_bbox.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_cheat.c b/src/m_cheat.c index 980d9fc21..1431e8873 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_cheat.h b/src/m_cheat.h index 3c4403e7f..092e51756 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_cond.c b/src/m_cond.c index 08f3fe038..89058a488 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_cond.h b/src/m_cond.h index 7fe3105fb..d7b9704dd 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 2012-2019 by Sonic Team Junior. +// Copyright (C) 2012-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_dllist.h b/src/m_dllist.h index 8f8d4c1fb..680c2cd80 100644 --- a/src/m_dllist.h +++ b/src/m_dllist.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2005 by James Haley -// Copyright (C) 2005-2019 by Sonic Team Junior. +// Copyright (C) 2005-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_fixed.c b/src/m_fixed.c index 6be54c486..eb10fd5f8 100644 --- a/src/m_fixed.c +++ b/src/m_fixed.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_fixed.h b/src/m_fixed.h index 02d4c73ff..7fdb9ad0a 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_menu.c b/src/m_menu.c index dbe5d854f..a5ba229c3 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2011-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_menu.h b/src/m_menu.h index 862303426..18b681ff0 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2011-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_misc.c b/src/m_misc.c index d762712b6..920a13198 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_misc.h b/src/m_misc.h index ad12517c1..d64faea59 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_queue.c b/src/m_queue.c index d8cb97d07..8603ab202 100644 --- a/src/m_queue.c +++ b/src/m_queue.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2003 by James Haley -// Copyright (C) 2003-2019 by Sonic Team Junior. +// Copyright (C) 2003-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_queue.h b/src/m_queue.h index 096b0e1bb..3e9579e11 100644 --- a/src/m_queue.h +++ b/src/m_queue.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2003 by James Haley -// Copyright (C) 2003-2019 by Sonic Team Junior. +// Copyright (C) 2003-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_random.c b/src/m_random.c index 8fd0e1e4e..481fdb72b 100644 --- a/src/m_random.c +++ b/src/m_random.c @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_random.h b/src/m_random.h index 5efd3e02c..01190e046 100644 --- a/src/m_random.h +++ b/src/m_random.h @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2012-2016 by Matthew "Kaito Sinclaire" Walsh. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_swap.h b/src/m_swap.h index d7233cba5..b44d6de8c 100644 --- a/src/m_swap.h +++ b/src/m_swap.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/mserv.c b/src/mserv.c index 4ddab05b9..505a21931 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/mserv.h b/src/mserv.h index b851aed30..6d91da643 100644 --- a/src/mserv.h +++ b/src/mserv.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_ceilng.c b/src/p_ceilng.c index 7031c287d..c65156b6f 100644 --- a/src/p_ceilng.c +++ b/src/p_ceilng.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_enemy.c b/src/p_enemy.c index 2ddbd8d29..5d067ebc3 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_floor.c b/src/p_floor.c index c23d469bc..9c5ab9057 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_inter.c b/src/p_inter.c index 667245f03..6d991367d 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_lights.c b/src/p_lights.c index 7de6a4dc5..371077a30 100644 --- a/src/p_lights.c +++ b/src/p_lights.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_local.h b/src/p_local.h index 8056d137c..0c3c9f164 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_map.c b/src/p_map.c index 40fee7b46..0fd1b8e07 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_maputl.c b/src/p_maputl.c index b4043d643..69be5a70f 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_maputl.h b/src/p_maputl.h index 16cfc834e..bb09c3ed1 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_mobj.c b/src/p_mobj.c index 10898f70e..00d6ae4f2 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_mobj.h b/src/p_mobj.h index fd0c95a56..63c91571b 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_polyobj.c b/src/p_polyobj.c index a206d0171..7e1ff1f49 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2006 by James Haley -// Copyright (C) 2006-2019 by Sonic Team Junior. +// Copyright (C) 2006-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_polyobj.h b/src/p_polyobj.h index 339390c0a..d56701d2d 100644 --- a/src/p_polyobj.h +++ b/src/p_polyobj.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2006 by James Haley -// Copyright (C) 2006-2019 by Sonic Team Junior. +// Copyright (C) 2006-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_pspr.h b/src/p_pspr.h index a7545bc3e..3c10e9be4 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_saveg.c b/src/p_saveg.c index 7d755edc6..a49184f86 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_saveg.h b/src/p_saveg.h index 16d47bea8..012e7023b 100644 --- a/src/p_saveg.h +++ b/src/p_saveg.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_setup.c b/src/p_setup.c index e1bfff98a..2c22fcaa3 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_setup.h b/src/p_setup.h index d7e2d8861..e7150c0ae 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_sight.c b/src/p_sight.c index 07dfabbc1..4ea14cca0 100644 --- a/src/p_sight.c +++ b/src/p_sight.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_slopes.c b/src/p_slopes.c index d584bb92d..cbece787e 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2004 by Stephen McGranahan -// Copyright (C) 2015-2019 by Sonic Team Junior. +// Copyright (C) 2015-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_slopes.h b/src/p_slopes.h index 0bf03f26d..f8159b884 100644 --- a/src/p_slopes.h +++ b/src/p_slopes.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2004 by Stephen McGranahan -// Copyright (C) 2015-2019 by Sonic Team Junior. +// Copyright (C) 2015-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_spec.c b/src/p_spec.c index 76a80d754..ff309008c 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_spec.h b/src/p_spec.h index 4b64fe05d..6377059b6 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_telept.c b/src/p_telept.c index 69729d208..600d40c88 100644 --- a/src/p_telept.c +++ b/src/p_telept.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_tick.c b/src/p_tick.c index 74472b71f..1d421ad37 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_tick.h b/src/p_tick.h index a9501f62f..1fb88f3f2 100644 --- a/src/p_tick.h +++ b/src/p_tick.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/p_user.c b/src/p_user.c index a63022986..19f49b90e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_bsp.c b/src/r_bsp.c index 6b4667aee..c0011f4b9 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_bsp.h b/src/r_bsp.h index 95aea9eff..1562b79f6 100644 --- a/src/r_bsp.h +++ b/src/r_bsp.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_data.c b/src/r_data.c index 5608fdbde..63ceeee78 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_data.h b/src/r_data.h index 145f0182b..20949fb4d 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_defs.h b/src/r_defs.h index 88d418fc9..dcb1b42be 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_draw.c b/src/r_draw.c index 743965cfb..5ea881c38 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_draw.h b/src/r_draw.h index da38c40e0..870d294c3 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_draw16.c b/src/r_draw16.c index 48017f45e..8b1d29e8d 100644 --- a/src/r_draw16.c +++ b/src/r_draw16.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_draw8.c b/src/r_draw8.c index 015dac2a7..a09884dcc 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_draw8_npo2.c b/src/r_draw8_npo2.c index 748ca195c..1a3b3e5e5 100644 --- a/src/r_draw8_npo2.c +++ b/src/r_draw8_npo2.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_local.h b/src/r_local.h index 379d55205..48044118d 100644 --- a/src/r_local.h +++ b/src/r_local.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_main.c b/src/r_main.c index a5789d6ba..3ec4a0976 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_main.h b/src/r_main.h index d72e94973..fad2aa233 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_patch.c b/src/r_patch.c index 4304f3eab..374189ac0 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 2005-2009 by Andrey "entryway" Budko. // Copyright (C) 2018-2020 by Jaime "Lactozilla" Passos. -// Copyright (C) 2019-2020 by Sonic Team Junior. +// Copyright (C) 2020-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_patch.h b/src/r_patch.h index e743a7d09..23d03bcec 100644 --- a/src/r_patch.h +++ b/src/r_patch.h @@ -1,8 +1,8 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. -// Copyright (C) 2018-2019 by Jaime "Lactozilla" Passos. -// Copyright (C) 2019 by Sonic Team Junior. +// Copyright (C) 2018-2020 by Jaime "Lactozilla" Passos. +// Copyright (C) 2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_plane.c b/src/r_plane.c index 5d5e1f20d..17ad24d0b 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_plane.h b/src/r_plane.h index d9ba5c56b..405dd9726 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_portal.c b/src/r_portal.c index 576b606ec..1aca145ec 100644 --- a/src/r_portal.c +++ b/src/r_portal.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_portal.h b/src/r_portal.h index c46ddfdab..406b98d10 100644 --- a/src/r_portal.h +++ b/src/r_portal.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_segs.c b/src/r_segs.c index dcb5fc160..bdc577e93 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_segs.h b/src/r_segs.h index 1c852ddc7..a61f1f921 100644 --- a/src/r_segs.h +++ b/src/r_segs.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_sky.c b/src/r_sky.c index c9d28cebc..b2221645d 100644 --- a/src/r_sky.c +++ b/src/r_sky.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_sky.h b/src/r_sky.h index 8eca2077a..55d866b86 100644 --- a/src/r_sky.h +++ b/src/r_sky.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_splats.c b/src/r_splats.c index f690dfa94..dfec185a1 100644 --- a/src/r_splats.c +++ b/src/r_splats.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_splats.h b/src/r_splats.h index 7565b4bcc..4ad893abb 100644 --- a/src/r_splats.h +++ b/src/r_splats.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_state.h b/src/r_state.h index 1451fca7a..7c860a6f2 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_things.c b/src/r_things.c index ca285644f..0a88a1394 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_things.h b/src/r_things.h index 217179148..bd6271b60 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/s_sound.c b/src/s_sound.c index d84e20ab4..8193fdb9b 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/s_sound.h b/src/s_sound.h index 9a4cbe48b..d7e0c46ab 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/screen.c b/src/screen.c index fcf6c6b0b..c2736345f 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/screen.h b/src/screen.h index 02b336f75..717ce9adc 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 81420e757..a86af316e 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -5,7 +5,7 @@ // // Copyright (C) 1993-1996 by id Software, Inc. // Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 7af1863ab..ece36b68e 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -4,7 +4,7 @@ // // Copyright (C) 1993-1996 by id Software, Inc. // Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index b60dab14c..9a713608c 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index 6c0dd35a5..b441000dd 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sdl/ogl_sdl.h b/src/sdl/ogl_sdl.h index 88d7d0b6c..748e30bae 100644 --- a/src/sdl/ogl_sdl.h +++ b/src/sdl/ogl_sdl.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index b8991293c..86e294fb5 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // // Copyright (C) 1993-1996 by id Software, Inc. -// Copyright (C) 2014-2019 by Sonic Team Junior. +// Copyright (C) 2014-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sdl/sdlmain.h b/src/sdl/sdlmain.h index bdafebfe9..e35506114 100644 --- a/src/sdl/sdlmain.h +++ b/src/sdl/sdlmain.h @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// Copyright (C) 2006-2019 by Sonic Team Junior. +// Copyright (C) 2006-2020 by Sonic Team Junior. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/src/sounds.c b/src/sounds.c index 720ba851e..a9d720d5c 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/sounds.h b/src/sounds.h index 039349d4f..e49dd2f3e 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/st_stuff.c b/src/st_stuff.c index d99d564c8..6f6f7e3ce 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/st_stuff.h b/src/st_stuff.h index e4b21b2b0..4ea307d2b 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/strcasestr.c b/src/strcasestr.c index 4ff778bf1..b266278ed 100644 --- a/src/strcasestr.c +++ b/src/strcasestr.c @@ -2,7 +2,7 @@ strcasestr -- case insensitive substring searching function. */ /* -Copyright 2019 James R. +Copyright 2019-2020 James R. All rights reserved. Redistribution and use in source forms, with or without modification, is diff --git a/src/string.c b/src/string.c index dc30529cc..e430c5cc3 100644 --- a/src/string.c +++ b/src/string.c @@ -1,8 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2006 by Graue. -// Copyright (C) 2006-2019 by Sonic Team Junior. -// Copyright (C) 2019 by James R. +// Copyright (C) 2006-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tables.c b/src/tables.c index 72dfaf0c3..00424db22 100644 --- a/src/tables.c +++ b/src/tables.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tables.h b/src/tables.h index 07e3cdf09..953d891ce 100644 --- a/src/tables.h +++ b/src/tables.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tmap.nas b/src/tmap.nas index 79452ab8c..106f38e96 100644 --- a/src/tmap.nas +++ b/src/tmap.nas @@ -1,7 +1,7 @@ ;; SONIC ROBO BLAST 2 ;;----------------------------------------------------------------------------- ;; Copyright (C) 1998-2000 by DooM Legacy Team. -;; Copyright (C) 1999-2019 by Sonic Team Junior. +;; Copyright (C) 1999-2020 by Sonic Team Junior. ;; ;; This program is free software distributed under the ;; terms of the GNU General Public License, version 2. diff --git a/src/tmap.s b/src/tmap.s index cdd65eee3..3a4cf2e1a 100644 --- a/src/tmap.s +++ b/src/tmap.s @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tmap_asm.s b/src/tmap_asm.s index 067318f30..3cd0f87cc 100644 --- a/src/tmap_asm.s +++ b/src/tmap_asm.s @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/tmap_mmx.nas b/src/tmap_mmx.nas index 843419c65..15b97499d 100644 --- a/src/tmap_mmx.nas +++ b/src/tmap_mmx.nas @@ -1,7 +1,7 @@ ;; SONIC ROBO BLAST 2 ;;----------------------------------------------------------------------------- ;; Copyright (C) 1998-2000 by DOSDOOM. -;; Copyright (C) 2010-2019 by Sonic Team Junior. +;; Copyright (C) 2010-2020 by Sonic Team Junior. ;; ;; This program is free software distributed under the ;; terms of the GNU General Public License, version 2. diff --git a/src/tmap_vc.nas b/src/tmap_vc.nas index 72ed9a530..49eb21a6d 100644 --- a/src/tmap_vc.nas +++ b/src/tmap_vc.nas @@ -1,7 +1,7 @@ ;; SONIC ROBO BLAST 2 ;;----------------------------------------------------------------------------- ;; Copyright (C) 1998-2000 by DooM Legacy Team. -;; Copyright (C) 1999-2019 by Sonic Team Junior. +;; Copyright (C) 1999-2020 by Sonic Team Junior. ;; ;; This program is free software distributed under the ;; terms of the GNU General Public License, version 2. diff --git a/src/v_video.c b/src/v_video.c index 81625ff9e..38e861ce0 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/v_video.h b/src/v_video.h index bc19f6e99..41d7f6a01 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/vid_copy.s b/src/vid_copy.s index d40510208..eae435ea4 100644 --- a/src/vid_copy.s +++ b/src/vid_copy.s @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/w_wad.c b/src/w_wad.c index d618b0c69..cfa66a965 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/w_wad.h b/src/w_wad.h index 439d12647..d598d9b39 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/win32/Srb2win.rc b/src/win32/Srb2win.rc index 8e7fdccc9..d7e3383b0 100644 --- a/src/win32/Srb2win.rc +++ b/src/win32/Srb2win.rc @@ -87,7 +87,7 @@ BEGIN VALUE "FileDescription", "Sonic Robo Blast 2\0" VALUE "FileVersion", VERSIONSTRING VALUE "InternalName", "srb2\0" - VALUE "LegalCopyright", "Copyright 1998-2019 by Sonic Team Junior\0" + VALUE "LegalCopyright", "Copyright 1998-2020 by Sonic Team Junior\0" VALUE "LegalTrademarks", "Sonic the Hedgehog and related characters are trademarks of Sega.\0" VALUE "OriginalFilename", "srb2win.exe\0" VALUE "PrivateBuild", "\0" diff --git a/src/y_inter.c b/src/y_inter.c index 214dee92e..36cb64d06 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2004-2019 by Sonic Team Junior. +// Copyright (C) 2004-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/y_inter.h b/src/y_inter.h index 5cf2cc1b8..855844fcc 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2004-2019 by Sonic Team Junior. +// Copyright (C) 2004-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/z_zone.c b/src/z_zone.c index e0e37312a..c42fed506 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2006 by Graue. -// Copyright (C) 2006-2019 by Sonic Team Junior. +// Copyright (C) 2006-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/z_zone.h b/src/z_zone.h index 9e5f74343..9c9595b50 100644 --- a/src/z_zone.h +++ b/src/z_zone.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. +// Copyright (C) 1999-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. From 61470201f99a575cd6a1844c9ab971dbfe609642 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 19 Feb 2020 14:37:42 -0800 Subject: [PATCH 084/112] Regex bruh moment --- src/r_patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_patch.c b/src/r_patch.c index 374189ac0..4304f3eab 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -3,7 +3,7 @@ // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 2005-2009 by Andrey "entryway" Budko. // Copyright (C) 2018-2020 by Jaime "Lactozilla" Passos. -// Copyright (C) 2020-2020 by Sonic Team Junior. +// Copyright (C) 2019-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. From 54794f325d0907d80c47086f01750e8d12d028ff Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 19 Feb 2020 14:44:22 -0800 Subject: [PATCH 085/112] :) --- src/r_patch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_patch.h b/src/r_patch.h index 23d03bcec..a2db6320c 100644 --- a/src/r_patch.h +++ b/src/r_patch.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 2018-2020 by Jaime "Lactozilla" Passos. -// Copyright (C) 2020 by Sonic Team Junior. +// Copyright (C) 2019-2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. From 3502278f8a5a5232adadbeddd524a7bf3687798a Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Thu, 20 Feb 2020 01:15:54 +0100 Subject: [PATCH 086/112] SpaceSpaceSpaceSpace --- src/d_netfil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 1d1e7d203..ed81a51b1 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -1038,9 +1038,9 @@ void Got_Filetxpak(void) #ifdef HAVE_BLUA if (luafiletransfers) { - // Tell the server we have received the file - netbuffer->packettype = PT_HASLUAFILE; - HSendPacket(servernode, true, 0, 0); + // Tell the server we have received the file + netbuffer->packettype = PT_HASLUAFILE; + HSendPacket(servernode, true, 0, 0); } #endif } From 903cc311a711d80436215e7f7c897a447daf2539 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 20 Feb 2020 20:31:11 +0000 Subject: [PATCH 087/112] move -warp code to a later part of D_SRB2Main so G_LoadGameData isn't upset by G_SetGameModified --- src/d_main.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 1f35ff64c..85e67b92d 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1230,20 +1230,6 @@ void D_SRB2Main(void) mainwadstally = packetsizetally; // technically not accurate atm, remember to port the two-stage -file process from kart in 2.2.x - if (M_CheckParm("-warp") && M_IsNextParm()) - { - const char *word = M_GetNextParm(); - pstartmap = G_FindMapByNameOrCode(word, 0); - if (! pstartmap) - I_Error("Cannot find a map remotely named '%s'\n", word); - else - { - if (!M_CheckParm("-server")) - G_SetGameModified(true); - autostart = true; - } - } - cht_Init(); //---------------------------------------------------- READY SCREEN @@ -1307,6 +1293,22 @@ void D_SRB2Main(void) //------------------------------------------------ COMMAND LINE PARAMS + // this must be done after loading gamedata, to avoid setting off the corrupted gamedata flag in G_LoadGameData + // -- Monster Iestyn 20/02/20 + if (M_CheckParm("-warp") && M_IsNextParm()) + { + const char *word = M_GetNextParm(); + pstartmap = G_FindMapByNameOrCode(word, 0); + if (! pstartmap) + I_Error("Cannot find a map remotely named '%s'\n", word); + else + { + if (!M_CheckParm("-server")) + G_SetGameModified(true); + autostart = true; + } + } + // Initialize CD-Audio if (M_CheckParm("-usecd") && !dedicated) I_InitCD(); From 5c33ff04581abe44e1c8ad03e680ff918b9dc0d2 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 20 Feb 2020 20:38:01 +0000 Subject: [PATCH 088/112] clarify the situation a bit more in the comments --- src/d_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index 85e67b92d..859a7ff25 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1293,7 +1293,8 @@ void D_SRB2Main(void) //------------------------------------------------ COMMAND LINE PARAMS - // this must be done after loading gamedata, to avoid setting off the corrupted gamedata flag in G_LoadGameData + // this must be done after loading gamedata, + // to avoid setting off the corrupted gamedata code in G_LoadGameData if a SOC with custom gamedata is added // -- Monster Iestyn 20/02/20 if (M_CheckParm("-warp") && M_IsNextParm()) { From 400366802c2d77a31b40da5ff57f366ca197383b Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Thu, 20 Feb 2020 16:40:39 -0500 Subject: [PATCH 089/112] Make hook_FollowMobj a mobj hook instead of a player hook Makes more logical sense, as if you have a custom follow item for a custom skin, you probably want your new thinker to only run for your new MT_ and not the vanilla ones. --- src/lua_hooklib.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index f9dad6cb7..99f41aef1 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -142,6 +142,7 @@ static int lib_addHook(lua_State *L) case hook_HurtMsg: case hook_MobjMoveBlocked: case hook_MapThingSpawn: + case hook_FollowMobj: hook.s.mt = MT_NULL; if (lua_isnumber(L, 2)) hook.s.mt = lua_tonumber(L, 2); @@ -203,6 +204,7 @@ static int lib_addHook(lua_State *L) case hook_MobjRemoved: case hook_MobjMoveBlocked: case hook_MapThingSpawn: + case hook_FollowMobj: lastp = &mobjhooks[hook.s.mt]; break; case hook_JumpSpecial: @@ -210,7 +212,6 @@ static int lib_addHook(lua_State *L) case hook_SpinSpecial: case hook_JumpSpinSpecial: case hook_PlayerSpawn: - case hook_FollowMobj: case hook_PlayerCanDamage: case hook_TeamSwitch: case hook_ViewpointSwitch: @@ -1364,7 +1365,34 @@ boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj) lua_settop(gL, 0); - for (hookp = playerhooks; hookp; hookp = hookp->next) + // Look for all generic mobj follow item hooks + for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next) + { + if (hookp->type != hook_FollowMobj) + continue; + + if (lua_gettop(gL) == 0) + { + LUA_PushUserdata(gL, player, META_PLAYER); + LUA_PushUserdata(gL, mobj, META_MOBJ); + } + lua_pushfstring(gL, FMT_HOOKID, hookp->id); + lua_gettable(gL, LUA_REGISTRYINDEX); + lua_pushvalue(gL, -3); + lua_pushvalue(gL, -3); + if (lua_pcall(gL, 2, 1, 0)) { + if (!hookp->error || cv_debug & DBG_LUA) + CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); + lua_pop(gL, 1); + hookp->error = true; + continue; + } + if (lua_toboolean(gL, -1)) + hooked = true; + lua_pop(gL, 1); + } + + for (hookp = mobjhooks[mobj->type]; hookp; hookp = hookp->next) { if (hookp->type != hook_FollowMobj) continue; From cce53081085b256165940e8ff38cc8d97880ae62 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 20 Feb 2020 17:18:26 -0800 Subject: [PATCH 090/112] Fix compiler warnings --- src/blua/liolib.c | 4 ++-- src/d_netfil.c | 2 +- src/d_netfil.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index e1a64c8d8..378b8c86d 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -34,7 +34,6 @@ #define FMT_FILECALLBACKID "file_callback_%d" -static const char *const fnames[] = {"input", "output"}; static const char *whitelist[] = { // Allow scripters to write files of these types to SRB2's folder ".bmp", ".cfg", @@ -230,6 +229,7 @@ static int io_openlocal (lua_State *L) { FILE **pf; const char *filename = luaL_checkstring(L, 1); const char *mode = luaL_optstring(L, 2, "r"); + char *realfilename; luafiletransfer_t *filetransfer; int checkresult; @@ -237,7 +237,7 @@ static int io_openlocal (lua_State *L) { if (checkresult) return checkresult; - char *realfilename = va("%s" PATHSEP "%s", luafiledir, filename); + realfilename = va("%s" PATHSEP "%s", luafiledir, filename); if (client && strnicmp(filename, "client/", strlen("client/"))) I_Error("Access denied to %s\n" diff --git a/src/d_netfil.c b/src/d_netfil.c index ed81a51b1..a5d4b71e2 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -98,7 +98,7 @@ INT32 lastfilenum = -1; #ifdef HAVE_BLUA luafiletransfer_t *luafiletransfers = NULL; boolean waitingforluafiletransfer = false; -char luafiledir[256] = "luafiles"; +char luafiledir[MAX_WADPATH] = "luafiles"; #endif diff --git a/src/d_netfil.h b/src/d_netfil.h index 0473b5f44..13087dfb2 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -93,7 +93,7 @@ typedef struct luafiletransfer_s extern luafiletransfer_t *luafiletransfers; extern boolean waitingforluafiletransfer; -extern char luafiledir[256]; +extern char luafiledir[MAX_WADPATH]; void AddLuaFileTransfer(const char *filename, const char *mode); void SV_PrepareSendLuaFileToNextNode(void); From 2df4717f18475835c5924c84624d44d2674c6aa7 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 20 Feb 2020 17:20:50 -0800 Subject: [PATCH 091/112] Fix NO_LUA compiling --- src/d_clisrv.c | 2 ++ src/d_main.c | 6 +++++- src/d_net.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index f31c2bcd4..3ad8db3c7 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3197,8 +3197,10 @@ void D_QuitNetGame(void) // abort send/receive of files CloseNetFile(); +#ifdef HAVE_BLUA RemoveAllLuaFileTransfers(); waitingforluafiletransfer = false; +#endif if (server) { diff --git a/src/d_main.c b/src/d_main.c index 715c90aa9..a54cdfc8d 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1126,8 +1126,10 @@ void D_SRB2Main(void) // can't use sprintf since there is %u in savegamename strcatbf(savegamename, srb2home, PATHSEP); +#ifdef HAVE_BLUA snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", srb2home); -#else +#endif +#else/*DEFAULTDIR*/ snprintf(srb2home, sizeof srb2home, "%s", userhome); snprintf(downloaddir, sizeof downloaddir, "%s", userhome); if (dedicated) @@ -1138,8 +1140,10 @@ void D_SRB2Main(void) // can't use sprintf since there is %u in savegamename strcatbf(savegamename, userhome, PATHSEP); +#ifdef HAVE_BLUA snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", userhome); #endif +#endif/*DEFAULTDIR*/ } configfile[sizeof configfile - 1] = '\0'; diff --git a/src/d_net.c b/src/d_net.c index ddb991235..a83d6d0ff 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -803,9 +803,11 @@ static const char *packettypename[NUMPACKETTYPE] = "RESYNCHEND", "RESYNCHGET", +#ifdef HAVE_BLUA "SENDINGLUAFILE", "ASKLUAFILE", "HASLUAFILE", +#endif "FILEFRAGMENT", "TEXTCMD", From 08627752b20b7ab4754bc5c4ac45a173bb36e0a0 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 20 Feb 2020 17:25:15 -0800 Subject: [PATCH 092/112] Fix NOPNG compiling --- src/r_patch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/r_patch.c b/src/r_patch.c index 4304f3eab..9e31d4d19 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -1212,15 +1212,17 @@ 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]; +#ifndef NO_PNG_LUMPS size_t lumplength; +#endif if (lump == LUMPERROR) return; patch = (patch_t *)W_CacheLumpNum(lump, PU_STATIC); +#ifndef NO_PNG_LUMPS lumplength = W_LumpLength(lump); -#ifndef NO_PNG_LUMPS if (R_IsLumpPNG((UINT8 *)patch, lumplength)) patch = R_PNGToPatch((UINT8 *)patch, lumplength, NULL); else From ec5b88e79fcf314fd4e4190ee343709ee74f7616 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 21 Feb 2020 17:17:39 +0100 Subject: [PATCH 093/112] Fix weird comment style --- src/d_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index a54cdfc8d..2553dc8e6 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1129,7 +1129,7 @@ void D_SRB2Main(void) #ifdef HAVE_BLUA snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", srb2home); #endif -#else/*DEFAULTDIR*/ +#else // DEFAULTDIR snprintf(srb2home, sizeof srb2home, "%s", userhome); snprintf(downloaddir, sizeof downloaddir, "%s", userhome); if (dedicated) @@ -1143,7 +1143,7 @@ void D_SRB2Main(void) #ifdef HAVE_BLUA snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", userhome); #endif -#endif/*DEFAULTDIR*/ +#endif // DEFAULTDIR } configfile[sizeof configfile - 1] = '\0'; From 472befd183143764218b466bbcda269aa3bb310a Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 21 Feb 2020 17:31:32 +0100 Subject: [PATCH 094/112] Replace MAX_WADPATH with plain numbers This is not ideal either, but I would rather not use a constant for something unrelated. --- src/d_netfil.c | 2 +- src/d_netfil.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index a5d4b71e2..ecb2229a6 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -98,7 +98,7 @@ INT32 lastfilenum = -1; #ifdef HAVE_BLUA luafiletransfer_t *luafiletransfers = NULL; boolean waitingforluafiletransfer = false; -char luafiledir[MAX_WADPATH] = "luafiles"; +char luafiledir[256 + 16] = "luafiles"; #endif diff --git a/src/d_netfil.h b/src/d_netfil.h index 13087dfb2..830293ca8 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -93,7 +93,7 @@ typedef struct luafiletransfer_s extern luafiletransfer_t *luafiletransfers; extern boolean waitingforluafiletransfer; -extern char luafiledir[MAX_WADPATH]; +extern char luafiledir[256 + 16]; void AddLuaFileTransfer(const char *filename, const char *mode); void SV_PrepareSendLuaFileToNextNode(void); From 0f2b8b8b2cfb431d46468c5a71fad9d4d51d98c6 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 21 Feb 2020 20:04:28 -0800 Subject: [PATCH 095/112] Register servername etc. under NOMD5 This fixes crashes in the menus. --- src/mserv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mserv.c b/src/mserv.c index 4ddab05b9..c02a58f99 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -18,7 +18,7 @@ #include -#if (defined (NOMD5) || defined (NOMSERV)) && !defined (NONET) +#if (defined (NOMSERV)) && !defined (NONET) #define NONET #endif From f6df71ba54139894c8bffd6c602ce3a990b434cd Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 21 Feb 2020 21:05:33 -0800 Subject: [PATCH 096/112] Fix NOMD5 compiling --- src/d_clisrv.c | 2 ++ src/w_wad.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 7f417b595..f5fea366f 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3945,7 +3945,9 @@ static void HandlePacketFromPlayer(SINT8 node) INT32 netconsole; tic_t realend, realstart; UINT8 *pak, *txtpak, numtxtpak; +#ifndef NOMD5 UINT8 finalmd5[16];/* Well, it's the cool thing to do? */ +#endif txtpak = NULL; diff --git a/src/w_wad.c b/src/w_wad.c index 8b3c21d28..e96afd050 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -670,7 +670,9 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup) wadfile_t *wadfile; restype_t type; UINT16 numlumps = 0; +#ifndef NOMD5 size_t i; +#endif size_t packetsize; UINT8 md5sum[16]; boolean important; From 1c1163bd0f64bdf7a0a94bd617bd350a31069c33 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 22 Feb 2020 16:37:13 -0500 Subject: [PATCH 097/112] Update version number to 2.2.2 --- CMakeLists.txt | 2 +- appveyor.yml | 2 +- src/doomdef.h | 8 ++++---- src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 855393de1..abec11087 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0) # DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string. # Version change is fine. project(SRB2 - VERSION 2.2.1 + VERSION 2.2.2 LANGUAGES C) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) diff --git a/appveyor.yml b/appveyor.yml index 20b18d7d5..a28935f63 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.2.1.{branch}-{build} +version: 2.2.2.{branch}-{build} os: MinGW environment: diff --git a/src/doomdef.h b/src/doomdef.h index 93c7590e2..b5313d479 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -143,9 +143,9 @@ extern char logfilename[1024]; // we use comprevision and compbranch instead. #else #define VERSION 202 // Game version -#define SUBVERSION 1 // more precise version number -#define VERSIONSTRING "v2.2.1" -#define VERSIONSTRINGW L"v2.2.1" +#define SUBVERSION 2 // more precise version number +#define VERSIONSTRING "v2.2.2" +#define VERSIONSTRINGW L"v2.2.2" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif @@ -210,7 +210,7 @@ extern char logfilename[1024]; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1". -#define MODVERSION 41 +#define MODVERSION 42 // To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically. // Increment MINOREXECVERSION whenever a config change is needed that does not correspond diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index 2b03cb8d4..b615bc1df 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1219,7 +1219,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.2.1; + CURRENT_PROJECT_VERSION = 2.2.2; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1231,7 +1231,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.2.1; + CURRENT_PROJECT_VERSION = 2.2.2; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( From 03e38e9486b6639b5f399fe3b30dccdfa89edcf6 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 22 Feb 2020 16:42:24 -0500 Subject: [PATCH 098/112] Enable use of the patch file --- assets/CMakeLists.txt | 3 ++- src/config.h.in | 4 ++-- src/d_main.c | 4 ++-- src/doomdef.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/assets/CMakeLists.txt b/assets/CMakeLists.txt index 0636c1e59..095349418 100644 --- a/assets/CMakeLists.txt +++ b/assets/CMakeLists.txt @@ -19,7 +19,8 @@ set(SRB2_ASSET_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/installer" set(SRB2_ASSET_HASHED "srb2.pk3;\ player.dta;\ -zones.pk3" +zones.pk3;\ +patch.pk3" CACHE STRING "Asset filenames to apply MD5 checks. No spaces between entries!" ) diff --git a/src/config.h.in b/src/config.h.in index 498f3086d..4926f9a06 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -27,13 +27,13 @@ /* Manually defined asset hashes for non-CMake builds * Last updated 2020 / 02 / 15 - v2.2.1 - main assets - * Last updated 20?? / ?? / ?? - v2.2.? - patch.pk3 + * Last updated 2020 / 02 / 22 - v2.2.2 - patch.pk3 */ #define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28" #define ASSET_HASH_ZONES_PK3 "f7e88afb6af7996a834c7d663144bead" #define ASSET_HASH_PLAYER_DTA "ad49e07b17cc662f1ad70c454910b4ae" #ifdef USE_PATCH_DTA -#define ASSET_HASH_PATCH_PK3 "there is no patch.pk3, only zuul" +#define ASSET_HASH_PATCH_PK3 "ee54330ecb743314c5f962af4db731ff" #endif #endif diff --git a/src/d_main.c b/src/d_main.c index d43d57b0b..904ab3bf1 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1215,14 +1215,14 @@ void D_SRB2Main(void) W_InitMultipleFiles(startupwadfiles, mainwads); D_CleanFile(); -#ifndef DEVELOP // md5s last updated 16/02/20 (ddmmyy) +#ifndef DEVELOP // md5s last updated 22/02/20 (ddmmyy) // Check MD5s of autoloaded files W_VerifyFileMD5(0, ASSET_HASH_SRB2_PK3); // srb2.pk3 W_VerifyFileMD5(1, ASSET_HASH_ZONES_PK3); // zones.pk3 W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta #ifdef USE_PATCH_DTA - W_VerifyFileMD5(3, ASSET_HASH_PATCH_DTA); // patch.pk3 + W_VerifyFileMD5(3, ASSET_HASH_PATCH_PK3); // patch.pk3 #endif // don't check music.dta because people like to modify it, and it doesn't matter if they do // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. diff --git a/src/doomdef.h b/src/doomdef.h index b5313d479..71c885019 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -152,7 +152,7 @@ extern char logfilename[1024]; // Does this version require an added patch file? // Comment or uncomment this as necessary. -//#define USE_PATCH_DTA +#define USE_PATCH_DTA // Use .kart extension addons //#define USE_KART From 4c00e3309647d6ee4a7f370b514f72ef1cc57027 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Sat, 22 Feb 2020 21:14:05 -0300 Subject: [PATCH 099/112] Oopsie --- src/p_user.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index 880d932af..9417f752d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -384,6 +384,9 @@ void P_GiveFinishFlags(player_t *player) if (!player->mo) return; + if !(netgame||multiplayer) + return; + for (i = 0; i < 3; i++) { angle_t fa = (angle >> ANGLETOFINESHIFT) & FINEMASK; From ff8a62819b6de93b32d746b6f4cb3c737b7041c2 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Sat, 22 Feb 2020 22:36:44 -0300 Subject: [PATCH 100/112] Oopsie 2 --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 9417f752d..9167d5345 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -384,7 +384,7 @@ void P_GiveFinishFlags(player_t *player) if (!player->mo) return; - if !(netgame||multiplayer) + if (!(netgame||multiplayer)) return; for (i = 0; i < 3; i++) From 94738bfd2d18d79698f60b40b04c6ceaad846529 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sun, 23 Feb 2020 19:28:16 -0300 Subject: [PATCH 101/112] Don't get chosen as the tagger if you're a spectator --- src/p_setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_setup.c b/src/p_setup.c index 7b4c6773b..eee90e03d 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3096,7 +3096,7 @@ static void P_InitTagGametype(void) //Also, you'd never have to loop through all 32 players slots to find anything ever again. for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i] && !(players[i].spectator && players[i].quittime)) + if (playeringame[i] && !(players[i].spectator || players[i].quittime)) { playersactive[realnumplayers] = i; //stores the player's node in the array. realnumplayers++; From ce801e1076484ba85e9c8e5ae9c02a9c2b1df8b0 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Mon, 24 Feb 2020 16:57:56 -0500 Subject: [PATCH 102/112] Fix new skin colors using default chat color --- src/hu_stuff.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 74b68ce69..98f3ca5a9 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -787,10 +787,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) case SKINCOLOR_RED: case SKINCOLOR_CRIMSON: case SKINCOLOR_FLAME: + case SKINCOLOR_KETCHUP: cstart = "\x85"; // V_REDMAP break; case SKINCOLOR_YOGURT: case SKINCOLOR_BROWN: + case SKINCOLOR_BRONZE: case SKINCOLOR_TAN: case SKINCOLOR_BEIGE: case SKINCOLOR_QUAIL: @@ -818,6 +820,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) cstart = "\x8e"; // V_ROSYMAP break; case SKINCOLOR_SUNSET: + case SKINCOLOR_COPPER: case SKINCOLOR_APRICOT: case SKINCOLOR_ORANGE: case SKINCOLOR_RUST: @@ -831,6 +834,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) break; case SKINCOLOR_LIME: case SKINCOLOR_PERIDOT: + case SKINCOLOR_APPLE: cstart = "\x8b"; // V_PERIDOTMAP break; case SKINCOLOR_SEAFOAM: @@ -851,12 +855,14 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) case SKINCOLOR_BLUE: case SKINCOLOR_COBALT: case SKINCOLOR_DUSK: + case SKINCOLOR_BLUEBELL: cstart = "\x84"; // V_BLUEMAP break; case SKINCOLOR_BUBBLEGUM: case SKINCOLOR_MAGENTA: case SKINCOLOR_NEON: case SKINCOLOR_VIOLET: + case SKINCOLOR_RASPBERRY: cstart = "\x81"; // V_MAGENTAMAP break; } From fe931555783c4a1d552a041faf0ae34ad0d7d532 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 24 Feb 2020 20:03:08 -0300 Subject: [PATCH 103/112] Fix Amy cameo's love hearts crashing the Software renderer due to invalid translucency tables --- src/p_mobj.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 2bb2cc028..faee245d3 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8001,8 +8001,9 @@ static void P_MobjSceneryThink(mobj_t *mobj) } if (mobj->fuse < 0) return; - if ((--mobj->fuse) < 6) + if (mobj->fuse < 6) mobj->frame = (mobj->frame & ~FF_TRANSMASK) | ((10 - (mobj->fuse*2)) << (FF_TRANSSHIFT)); + mobj->fuse--; } break; case MT_FINISHFLAG: @@ -11594,7 +11595,7 @@ void P_AfterPlayerSpawn(INT32 playernum) if (CheckForReverseGravity) P_CheckGravity(mobj, false); - + if (p->pflags & PF_FINISHED) P_GiveFinishFlags(p); } From 3d7cd29edaf34d7abf7a5d19f14d327fdd5c69bf Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 25 Feb 2020 22:30:34 -0300 Subject: [PATCH 104/112] Fix TYPEOFLEVEL options not having enough bits for TOL_ flags --- src/dehacked.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index dea0289b9..329cf8788 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1249,7 +1249,7 @@ static void readgametype(MYFILE *f, char *gtname) newgttol = (UINT32)i; else { - UINT16 tol = 0; + UINT32 tol = 0; tmp = strtok(word2,","); do { for (i = 0; TYPEOFLEVEL[i].name; i++) @@ -1591,7 +1591,7 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->typeoflevel = (UINT32)i; else { - UINT16 tol = 0; + UINT32 tol = 0; tmp = strtok(word2,","); do { for (i = 0; TYPEOFLEVEL[i].name; i++) @@ -7477,7 +7477,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // Got Flag Sign "S_GOTFLAG", - + // Finish flag "S_FINISHFLAG", From 25cf369f2261fc9b337524653332c45dfbb59b2d Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 25 Feb 2020 22:34:19 -0300 Subject: [PATCH 105/112] Fix (technically functional) string comparison counting an extra character in the comparison length --- src/dehacked.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 329cf8788..5d29ca280 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -10236,7 +10236,7 @@ static fixed_t find_const(const char **rword) free(word); return r; } - else if (fastncmp("GT_",word,4)) { + else if (fastncmp("GT_",word,3)) { r = get_gametype(word); free(word); return r; From 70a103b9afb143141449d99fbce0a59a29e358c4 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 2 Mar 2020 00:20:53 -0300 Subject: [PATCH 106/112] Fix G_TOLFlag returning the wrong type --- src/g_game.c | 4 ++-- src/g_game.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 08192bfb8..6d8826f1c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3592,7 +3592,7 @@ boolean G_CompetitionGametype(void) * \return The typeoflevel flag to check for that gametype. * \author Graue */ -INT16 G_TOLFlag(INT32 pgametype) +UINT32 G_TOLFlag(INT32 pgametype) { if (!multiplayer) return TOL_SP; @@ -3723,7 +3723,7 @@ static void G_DoCompleted(void) && (nextmap >= 0 && nextmap < NUMMAPS)) { register INT16 cm = nextmap; - INT16 tolflag = G_TOLFlag(gametype); + UINT32 tolflag = G_TOLFlag(gametype); UINT8 visitedmap[(NUMMAPS+7)/8]; memset(visitedmap, 0, sizeof (visitedmap)); diff --git a/src/g_game.h b/src/g_game.h index c4c40d84b..8a2c5b0ae 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -309,6 +309,6 @@ FUNCMATH INT32 G_TicsToCentiseconds(tic_t tics); FUNCMATH INT32 G_TicsToMilliseconds(tic_t tics); // Don't split up TOL handling -INT16 G_TOLFlag(INT32 pgametype); +UINT32 G_TOLFlag(INT32 pgametype); #endif From 7ba93c184f15ef1212dbc45c69354dbc278293a2 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 2 Mar 2020 13:33:12 +0100 Subject: [PATCH 107/112] Fix warning and formatting --- src/blua/liolib.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index 378b8c86d..b43052194 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -34,7 +34,8 @@ #define FMT_FILECALLBACKID "file_callback_%d" -static const char *whitelist[] = { // Allow scripters to write files of these types to SRB2's folder +// Allow scripters to write files of these types to SRB2's folder +static const char *whitelist[] = { ".bmp", ".cfg", ".csv", @@ -508,7 +509,6 @@ static int io_readline (lua_State *L) { static int g_write (lua_State *L, FILE *f, int arg) { int nargs = lua_gettop(L) - 1; int status = 1; - size_t count; for (; nargs--; arg++) { if (lua_type(L, arg) == LUA_TNUMBER) { /* optimization: could be done exactly as for strings */ @@ -518,12 +518,10 @@ static int g_write (lua_State *L, FILE *f, int arg) { else { size_t l; const char *s = luaL_checklstring(L, arg, &l); - count += l; - if (ftell(f) + l > FILELIMIT) - { - luaL_error(L,"write limit bypassed in file. Changes have been discarded."); - break; - } + if (ftell(f) + l > FILELIMIT) { + luaL_error(L,"write limit bypassed in file. Changes have been discarded."); + break; + } status = status && (fwrite(s, sizeof(char), l, f) == l); } } From da9bf34175f6eb9bc0affaf5ad1a314f58f23abd Mon Sep 17 00:00:00 2001 From: ZipperQR Date: Thu, 5 Mar 2020 12:24:45 +0300 Subject: [PATCH 108/112] fix source player being nil --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index a24f9bf03..c2d4c695e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3441,7 +3441,7 @@ void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source) if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super]) return; - if (!cv_friendlyfire.value) + if (!cv_friendlyfire.value && source->player) { if (inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK)) { From 4d8a523da92654f80d40898efa6e81c34e2f2110 Mon Sep 17 00:00:00 2001 From: Zipper Date: Thu, 5 Mar 2020 18:30:27 -0500 Subject: [PATCH 109/112] Update p_inter.c --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index c2d4c695e..858718f84 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3441,7 +3441,7 @@ void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source) if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super]) return; - if (!cv_friendlyfire.value && source->player) + if (!cv_friendlyfire.value && source && source->player) { if (inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK)) { From 4b28e19d16db1ece7bdeffef981513ef0b30d360 Mon Sep 17 00:00:00 2001 From: Zipper Date: Thu, 5 Mar 2020 18:48:20 -0500 Subject: [PATCH 110/112] Update p_inter.c --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index 858718f84..95f8fba41 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3456,7 +3456,7 @@ void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source) return; } - if (inflictor->type == MT_LHRT) + if (inflictor && inflictor->type == MT_LHRT) return; if (player->powers[pw_shield] || player->bot) //If One-Hit Shield From ce29129f3a67eab7c88af8e2360be48333ce0d16 Mon Sep 17 00:00:00 2001 From: colette Date: Sun, 8 Mar 2020 13:09:39 -0400 Subject: [PATCH 111/112] Fix resyncs never recovering if node and player mismatch --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index f5fea366f..71e32977a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3966,7 +3966,7 @@ static void HandlePacketFromPlayer(SINT8 node) case PT_RESYNCHGET: if (client) break; - SV_AcknowledgeResynchAck(netconsole, netbuffer->u.resynchgot); + SV_AcknowledgeResynchAck(node, netbuffer->u.resynchgot); break; case PT_CLIENTCMD: case PT_CLIENT2CMD: From 40e728fdb5d428532ecd5f9fa73a2ea0a4a83b73 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 9 Mar 2020 15:04:22 +0000 Subject: [PATCH 112/112] One line fix: don't assume 0 (aka SPR2_STND) is the default value for sprite2, but rather what the state sets for it This fixes some issues with a custom character tested during netplay, which did not have SPR2_WAIT sprites and therefore fell back to SPR2_STND sprites. Unfortunately, the fact they used SPR2_STND instead meant the sprite2 was not synced at all! --- src/p_saveg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index e8c6c7a84..fc8d9d4ee 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1406,7 +1406,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) diff |= MD_TICS; if (mobj->sprite != mobj->state->sprite) diff |= MD_SPRITE; - if (mobj->sprite == SPR_PLAY && mobj->sprite2 != 0) + if (mobj->sprite == SPR_PLAY && mobj->sprite2 != (mobj->state->frame&FF_FRAMEMASK)) diff |= MD_SPRITE; if (mobj->frame != mobj->state->frame) diff |= MD_FRAME;