From d764d68d02c1f7609c65534f7cfa07da724c42cd Mon Sep 17 00:00:00 2001 From: lachablock Date: Thu, 13 Jan 2022 18:53:26 +1100 Subject: [PATCH 001/108] Turn dispoffset into a mobj field --- src/hardware/hw_glob.h | 2 +- src/hardware/hw_main.c | 2 +- src/lua_mobjlib.c | 10 +++++++++- src/p_mobj.c | 2 ++ src/p_mobj.h | 1 + src/p_saveg.c | 9 +++++++++ src/r_things.c | 2 +- src/r_things.h | 2 +- 8 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/hardware/hw_glob.h b/src/hardware/hw_glob.h index 37d77b467..68c5dd14d 100644 --- a/src/hardware/hw_glob.h +++ b/src/hardware/hw_glob.h @@ -84,7 +84,7 @@ typedef struct gl_vissprite_s //Hurdler: 25/04/2000: now support colormap in hardware mode UINT8 *colormap; - INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing + INT32 dispoffset; // copy of mobj->dispoffset, affects ordering but not drawing patch_t *gpatch; mobj_t *mobj; // NOTE: This is a precipmobj_t if precip is true !!! Watch out. diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index d2982afe4..ab2b7cae2 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5052,7 +5052,7 @@ static void HWR_ProjectSprite(mobj_t *thing) return; } - dispoffset = thing->info->dispoffset; + dispoffset = thing->dispoffset; this_scale = FIXED_TO_FLOAT(thing->scale); spritexscale = FIXED_TO_FLOAT(thing->spritexscale); diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index cf8ccab2c..ffdfe999d 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -96,7 +96,8 @@ enum mobj_e { mobj_standingslope, mobj_colorized, mobj_mirrored, - mobj_shadowscale + mobj_shadowscale, + mobj_dispoffset }; static const char *const mobj_opt[] = { @@ -173,6 +174,7 @@ static const char *const mobj_opt[] = { "colorized", "mirrored", "shadowscale", + "dispoffset", NULL}; #define UNIMPLEMENTED luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " is not implemented for Lua and cannot be accessed.", mobj_opt[field]) @@ -439,6 +441,9 @@ static int mobj_get(lua_State *L) case mobj_shadowscale: lua_pushfixed(L, mo->shadowscale); break; + case mobj_dispoffset: + lua_pushinteger(L, mo->dispoffset); + break; default: // extra custom variables in Lua memory lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); I_Assert(lua_istable(L, -1)); @@ -803,6 +808,9 @@ static int mobj_set(lua_State *L) case mobj_shadowscale: mo->shadowscale = luaL_checkfixed(L, 3); break; + case mobj_dispoffset: + mo->dispoffset = luaL_checkinteger(L, 3); + break; default: lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); I_Assert(lua_istable(L, -1)); diff --git a/src/p_mobj.c b/src/p_mobj.c index 87e20fd4a..10a01dbaa 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10499,6 +10499,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->reactiontime = info->reactiontime; + mobj->dispoffset = info->dispoffset; + mobj->lastlook = -1; // stuff moved in P_enemy.P_LookForPlayer // do not set the state with P_SetMobjState, diff --git a/src/p_mobj.h b/src/p_mobj.h index 2d096385b..d078137d8 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -390,6 +390,7 @@ typedef struct mobj_s boolean colorized; // Whether the mobj uses the rainbow colormap boolean mirrored; // The object's rotations will be mirrored left to right, e.g., see frame AL from the right and AR from the left fixed_t shadowscale; // If this object casts a shadow, and the size relative to radius + INT32 dispoffset; // copy of info->dispoffset, so mobjs can be sorted independently of their type // WARNING: New fields must be added separately to savegame and Lua. } mobj_t; diff --git a/src/p_saveg.c b/src/p_saveg.c index 722340f41..17c47c7a1 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1486,6 +1486,7 @@ typedef enum MD2_SPRITEXOFFSET = 1<<20, MD2_SPRITEYOFFSET = 1<<21, MD2_FLOORSPRITESLOPE = 1<<22, + MD2_DISPOFFSET = 1<<23 } mobj_diff2_t; typedef enum @@ -1720,6 +1721,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) || (slope->normal.z != FRACUNIT)) diff2 |= MD2_FLOORSPRITESLOPE; } + if (mobj->dispoffset != mobj->info->dispoffset) + diff2 |= MD2_DISPOFFSET; if (diff2 != 0) diff |= MD_MORE; @@ -1895,6 +1898,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) WRITEFIXED(save_p, slope->normal.y); WRITEFIXED(save_p, slope->normal.z); } + if (diff2 & MD2_DISPOFFSET) + WRITEINT32(save_p, mobj->dispoffset); WRITEUINT32(save_p, mobj->mobjnum); } @@ -2942,6 +2947,10 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker) slope->normal.y = READFIXED(save_p); slope->normal.z = READFIXED(save_p); } + if (diff2 & MD2_DISPOFFSET) + mobj->dispoffset = READINT32(save_p); + else + mobj->dispoffset = mobj->info->dispoffset; if (diff & MD_REDFLAG) { diff --git a/src/r_things.c b/src/r_things.c index accd1e2b3..1dee17356 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1437,7 +1437,7 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t paperoffset = 0, paperdistance = 0; angle_t centerangle = 0; - INT32 dispoffset = thing->info->dispoffset; + INT32 dispoffset = thing->dispoffset; //SoM: 3/17/2000 fixed_t gz = 0, gzt = 0; diff --git a/src/r_things.h b/src/r_things.h index b1ff32b1e..6a6ff3042 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -209,7 +209,7 @@ typedef struct vissprite_s INT16 clipbot[MAXVIDWIDTH], cliptop[MAXVIDWIDTH]; - INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing + INT32 dispoffset; // copy of mobj->dispoffset, affects ordering but not drawing } vissprite_t; extern UINT32 visspritecount; From f7b166da07d821c655cc804111d419ab3c14c694 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 27 Feb 2022 07:56:45 -0500 Subject: [PATCH 002/108] Refresh sprite2s Allows for custom characters to be loaded first, then a wad that adds a custom sprite2, and the custom character's sprite2s won't be discarded. --- src/deh_lua.c | 3 + src/deh_soc.c | 2 + src/r_skins.c | 156 ++++++++++++++++++++++++++++++++++++++++++++++++-- src/r_skins.h | 2 + 4 files changed, 158 insertions(+), 5 deletions(-) diff --git a/src/deh_lua.c b/src/deh_lua.c index a2ffca95b..7984a38c8 100644 --- a/src/deh_lua.c +++ b/src/deh_lua.c @@ -188,6 +188,9 @@ static inline int lib_freeslot(lua_State *L) lua_remove(L, 1); continue; } + + R_RefreshSprite2(); + return r; } diff --git a/src/deh_soc.c b/src/deh_soc.c index 3a611f3ba..dd33594ea 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -513,6 +513,8 @@ void readfreeslots(MYFILE *f) } while (!myfeof(f)); // finish when the line is empty Z_Free(s); + + R_RefreshSprite2(); } void readthing(MYFILE *f, INT32 num) diff --git a/src/r_skins.c b/src/r_skins.c index 86c0bbc54..010280403 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -499,7 +499,7 @@ static UINT16 W_CheckForPatchSkinMarkerInPwad(UINT16 wadid, UINT16 startlump) return INT16_MAX; // not found } -static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, skin_t *skin) +static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, skin_t *skin, UINT8 start_spr2) { UINT16 newlastlump; UINT8 sprite2; @@ -521,7 +521,7 @@ static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, ski { newlastlump++; // load all sprite sets we are aware of... for super! - for (sprite2 = 0; sprite2 < free_spr2; sprite2++) + for (sprite2 = start_spr2; sprite2 < free_spr2; sprite2++) R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, *lastlump); newlastlump--; @@ -529,7 +529,7 @@ static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, ski } // load all sprite sets we are aware of... for normal stuff. - for (sprite2 = 0; sprite2 < free_spr2; sprite2++) + for (sprite2 = start_spr2; sprite2 < free_spr2; sprite2++) R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[sprite2], wadnum, *lump, *lastlump); if (skin->sprites[0].numframes == 0) @@ -795,7 +795,7 @@ next_token: free(buf2); // Add sprites - R_LoadSkinSprites(wadnum, &lump, &lastlump, skin); + R_LoadSkinSprites(wadnum, &lump, &lastlump, skin, 0); //ST_LoadFaceGraphics(numskins); -- nah let's do this elsewhere R_FlushTranslationColormapCache(); @@ -928,7 +928,7 @@ next_token: } // Patch sprites - R_LoadSkinSprites(wadnum, &lump, &lastlump, skin); + R_LoadSkinSprites(wadnum, &lump, &lastlump, skin, 0); //ST_LoadFaceGraphics(skinnum); -- nah let's do this elsewhere R_FlushTranslationColormapCache(); @@ -941,3 +941,149 @@ next_token: #undef HUDNAMEWRITE #undef SYMBOLCONVERT + +static UINT16 W_CheckForEitherSkinMarkerInPwad(UINT16 wadid, UINT16 startlump) +{ + UINT16 i; + const char *S_SKIN = "S_SKIN"; + const char *P_SKIN = "P_SKIN"; + lumpinfo_t *lump_p; + + // scan forward, start at + if (startlump < wadfiles[wadid]->numlumps) + { + lump_p = wadfiles[wadid]->lumpinfo + startlump; + for (i = startlump; i < wadfiles[wadid]->numlumps; i++, lump_p++) + if (memcmp(lump_p->name,S_SKIN,6)==0 || memcmp(lump_p->name,P_SKIN,6)==0) + return i; + } + return INT16_MAX; // not found +} + +static void R_RefreshSprite2ForWad(UINT16 wadnum, UINT8 start_spr2) +{ + UINT16 lump, lastlump = 0; + char *buf; + char *buf2; + char *stoken; + char *value; + size_t size; + skin_t *skin; + boolean noskincomplain; + + // + // search for all skin patch markers in pwad + // + + while ((lump = W_CheckForEitherSkinMarkerInPwad(wadnum, lastlump)) != INT16_MAX) + { + INT32 skinnum = 0; + + // advance by default + lastlump = lump + 1; + + buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE); + size = W_LumpLengthPwad(wadnum, lump); + + // for strtok + buf2 = malloc(size+1); + if (!buf2) + I_Error("R_RefreshSprite2ForWad: No more free memory\n"); + M_Memcpy(buf2,buf,size); + buf2[size] = '\0'; + + skin = NULL; + noskincomplain = false; + + /* + Parse. Has more phases than the parser in R_AddSkins because it needs to have the patching name first (no default skin name is acceptible for patching, unlike skin creation) + */ + + stoken = strtok(buf2, "\r\n= "); + while (stoken) + { + if ((stoken[0] == '/' && stoken[1] == '/') + || (stoken[0] == '#'))// skip comments + { + stoken = strtok(NULL, "\r\n"); // skip end of line + goto next_token; // find the real next token + } + + value = strtok(NULL, "\r\n= "); + + if (!value) + I_Error("R_RefreshSprite2ForWad: syntax error in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename); + + if (!stricmp(stoken, "name")) + { + strlwr(value); + skinnum = R_SkinAvailable(value); + if (skinnum != -1) + skin = &skins[skinnum]; + else + { + CONS_Debug(DBG_SETUP, "R_RefreshSprite2ForWad: unknown skin name in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename); + noskincomplain = true; + } + } + + if (!skin) + break; + +next_token: + stoken = strtok(NULL, "\r\n= "); + } + free(buf2); + + if (!skin) // Didn't include a name parameter? What a waste. + { + if (!noskincomplain) + CONS_Debug(DBG_SETUP, "R_RefreshSprite2ForWad: no skin name given in P_SKIN lump #%d (WAD %s)\n", lump, wadfiles[wadnum]->filename); + continue; + } + + // Update sprites, in the range of (start_spr2 - free_spr2-1) + R_LoadSkinSprites(wadnum, &lump, &lastlump, skin, start_spr2); + //R_FlushTranslationColormapCache(); // I don't think this is needed for what we're doing? + } +} + +static playersprite_t old_spr2 = SPR2_FIRSTFREESLOT; +void R_RefreshSprite2(void) +{ + // Sprite2s being defined by custom wads can create situations where + // a custom character might want to add support, but due to load order, + // might not be defined in time. + + // The trick where you load characters then level packs to keep savedata + // in particular will practically garantuee a level pack can NEVER add custom animations, + // because custom character's Sprite2s will not be added. + + // So, go through every file, and reload the sprite2s that were added. + + INT32 i; + + if (old_spr2 > free_spr2) + { +#ifdef PARANOIA + I_Error("R_RefreshSprite2: old_spr2 is too high?! (old_spr2: %d, free_spr2: %d)\n", old_spr2, free_spr2); +#else + // Just silently fix + old_spr2 = free_spr2; +#endif + } + + if (old_spr2 == free_spr2) + { + // No sprite2s were added since the last time we did freeslots. + return; + } + + for (i = 0; i < numwadfiles; i++) + { + R_RefreshSprite2ForWad(i, old_spr2); + } + + // Update previous value. + old_spr2 = free_spr2; +} diff --git a/src/r_skins.h b/src/r_skins.h index a38997f4d..2ef1bdd65 100644 --- a/src/r_skins.h +++ b/src/r_skins.h @@ -100,4 +100,6 @@ void R_PatchSkins(UINT16 wadnum, boolean mainfile); UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player); +void R_RefreshSprite2(void); + #endif //__R_SKINS__ From 9bfc82a14b95638bb51aaf6d8cbf7bd840178575 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sun, 27 Mar 2022 20:14:54 -0500 Subject: [PATCH 003/108] Prevent comptime.* from failing compilation --- src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index c1aa35742..e24d301bc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -357,9 +357,9 @@ $(dbg).txt : $(dbg) # this really updates comptime.h comptime.c :: ifdef WINDOWSHELL - $(.)..\comptime.bat . + -$(.)..\comptime.bat . else - $(.)../comptime.sh . + -$(.)../comptime.sh . endif # I wish I could make dependencies out of rc files :( From a614865d3592ef7aed3c0c2d570aea8c6e508ea3 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sun, 27 Mar 2022 21:16:07 -0500 Subject: [PATCH 004/108] Make comptime.sh conform to POSIX and less redundant, among other improvements - Shebang now directly calls /bin/sh - Improved indenting within the comprevision() function - Quoted several strings to prevent possible argument splitting - Replaced archaic backtick command statements with more descriptive `"$(...)"` statements - Replaced direct references to `test` with more readable, but equivalent `[ ... ]` statements - Replaced the ${str:0:8} bashism with an equivalent statement using POSIX cut - Moved redundant definitions of the comptime.h body to a single function that takes arguments --- comptime.sh | 54 ++++++++++++++++++++++------------------------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/comptime.sh b/comptime.sh index d5ef7271a..a619f6a1a 100755 --- a/comptime.sh +++ b/comptime.sh @@ -1,54 +1,44 @@ -#!/bin/bash -e +#!/bin/sh path="." if [ x"$1" != x ]; then path="$1" fi -versiongit() { - gitbranch=`git rev-parse --abbrev-ref HEAD` - gitversion=`git rev-parse HEAD` - cat < $path/comptime.h +version() { + cat < "$path/comptime.h" // Do not edit! This file was autogenerated // by the $0 script with git // -const char* compbranch = "$gitbranch"; -const char* comprevision = "${gitversion:0:8}"; +const char* compbranch = "$1"; +const char* comprevision = "$2"; EOF -exit 0 +} + +versiongit() { + gitbranch="$(git rev-parse --abbrev-ref HEAD)" + gitversion="$(git rev-parse HEAD | cut -c -8)" + version "$gitbranch" "$gitversion"; + exit 0 } versionsvn() { - svnrevision=`svnversion -n $1` - cat < $path/comptime.h - -// Do not edit! This file was autogenerated -// by the $0 script with subversion -// -const char* compbranch = "Subversion"; -const char* comprevision = "r$svnrevision"; -EOF -exit 0 + svnrevision="$(svnversion -n $1)" + version "Subversion" "r$svnrevision"; + exit 0 } versionfake() { - cat < $path/comptime.h - -// Do not edit! This file was autogenerated -// by the $0 script with an unknown or nonexist SCM -// -const char* compbranch = "Unknown"; -const char* comprevision = "illegal"; -EOF + version "Unknown" "illegal"; } compversion() { -touch $path/comptime.c -versionfake -test -d $path/.svn && versionsvn -test -d $path/../.git && versiongit -exit 1 + touch "$path/comptime.c" + versionfake + [ -d "$path/.svn" ] && versionsvn + [ -d "$path/../.git" ] && versiongit + exit 1 } -test -f $path/comptime.c && compversion +[ -f "$path/comptime.c" ] && compversion exit 2 From b7711b2b97ea33b8f8ceb2e5fde791da725dd067 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sun, 27 Mar 2022 21:23:32 -0500 Subject: [PATCH 005/108] Pass argument list directly to functions that use them; quote arguments when used. --- comptime.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/comptime.sh b/comptime.sh index a619f6a1a..ce771f631 100755 --- a/comptime.sh +++ b/comptime.sh @@ -23,7 +23,7 @@ versiongit() { } versionsvn() { - svnrevision="$(svnversion -n $1)" + svnrevision="$(svnversion -n "$1")" version "Subversion" "r$svnrevision"; exit 0 } @@ -35,10 +35,10 @@ versionfake() { compversion() { touch "$path/comptime.c" versionfake - [ -d "$path/.svn" ] && versionsvn + [ -d "$path/.svn" ] && versionsvn "$@" [ -d "$path/../.git" ] && versiongit exit 1 } -[ -f "$path/comptime.c" ] && compversion +[ -f "$path/comptime.c" ] && compversion "$@" exit 2 From 3da9fb636aebd8311e4119f7f6af65a924a0e0df Mon Sep 17 00:00:00 2001 From: spherallic Date: Sat, 17 Sep 2022 10:51:16 +0200 Subject: [PATCH 006/108] Add plane scroller features to binary map format: - Added actions for scrolling floor + ceiling simultaneously - Added flag to use X offset for speed, instead of line length --- extras/conf/SRB2-22.cfg | 89 +++++++++++++++++++- extras/conf/udb/Includes/SRB222_linedefs.cfg | 47 ++++++++++- src/p_setup.c | 13 ++- 3 files changed, 146 insertions(+), 3 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 969f645f3..0bf009f79 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -2824,36 +2824,63 @@ linedeftypes { title = "Scroll Floor Texture"; prefix = "(510)"; + flags8192text = "[13] Use angle and X offset"; } 511 { title = "Scroll Floor Texture (Accelerative)"; prefix = "(511)"; + flags8192text = "[13] Use angle and X offset"; } 512 { title = "Scroll Floor Texture (Displacement)"; prefix = "(512)"; + flags8192text = "[13] Use angle and X offset"; } 513 { title = "Scroll Ceiling Texture"; prefix = "(513)"; + flags8192text = "[13] Use angle and X offset"; } 514 { title = "Scroll Ceiling Texture (Accelerative)"; prefix = "(514)"; + flags8192text = "[13] Use angle and X offset"; } 515 { title = "Scroll Ceiling Texture (Displacement)"; prefix = "(515)"; + flags8192text = "[13] Use angle and X offset"; + } + + 516 + { + title = "Scroll Floor and Ceiling Texture"; + prefix = "(516)"; + flags8192text = "[13] Use angle and X offset"; + } + + 517 + { + title = "Scroll Floor and Ceiling Texture (Accelerative)"; + prefix = "(517)"; + flags8192text = "[13] Use angle and X offset"; + } + + 518 + { + title = "Scroll Floor and Ceiling Texture (Displacement)"; + prefix = "(518)"; + flags8192text = "[13] Use angle and X offset"; } 520 @@ -2861,6 +2888,7 @@ linedeftypes title = "Carry Objects on Floor"; prefix = "(520)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 521 @@ -2868,6 +2896,7 @@ linedeftypes title = "Carry Objects on Floor (Accelerative)"; prefix = "(521)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 522 @@ -2875,6 +2904,7 @@ linedeftypes title = "Carry Objects on Floor (Displacement)"; prefix = "(522)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 523 @@ -2882,6 +2912,7 @@ linedeftypes title = "Carry Objects on Ceiling"; prefix = "(523)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 524 @@ -2889,6 +2920,7 @@ linedeftypes title = "Carry Objects on Ceiling (Accelerative)"; prefix = "(524)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 525 @@ -2896,6 +2928,31 @@ linedeftypes title = "Carry Objects on Ceiling (Displacement)"; prefix = "(525)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; + } + + 526 + { + title = "Carry Objects on Floor and Ceiling"; + prefix = "(526)"; + flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; + } + + 527 + { + title = "Carry Objects on Floor and Ceiling (Accelerative)"; + prefix = "(527)"; + flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; + } + + 528 + { + title = "Carry Objects on Floor and Ceiling (Displacement)"; + prefix = "(528)"; + flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 530 @@ -2903,6 +2960,7 @@ linedeftypes title = "Scroll Floor Texture and Carry Objects"; prefix = "(530)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 531 @@ -2910,6 +2968,7 @@ linedeftypes title = "Scroll Floor Texture and Carry Objects (Accelerative)"; prefix = "(531)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 532 @@ -2917,6 +2976,7 @@ linedeftypes title = "Scroll Floor Texture and Carry Objects (Displacement)"; prefix = "(532)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 533 @@ -2924,6 +2984,7 @@ linedeftypes title = "Scroll Ceiling Texture and Carry Objects"; prefix = "(533)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 534 @@ -2931,6 +2992,7 @@ linedeftypes title = "Scroll Ceiling Texture and Carry Objects (Accelerative)"; prefix = "(534)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } 535 @@ -2938,6 +3000,31 @@ linedeftypes title = "Scroll Ceiling Texture and Carry Objects (Displacement)"; prefix = "(535)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; + } + + 536 + { + title = "Scroll Floor and Ceiling Texture and Carry Objects"; + prefix = "(536)"; + flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; + } + + 537 + { + title = "Scroll Floor and Ceiling Texture and Carry Objects (Accelerative)"; + prefix = "(537)"; + flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; + } + + 538 + { + title = "Scroll Floor and Ceiling Texture and Carry Objects (Displacement)"; + prefix = "(538)"; + flags64text = "[6] Exclusive"; + flags8192text = "[13] Use angle and X offset"; } } @@ -6949,7 +7036,7 @@ thingtypes { color = 10; // Green title = "Tutorial"; - + 799 { title = "Tutorial Plant"; diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index fff9edf10..4b9e5fd97 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -1286,6 +1286,21 @@ doom title = "Scroll Ceiling Texture (Displacement)"; prefix = "(515)"; } + 516 + { + title = "Scroll Floor and Ceiling Texture"; + prefix = "(516)"; + } + 517 + { + title = "Scroll Floor and Ceiling Texture (Accelerative)"; + prefix = "(517)"; + } + 518 + { + title = "Scroll Floor and Ceiling Texture (Displacement)"; + prefix = "(518)"; + } 520 { title = "Carry Objects on Floor"; @@ -1316,6 +1331,21 @@ doom title = "Carry Objects on Ceiling (Displacement)"; prefix = "(525)"; } + 526 + { + title = "Carry Objects on Floor and Ceiling"; + prefix = "(526)"; + } + 527 + { + title = "Carry Objects on Floor and Ceiling (Accelerative)"; + prefix = "(527)"; + } + 528 + { + title = "Carry Objects on Floor and Ceiling (Displacement)"; + prefix = "(528)"; + } 530 { title = "Scroll Floor Texture and Carry Objects"; @@ -1346,6 +1376,21 @@ doom title = "Scroll Ceiling Texture and Carry Objects (Displacement)"; prefix = "(535)"; } + 536 + { + title = "Scroll Floor and Ceiling Texture and Carry Objects"; + prefix = "(536)"; + } + 537 + { + title = "Scroll Floor and Ceiling Texture and Carry Objects (Accelerative)"; + prefix = "(537)"; + } + 538 + { + title = "Scroll Floor and Ceiling Texture and Carry Objects (Displacement)"; + prefix = "(538)"; + } } pusher @@ -2593,7 +2638,7 @@ udmf } } } - + 190 { title = "Rising"; diff --git a/src/p_setup.c b/src/p_setup.c index 146d5d302..9712528ef 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -5594,25 +5594,36 @@ static void P_ConvertBinaryLinedefTypes(void) case 513: //Scroll ceiling texture case 514: //Scroll ceiling texture (accelerative) case 515: //Scroll ceiling texture (displacement) + case 516: //Scroll floor and ceiling texture + case 517: //Scroll floor and ceiling texture (accelerative) + case 518: //Scroll floor and ceiling texture (displacement) case 520: //Carry objects on floor case 521: //Carry objects on floor (accelerative) case 522: //Carry objects on floor (displacement) case 523: //Carry objects on ceiling case 524: //Carry objects on ceiling (accelerative) case 525: //Carry objects on ceiling (displacement) + case 526: //Carry objects on floor and ceiling + case 527: //Carry objects on floor and ceiling (accelerative) + case 528: //Carry objects on floor and ceiling (displacement) case 530: //Scroll floor texture and carry objects case 531: //Scroll floor texture and carry objects (accelerative) case 532: //Scroll floor texture and carry objects (displacement) case 533: //Scroll ceiling texture and carry objects case 534: //Scroll ceiling texture and carry objects (accelerative) case 535: //Scroll ceiling texture and carry objects (displacement) + case 536: //Scroll floor and ceiling texture and carry objects + case 537: //Scroll floor and ceiling texture and carry objects (accelerative) + case 538: //Scroll floor and ceiling texture and carry objects (displacement) lines[i].args[0] = tag; - lines[i].args[1] = ((lines[i].special % 10) < 3) ? TMP_FLOOR : TMP_CEILING; + lines[i].args[1] = ((lines[i].special % 10) < 6) ? (((lines[i].special % 10) < 3) ? TMP_FLOOR : TMP_CEILING) : TMP_BOTH; lines[i].args[2] = ((lines[i].special - 510)/10 + 1) % 3; lines[i].args[3] = R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS; lines[i].args[4] = (lines[i].special % 10) % 3; if (lines[i].args[2] != TMS_SCROLLONLY && !(lines[i].flags & ML_NOCLIMB)) lines[i].args[4] |= TMST_NONEXCLUSIVE; + if (lines[i].flags & ML_EFFECT6) + lines[i].args[3] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; lines[i].special = 510; break; case 540: //Floor friction From fe8485cc2ffd6ca761e8423f08039ba5672bce29 Mon Sep 17 00:00:00 2001 From: spherallic Date: Sat, 17 Sep 2022 11:20:51 +0200 Subject: [PATCH 007/108] Add flag to set wind/current/push/pull strength using X offset --- extras/conf/SRB2-22.cfg | 19 +++++++++++++------ src/p_setup.c | 9 +++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 0bf009f79..6cd2f0d04 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -3036,48 +3036,54 @@ linedeftypes { title = "Wind"; prefix = "(541)"; - flags512text = "[9] Player slides"; flags64text = "[6] Exclusive"; + flags512text = "[9] Player slides"; + flags8192text = "[13] Use angle and X offset"; } 542 { title = "Upwards Wind"; prefix = "(542)"; - flags512text = "[9] Player slides"; flags64text = "[6] Exclusive"; + flags512text = "[9] Player slides"; + flags8192text = "[13] Use X offset"; } 543 { title = "Downwards Wind"; prefix = "(543)"; - flags512text = "[9] Player slides"; flags64text = "[6] Exclusive"; + flags512text = "[9] Player slides"; + flags8192text = "[13] Use X offset"; } 544 { title = "Current"; prefix = "(544)"; - flags512text = "[9] Player slides"; flags64text = "[6] Exclusive"; + flags512text = "[9] Player slides"; + flags8192text = "[13] Use angle and X offset"; } 545 { title = "Upwards Current"; prefix = "(545)"; - flags512text = "[9] Player slides"; flags64text = "[6] Exclusive"; + flags512text = "[9] Player slides"; + flags8192text = "[13] Use X offset"; } 546 { title = "Downwards Current"; prefix = "(546)"; - flags512text = "[9] Player slides"; flags64text = "[6] Exclusive"; + flags512text = "[9] Player slides"; + flags8192text = "[13] Use X offset"; } 547 @@ -3085,6 +3091,7 @@ linedeftypes title = "Push/Pull"; prefix = "(547)"; flags64text = "[6] Exclusive"; + flags8192text = "[13] Use X offset"; } } diff --git a/src/p_setup.c b/src/p_setup.c index 9712528ef..acee2bb69 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -5651,17 +5651,18 @@ static void P_ConvertBinaryLinedefTypes(void) case 544: //Current case 545: //Upwards current case 546: //Downwards current + fixed_t speed = (lines[i].flags & ML_EFFECT6) ? sides[lines[i].sidenum[0]].textureoffset : R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y); lines[i].args[0] = tag; switch ((lines[i].special - 541) % 3) { case 0: - lines[i].args[1] = R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS; + lines[i].args[1] = speed >> FRACBITS; break; case 1: - lines[i].args[2] = R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS; + lines[i].args[2] = speed >> FRACBITS; break; case 2: - lines[i].args[2] = -R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS; + lines[i].args[2] = -speed >> FRACBITS; break; } lines[i].args[3] = (lines[i].special >= 544) ? p_current : p_wind; @@ -6308,7 +6309,7 @@ static void P_ConvertBinaryThingTypes(void) } mapthings[i].args[0] = mapthings[i].angle; - mapthings[i].args[1] = P_AproxDistance(line->dx >> FRACBITS, line->dy >> FRACBITS); + mapthings[i].args[1] = (line->flags & ML_EFFECT6) ? sides[line->sidenum[0]].textureoffset >> FRACBITS : P_AproxDistance(line->dx >> FRACBITS, line->dy >> FRACBITS); if (mapthings[i].type == 755) mapthings[i].args[1] *= -1; if (mapthings[i].options & MTF_OBJECTSPECIAL) From cc3d4acdcdd18d97140b40824c2f46ee71476d4a Mon Sep 17 00:00:00 2001 From: spherallic Date: Tue, 20 Sep 2022 20:42:19 +0200 Subject: [PATCH 008/108] Fix AppVeyor build failure --- src/p_setup.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index acee2bb69..a85e27e99 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -5651,18 +5651,19 @@ static void P_ConvertBinaryLinedefTypes(void) case 544: //Current case 545: //Upwards current case 546: //Downwards current - fixed_t speed = (lines[i].flags & ML_EFFECT6) ? sides[lines[i].sidenum[0]].textureoffset : R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y); + { + fixed_t strength = (lines[i].flags & ML_EFFECT6) ? sides[lines[i].sidenum[0]].textureoffset : R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y); lines[i].args[0] = tag; switch ((lines[i].special - 541) % 3) { case 0: - lines[i].args[1] = speed >> FRACBITS; + lines[i].args[1] = strength >> FRACBITS; break; case 1: - lines[i].args[2] = speed >> FRACBITS; + lines[i].args[2] = strength >> FRACBITS; break; case 2: - lines[i].args[2] = -speed >> FRACBITS; + lines[i].args[2] = -strength >> FRACBITS; break; } lines[i].args[3] = (lines[i].special >= 544) ? p_current : p_wind; @@ -5672,6 +5673,7 @@ static void P_ConvertBinaryLinedefTypes(void) lines[i].args[4] |= TMPF_NONEXCLUSIVE; lines[i].special = 541; break; + } case 600: //Floor lighting case 601: //Ceiling lighting lines[i].args[0] = tag; From 049bfd7bd4c0b3ba27cfcf3f38fb7653ebeaaf76 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 9 Oct 2022 17:17:16 +0200 Subject: [PATCH 009/108] Minor code cleanup in P_ConvertBinaryLinedefTypes --- src/p_setup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index a85e27e99..1f8d316a7 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -5618,12 +5618,10 @@ static void P_ConvertBinaryLinedefTypes(void) lines[i].args[0] = tag; lines[i].args[1] = ((lines[i].special % 10) < 6) ? (((lines[i].special % 10) < 3) ? TMP_FLOOR : TMP_CEILING) : TMP_BOTH; lines[i].args[2] = ((lines[i].special - 510)/10 + 1) % 3; - lines[i].args[3] = R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS; + lines[i].args[3] = ((lines[i].flags & ML_EFFECT6) ? sides[lines[i].sidenum[0]].textureoffset : R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y)) >> FRACBITS; lines[i].args[4] = (lines[i].special % 10) % 3; if (lines[i].args[2] != TMS_SCROLLONLY && !(lines[i].flags & ML_NOCLIMB)) lines[i].args[4] |= TMST_NONEXCLUSIVE; - if (lines[i].flags & ML_EFFECT6) - lines[i].args[3] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; lines[i].special = 510; break; case 540: //Floor friction From 2714ac44b47af785e3e4d7532731192911ae0879 Mon Sep 17 00:00:00 2001 From: katsy Date: Wed, 12 Oct 2022 20:38:29 -0500 Subject: [PATCH 010/108] reallow score chains from rolling --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 2f522ad4b..bcc9cb20b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8412,12 +8412,12 @@ void P_MovePlayer(player_t *player) } } - // End your chain if you're on the ground or climbing a wall. + // End your chain if you're on the ground while not rolling, or climbing a wall. // But not if invincible! Allow for some crazy long chains with it. // Also keep in mind the PF_JUMPED check. // If we lacked this, stepping up while jumping up would reset score. // (for instance, when climbing up off a wall.) - if ((onground || player->climbing) && !(player->pflags & PF_JUMPED) && player->powers[pw_invulnerability] <= 1) + if ((onground || player->climbing) && ((player->pflags & (PF_STARTDASH|PF_SPINNING)) != PF_SPINNING) && !(player->pflags & PF_JUMPED) && player->powers[pw_invulnerability] <= 1) P_ResetScore(player); // Show the "THOK!" graphic when spinning quickly across the ground. (even applies to non-spinners, in the case of zoom tubes) From 373af010920537ba949c113163ddf0537cb30078 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 14 Oct 2022 18:20:52 -0700 Subject: [PATCH 011/108] Add startswith and endswith, functions that compare the beginning or ending of a string --- src/doomtype.h | 3 +++ src/string.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/doomtype.h b/src/doomtype.h index 5ddd9ae44..95871e98c 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -107,6 +107,9 @@ typedef long ssize_t; char *strcasestr(const char *in, const char *what); #define stristr strcasestr +int startswith (const char *base, const char *tag); +int endswith (const char *base, const char *tag); + #if defined (macintosh) //|| defined (__APPLE__) //skip all boolean/Boolean crap #define true 1 #define false 0 diff --git a/src/string.c b/src/string.c index 5534a3f0c..f48788e35 100644 --- a/src/string.c +++ b/src/string.c @@ -52,3 +52,19 @@ size_t strlcpy(char *dst, const char *src, size_t siz) #endif #include "strcasestr.c" + +int startswith(const char *path, const char *tag) +{ + return !strncmp(path, tag, strlen(tag)); +} + +int endswith(const char *base, const char *tag) +{ + const size_t base_length = strlen(base); + const size_t tag_length = strlen(tag); + + if (tag_length > base_length) + return false; + + return !memcmp(&base[base_length - tag_length], tag, tag_length); +} From b1a86b0b340fce3d0b92493bca6db55878f2eafa Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 14 Oct 2022 17:40:13 -0700 Subject: [PATCH 012/108] Disallow adding files with absolute path or traversing upward (Except as part of srb2home, srb2path or addons_folder -- this lets addons menu work, primarily.) - disallowed when using addfile or addfolder - security check for xcmd receive --- src/d_main.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/d_main.h | 2 ++ src/p_setup.c | 43 +++++++++++++++---------------- 3 files changed, 94 insertions(+), 22 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index fa9e21337..6e76672e0 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1689,3 +1689,74 @@ const char *D_Home(void) if (usehome) return userhome; else return NULL; } + +static boolean check_top_dir(const char **path, const char *top) +{ + // empty string does NOT match + if (!strcmp(top, "")) + return false; + + if (!startswith(*path, top)) + return false; + + *path += strlen(top); + + // if it doesn't already end with a path separator, + // check if a separator follows + if (!endswith(top, PATHSEP)) + { + if (startswith(*path, PATHSEP)) + *path += strlen(PATHSEP); + else + return false; + } + + return true; +} + +static int cmp_strlen_desc(const void *a, const void *b) +{ + return ((int)strlen(*(const char*const*)b) - (int)strlen(*(const char*const*)a)); +} + +boolean D_IsPathAllowed(const char *path) +{ + const char *paths[] = { + srb2home, + srb2path, + cv_addons_folder.string + }; + + const size_t n_paths = sizeof paths / sizeof *paths; + + size_t i; + + // Sort folder paths by longest to shortest so + // overlapping paths work. E.g.: + // Path 1: /home/james/.srb2/addons + // Path 2: /home/james/.srb2 + qsort(paths, n_paths, sizeof *paths, cmp_strlen_desc); + + // These paths are allowed to be absolute + // path is offset so ".." can be checked only in the + // rest of the path + for (i = 0; i < n_paths; ++i) + { + if (check_top_dir(&path, paths[i])) + break; + } + + // Only if none of the presets matched + if (i == n_paths) + { + // Cannot be an absolute path + if (M_IsPathAbsolute(path)) + return false; + } + + // Cannot traverse upwards + if (strstr(path, "..")) + return false; + + return true; +} diff --git a/src/d_main.h b/src/d_main.h index 8189a9f2b..7760351f3 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -44,6 +44,8 @@ void D_ProcessEvents(void); const char *D_Home(void); +boolean D_IsPathAllowed(const char *path); + // // BASE LEVEL // diff --git a/src/p_setup.c b/src/p_setup.c index 03a702b30..132dc4259 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -7860,8 +7860,10 @@ static lumpinfo_t* FindFolder(const char *folName, UINT16 *start, UINT16 *end, l // Add a wadfile to the active wad files, // replace sounds, musics, patches, textures, sprites and maps // -static boolean P_LoadAddon(UINT16 wadnum, UINT16 numlumps) +static boolean P_LoadAddon(UINT16 numlumps) { + const UINT16 wadnum = (UINT16)(numwadfiles-1); + size_t i, j, sreplaces = 0, mreplaces = 0, digmreplaces = 0; char *name; lumpinfo_t *lumpinfo; @@ -7883,6 +7885,12 @@ static boolean P_LoadAddon(UINT16 wadnum, UINT16 numlumps) // UINT16 flaPos, flaNum = 0; // UINT16 mapPos, mapNum = 0; + if (numlumps == INT16_MAX) + { + refreshdirmenu |= REFRESHDIR_NOTLOADED; + return false; + } + switch(wadfiles[wadnum]->type) { case RET_PK3: @@ -8051,34 +8059,25 @@ static boolean P_LoadAddon(UINT16 wadnum, UINT16 numlumps) return true; } -boolean P_AddWadFile(const char *wadfilename) +static boolean P_CheckAddonPath(const char *path) { - UINT16 numlumps, wadnum; - - // Init file. - if ((numlumps = W_InitFile(wadfilename, false, false)) == INT16_MAX) + if (!D_IsPathAllowed(path)) { - refreshdirmenu |= REFRESHDIR_NOTLOADED; + CONS_Alert(CONS_WARNING, "%s: tried to add file, location is not allowed\n", path); return false; } - else - wadnum = (UINT16)(numwadfiles-1); - return P_LoadAddon(wadnum, numlumps); + return true; +} + +boolean P_AddWadFile(const char *wadfilename) +{ + return P_CheckAddonPath(wadfilename) && + P_LoadAddon(W_InitFile(wadfilename, false, false)); } boolean P_AddFolder(const char *folderpath) { - UINT16 numlumps, wadnum; - - // Init file. - if ((numlumps = W_InitFolder(folderpath, false, false)) == INT16_MAX) - { - refreshdirmenu |= REFRESHDIR_NOTLOADED; - return false; - } - else - wadnum = (UINT16)(numwadfiles-1); - - return P_LoadAddon(wadnum, numlumps); + return P_CheckAddonPath(folderpath) && + P_LoadAddon(W_InitFolder(folderpath, false, false)); } From 3bd3369fdc8b133d2a6a537160cb438749af3349 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 14 Oct 2022 21:56:01 -0700 Subject: [PATCH 013/108] Add fopenfile, alternative to fopen that does not ever open directories --- src/doomdef.h | 2 ++ src/filesrch.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/doomdef.h b/src/doomdef.h index 2b62bcd6e..62afcc6c7 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -104,6 +104,8 @@ #include #endif +FILE *fopenfile(const char*, const char*); + //#define NOMD5 // Uncheck this to compile debugging code diff --git a/src/filesrch.c b/src/filesrch.c index 3f901b695..33d5bc65f 100644 --- a/src/filesrch.c +++ b/src/filesrch.c @@ -39,6 +39,7 @@ #define SUFFIX "*" #define SLASH "\\" +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #ifndef INVALID_FILE_ATTRIBUTES @@ -307,6 +308,39 @@ closedir (DIR * dirp) } #endif +// fopen but it REALLY only works on regular files +// Turns out, on linux, anyway, you can fopen directories +// in read mode. (It's supposed to fail in write mode +// though!!) +FILE *fopenfile(const char *path, const char *mode) +{ + FILE *h = fopen(path, mode); + + if (h != NULL) + { + struct stat st; + int eno; + + if (fstat(fileno(h), &st) == -1) + { + eno = errno; + } + else if (!S_ISREG(st.st_mode)) + { + eno = EACCES; // set some kinda error + } + else + { + return h; // ok + } + + fclose(h); + errno = eno; + } + + return NULL; +} + static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"}, #if 1 {1, "HOME"}, {2, "SRB2"}, From 9761ab52d9d4193aa9fde4c072aa86572d79bccb Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 14 Oct 2022 21:57:14 -0700 Subject: [PATCH 014/108] FIL_ReadFileTag: use fopenfile Fixes exec, for example, crashing the game if given a directory. Test: `exec .` --- src/m_misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_misc.c b/src/m_misc.c index 6c346e5a1..495c40e8b 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -273,8 +273,8 @@ size_t FIL_ReadFileTag(char const *name, UINT8 **buffer, INT32 tag) size_t count, length; UINT8 *buf; - if (FIL_ReadFileOK(name)) - handle = fopen(name, "rb"); + //if (FIL_ReadFileOK(name)) + handle = fopenfile(name, "rb"); if (!handle) return 0; From 76879299f98b2b91f9a7df661e17c137ff2f6598 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 14 Oct 2022 22:10:24 -0700 Subject: [PATCH 015/108] Restrict exec path to srb2 directories --- src/command.c | 4 ++++ src/d_main.c | 11 +++++++++++ src/d_main.h | 1 + src/m_misc.c | 1 + src/p_setup.c | 15 ++------------- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/command.c b/src/command.c index dae4dc7b1..f8b587328 100644 --- a/src/command.c +++ b/src/command.c @@ -34,6 +34,7 @@ #include "lua_script.h" #include "d_netfil.h" // findfile #include "r_data.h" // Color_cons_t +#include "d_main.h" // D_IsPathAllowed //======== // protos. @@ -770,6 +771,9 @@ static void COM_Exec_f(void) return; } + if (!D_CheckPathAllowed(COM_Argv(1), "tried to exec")) + return; + // load file // Try with Argv passed verbatim first, for back compat FIL_ReadFile(COM_Argv(1), &buf); diff --git a/src/d_main.c b/src/d_main.c index 6e76672e0..5b102d623 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1760,3 +1760,14 @@ boolean D_IsPathAllowed(const char *path) return true; } + +boolean D_CheckPathAllowed(const char *path, const char *why) +{ + if (!D_IsPathAllowed(path)) + { + CONS_Alert(CONS_WARNING, "%s: %s, location is not allowed\n", why, path); + return false; + } + + return true; +} diff --git a/src/d_main.h b/src/d_main.h index 7760351f3..cc06f5f61 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -45,6 +45,7 @@ void D_ProcessEvents(void); const char *D_Home(void); boolean D_IsPathAllowed(const char *path); +boolean D_CheckPathAllowed(const char *path, const char *why); // // BASE LEVEL diff --git a/src/m_misc.c b/src/m_misc.c index 6c346e5a1..fca0474eb 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -467,6 +467,7 @@ void Command_SaveConfig_f(void) CONS_Printf(M_GetText("saveconfig [-silent] : save config to a file\n")); return; } + strcpy(tmpstr, COM_Argv(1)); FIL_ForceExtension(tmpstr, ".cfg"); diff --git a/src/p_setup.c b/src/p_setup.c index 132dc4259..45813e04d 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8059,25 +8059,14 @@ static boolean P_LoadAddon(UINT16 numlumps) return true; } -static boolean P_CheckAddonPath(const char *path) -{ - if (!D_IsPathAllowed(path)) - { - CONS_Alert(CONS_WARNING, "%s: tried to add file, location is not allowed\n", path); - return false; - } - - return true; -} - boolean P_AddWadFile(const char *wadfilename) { - return P_CheckAddonPath(wadfilename) && + return D_CheckPathAllowed(wadfilename, "tried to add file") && P_LoadAddon(W_InitFile(wadfilename, false, false)); } boolean P_AddFolder(const char *folderpath) { - return P_CheckAddonPath(folderpath) && + return D_CheckPathAllowed(folderpath, "tried to add folder") && P_LoadAddon(W_InitFolder(folderpath, false, false)); } From 9277870fa2b62aa7984a9a95f9bfe8d94c9268f5 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 5 Nov 2022 03:11:36 +0000 Subject: [PATCH 016/108] Merge branch 'cmake-develop-flag' into 'next' cmake: Add SRB2_CONFIG_DEV_BUILD See merge request STJr/SRB2!1837 (cherry picked from commit 896a7609a77247a09eb93815a335dad5c85d0431) 518cb0b3 cmake: Add SRB2_CONFIG_DEV_BUILD --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ae93aac37..95689a2d1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,6 +37,8 @@ set(SRB2_CONFIG_YASM OFF CACHE BOOL "Use YASM in place of NASM.") set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL "Use statically linked OpenGL. NOT RECOMMENDED.") +set(SRB2_CONFIG_DEV_BUILD OFF CACHE BOOL + "Compile a development build of SRB2.") ### use internal libraries? if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only @@ -255,6 +257,10 @@ endif() set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-trigraphs) +if(${SRB2_CONFIG_DEV_BUILD}) + target_compile_definitions(SRB2SDL2 PRIVATE -DDEVELOP) +endif() + target_compile_definitions(SRB2SDL2 PRIVATE -DCMAKECONFIG) #add_library(SRB2Core STATIC From ce5c41d7eb952e68eb5db593d1f94a5aed9dc4c6 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 5 Nov 2022 05:14:32 +0000 Subject: [PATCH 017/108] Merge branch 'the-one-cmake' into 'next' Overhaul cmake build See merge request STJr/SRB2!1832 (cherry picked from commit 4337205fa82dd30adee9842894e24d56185bf2c7) # Conflicts: # src/sdl/CMakeLists.txt --- CMakeLists.txt | 169 +++++----- cmake/CPM.cmake | 21 ++ cmake/Modules/FindGME.cmake | 12 +- cmake/Modules/FindOPENMPT.cmake | 12 +- cmake/Modules/FindSDL2.cmake | 10 + cmake/Modules/FindSDL2_mixer.cmake | 10 + src/CMakeLists.txt | 242 ++++---------- src/sdl/CMakeLists.txt | 399 +++++++---------------- src/sdl/mixer_sound.c | 2 +- thirdparty/CMakeLists.txt | 499 +++++++++++++++++++++++++++++ thirdparty/openmpt_svn_version.h | 10 + 11 files changed, 822 insertions(+), 564 deletions(-) create mode 100644 cmake/CPM.cmake create mode 100644 thirdparty/CMakeLists.txt create mode 100644 thirdparty/openmpt_svn_version.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f901d3d7..f5364bc88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,68 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.14 FATAL_ERROR) + +# Set up CMAKE path +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") + +include(CMakeDependentOption) +include(cmake/CPM.cmake) + +file(STRINGS src/version.h SRB2_VERSION) +string(REGEX MATCH "[0-9]+\\.[0-9.]+" SRB2_VERSION ${SRB2_VERSION}) + +# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string. +# Version change is fine. +project(SRB2 + VERSION ${SRB2_VERSION} + LANGUAGES C CXX) + +##### PACKAGE CONFIGURATION ##### + +set(SRB2_CPACK_GENERATOR "" CACHE STRING "Generator to use for making a package. E.g., ZIP, TGZ, DragNDrop (OSX only). Leave blank for default generator.") + +if("${SRB2_CPACK_GENERATOR}" STREQUAL "") + if("${CMAKE_SYSTEM_NAME}" MATCHES "Windows") + set(SRB2_CPACK_GENERATOR "ZIP") + elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") + set(SRB2_CPACK_GENERATOR "TGZ") + elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") + set(SRB2_CPACK_GENERATOR "TGZ") + endif() +endif() + +set(CPACK_GENERATOR ${SRB2_CPACK_GENERATOR}) +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Sonic Robo Blast 2" CACHE STRING "Program name for display purposes") +set(CPACK_PACKAGE_VENDOR "Sonic Team Jr." CACHE STRING "Vendor name for display purposes") +#set(CPACK_PACKAGE_DESCRIPTION_FILE ) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +set(CPACK_PACKAGE_VERSION_MAJOR ${SRB2_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${SRB2_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${SRB2_VERSION_PATCH}) +set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}") +SET(CPACK_OUTPUT_FILE_PREFIX package) +include(CPack) + +# Options + +if("${CMAKE_SYSTEM_NAME}" MATCHES Linux) + set(SRB2_CONFIG_SYSTEM_LIBRARIES_DEFAULT ON) +else() + set(SRB2_CONFIG_SYSTEM_LIBRARIES_DEFAULT OFF) +endif() + +option( + SRB2_CONFIG_SYSTEM_LIBRARIES + "Link dependencies using CMake's find_package and do not use internal builds" + ${SRB2_CONFIG_SYSTEM_LIBRARIES_DEFAULT} +) +# This option isn't recommended for distribution builds and probably won't work (yet). +cmake_dependent_option( + SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES + "Use dynamic libraries when compiling internal dependencies" + OFF "NOT SRB2_CONFIG_SYSTEM_LIBRARIES" + OFF +) +option(SRB2_CONFIG_HWRENDER "Enable hardware render (OpenGL) support" ON) +option(SRB2_CONFIG_STATIC_OPENGL "Enable static linking GL (do not do this)" OFF) # Enable CCache early set(SRB2_USE_CCACHE OFF CACHE BOOL "Use CCache") @@ -12,14 +76,18 @@ if (${SRB2_USE_CCACHE}) endif() endif() -file(STRINGS src/version.h SRB2_VERSION) -string(REGEX MATCH "[0-9]+\\.[0-9.]+" SRB2_VERSION ${SRB2_VERSION}) +# Dependencies +add_subdirectory(thirdparty) -# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string. -# Version change is fine. -project(SRB2 - VERSION ${SRB2_VERSION} - LANGUAGES C) +if("${SRB2_CONFIG_SYSTEM_LIBRARIES}") + find_package(ZLIB REQUIRED) + find_package(PNG REQUIRED) + find_package(SDL2 REQUIRED) + find_package(SDL2_mixer REQUIRED) + find_package(CURL REQUIRED) + find_package(OPENMPT REQUIRED) + find_package(GME REQUIRED) +endif() if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) message(FATAL_ERROR "In-source builds will bring you a world of pain. Please make a separate directory to invoke CMake from.") @@ -29,11 +97,6 @@ if ((${SRB2_USE_CCACHE}) AND (${CMAKE_C_COMPILER} MATCHES "clang")) message(WARNING "Using clang and CCache: You may want to set environment variable CCACHE_CPP2=yes to prevent include errors during compile.") endif() -# Set up CMAKE path -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") - -### Useful functions - # Add sources from Sourcefile function(target_sourcefile type) file(STRINGS Sourcefile list @@ -41,40 +104,6 @@ function(target_sourcefile type) target_sources(SRB2SDL2 PRIVATE ${list}) endfunction() -# Macro to add OSX framework -macro(add_framework fwname appname) - find_library(FRAMEWORK_${fwname} - NAMES ${fwname} - PATHS ${CMAKE_OSX_SYSROOT}/System/Library - ${CMAKE_OSX_SYSROOT}/Library - /System/Library - /Library - ATH_SUFFIXES Frameworks - NO_DEFAULT_PATH) - if( ${FRAMEWORK_${fwname}} STREQUAL FRAMEWORK_${fwname}-NOTFOUND) - MESSAGE(ERROR ": Framework ${fwname} not found") - else() - TARGET_LINK_LIBRARIES(${appname} PRIVATE "${FRAMEWORK_${fwname}}/${fwname}") - MESSAGE(STATUS "Framework ${fwname} found at ${FRAMEWORK_${fwname}}") - endif() -endmacro() - -# Macro to copy Windows DLLs to Debug/Release folder for easy debugging -# Note: this is general purpose, we could copy anything. Just using for DLLs on MSVC though -macro(copy_files_to_build_dir target dlllist_var) - if(MSVC) - # http://stackoverflow.com/a/26983405/3064195 - foreach(dlllist_item ${${dlllist_var}}) - get_filename_component(dllname ${dlllist_item} NAME) - add_custom_command(TARGET ${target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${dlllist_item} - $/${dllname} - ) - endforeach() - endif() -endmacro() - # bitness check set(SRB2_SYSTEM_BITS 0) if(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -89,26 +118,6 @@ if(${SRB2_SYSTEM_BITS} EQUAL 0) message(STATUS "Target bitness is unknown") endif() -# OS macros -if (UNIX) - add_definitions(-DUNIXCOMMON) -endif() - -if(CMAKE_COMPILER_IS_GNUCC) - find_program(OBJCOPY objcopy) -endif() - -if(${CMAKE_SYSTEM} MATCHES "Linux") - add_definitions(-DLINUX) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - add_definitions(-DLINUX64) - endif() -endif() - -if(${CMAKE_SYSTEM} MATCHES "Darwin") - add_definitions(-DMACOSX) -endif() - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") set(CMAKE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") @@ -129,29 +138,3 @@ git_current_branch(SRB2_GIT_BRANCH "${CMAKE_SOURCE_DIR}") set(SRB2_COMP_BRANCH "${SRB2_GIT_BRANCH}") set(SRB2_COMP_REVISION "${SRB2_COMP_COMMIT}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config.h) - -##### PACKAGE CONFIGURATION ##### - -set(SRB2_CPACK_GENERATOR "" CACHE STRING "Generator to use for making a package. E.g., ZIP, TGZ, DragNDrop (OSX only). Leave blank for default generator.") - -if("${SRB2_CPACK_GENERATOR}" STREQUAL "") - if(${CMAKE_SYSTEM} MATCHES "Windows") - set(SRB2_CPACK_GENERATOR "ZIP") - elseif(${CMAKE_SYSTEM} MATCHES "Linux") - set(SRB2_CPACK_GENERATOR "TGZ") - elseif(${CMAKE_SYSTEM} MATCHES "Darwin") - set(SRB2_CPACK_GENERATOR "TGZ") - endif() -endif() - -set(CPACK_GENERATOR ${SRB2_CPACK_GENERATOR}) -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Sonic Robo Blast 2" CACHE STRING "Program name for display purposes") -set(CPACK_PACKAGE_VENDOR "Sonic Team Jr." CACHE STRING "Vendor name for display purposes") -#set(CPACK_PACKAGE_DESCRIPTION_FILE ) -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") -set(CPACK_PACKAGE_VERSION_MAJOR ${SRB2_VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${SRB2_VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${SRB2_VERSION_PATCH}) -set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}") -SET(CPACK_OUTPUT_FILE_PREFIX package) -include(CPack) diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake new file mode 100644 index 000000000..772103fc3 --- /dev/null +++ b/cmake/CPM.cmake @@ -0,0 +1,21 @@ +set(CPM_DOWNLOAD_VERSION 0.36.0) + +if(CPM_SOURCE_CACHE) + set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +elseif(DEFINED ENV{CPM_SOURCE_CACHE}) + set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +else() + set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +endif() + +# Expand relative path. This is important if the provided path contains a tilde (~) +get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) +if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) + message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") + file(DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} + ) +endif() + +include(${CPM_DOWNLOAD_LOCATION}) diff --git a/cmake/Modules/FindGME.cmake b/cmake/Modules/FindGME.cmake index ea80af454..3af0a94be 100644 --- a/cmake/Modules/FindGME.cmake +++ b/cmake/Modules/FindGME.cmake @@ -20,4 +20,14 @@ find_library(GME_LIBRARY set(GME_PROCESS_INCLUDES GME_INCLUDE_DIR) set(GME_PROCESS_LIBS GME_LIBRARY) -libfind_process(GME) \ No newline at end of file +libfind_process(GME) + +if(GME_FOUND AND NOT TARGET gme) + add_library(gme UNKNOWN IMPORTED) + set_target_properties( + gme + PROPERTIES + IMPORTED_LOCATION "${GME_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${GME_INCLUDE_DIR}" + ) +endif() diff --git a/cmake/Modules/FindOPENMPT.cmake b/cmake/Modules/FindOPENMPT.cmake index 2d334b6f0..7e5b2d5a3 100644 --- a/cmake/Modules/FindOPENMPT.cmake +++ b/cmake/Modules/FindOPENMPT.cmake @@ -20,4 +20,14 @@ find_library(OPENMPT_LIBRARY set(OPENMPT_PROCESS_INCLUDES OPENMPT_INCLUDE_DIR) set(OPENMPT_PROCESS_LIBS OPENMPT_LIBRARY) -libfind_process(OPENMPT) \ No newline at end of file +libfind_process(OPENMPT) + +if(OPENMPT_FOUND AND NOT TARGET openmpt) + add_library(openmpt UNKNOWN IMPORTED) + set_target_properties( + openmpt + PROPERTIES + IMPORTED_LOCATION "${OPENMPT_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${OPENMPT_INCLUDE_DIR}" + ) +endif() diff --git a/cmake/Modules/FindSDL2.cmake b/cmake/Modules/FindSDL2.cmake index 2fc833cef..2d625f84c 100644 --- a/cmake/Modules/FindSDL2.cmake +++ b/cmake/Modules/FindSDL2.cmake @@ -31,3 +31,13 @@ find_library(SDL2_LIBRARY set(SDL2_PROCESS_INCLUDES SDL2_INCLUDE_DIR) set(SDL2_PROCESS_LIBS SDL2_LIBRARY) libfind_process(SDL2) + +if(SDL2_FOUND AND NOT TARGET SDL2::SDL2) + add_library(SDL2::SDL2 UNKNOWN IMPORTED) + set_target_properties( + SDL2::SDL2 + PROPERTIES + IMPORTED_LOCATION "${SDL2_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" + ) +endif() diff --git a/cmake/Modules/FindSDL2_mixer.cmake b/cmake/Modules/FindSDL2_mixer.cmake index 9af3e26dd..637498e53 100644 --- a/cmake/Modules/FindSDL2_mixer.cmake +++ b/cmake/Modules/FindSDL2_mixer.cmake @@ -32,3 +32,13 @@ find_library(SDL2_MIXER_LIBRARY set(SDL2_MIXER_PROCESS_INCLUDES SDL2_MIXER_INCLUDE_DIR) set(SDL2_MIXER_PROCESS_LIBS SDL2_MIXER_LIBRARY) libfind_process(SDL2_MIXER) + +if(SDL2_MIXER_FOUND AND NOT TARGET SDL2_mixer::SDL2_mixer) + add_library(SDL2_mixer::SDL2_mixer UNKNOWN IMPORTED) + set_target_properties( + SDL2_mixer::SDL2_mixer + PROPERTIES + IMPORTED_LOCATION "${SDL2_MIXER_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${SDL2_MIXER_INCLUDE_DIR}" + ) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 95689a2d1..2c98019e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,10 @@ -# SRB2 Core - add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32) +if("${CMAKE_COMPILER_IS_GNUCC}" AND "${CMAKE_SYSTEM_NAME}" MATCHES "Windows" AND NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + # On MinGW with internal libraries, link the standard library statically + target_link_options(SRB2SDL2 PRIVATE "-static") +endif() + # Core sources target_sourcefile(c) target_sources(SRB2SDL2 PRIVATE comptime.c md5.c config.h.in) @@ -11,193 +14,69 @@ set(SRB2_ASM_SOURCES vid_copy.s) set(SRB2_NASM_SOURCES tmap_mmx.nas tmap.nas) ### Configuration -set(SRB2_CONFIG_HAVE_PNG ON CACHE BOOL - "Enable PNG support. Depends on zlib, so will be disabled if you don't enable that too.") -set(SRB2_CONFIG_HAVE_ZLIB ON CACHE BOOL - "Enable zlib support.") -set(SRB2_CONFIG_HAVE_GME ON CACHE BOOL - "Enable GME support.") -set(SRB2_CONFIG_HAVE_OPENMPT ON CACHE BOOL - "Enable OpenMPT support.") -set(SRB2_CONFIG_HAVE_CURL ON CACHE BOOL - "Enable curl support.") -set(SRB2_CONFIG_HAVE_THREADS ON CACHE BOOL - "Enable multithreading support.") -if(${CMAKE_SYSTEM} MATCHES Windows) - set(SRB2_CONFIG_HAVE_MIXERX ON CACHE BOOL - "Enable SDL Mixer X support.") -else() - set(SRB2_CONFIG_HAVE_MIXERX OFF) -endif() -set(SRB2_CONFIG_HWRENDER ON CACHE BOOL - "Enable hardware rendering through OpenGL.") set(SRB2_CONFIG_USEASM OFF CACHE BOOL "Enable NASM tmap implementation for software mode speedup.") set(SRB2_CONFIG_YASM OFF CACHE BOOL "Use YASM in place of NASM.") -set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL - "Use statically linked OpenGL. NOT RECOMMENDED.") set(SRB2_CONFIG_DEV_BUILD OFF CACHE BOOL "Compile a development build of SRB2.") -### use internal libraries? -if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only - set(SRB2_CONFIG_USE_INTERNAL_LIBRARIES OFF CACHE BOOL - "Use SRB2's internal copies of required dependencies (SDL2, PNG, zlib, GME, OpenMPT).") -endif() - add_subdirectory(blua) -if(${SRB2_CONFIG_HAVE_GME}) - if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) - set(GME_FOUND ON) - set(GME_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/gme/include) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - set(GME_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/gme/win64 -lgme") - else() # 32-bit - set(GME_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/gme/win32 -lgme") - endif() - else() - find_package(GME) - endif() - if(${GME_FOUND}) - set(SRB2_HAVE_GME ON) - target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_GME) - else() - message(WARNING "You have specified that GME is available but it was not found.") +# OS macros +if (UNIX) + target_compile_definitions(SRB2SDL2 PRIVATE -DUNIXCOMMON) +endif() + +if(CMAKE_COMPILER_IS_GNUCC) + find_program(OBJCOPY objcopy) +endif() + +if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") + target_compile_definitions(SRB2SDL2 PRIVATE -DLINUX) + if(${SRB2_SYSTEM_BITS} EQUAL 64) + target_compile_definitions(SRB2SDL2 PRIVATE -DLINUX64) endif() endif() -if(${SRB2_CONFIG_HAVE_OPENMPT}) - if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) - set(OPENMPT_FOUND ON) - set(OPENMPT_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/libopenmpt/inc) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - set(OPENMPT_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/libopenmpt/lib/x86_64/mingw -lopenmpt") - else() # 32-bit - set(OPENMPT_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/libopenmpt/lib/x86/mingw -lopenmpt") - endif() - else() - find_package(OPENMPT) - endif() - if(${OPENMPT_FOUND}) - set(SRB2_HAVE_OPENMPT ON) - target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_OPENMPT) - else() - message(WARNING "You have specified that OpenMPT is available but it was not found.") - endif() +if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") + target_compile_definitions(SRB2SDL2 PRIVATE -DMACOSX) endif() -if(${SRB2_CONFIG_HAVE_MIXERX}) - if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) - set(MIXERX_FOUND ON) - set(MIXERX_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/include/SDL2) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - set(MIXERX_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDLMixerX/x86_64-w64-mingw32/lib -lSDL2_mixer_ext") - else() # 32-bit - set(MIXERX_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/lib -lSDL2_mixer_ext") - endif() - else() - # No support for non-Windows (yet?) - #find_package(MIXERX) - message(WARNING "SDL Mixer X is not supported as an external library.") - set(MIXERX_FOUND OFF) - endif() - if(${MIXERX_FOUND}) - set(SRB2_HAVE_MIXERX ON) - target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXERX) - else() - message(WARNING "You have specified that SDL Mixer X is available but it was not found.") - endif() +target_link_libraries(SRB2SDL2 PRIVATE gme) +target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_GME) +if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + # this sucks but gme doesn't use modern cmake to delineate public headers + target_include_directories(SRB2SDL2 PRIVATE "${libgme_SOURCE_DIR}") endif() -if(${SRB2_CONFIG_HAVE_ZLIB}) - if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) - set(ZLIB_FOUND ON) - set(ZLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/zlib) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - set(ZLIB_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/zlib/win32 -lz64") - else() # 32-bit - set(ZLIB_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/zlib/win32 -lz32") - endif() - else() - find_package(ZLIB) - endif() - if(${ZLIB_FOUND}) - set(SRB2_HAVE_ZLIB ON) - target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_ZLIB) - else() - message(WARNING "You have specified that ZLIB is available but it was not found. SRB2 may not compile correctly.") - endif() -endif() +target_link_libraries(SRB2SDL2 PRIVATE openmpt) +target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_OPENMPT) -if(${SRB2_CONFIG_HAVE_PNG} AND ${SRB2_CONFIG_HAVE_ZLIB}) - if (${ZLIB_FOUND}) - if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) - set(PNG_FOUND ON) - set(PNG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/libpng-src) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - set(PNG_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/libpng-src/projects -lpng64") - else() # 32-bit - set(PNG_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/libpng-src/projects -lpng32") - endif() - else() - find_package(PNG) - endif() - if(${PNG_FOUND}) - set(SRB2_HAVE_PNG ON) - target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_PNG) - target_compile_definitions(SRB2SDL2 PRIVATE -D_LARGEFILE64_SOURCE) - target_sources(SRB2SDL2 PRIVATE apng.c) - else() - message(WARNING "You have specified that PNG is available but it was not found. SRB2 may not compile correctly.") - endif() - endif() -endif() +target_link_libraries(SRB2SDL2 PRIVATE ZLIB::ZLIB PNG::PNG CURL::libcurl) +target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_ZLIB -DHAVE_PNG -DHAVE_CURL -D_LARGEFILE64_SOURCE) +target_sources(SRB2SDL2 PRIVATE apng.c) -if(${SRB2_CONFIG_HAVE_CURL}) - if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) - set(CURL_FOUND ON) - set(CURL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/curl/include) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - set(CURL_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/curl/lib64 -lcurl") - else() # 32-bit - set(CURL_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/curl/lib32 -lcurl") - endif() - else() - find_package(CURL) - endif() - if(${CURL_FOUND}) - set(SRB2_HAVE_CURL ON) - target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_CURL) - else() - message(WARNING "You have specified that CURL is available but it was not found. SRB2 may not compile correctly.") - endif() -endif() +set(SRB2_HAVE_THREADS ON) +target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_THREADS) -if(${SRB2_CONFIG_HAVE_THREADS}) - set(SRB2_HAVE_THREADS ON) - target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_THREADS) -endif() - -if(${SRB2_CONFIG_HWRENDER}) +if("${SRB2_CONFIG_HWRENDER}") target_compile_definitions(SRB2SDL2 PRIVATE -DHWRENDER) add_subdirectory(hardware) -endif() -if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL}) - find_package(OpenGL) - if(${OPENGL_FOUND}) - target_compile_definitions(SRB2SDL2 PRIVATE -DHWRENDER) - target_compile_definitions(SRB2SDL2 PRIVATE -DSTATIC_OPENGL) - else() - message(WARNING "You have specified static opengl but opengl was not found. Not setting HWRENDER.") + if("${SRB2_CONFIG_STATIC_OPENGL}") + find_package(OpenGL) + if(${OPENGL_FOUND}) + target_compile_definitions(SRB2SDL2 PRIVATE -DSTATIC_OPENGL) + else() + message(WARNING "You have specified static opengl but opengl was not found. Not setting HWRENDER.") + endif() endif() endif() if(${SRB2_CONFIG_USEASM}) #SRB2_ASM_FLAGS can be used to pass flags to either nasm or yasm. - if(${CMAKE_SYSTEM} MATCHES "Linux") + if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") set(SRB2_ASM_FLAGS "-DLINUX ${SRB2_ASM_FLAGS}") endif() @@ -213,7 +92,7 @@ if(${SRB2_CONFIG_USEASM}) set(SRB2_USEASM ON) target_compile_definitions(SRB2SDL2 PRIVATE -DUSEASM) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3 -mfpmath=sse") + target_compile_options(SRB2SDL2 PRIVATE -msse3 -mfpmath=sse) target_sources(SRB2SDL2 PRIVATE ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES}) @@ -226,7 +105,7 @@ endif() # If using CCACHE, then force it. # https://github.com/Cockatrice/Cockatrice/pull/3052/files -if (${CMAKE_SYSTEM} MATCHES "Darwin") +if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE) if(RULE_LAUNCH_COMPILE) MESSAGE(STATUS "Force enabling CCache usage under macOS") @@ -248,34 +127,33 @@ endif() # Compatibility flag with later versions of GCC # We should really fix our code to not need this if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -mno-ms-bitfields) + target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields) + target_compile_options(SRB2SDL2 PRIVATE -Wno-trigraphs) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-absolute-value) + target_compile_options(SRB2SDL2 PRIVATE -Wno-absolute-value) endif() -set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-trigraphs) - if(${SRB2_CONFIG_DEV_BUILD}) target_compile_definitions(SRB2SDL2 PRIVATE -DDEVELOP) endif() - target_compile_definitions(SRB2SDL2 PRIVATE -DCMAKECONFIG) -#add_library(SRB2Core STATIC -# ${SRB2_CORE_SOURCES} -# ${SRB2_CORE_HEADERS} -# ${SRB2_CORE_RENDER_SOURCES} -# ${SRB2_CORE_GAME_SOURCES} -# ${SRB2_LUA_SOURCES} -# ${SRB2_LUA_HEADERS} -# ${SRB2_BLUA_SOURCES} -# ${SRB2_BLUA_HEADERS} -#) - add_subdirectory(sdl) -if(NOT ${SRB2_SDL2_AVAILABLE}) - message(FATAL_ERROR "There are no targets available to build an SRB2 executable. :(") +# strip debug symbols into separate file when using gcc. +# to be consistent with Makefile, don't generate for OS X. +if((CMAKE_COMPILER_IS_GNUCC) AND NOT ("${CMAKE_SYSTEM_NAME}" MATCHES Darwin)) + if((${CMAKE_BUILD_TYPE} MATCHES Debug) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)) + if(${CMAKE_BUILD_TYPE} MATCHES Debug) + set(OBJCOPY_ONLY_KEEP_DEBUG "--only-keep-debug") + endif() + message(STATUS "Will make separate debug symbols in *.debug") + add_custom_command(TARGET SRB2SDL2 POST_BUILD + COMMAND ${OBJCOPY} ${OBJCOPY_ONLY_KEEP_DEBUG} $ $.debug + COMMAND ${OBJCOPY} --strip-debug $ + COMMAND ${OBJCOPY} --add-gnu-debuglink=$.debug $ + ) + endif() endif() diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 4f19d93df..be540b778 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -1,309 +1,136 @@ # Declare SDL2 interface sources -if(NOT ${SRB2_CONFIG_HAVE_MIXERX}) - set(SRB2_CONFIG_SDL2_USEMIXER ON CACHE BOOL "Use SDL2_mixer or regular sdl sound") -else() - set(SRB2_CONFIG_SDL2_USEMIXER OFF) -endif() - -if(${SRB2_CONFIG_SDL2_USEMIXER}) - if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) - set(SDL2_MIXER_FOUND ON) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - set(SDL2_MIXER_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/x86_64-w64-mingw32/include/SDL2) - set(SDL2_MIXER_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/x86_64-w64-mingw32/lib -lSDL2_mixer") - else() # 32-bit - set(SDL2_MIXER_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/i686-w64-mingw32/include/SDL2) - set(SDL2_MIXER_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/i686-w64-mingw32/lib -lSDL2_mixer") - endif() - else() - find_package(SDL2_mixer) - endif() - if(${SDL2_MIXER_FOUND}) - set(SRB2_HAVE_MIXER ON) - target_sources(SRB2SDL2 PRIVATE mixer_sound.c) - else() - message(WARNING "You specified that SDL2_mixer is available, but it was not found. Falling back to sdl sound.") - target_sources(SRB2SDL2 PRIVATE sdl_sound.c) - endif() -elseif(${MIXERX_FOUND}) - target_sources(SRB2SDL2 PRIVATE mixer_sound.c) -else() - target_sources(SRB2SDL2 PRIVATE sdl_sound.c) -endif() +target_sources(SRB2SDL2 PRIVATE mixer_sound.c) target_sourcefile(c) target_sources(SRB2SDL2 PRIVATE ogl_sdl.c) -if(${SRB2_CONFIG_HAVE_THREADS}) - target_sources(SRB2SDL2 PRIVATE i_threads.c) +target_sources(SRB2SDL2 PRIVATE i_threads.c) + +if(${SRB2_USEASM}) + set_source_files_properties(${SRB2_ASM_SOURCES} PROPERTIES LANGUAGE C) + set_source_files_properties(${SRB2_ASM_SOURCES} PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp") endif() -# Dependency -if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) - set(SDL2_FOUND ON) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - set(SDL2_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/include/SDL2) - set(SDL2_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/lib -lSDL2") - else() # 32-bit - set(SDL2_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/include/SDL2) - set(SDL2_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/lib -lSDL2") - endif() +if("${CMAKE_SYSTEM_NAME}" MATCHES Windows) + target_sources(SRB2SDL2 PRIVATE + ../win32/win_dbg.c + ../win32/Srb2win.rc) +endif() + +if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin) + set(MACOSX_BUNDLE_ICON_FILE Srb2mac.icns) + set_source_files_properties(macosx/Srb2mac.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") + target_sources(SRB2SDL2 PRIVATE + macosx/mac_alert.c + macosx/mac_alert.h + macosx/mac_resources.c + macosx/mac_resources.h + macosx/Srb2mac.icns + ) +endif() + +if("${CMAKE_SYSTEM_NAME}" MATCHES Windows) + set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME srb2win) +elseif("${CMAKE_SYSTEM_NAME}" MATCHES Linux) + set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME lsdlsrb2) else() - find_package(SDL2) + set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME srb2) endif() -if(${SDL2_FOUND}) - if(${SRB2_USEASM}) - set_source_files_properties(${SRB2_ASM_SOURCES} PROPERTIES LANGUAGE C) - set_source_files_properties(${SRB2_ASM_SOURCES} PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp") - endif() +if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin) + find_library(CORE_FOUNDATION_LIBRARY "CoreFoundation") + target_link_libraries(SRB2SDL2 PRIVATE + ${CORE_FOUNDATION_LIBRARY} + ) - if(${CMAKE_SYSTEM} MATCHES Windows) - target_sources(SRB2SDL2 PRIVATE - ../win32/win_dbg.c - ../win32/Srb2win.rc) - endif() + set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") - if(${CMAKE_SYSTEM} MATCHES Darwin) - set(MACOSX_BUNDLE_ICON_FILE Srb2mac.icns) - set_source_files_properties(macosx/Srb2mac.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") - target_sources(SRB2SDL2 PRIVATE - macosx/mac_alert.c - macosx/mac_alert.h - macosx/mac_resources.c - macosx/mac_resources.h - macosx/Srb2mac.icns - ) - endif() + # Configure the app bundle icon and plist properties + target_sources(SRB2SDL2 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/macosx/Srb2mac.icns") + set_target_properties(SRB2SDL2 PROPERTIES + MACOSX_BUNDLE_ICON_FILE "Srb2mac" + MACOSX_BUNDLE_BUNDLE_NAME "Sonic Robo Blast 2" + MACOSX_BUNDLE_BUNDLE_VERSION ${SRB2_VERSION} - if(${CMAKE_SYSTEM} MATCHES Windows) - set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME srb2win) - elseif(${CMAKE_SYSTEM} MATCHES Linux) - set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME lsdlsrb2) + RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/macosx/Srb2mac.icns" + ) +endif() + +if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}" AND NOT "${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}") + target_link_libraries(SRB2SDL2 PRIVATE SDL2::SDL2-static SDL2_mixer::SDL2_mixer-static) +else() + target_link_libraries(SRB2SDL2 PRIVATE SDL2::SDL2 SDL2_mixer::SDL2_mixer) +endif() + +if("${CMAKE_SYSTEM_NAME}" MATCHES Linux) + target_link_libraries(SRB2SDL2 PRIVATE m rt) +endif() + +if(${SRB2_USEASM}) + if(${SRB2_CONFIG_YASM}) + set(ASM_ASSEMBLER_TEMP ${CMAKE_ASM_YASM_COMPILER}) + set(ASM_ASSEMBLER_OBJFORMAT ${CMAKE_ASM_YASM_OBJECT_FORMAT}) + set_source_files_properties(${SRB2_NASM_SOURCES} LANGUAGE ASM_YASM) else() - set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME srb2) + set(ASM_ASSEMBLER_TEMP ${CMAKE_ASM_NASM_COMPILER}) + set(ASM_ASSEMBLER_OBJFORMAT ${CMAKE_ASM_NASM_OBJECT_FORMAT}) + set_source_files_properties(${SRB2_NASM_SOURCES} LANGUAGE ASM_NASM) endif() +endif() - if(${CMAKE_SYSTEM} MATCHES Darwin) - find_library(CORE_LIB CoreFoundation) - target_link_libraries(SRB2SDL2 PRIVATE - ${CORE_LIB} - SDL2 - SDL2_mixer - ${GME_LIBRARIES} - ${OPENMPT_LIBRARIES} - ${MIXERX_LIBRARIES} - ${PNG_LIBRARIES} - ${ZLIB_LIBRARIES} - ${OPENGL_LIBRARIES} - ${CURL_LIBRARIES} - ) - set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") - else() - target_link_libraries(SRB2SDL2 PRIVATE - ${SDL2_LIBRARIES} - ${SDL2_MIXER_LIBRARIES} - ${GME_LIBRARIES} - ${OPENMPT_LIBRARIES} - ${MIXERX_LIBRARIES} - ${PNG_LIBRARIES} - ${ZLIB_LIBRARIES} - ${OPENGL_LIBRARIES} - ${CURL_LIBRARIES} - ) +if("${CMAKE_SYSTEM_NAME}" MATCHES Windows) + target_link_libraries(SRB2SDL2 PRIVATE + ws2_32 + ) + target_compile_options(SRB2SDL2 PRIVATE + -U_WINDOWS + ) +endif() - if(${CMAKE_SYSTEM} MATCHES Linux) - target_link_libraries(SRB2SDL2 PRIVATE - m - rt +target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXER -DSOUND=SOUND_MIXER) +target_compile_definitions(SRB2SDL2 PRIVATE -DDIRECTFULLSCREEN -DHAVE_SDL) + +#### Installation #### +if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin) + install(TARGETS SRB2SDL2 + BUNDLE DESTINATION . + ) + set_property(TARGET SRB2SDL2 PROPERTY INSTALL_RPATH_USE_LINK_PATH ON) +else() + install(TARGETS SRB2SDL2 SRB2SDL2 + RUNTIME DESTINATION . + ) + if ((${CMAKE_BUILD_TYPE} MATCHES Debug) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)) + set(SRB2_DEBUG_INSTALL OFF CACHE BOOL "Insert *.debug file into the install directory or package.") + if (${SRB2_DEBUG_INSTALL}) + install(FILES $.debug + DESTINATION . + OPTIONAL ) endif() endif() - - #target_link_libraries(SRB2SDL2 PRIVATE SRB2Core) - - if(${SRB2_USEASM}) - if(${SRB2_CONFIG_YASM}) - set(ASM_ASSEMBLER_TEMP ${CMAKE_ASM_YASM_COMPILER}) - set(ASM_ASSEMBLER_OBJFORMAT ${CMAKE_ASM_YASM_OBJECT_FORMAT}) - set_source_files_properties(${SRB2_NASM_SOURCES} LANGUAGE ASM_YASM) - else() - set(ASM_ASSEMBLER_TEMP ${CMAKE_ASM_NASM_COMPILER}) - set(ASM_ASSEMBLER_OBJFORMAT ${CMAKE_ASM_NASM_OBJECT_FORMAT}) - set_source_files_properties(${SRB2_NASM_SOURCES} LANGUAGE ASM_NASM) - endif() - endif() - - set_target_properties(SRB2SDL2 PROPERTIES VERSION ${SRB2_VERSION}) - - if(${CMAKE_SYSTEM} MATCHES Windows) - target_link_libraries(SRB2SDL2 PRIVATE - ws2_32 - ) - target_compile_options(SRB2SDL2 PRIVATE - -U_WINDOWS - ) - endif() - - target_include_directories(SRB2SDL2 PRIVATE - ${SDL2_INCLUDE_DIRS} - ${SDL2_MIXER_INCLUDE_DIRS} - ${GME_INCLUDE_DIRS} - ${OPENMPT_INCLUDE_DIRS} - ${MIXERX_INCLUDE_DIRS} - ${PNG_INCLUDE_DIRS} - ${ZLIB_INCLUDE_DIRS} - ${OPENGL_INCLUDE_DIRS} - ${CURL_INCLUDE_DIRS} - ) - - if((${SRB2_HAVE_MIXER}) OR (${SRB2_HAVE_MIXERX})) - target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXER -DSOUND=SOUND_MIXER) - endif() - - target_compile_definitions(SRB2SDL2 PRIVATE - -DDIRECTFULLSCREEN -DHAVE_SDL - ) - - ## strip debug symbols into separate file when using gcc. - ## to be consistent with Makefile, don't generate for OS X. - if((CMAKE_COMPILER_IS_GNUCC) AND NOT (${CMAKE_SYSTEM} MATCHES Darwin)) - if((${CMAKE_BUILD_TYPE} MATCHES Debug) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)) - if(${CMAKE_BUILD_TYPE} MATCHES Debug) - set(OBJCOPY_ONLY_KEEP_DEBUG "--only-keep-debug") - endif() - message(STATUS "Will make separate debug symbols in *.debug") - add_custom_command(TARGET SRB2SDL2 POST_BUILD - COMMAND ${OBJCOPY} ${OBJCOPY_ONLY_KEEP_DEBUG} $ $.debug - COMMAND ${OBJCOPY} --strip-debug $ - COMMAND ${OBJCOPY} --add-gnu-debuglink=$.debug $ - ) - endif() - endif() - - #### Installation #### - if(${CMAKE_SYSTEM} MATCHES Darwin) - install(TARGETS SRB2SDL2 - BUNDLE DESTINATION . - ) - else() - install(TARGETS SRB2SDL2 SRB2SDL2 - RUNTIME DESTINATION . - ) - if ((${CMAKE_BUILD_TYPE} MATCHES Debug) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)) - set(SRB2_DEBUG_INSTALL OFF CACHE BOOL "Insert *.debug file into the install directory or package.") - if (${SRB2_DEBUG_INSTALL}) - install(FILES $.debug - DESTINATION . - OPTIONAL - ) - endif() - endif() - endif() - - if(${CMAKE_SYSTEM} MATCHES Windows) - set(win_extra_dll_list "") - macro(getwinlib dllname defaultname) - if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) - if (${CMAKE_GENERATOR} STREQUAL "MinGW Makefiles") - if(${SRB2_SYSTEM_BITS} EQUAL 64) - find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}" - HINTS ${CMAKE_SOURCE_DIR}/libs/dll-binaries/x86_64 - HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/bin - HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/x86_64-w64-mingw32/bin - HINTS ${CMAKE_SOURCE_DIR}/libs/libopenmpt/bin/x86_64/mingw - HINTS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/x86_64-w64-mingw32/bin - ) - else() - find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}" - HINTS ${CMAKE_SOURCE_DIR}/libs/dll-binaries/i686 - HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/bin - HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/i686-w64-mingw32/bin - HINTS ${CMAKE_SOURCE_DIR}/libs/libopenmpt/bin/x86/mingw - HINTS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/bin - ) - endif() - else() - if(${SRB2_SYSTEM_BITS} EQUAL 64) - find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}" - HINTS ${CMAKE_SOURCE_DIR}/libs/dll-binaries/x86_64 - HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/lib/x64 - HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/lib/x64 - HINTS ${CMAKE_SOURCE_DIR}/libs/libopenmpt/bin/x86_64/mingw - HINTS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/x86_64-w64-mingw32/bin - ) - else() - find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}" - HINTS ${CMAKE_SOURCE_DIR}/libs/dll-binaries/i686 - HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/lib/x86 - HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/lib/x86 - HINTS ${CMAKE_SOURCE_DIR}/libs/libopenmpt/bin/x86/mingw - HINTS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/bin - ) - endif() - endif() - - list(APPEND win_extra_dll_list ${SRB2_SDL2_DLL_${dllname}}) - else() - find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}") - list(APPEND win_extra_dll_list ${SRB2_SDL2_DLL_${dllname}}) - endif() - endmacro() - getwinlib(SDL2 "SDL2.dll") - if(${SRB2_CONFIG_SDL2_USEMIXER}) - getwinlib(SDL2_mixer "SDL2_mixer.dll") - getwinlib(libogg_0 "libogg-0.dll") - getwinlib(libvorbis_0 "libvorbis-0.dll") - getwinlib(libvorbisfile_3 "libvorbisfile-3.dll") - endif() - if(${SRB2_CONFIG_HAVE_GME}) - getwinlib(libgme "libgme.dll") - endif() - if(${SRB2_CONFIG_HAVE_OPENMPT}) - getwinlib(libopenmpt "libopenmpt.dll") - endif() - if(${SRB2_CONFIG_HAVE_MIXERX}) - getwinlib(SDL2_mixer_ext "SDL2_mixer_ext.dll") - getwinlib(libfluidsynth-2 "libfluidsynth-2.dll") - getwinlib(libgcc_s_sjlj-1 "libgcc_s_sjlj-1.dll") - getwinlib(libstdc++-6 "libstdc++-6.dll") - endif() - - install(PROGRAMS - ${win_extra_dll_list} - DESTINATION . - ) - - # We also want to copy those DLLs to build directories on MSVC. - # So we'll add a post_build step. - copy_files_to_build_dir(SRB2SDL2 win_extra_dll_list) - endif() - - - # Mac bundle fixup - # HACK: THIS IS IMPORTANT! See the escaped \${CMAKE_INSTALL_PREFIX}? This - # makes it so that var is evaluated LATER during cpack, not right now! - # This fixes the quirk where the bundled libraries don't land in the final package - # https://cmake.org/pipermail/cmake/2011-March/043532.html - # - # HOWEVER: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY} is NOT escaped, because that var - # is only available to us at this step. Read the link: ${CMAKE_INSTALL_PREFIX} at - # this current step points to the CMAKE build folder, NOT the folder that CPACK uses. - # Therefore, it makes sense to escape that var, but not the other. - if(${CMAKE_SYSTEM} MATCHES Darwin) - install(CODE " - include(BundleUtilities) - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${CPACK_PACKAGE_DESCRIPTION_SUMMARY}.app\" - \"\" - /Library/Frameworks - )" - ) - endif() - - set(SRB2_SDL2_AVAILABLE YES PARENT_SCOPE) -else() - message(WARNING "SDL2 was not found, so the SDL2 target will not be available.") - set(SRB2_SDL2_AVAILABLE NO PARENT_SCOPE) endif() + +# Mac bundle fixup +# HACK: THIS IS IMPORTANT! See the escaped \${CMAKE_INSTALL_PREFIX}? This +# makes it so that var is evaluated LATER during cpack, not right now! +# This fixes the quirk where the bundled libraries don't land in the final package +# https://cmake.org/pipermail/cmake/2011-March/043532.html +# +# HOWEVER: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY} is NOT escaped, because that var +# is only available to us at this step. Read the link: ${CMAKE_INSTALL_PREFIX} at +# this current step points to the CMAKE build folder, NOT the folder that CPACK uses. +# Therefore, it makes sense to escape that var, but not the other. +if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin) + install(CODE " + include(BundleUtilities) + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${CPACK_PACKAGE_DESCRIPTION_SUMMARY}.app\" + \"\" + /Library/Frameworks + )" + ) +endif() + +set(SRB2_SDL2_AVAILABLE YES PARENT_SCOPE) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 748cd374b..e56a5bc1b 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -74,7 +74,7 @@ #endif #ifdef HAVE_GME -#include "gme/gme.h" +#include #define GME_TREBLE 5.0f #define GME_BASS 1.0f #endif // HAVE_GME diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt new file mode 100644 index 000000000..208044113 --- /dev/null +++ b/thirdparty/CMakeLists.txt @@ -0,0 +1,499 @@ +macro(export) +endmacro() + +if(SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES) + set(SRB2_INTERNAL_LIBRARY_TYPE SHARED) + set(NOT_SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES OFF) +else() + set(SRB2_INTERNAL_LIBRARY_TYPE STATIC) + set(NOT_SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES ON) +endif() + + +if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + CPMAddPackage( + NAME SDL2 + VERSION 2.24.2 + URL "https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.24.2.zip" + EXCLUDE_FROM_ALL ON + OPTIONS + "BUILD_SHARED_LIBS ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}" + "SDL_SHARED ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}" + "SDL_STATIC ${NOT_SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}" + "SDL_TEST OFF" + "SDL2_DISABLE_SDL2MAIN ON" + "SDL2_DISABLE_INSTALL ON" + ) +endif() + +if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + CPMAddPackage( + NAME SDL2_mixer + VERSION 2.6.2 + URL "https://github.com/libsdl-org/SDL_mixer/archive/refs/tags/release-2.6.2.zip" + EXCLUDE_FROM_ALL ON + OPTIONS + "BUILD_SHARED_LIBS ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}" + "SDL2MIXER_INSTALL OFF" + "SDL2MIXER_DEPS_SHARED OFF" + "SDL2MIXER_SAMPLES OFF" + "SDL2MIXER_VENDORED ON" + "SDL2MIXER_FLAC ON" + "SDL2MIXER_FLAC_LIBFLAC OFF" + "SDL2MIXER_FLAC_DRFLAC ON" + "SDL2MIXER_MOD OFF" + "SDL2MIXER_MP3 ON" + "SDL2MIXER_MP3_DRMP3 ON" + "SDL2MIXER_MIDI ON" + "SDL2MIXER_OPUS OFF" + "SDL2MIXER_VORBIS STB" + "SDL2MIXER_WAVE ON" + ) +endif() + +if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + CPMAddPackage( + NAME ZLIB + VERSION 1.2.13 + URL "https://github.com/madler/zlib/archive/refs/tags/v1.2.13.zip" + EXCLUDE_FROM_ALL + OPTIONS + # The assembly optimizations are unmaintained and slated to be removed + "ASM686 Off" + "AMD64 Off" + "SKIP_INSTALL_ALL ON" + ) + file(MAKE_DIRECTORY "${zlib_BINARY_DIR}/include") + file(COPY "${zlib_SOURCE_DIR}/zlib.h" DESTINATION "${zlib_BINARY_DIR}/include") + file(COPY "${zlib_BINARY_DIR}/zconf.h" DESTINATION "${zlib_BINARY_DIR}/include") + # honestly this should probably be built like png is + set_target_properties(zlib PROPERTIES EXCLUDE_FROM_ALL ON) + set_target_properties(minigzip PROPERTIES EXCLUDE_FROM_ALL ON) + set_target_properties(example PROPERTIES EXCLUDE_FROM_ALL ON) + # zlib cmake also adds these 64 targets separately + if(HAVE_OFF64_T) + set_target_properties(minigzip64 PROPERTIES EXCLUDE_FROM_ALL ON) + set_target_properties(example64 PROPERTIES EXCLUDE_FROM_ALL ON) + endif() + target_include_directories(zlib INTERFACE "${zlib_BINARY_DIR}/include") + target_include_directories(zlibstatic INTERFACE "${zlib_BINARY_DIR}/include") + if(SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES) + add_library(ZLIB::ZLIB ALIAS zlib) + else() + add_library(ZLIB::ZLIB ALIAS zlibstatic) + endif() +endif() + +if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + CPMAddPackage( + NAME png + VERSION 1.6.38 + URL "https://github.com/glennrp/libpng/archive/refs/tags/v1.6.38.zip" + # png cmake build is broken on msys/mingw32 + DOWNLOAD_ONLY YES + ) + + if(png_ADDED) + # Since png's cmake build is broken, we're going to create a target manually + set( + PNG_SOURCES + + png.h + pngconf.h + + pngpriv.h + pngdebug.h + pnginfo.h + pngstruct.h + + png.c + pngerror.c + pngget.c + pngmem.c + pngpread.c + pngread.c + pngrio.c + pngrtran.c + pngrutil.c + pngset.c + pngtrans.c + pngwio.c + pngwrite.c + pngwtran.c + pngwutil.c + ) + list(TRANSFORM PNG_SOURCES PREPEND "${png_SOURCE_DIR}/") + + add_custom_command( + OUTPUT "${png_BINARY_DIR}/include/png.h" "${png_BINARY_DIR}/include/pngconf.h" + COMMAND ${CMAKE_COMMAND} -E copy "${png_SOURCE_DIR}/png.h" "${png_SOURCE_DIR}/pngconf.h" "${png_BINARY_DIR}/include" + DEPENDS "${png_SOURCE_DIR}/png.h" "${png_SOURCE_DIR}/pngconf.h" + VERBATIM + ) + add_custom_command( + OUTPUT "${png_BINARY_DIR}/include/pnglibconf.h" + COMMAND ${CMAKE_COMMAND} -E copy "${png_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt" "${png_BINARY_DIR}/include/pnglibconf.h" + DEPENDS "${png_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt" + VERBATIM + ) + list( + APPEND PNG_SOURCES + "${png_BINARY_DIR}/include/png.h" + "${png_BINARY_DIR}/include/pngconf.h" + "${png_BINARY_DIR}/include/pnglibconf.h" + ) + add_library(png "${SRB2_INTERNAL_LIBRARY_TYPE}" ${PNG_SOURCES}) + + # Disable ARM NEON since having it automatic breaks libpng external build on clang for some reason + target_compile_definitions(png PRIVATE -DPNG_ARM_NEON_OPT=0) + + # The png includes need to be available to consumers + target_include_directories(png PUBLIC "${png_BINARY_DIR}/include") + + # ... and these also need to be present only for png build + target_include_directories(png PRIVATE "${zlib_SOURCE_DIR}") + target_include_directories(png PRIVATE "${zlib_BINARY_DIR}") + target_include_directories(png PRIVATE "${png_BINARY_DIR}") + + target_link_libraries(png PRIVATE ZLIB::ZLIB) + add_library(PNG::PNG ALIAS png) + endif() +endif() + +if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + set( + internal_curl_options + + "BUILD_CURL_EXE OFF" + "BUILD_SHARED_LIBS ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}" + "CURL_DISABLE_TESTS ON" + "HTTP_ONLY ON" + "CURL_DISABLE_CRYPTO_AUTH ON" + "CURL_DISABLE_NTLM ON" + "ENABLE_MANUAL OFF" + "ENABLE_THREADED_RESOLVER OFF" + "CURL_USE_LIBPSL OFF" + "CURL_USE_LIBSSH2 OFF" + "USE_LIBIDN2 OFF" + "CURL_ENABLE_EXPORT_TARGET OFF" + ) + if(${CMAKE_SYSTEM} MATCHES Windows) + list(APPEND internal_curl_options "CURL_USE_OPENSSL OFF") + list(APPEND internal_curl_options "CURL_USE_SCHANNEL ON") + endif() + if(${CMAKE_SYSTEM} MATCHES Darwin) + list(APPEND internal_curl_options "CURL_USE_OPENSSL OFF") + list(APPEND internal_curl_options "CURL_USE_SECTRANSP ON") + endif() + if(${CMAKE_SYSTEM} MATCHES Linux) + list(APPEND internal_curl_options "CURL_USE_OPENSSL ON") + endif() + + CPMAddPackage( + NAME curl + VERSION 7.86.0 + URL "https://github.com/curl/curl/archive/refs/tags/curl-7_86_0.zip" + EXCLUDE_FROM_ALL ON + OPTIONS ${internal_curl_options} + ) +endif() + +if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + CPMAddPackage( + NAME openmpt + VERSION 0.4.30 + URL "https://github.com/OpenMPT/openmpt/archive/refs/tags/libopenmpt-0.4.30.zip" + DOWNLOAD_ONLY ON + ) + + if(openmpt_ADDED) + set( + openmpt_SOURCES + + # minimp3 + # -DMPT_WITH_MINIMP3 + include/minimp3/minimp3.c + + common/mptStringParse.cpp + common/mptLibrary.cpp + common/Logging.cpp + common/Profiler.cpp + common/version.cpp + common/mptCPU.cpp + common/ComponentManager.cpp + common/mptOS.cpp + common/serialization_utils.cpp + common/mptStringFormat.cpp + common/FileReader.cpp + common/mptWine.cpp + common/mptPathString.cpp + common/mptAlloc.cpp + common/mptUUID.cpp + common/mptTime.cpp + common/mptString.cpp + common/mptFileIO.cpp + common/mptStringBuffer.cpp + common/mptRandom.cpp + common/mptIO.cpp + common/misc_util.cpp + + common/mptCRC.h + common/mptLibrary.h + common/mptIO.h + common/version.h + common/stdafx.h + common/ComponentManager.h + common/Endianness.h + common/mptStringFormat.h + common/mptMutex.h + common/mptUUID.h + common/mptExceptionText.h + common/BuildSettings.h + common/mptAlloc.h + common/mptTime.h + common/FileReaderFwd.h + common/Logging.h + common/mptException.h + common/mptWine.h + common/mptStringBuffer.h + common/misc_util.h + common/mptBaseMacros.h + common/mptMemory.h + common/mptFileIO.h + common/serialization_utils.h + common/mptSpan.h + common/mptThread.h + common/FlagSet.h + common/mptString.h + common/mptStringParse.h + common/mptBaseUtils.h + common/mptRandom.h + common/CompilerDetect.h + common/FileReader.h + common/mptAssert.h + common/mptPathString.h + common/Profiler.h + common/mptOS.h + common/mptBaseTypes.h + common/mptCPU.h + common/mptBufferIO.h + common/versionNumber.h + + soundlib/WAVTools.cpp + soundlib/ITTools.cpp + soundlib/AudioCriticalSection.cpp + soundlib/Load_stm.cpp + soundlib/MixerLoops.cpp + soundlib/Load_dbm.cpp + soundlib/ModChannel.cpp + soundlib/Load_gdm.cpp + soundlib/Snd_fx.cpp + soundlib/Load_mid.cpp + soundlib/mod_specifications.cpp + soundlib/Snd_flt.cpp + soundlib/Load_psm.cpp + soundlib/Load_far.cpp + soundlib/patternContainer.cpp + soundlib/Load_med.cpp + soundlib/Load_dmf.cpp + soundlib/Paula.cpp + soundlib/modcommand.cpp + soundlib/Message.cpp + soundlib/SoundFilePlayConfig.cpp + soundlib/Load_uax.cpp + soundlib/plugins/PlugInterface.cpp + soundlib/plugins/LFOPlugin.cpp + soundlib/plugins/PluginManager.cpp + soundlib/plugins/DigiBoosterEcho.cpp + soundlib/plugins/dmo/DMOPlugin.cpp + soundlib/plugins/dmo/Flanger.cpp + soundlib/plugins/dmo/Distortion.cpp + soundlib/plugins/dmo/ParamEq.cpp + soundlib/plugins/dmo/Gargle.cpp + soundlib/plugins/dmo/I3DL2Reverb.cpp + soundlib/plugins/dmo/Compressor.cpp + soundlib/plugins/dmo/WavesReverb.cpp + soundlib/plugins/dmo/Echo.cpp + soundlib/plugins/dmo/Chorus.cpp + soundlib/Load_ams.cpp + soundlib/tuningbase.cpp + soundlib/ContainerUMX.cpp + soundlib/Load_ptm.cpp + soundlib/ContainerXPK.cpp + soundlib/SampleFormatMP3.cpp + soundlib/tuning.cpp + soundlib/Sndfile.cpp + soundlib/ContainerMMCMP.cpp + soundlib/Load_amf.cpp + soundlib/Load_669.cpp + soundlib/modsmp_ctrl.cpp + soundlib/Load_mtm.cpp + soundlib/OggStream.cpp + soundlib/Load_plm.cpp + soundlib/Tables.cpp + soundlib/Load_c67.cpp + soundlib/Load_mod.cpp + soundlib/Load_sfx.cpp + soundlib/Sndmix.cpp + soundlib/load_j2b.cpp + soundlib/ModSequence.cpp + soundlib/SampleFormatFLAC.cpp + soundlib/ModInstrument.cpp + soundlib/Load_mo3.cpp + soundlib/ModSample.cpp + soundlib/Dlsbank.cpp + soundlib/Load_itp.cpp + soundlib/UpgradeModule.cpp + soundlib/MIDIMacros.cpp + soundlib/ContainerPP20.cpp + soundlib/RowVisitor.cpp + soundlib/Load_imf.cpp + soundlib/SampleFormatVorbis.cpp + soundlib/Load_dsm.cpp + soundlib/Load_mt2.cpp + soundlib/MixerSettings.cpp + soundlib/S3MTools.cpp + soundlib/Load_xm.cpp + soundlib/MIDIEvents.cpp + soundlib/pattern.cpp + soundlib/Load_digi.cpp + soundlib/Load_s3m.cpp + soundlib/tuningCollection.cpp + soundlib/SampleIO.cpp + soundlib/Dither.cpp + soundlib/Load_mdl.cpp + soundlib/OPL.cpp + soundlib/WindowedFIR.cpp + soundlib/SampleFormats.cpp + soundlib/Load_wav.cpp + soundlib/Load_it.cpp + soundlib/UMXTools.cpp + soundlib/Load_stp.cpp + soundlib/Load_okt.cpp + soundlib/Load_ult.cpp + soundlib/MixFuncTable.cpp + soundlib/SampleFormatOpus.cpp + soundlib/Fastmix.cpp + soundlib/Tagging.cpp + soundlib/ITCompression.cpp + soundlib/Load_dtm.cpp + soundlib/MPEGFrame.cpp + soundlib/XMTools.cpp + soundlib/SampleFormatMediaFoundation.cpp + soundlib/InstrumentExtensions.cpp + + soundlib/MixerInterface.h + soundlib/SoundFilePlayConfig.h + soundlib/ModSample.h + soundlib/MIDIEvents.h + soundlib/ModSampleCopy.h + soundlib/patternContainer.h + soundlib/ChunkReader.h + soundlib/ITCompression.h + soundlib/Dither.h + soundlib/S3MTools.h + soundlib/MPEGFrame.h + soundlib/WAVTools.h + soundlib/mod_specifications.h + soundlib/ITTools.h + soundlib/RowVisitor.h + soundlib/plugins/PluginMixBuffer.h + soundlib/plugins/PluginStructs.h + soundlib/plugins/LFOPlugin.h + soundlib/plugins/PlugInterface.h + soundlib/plugins/DigiBoosterEcho.h + soundlib/plugins/OpCodes.h + soundlib/plugins/dmo/Echo.h + soundlib/plugins/dmo/I3DL2Reverb.h + soundlib/plugins/dmo/WavesReverb.h + soundlib/plugins/dmo/ParamEq.h + soundlib/plugins/dmo/Gargle.h + soundlib/plugins/dmo/DMOPlugin.h + soundlib/plugins/dmo/Chorus.h + soundlib/plugins/dmo/Compressor.h + soundlib/plugins/dmo/Distortion.h + soundlib/plugins/dmo/Flanger.h + soundlib/plugins/PluginManager.h + soundlib/SampleIO.h + soundlib/Container.h + soundlib/ModSequence.h + soundlib/UMXTools.h + soundlib/Message.h + soundlib/modcommand.h + soundlib/XMTools.h + soundlib/Snd_defs.h + soundlib/MixFuncTable.h + soundlib/pattern.h + soundlib/modsmp_ctrl.h + soundlib/Tagging.h + soundlib/tuningcollection.h + soundlib/Mixer.h + soundlib/FloatMixer.h + soundlib/AudioCriticalSection.h + soundlib/Tables.h + soundlib/tuningbase.h + soundlib/WindowedFIR.h + soundlib/Sndfile.h + soundlib/Paula.h + soundlib/ModInstrument.h + soundlib/Dlsbank.h + soundlib/IntMixer.h + soundlib/OPL.h + soundlib/Resampler.h + soundlib/ModChannel.h + soundlib/MixerSettings.h + soundlib/AudioReadTarget.h + soundlib/MixerLoops.h + soundlib/tuning.h + soundlib/MIDIMacros.h + soundlib/OggStream.h + soundlib/Loaders.h + soundlib/BitReader.h + soundlib/opal.h + + sounddsp/AGC.cpp + sounddsp/EQ.cpp + sounddsp/DSP.cpp + sounddsp/Reverb.cpp + sounddsp/Reverb.h + sounddsp/EQ.h + sounddsp/DSP.h + sounddsp/AGC.h + + libopenmpt/libopenmpt_c.cpp + libopenmpt/libopenmpt_cxx.cpp + libopenmpt/libopenmpt_impl.cpp + libopenmpt/libopenmpt_ext_impl.cpp + ) + list(TRANSFORM openmpt_SOURCES PREPEND "${openmpt_SOURCE_DIR}/") + + # -DLIBOPENMPT_BUILD + configure_file("openmpt_svn_version.h" "svn_version.h") + add_library(openmpt "${SRB2_INTERNAL_LIBRARY_TYPE}" ${openmpt_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/svn_version.h) + target_compile_features(openmpt PRIVATE cxx_std_11) + target_compile_definitions(openmpt PRIVATE -DLIBOPENMPT_BUILD) + + target_include_directories(openmpt PRIVATE "${openmpt_SOURCE_DIR}/common") + target_include_directories(openmpt PRIVATE "${openmpt_SOURCE_DIR}/src") + target_include_directories(openmpt PRIVATE "${openmpt_SOURCE_DIR}/include") + target_include_directories(openmpt PRIVATE "${openmpt_SOURCE_DIR}") + target_include_directories(openmpt PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") + + # I wish this wasn't necessary, but it is + target_include_directories(openmpt PUBLIC "${openmpt_SOURCE_DIR}") + endif() +endif() + +if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + CPMAddPackage( + NAME libgme + VERSION 0.6.3 + URL "https://bitbucket.org/mpyne/game-music-emu/get/e76bdc0cb916e79aa540290e6edd0c445879d3ba.zip" + EXCLUDE_FROM_ALL ON + OPTIONS + "BUILD_SHARED_LIBS ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}" + "ENABLE_UBSAN OFF" + ) + target_compile_features(gme PRIVATE cxx_std_11) + target_link_libraries(gme PRIVATE ZLIB::ZLIB) +endif() diff --git a/thirdparty/openmpt_svn_version.h b/thirdparty/openmpt_svn_version.h new file mode 100644 index 000000000..a45ed9f22 --- /dev/null +++ b/thirdparty/openmpt_svn_version.h @@ -0,0 +1,10 @@ + +#pragma once +#define OPENMPT_VERSION_SVNVERSION "17963" +#define OPENMPT_VERSION_REVISION 17963 +#define OPENMPT_VERSION_DIRTY 0 +#define OPENMPT_VERSION_MIXEDREVISIONS 0 +#define OPENMPT_VERSION_URL "https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.4.32" +#define OPENMPT_VERSION_DATE "2022-09-25T14:19:05.052596Z" +#define OPENMPT_VERSION_IS_PACKAGE 1 + From b637df4ce0e64c6f26a73754400131bc24c5ebae Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 5 Nov 2022 21:20:53 +0000 Subject: [PATCH 018/108] removed a name from credits by request --- src/f_finale.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/f_finale.c b/src/f_finale.c index b5715b863..ec325206b 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1182,7 +1182,6 @@ static const char *credits[] = { "Ben \"Mystic\" Geyer", "Nathan \"Jazz\" Giroux", "Vivian \"toaster\" Grannell", - "Dan \"Blitzzo\" Hagerstrand", "James \"SeventhSentinel\" Hall", "Kepa \"Nev3r\" Iceta", "Thomas \"Shadow Hog\" Igoe", From 1b43cdddd59ebeb6ea76721ba953370476478f0f Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 27 Feb 2022 10:11:55 -0500 Subject: [PATCH 019/108] Allow saving in modified games. --- src/d_main.c | 6 ++++ src/d_netcmd.c | 6 ++-- src/f_finale.c | 17 +++------ src/g_game.c | 97 +++++++++++++++++++++++++++++++++----------------- src/hu_stuff.c | 2 +- src/m_cond.c | 3 -- src/m_menu.c | 30 ++++++---------- src/p_inter.c | 2 +- src/p_mobj.c | 6 +--- src/p_setup.c | 6 ++-- src/p_spec.c | 2 +- src/y_inter.c | 4 +-- 12 files changed, 97 insertions(+), 84 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 3566e7f3d..b1f09aaa8 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1473,6 +1473,12 @@ void D_SRB2Main(void) //--------------------------------------------------------- CONFIG.CFG M_FirstLoadConfig(); // WARNING : this do a "COM_BufExecute()" + if (M_CheckParm("-gamedata") && M_IsNextParm()) + { + // Moved from G_LoadGameData itself, as it would cause some crazy + // confusion issues when loading mods. + strlcpy(gamedatafilename, M_GetNextParm(), sizeof gamedatafilename); + } G_LoadGameData(); #if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 4e90db0dc..73bfe9e17 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4613,11 +4613,11 @@ static void Fishcake_OnChange(void) static void Command_Isgamemodified_f(void) { if (savemoddata) - CONS_Printf(M_GetText("modifiedgame is true, but you can save emblem and time data in this mod.\n")); + CONS_Printf(M_GetText("modifiedgame is true, but you can save time data in this mod.\n")); else if (modifiedgame) - CONS_Printf(M_GetText("modifiedgame is true, extras will not be unlocked\n")); + CONS_Printf(M_GetText("modifiedgame is true, time data can't be saved\n")); else - CONS_Printf(M_GetText("modifiedgame is false, you can unlock extras\n")); + CONS_Printf(M_GetText("modifiedgame is false, you can save time data\n")); } static void Command_Cheats_f(void) diff --git a/src/f_finale.c b/src/f_finale.c index bca8e3ba6..73f6281a1 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1575,7 +1575,9 @@ void F_GameEvaluationDrawer(void) { V_DrawString(8, 16, V_YELLOWMAP, "Unlocked:"); - if (!(netgame) && (!modifiedgame || savemoddata)) + if (netgame) + V_DrawString(8, 96, V_YELLOWMAP, "Multiplayer games\ncan't unlock\nextras!"); + else { INT32 startcoord = 32; @@ -1590,10 +1592,6 @@ void F_GameEvaluationDrawer(void) } } } - else if (netgame) - V_DrawString(8, 96, V_YELLOWMAP, "Multiplayer games\ncan't unlock\nextras!"); - else - V_DrawString(8, 96, V_YELLOWMAP, "Modified games\ncan't unlock\nextras!"); } #endif @@ -1657,7 +1655,7 @@ void F_GameEvaluationTicker(void) HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Multiplayer games can't unlock extras!"); S_StartSound(NULL, sfx_s3k68); } - else if (!modifiedgame || savemoddata) + else { ++timesBeaten; @@ -1672,13 +1670,6 @@ void F_GameEvaluationTicker(void) G_SaveGameData(); } - else - { - HU_SetCEchoFlags(V_YELLOWMAP|V_RETURN8); - HU_SetCEchoDuration(6); - HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Modified games can't unlock extras!"); - S_StartSound(NULL, sfx_s3k68); - } } } diff --git a/src/g_game.c b/src/g_game.c index 349d90558..edddcc050 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -755,7 +755,7 @@ void G_SetGameModified(boolean silent) savemoddata = false; if (!silent) - CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to record statistics.\n")); + CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to play Record Attack.\n")); // If in record attack recording, cancel it. if (modeattacking) @@ -3826,8 +3826,7 @@ static void G_UpdateVisited(void) { boolean spec = G_IsSpecialStage(gamemap); // Update visitation flags? - if ((!modifiedgame || savemoddata) // Not modified - && !multiplayer && !demoplayback && (gametype == GT_COOP) // SP/RA/NiGHTS mode + if (!multiplayer && !demoplayback && (gametype == GT_COOP) // SP/RA/NiGHTS mode && !stagefailed) // Did not fail the stage { UINT8 earnedEmblems; @@ -3895,14 +3894,18 @@ static void G_HandleSaveLevel(void) remove(liveeventbackup); cursaveslot = 0; } - else if ((!modifiedgame || savemoddata) && !(netgame || multiplayer || ultimatemode || demorecording || metalrecording || modeattacking)) + else if (!(netgame || multiplayer || ultimatemode || demorecording || metalrecording || modeattacking)) + { G_SaveGame((UINT32)cursaveslot, spstage_start); + } } } // and doing THIS here means you don't lose your progress if you close the game mid-intermission else if (!(ultimatemode || netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) - && (!modifiedgame || savemoddata) && cursaveslot > 0 && CanSaveLevel(lastmap+1)) + && cursaveslot > 0 && CanSaveLevel(lastmap+1)) + { G_SaveGame((UINT32)cursaveslot, lastmap+1); // not nextmap+1 to route around special stages + } } // @@ -4178,8 +4181,10 @@ static void G_DoContinued(void) tokenlist = 0; token = 0; - if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && (!modifiedgame || savemoddata) && cursaveslot > 0) + if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && cursaveslot > 0) + { G_SaveGameOver((UINT32)cursaveslot, true); + } // Reset # of lives pl->lives = (ultimatemode) ? 1 : startinglivesbalance[numgameovers]; @@ -4244,13 +4249,17 @@ void G_LoadGameSettings(void) S_InitRuntimeSounds(); } +#define GAMEDATA_ID 0x86E4A27C // Change every major version, as usual +#define COMPAT_GAMEDATA_ID 0xFCAFE211 // Can be removed entirely for 2.3 + // G_LoadGameData // Loads the main data file, which stores information such as emblems found, etc. void G_LoadGameData(void) { size_t length; INT32 i, j; - UINT8 modded = false; + + UINT32 versionID; UINT8 rtemp; //For records @@ -4261,6 +4270,9 @@ void G_LoadGameData(void) UINT8 recmares; INT32 curmare; + // Stop saving, until we successfully load it again. + gamedataloaded = false; + // Clear things so previously read gamedata doesn't transfer // to new gamedata G_ClearRecords(); // main and nights records @@ -4268,27 +4280,35 @@ void G_LoadGameData(void) totalplaytime = 0; // total play time (separate from all) if (M_CheckParm("-nodata")) - return; // Don't load. - - // Allow saving of gamedata beyond this point - gamedataloaded = true; - - if (M_CheckParm("-gamedata") && M_IsNextParm()) { - strlcpy(gamedatafilename, M_GetNextParm(), sizeof gamedatafilename); + // Don't load at all. + return; } if (M_CheckParm("-resetdata")) - return; // Don't load (essentially, reset). + { + // Don't load, but do save. (essentially, reset) + gamedataloaded = true; + return; + } length = FIL_ReadFile(va(pandf, srb2home, gamedatafilename), &savebuffer); - if (!length) // Aw, no game data. Their loss! + if (!length) + { + // No gamedata. We can save a new one. + gamedataloaded = true; return; + } save_p = savebuffer; // Version check - if (READUINT32(save_p) != 0xFCAFE211) + versionID = READUINT32(save_p); + if (versionID != GAMEDATA_ID +#ifdef COMPAT_GAMEDATA_ID // backwards compat behavior + && versionID != COMPAT_GAMEDATA_ID +#endif + ) { const char *gdfolder = "the SRB2 folder"; if (strcmp(srb2home,".")) @@ -4301,13 +4321,26 @@ void G_LoadGameData(void) totalplaytime = READUINT32(save_p); - modded = READUINT8(save_p); +#ifdef COMPAT_GAMEDATA_ID + // Ignore for backwards compat, it'll get fixed when saving. + if (versionID == COMPAT_GAMEDATA_ID) + { + // Old files use a UINT8 here. + READUINT8(save_p); + } + else +#endif + { + // Quick & dirty hash for what mod this save file is for. + UINT32 modID = READUINT32(save_p); + UINT32 expectedID = quickncasehash(timeattackfolder, sizeof timeattackfolder); - // Aha! Someone's been screwing with the save file! - if ((modded && !savemoddata)) - goto datacorrupt; - else if (modded != true && modded != false) - goto datacorrupt; + if (modID != expectedID) + { + // Aha! Someone's been screwing with the save file! + goto datacorrupt; + } + } // TODO put another cipher on these things? meh, I don't care... for (i = 0; i < NUMMAPS; i++) @@ -4393,6 +4426,12 @@ void G_LoadGameData(void) Z_Free(savebuffer); save_p = NULL; + // Don't consider loaded until it's a success! + // It used to do this much earlier, but this would cause the gamedata to + // save over itself when it I_Errors from the corruption landing point below, + // which can accidentally delete players' legitimate data if the code ever has any tiny mistakes! + gamedataloaded = true; + // Silent update unlockables in case they're out of sync with conditions M_SilentUpdateUnlockablesAndEmblems(); @@ -4432,20 +4471,12 @@ void G_SaveGameData(void) return; } - if (modifiedgame && !savemoddata) - { - free(savebuffer); - save_p = savebuffer = NULL; - return; - } - // Version test - WRITEUINT32(save_p, 0xFCAFE211); + WRITEUINT32(save_p, GAMEDATA_ID); WRITEUINT32(save_p, totalplaytime); - btemp = (UINT8)(savemoddata || modifiedgame); - WRITEUINT8(save_p, btemp); + WRITEUINT32(save_p, quickncasehash(timeattackfolder, sizeof timeattackfolder)); // TODO put another cipher on these things? meh, I don't care... for (i = 0; i < NUMMAPS; i++) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index c037abcd7..ebef02319 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2994,7 +2994,7 @@ static void HU_DrawCoopOverlay(void) V_DrawSmallScaledPatch(148, 172, 0, tokenicon); } - if (LUA_HudEnabled(hud_tabemblems) && (!modifiedgame || savemoddata)) + if (LUA_HudEnabled(hud_tabemblems)) { V_DrawString(160, 144, 0, va("- %d/%d", M_CountEmblems(), numemblems+numextraemblems)); V_DrawScaledPatch(128, 144 - emblemicon->height/4, 0, emblemicon); diff --git a/src/m_cond.c b/src/m_cond.c index 1406317c5..58ee71fec 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -200,9 +200,6 @@ UINT8 M_UpdateUnlockablesAndExtraEmblems(void) char cechoText[992] = ""; UINT8 cechoLines = 0; - if (modifiedgame && !savemoddata) - return false; - M_CheckUnlockConditions(); // Go through extra emblems diff --git a/src/m_menu.c b/src/m_menu.c index 83b788fd5..55733e552 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -757,12 +757,12 @@ static menuitem_t SR_EmblemHintMenu[] = static menuitem_t SP_MainMenu[] = { // Note: If changing the positions here, also change them in M_SinglePlayerMenu() - {IT_CALL | IT_STRING, NULL, "Start Game", M_LoadGame, 76}, - {IT_SECRET, NULL, "Record Attack", M_TimeAttack, 84}, - {IT_SECRET, NULL, "NiGHTS Mode", M_NightsAttack, 92}, - {IT_SECRET, NULL, "Marathon Run", M_Marathon, 100}, - {IT_CALL | IT_STRING, NULL, "Tutorial", M_StartTutorial, 108}, - {IT_CALL | IT_STRING | IT_CALL_NOTMODIFIED, NULL, "Statistics", M_Statistics, 116} + {IT_CALL | IT_STRING, NULL, "Start Game", M_LoadGame, 76}, + {IT_SECRET, NULL, "Record Attack", M_TimeAttack, 84}, + {IT_SECRET, NULL, "NiGHTS Mode", M_NightsAttack, 92}, + {IT_SECRET, NULL, "Marathon Run", M_Marathon, 100}, + {IT_CALL | IT_STRING, NULL, "Tutorial", M_StartTutorial, 108}, + {IT_CALL | IT_STRING, NULL, "Statistics", M_Statistics, 116} }; enum @@ -3514,9 +3514,11 @@ boolean M_Responder(event_t *ev) { if (((currentMenu->menuitems[itemOn].status & IT_TYPE)==IT_CALL || (currentMenu->menuitems[itemOn].status & IT_TYPE)==IT_SUBMENU) - && (currentMenu->menuitems[itemOn].status & IT_CALLTYPE)) + && (currentMenu->menuitems[itemOn].status & IT_CALLTYPE)) { #ifndef DEVELOP + // TODO: Replays are scary, so I left the remaining instances of this alone. + // It'd be nice to get rid of this once and for all though! if (((currentMenu->menuitems[itemOn].status & IT_CALLTYPE) & IT_CALL_NOTMODIFIED) && modifiedgame && !savemoddata) { S_StartSound(NULL, sfx_skid); @@ -8701,12 +8703,6 @@ static void M_DrawLoad(void) loadgameoffset = 0; M_DrawLoadGameData(); - - if (modifiedgame && !savemoddata) - { - V_DrawCenteredThinString(BASEVIDWIDTH/2, 184, 0, "\x85WARNING: \x80The game is modified."); - V_DrawCenteredThinString(BASEVIDWIDTH/2, 192, 0, "Progress will not be saved."); - } } // @@ -9008,18 +9004,12 @@ static void M_HandleLoadSave(INT32 choice) break; case KEY_ENTER: - if (ultimate_selectable && saveSlotSelected == NOSAVESLOT && !savemoddata && !modifiedgame) + if (ultimate_selectable && saveSlotSelected == NOSAVESLOT) { loadgamescroll = 0; S_StartSound(NULL, sfx_skid); M_StartMessage("Are you sure you want to play\n\x85ultimate mode\x80? It isn't remotely fair,\nand you don't even get an emblem for it.\n\n(Press 'Y' to confirm)\n",M_SaveGameUltimateResponse,MM_YESNO); } - else if (saveSlotSelected != NOSAVESLOT && savegameinfo[saveSlotSelected-1].lives == -42 && !(!modifiedgame || savemoddata)) - { - loadgamescroll = 0; - S_StartSound(NULL, sfx_skid); - M_StartMessage(M_GetText("This cannot be done in a modified game.\n\n(Press a key)\n"), NULL, MM_NOTHING); - } else if (saveSlotSelected == NOSAVESLOT || savegameinfo[saveSlotSelected-1].lives != -666) // don't allow loading of "bad saves" { loadgamescroll = 0; diff --git a/src/p_inter.c b/src/p_inter.c index dd3e0f9c2..1094c3045 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2583,7 +2583,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && numgameovers < maxgameovers) { numgameovers++; - if ((!modifiedgame || savemoddata) && cursaveslot > 0) + if (cursaveslot > 0) G_SaveGameOver((UINT32)cursaveslot, (target->player->continues <= 0)); } } diff --git a/src/p_mobj.c b/src/p_mobj.c index 4533a2ce8..ac91e0f7f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11972,11 +11972,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i) break; case MT_EMBLEM: if (netgame || multiplayer) - return false; // Single player - - if (modifiedgame && !savemoddata) - return false; // No cheating!! - + return false; // Single player (You're next on my shit list) break; default: break; diff --git a/src/p_setup.c b/src/p_setup.c index deb308da2..c41a5d94e 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -7746,7 +7746,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) nextmapoverride = 0; skipstats = 0; - if (!(netgame || multiplayer || demoplayback) && (!modifiedgame || savemoddata)) + if (!(netgame || multiplayer || demoplayback)) mapvisited[gamemap-1] |= MV_VISITED; else if (netgame || multiplayer) mapvisited[gamemap-1] |= MV_MP; // you want to record that you've been there this session, but not permanently @@ -7764,8 +7764,10 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) { // I'd love to do this in the menu code instead of here, but everything's a mess and I can't guarantee saving proper player struct info before the first act's started. You could probably refactor it, but it'd be a lot of effort. Easier to just work off known good code. ~toast 22/06/2020 if (!(ultimatemode || netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking || marathonmode) - && (!modifiedgame || savemoddata) && cursaveslot > 0) + && cursaveslot > 0) + { G_SaveGame((UINT32)cursaveslot, gamemap); + } // If you're looking for saving sp file progression (distinct from G_SaveGameOver), check G_DoCompleted. } lastmaploaded = gamemap; // HAS to be set after saving!! diff --git a/src/p_spec.c b/src/p_spec.c index 82337d2f6..94659e0d7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2937,7 +2937,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) break; case 441: // Trigger unlockable - if ((!modifiedgame || savemoddata) && !(netgame || multiplayer)) + if (!(netgame || multiplayer)) { INT32 trigid = line->args[0]; diff --git a/src/y_inter.c b/src/y_inter.c index 7faceff50..e0f246eee 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1092,7 +1092,7 @@ void Y_Ticker(void) S_StartSound(NULL, (gottoken ? sfx_token : sfx_chchng)); // cha-ching! // Update when done with tally - if ((!modifiedgame || savemoddata) && !(netgame || multiplayer) && !demoplayback) + if (!(netgame || multiplayer) && !demoplayback) { if (M_UpdateUnlockablesAndExtraEmblems()) S_StartSound(NULL, sfx_s3k68); @@ -1223,7 +1223,7 @@ void Y_Ticker(void) S_StartSound(NULL, (gottoken ? sfx_token : sfx_chchng)); // cha-ching! // Update when done with tally - if ((!modifiedgame || savemoddata) && !(netgame || multiplayer) && !demoplayback) + if (!(netgame || multiplayer) && !demoplayback) { if (M_UpdateUnlockablesAndExtraEmblems()) S_StartSound(NULL, sfx_s3k68); From bcfe0da8fc10ed8b3417a11e2dcdb26aeda9bd1f Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 27 Feb 2022 10:22:44 -0500 Subject: [PATCH 020/108] Use old modded behavior when loading old files, instead of ignoring Let's not pretend script-kiddie edited old files are now perfectly A-OK :p --- src/g_game.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index edddcc050..892802d91 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4322,11 +4322,20 @@ void G_LoadGameData(void) totalplaytime = READUINT32(save_p); #ifdef COMPAT_GAMEDATA_ID - // Ignore for backwards compat, it'll get fixed when saving. if (versionID == COMPAT_GAMEDATA_ID) { - // Old files use a UINT8 here. - READUINT8(save_p); + // We'll temporarily use the old condition when loading an older file. + // The proper mod-specific hash will get saved in afterwards. + boolean modded = READUINT8(save_p); + + if (modded && !savemoddata) + { + goto datacorrupt; + } + else if (modded != true && modded != false) + { + goto datacorrupt; + } } else #endif From 4a520e63c67bfe8d9a8320553d1fd71908df3243 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 27 Feb 2022 10:33:58 -0500 Subject: [PATCH 021/108] Don't allow a gamedata named the same as the default time attack folder That'd be kinda scary! --- src/deh_soc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/deh_soc.c b/src/deh_soc.c index 583776ee7..db427b349 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2901,7 +2901,9 @@ static boolean GoodDataFileName(const char *s) p = s + strlen(s) - strlen(tail); if (p <= s) return false; // too short if (!fasticmp(p, tail)) return false; // doesn't end in .dat - if (fasticmp(s, "gamedata.dat")) return false; + + if (fasticmp(s, "gamedata.dat")) return false; // Don't overwrite default gamedata + if (fasticmp(s, "main.dat")) return false; // Don't overwrite default time attack replays return true; } From a22fa1c455cea774946f7032fd74e2e8155c9d9d Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 28 Feb 2022 12:43:00 -0500 Subject: [PATCH 022/108] Compromise on cheats setting modified game Instead of modifying the game, cheats now set a separate "cheats were used in this session" variable, which returns some of the old behavior. HOWEVER, cheats will STILL allow spawning / collecting emblems & unlocking unlockables. Cheats will purely prevent saving progress. (It was always frustrating that devmode would make debugging unlockable features harder...) Lastly, the function to set no-saving was exposed to Lua (`G_SetUsedCheats(silent)`). Just thought it'd be useful for large-scale gamedata-using mods that want to add their own cheat commands. --- src/d_clisrv.c | 3 +++ src/d_clisrv.h | 1 + src/d_main.c | 2 +- src/d_netcmd.c | 20 ++++++++++---------- src/doomstat.h | 1 + src/g_game.c | 31 ++++++++++++++++++++++++++++--- src/g_game.h | 1 + src/lua_baselib.c | 11 +++++++++++ src/lua_script.c | 3 +++ src/m_cheat.c | 20 ++++++++++---------- src/m_menu.c | 20 ++++++++++++++++---- src/p_inter.c | 2 +- src/p_setup.c | 2 +- 13 files changed, 87 insertions(+), 30 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 4cd6333c5..f95b952f3 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1448,6 +1448,7 @@ static boolean SV_SendServerConfig(INT32 node) netbuffer->u.servercfg.gamestate = (UINT8)gamestate; netbuffer->u.servercfg.gametype = (UINT8)gametype; netbuffer->u.servercfg.modifiedgame = (UINT8)modifiedgame; + netbuffer->u.servercfg.usedCheats = (UINT8)usedCheats; memcpy(netbuffer->u.servercfg.server_context, server_context, 8); @@ -4341,6 +4342,8 @@ static void HandlePacketFromAwayNode(SINT8 node) maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic); G_SetGametype(netbuffer->u.servercfg.gametype); modifiedgame = netbuffer->u.servercfg.modifiedgame; + if (netbuffer->u.servercfg.usedCheats) + G_SetUsedCheats(true); memcpy(server_context, netbuffer->u.servercfg.server_context, 8); } diff --git a/src/d_clisrv.h b/src/d_clisrv.h index e07864122..f3896c7ea 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -158,6 +158,7 @@ typedef struct UINT8 gametype; UINT8 modifiedgame; + UINT8 usedCheats; char server_context[8]; // Unique context id, generated at server startup. } ATTRPACK serverconfig_pak; diff --git a/src/d_main.c b/src/d_main.c index b1f09aaa8..9df1d8fab 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1506,7 +1506,7 @@ void D_SRB2Main(void) else { if (!M_CheckParm("-server")) - G_SetGameModified(true); + G_SetUsedCheats(true); autostart = true; } } diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 73bfe9e17..847f97341 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1877,7 +1877,7 @@ static void Command_Map_f(void) const char *gametypename; boolean newresetplayers; - boolean mustmodifygame; + boolean wouldSetCheats; INT32 newmapnum; @@ -1898,11 +1898,11 @@ static void Command_Map_f(void) option_gametype = COM_CheckPartialParm("-g"); newresetplayers = ! COM_CheckParm("-noresetplayers"); - mustmodifygame = - !( netgame || multiplayer ) && - (!modifiedgame || savemoddata ); + wouldSetCheats = + !( netgame || multiplayer ) && + !( usedCheats ); - if (mustmodifygame && !option_force) + if (wouldSetCheats && !option_force) { /* May want to be more descriptive? */ CONS_Printf(M_GetText("Sorry, level change disabled in single player.\n")); @@ -1956,9 +1956,9 @@ static void Command_Map_f(void) return; } - if (mustmodifygame && option_force) + if (wouldSetCheats && option_force) { - G_SetGameModified(false); + G_SetUsedCheats(false); } // new gametype value @@ -4259,7 +4259,7 @@ static void Ringslinger_OnChange(void) } if (cv_ringslinger.value) // Only if it's been turned on - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } static void Gravity_OnChange(void) @@ -4280,7 +4280,7 @@ static void Gravity_OnChange(void) #endif if (!CV_IsSetToDefault(&cv_gravity)) - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); gravity = cv_gravity.value; } @@ -4596,7 +4596,7 @@ static void Fishcake_OnChange(void) // so don't make modifiedgame always on! if (cv_debug) { - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } else if (cv_debug != cv_fishcake.value) diff --git a/src/doomstat.h b/src/doomstat.h index bce43416b..490054cf9 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -75,6 +75,7 @@ extern SINT8 startinglivesbalance[maxgameovers+1]; extern boolean modifiedgame; extern UINT16 mainwads; extern boolean savemoddata; // This mod saves time/emblem data. +extern boolean usedCheats; extern boolean disableSpeedAdjust; // Don't alter the duration of player states if true extern boolean imcontinuing; // Temporary flag while continuing extern boolean metalrecording; diff --git a/src/g_game.c b/src/g_game.c index 892802d91..e75bb433e 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -96,6 +96,7 @@ SINT8 startinglivesbalance[maxgameovers+1] = {3, 5, 7, 9, 12, 15, 20, 25, 30, 40 UINT16 mainwads = 0; boolean modifiedgame; // Set if homebrew PWAD stuff has been added. boolean savemoddata = false; +boolean usedCheats = false; // Set when a gamedata-preventing cheat command is used. UINT8 paused; UINT8 modeattacking = ATTACKING_NONE; boolean disableSpeedAdjust = false; @@ -764,6 +765,23 @@ void G_SetGameModified(boolean silent) Command_ExitGame_f(); } +void G_SetUsedCheats(boolean silent) +{ + if (usedCheats) + return; + + usedCheats = true; + + if (!silent) + CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to save progress.\n")); + + // If in record attack recording, cancel it. + if (modeattacking) + M_EndModeAttackRun(); + else if (marathonmode) + Command_ExitGame_f(); +} + /** Builds an original game map name from a map number. * The complexity is due to MAPA0-MAPZZ. * @@ -3894,7 +3912,7 @@ static void G_HandleSaveLevel(void) remove(liveeventbackup); cursaveslot = 0; } - else if (!(netgame || multiplayer || ultimatemode || demorecording || metalrecording || modeattacking)) + else if (!usedCheats && !(netgame || multiplayer || ultimatemode || demorecording || metalrecording || modeattacking)) { G_SaveGame((UINT32)cursaveslot, spstage_start); } @@ -3902,7 +3920,7 @@ static void G_HandleSaveLevel(void) } // and doing THIS here means you don't lose your progress if you close the game mid-intermission else if (!(ultimatemode || netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) - && cursaveslot > 0 && CanSaveLevel(lastmap+1)) + && !usedCheats && cursaveslot > 0 && CanSaveLevel(lastmap+1)) { G_SaveGame((UINT32)cursaveslot, lastmap+1); // not nextmap+1 to route around special stages } @@ -4181,7 +4199,7 @@ static void G_DoContinued(void) tokenlist = 0; token = 0; - if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && cursaveslot > 0) + if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && !usedCheats && cursaveslot > 0) { G_SaveGameOver((UINT32)cursaveslot, true); } @@ -4480,6 +4498,13 @@ void G_SaveGameData(void) return; } + if (usedCheats) + { + free(savebuffer); + save_p = savebuffer = NULL; + return; + } + // Version test WRITEUINT32(save_p, GAMEDATA_ID); diff --git a/src/g_game.h b/src/g_game.h index dca043f2e..a781e23f9 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -243,6 +243,7 @@ void G_LoadGameData(void); void G_LoadGameSettings(void); void G_SetGameModified(boolean silent); +void G_SetUsedCheats(boolean silent); void G_SetGamestate(gamestate_t newstate); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 29adb478a..031a155d2 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -3612,6 +3612,16 @@ static int lib_gRemovePlayer(lua_State *L) } +static int lib_gSetUsedCheats(lua_State *L) +{ + // Let large-scale level packs using Lua be able to add cheat commands. + boolean silent = lua_optboolean(L, 1); + //NOHUD + //INLEVEL + G_SetUsedCheats(silent); + return 0; +} + static int Lcheckmapnumber (lua_State *L, int idx, const char *fun) { if (ISINLEVEL) @@ -4213,6 +4223,7 @@ static luaL_Reg lib[] = { {"G_AddGametype", lib_gAddGametype}, {"G_AddPlayer", lib_gAddPlayer}, {"G_RemovePlayer", lib_gRemovePlayer}, + {"G_SetUsedCheats", lib_gSetUsedCheats}, {"G_BuildMapName",lib_gBuildMapName}, {"G_BuildMapTitle",lib_gBuildMapTitle}, {"G_FindMap",lib_gFindMap}, diff --git a/src/lua_script.c b/src/lua_script.c index 4d4071545..5f16bca8a 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -204,6 +204,9 @@ int LUA_PushGlobals(lua_State *L, const char *word) } else if (fastcmp(word,"modifiedgame")) { lua_pushboolean(L, modifiedgame && !savemoddata); return 1; + } else if (fastcmp(word,"usedCheats")) { + lua_pushboolean(L, usedCheats); + return 1; } else if (fastcmp(word,"menuactive")) { lua_pushboolean(L, menuactive); return 1; diff --git a/src/m_cheat.c b/src/m_cheat.c index 89c8009ae..78fb3a505 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -81,7 +81,7 @@ static UINT8 cheatf_warp(void) S_StartSound(0, sfx_itemup); // Temporarily unlock stuff. - G_SetGameModified(false); + G_SetUsedCheats(false); unlockables[31].unlocked = true; // credits unlockables[30].unlocked = true; // sound test unlockables[28].unlocked = true; // level select @@ -106,7 +106,7 @@ static UINT8 cheatf_devmode(void) S_StartSound(0, sfx_itemup); // Just unlock all the things and turn on -debug and console devmode. - G_SetGameModified(false); + G_SetUsedCheats(false); for (i = 0; i < MAXUNLOCKABLES; i++) unlockables[i].unlocked = true; devparm = true; @@ -275,7 +275,7 @@ void Command_CheatNoClip_f(void) plyr->pflags ^= PF_NOCLIP; CONS_Printf(M_GetText("No Clipping %s\n"), plyr->pflags & PF_NOCLIP ? M_GetText("On") : M_GetText("Off")); - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } void Command_CheatGod_f(void) @@ -290,7 +290,7 @@ void Command_CheatGod_f(void) plyr->pflags ^= PF_GODMODE; CONS_Printf(M_GetText("Cheese Mode %s\n"), plyr->pflags & PF_GODMODE ? M_GetText("On") : M_GetText("Off")); - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } void Command_CheatNoTarget_f(void) @@ -305,7 +305,7 @@ void Command_CheatNoTarget_f(void) plyr->pflags ^= PF_INVIS; CONS_Printf(M_GetText("SEP Field %s\n"), plyr->pflags & PF_INVIS ? M_GetText("On") : M_GetText("Off")); - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } void Command_Scale_f(void) @@ -879,7 +879,7 @@ void Command_Devmode_f(void) return; } - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } void Command_Setrings_f(void) @@ -905,7 +905,7 @@ void Command_Setrings_f(void) // no totalsphere addition to revert } - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } } @@ -928,7 +928,7 @@ void Command_Setlives_f(void) P_GivePlayerLives(&players[consoleplayer], atoi(COM_Argv(1))); } - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } } @@ -955,7 +955,7 @@ void Command_Setcontinues_f(void) players[consoleplayer].continues = numcontinues; - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } } @@ -1446,7 +1446,7 @@ void Command_ObjectPlace_f(void) REQUIRE_SINGLEPLAYER; REQUIRE_NOULTIMATE; - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); silent = COM_CheckParm("-silent"); diff --git a/src/m_menu.c b/src/m_menu.c index 55733e552..81567662a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7082,7 +7082,7 @@ static void M_AllowSuper(INT32 choice) M_StartMessage(M_GetText("You are now capable of turning super.\nRemember to get all the emeralds!\n"),NULL,MM_NOTHING); SR_PandorasBox[6].status = IT_GRAYEDOUT; - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } static void M_GetAllEmeralds(INT32 choice) @@ -7093,7 +7093,7 @@ static void M_GetAllEmeralds(INT32 choice) M_StartMessage(M_GetText("You now have all 7 emeralds.\nUse them wisely.\nWith great power comes great ring drain.\n"),NULL,MM_NOTHING); SR_PandorasBox[7].status = IT_GRAYEDOUT; - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } static void M_DestroyRobotsResponse(INT32 ch) @@ -7104,7 +7104,7 @@ static void M_DestroyRobotsResponse(INT32 ch) // Destroy all robots P_DestroyRobots(); - G_SetGameModified(multiplayer); + G_SetUsedCheats(false); } static void M_DestroyRobots(INT32 choice) @@ -8703,6 +8703,12 @@ static void M_DrawLoad(void) loadgameoffset = 0; M_DrawLoadGameData(); + + if (usedCheats) + { + V_DrawCenteredThinString(BASEVIDWIDTH/2, 184, 0, "\x85WARNING:\x80 Cheats have been activated."); + V_DrawCenteredThinString(BASEVIDWIDTH/2, 192, 0, "Progress will not be saved."); + } } // @@ -9004,12 +9010,18 @@ static void M_HandleLoadSave(INT32 choice) break; case KEY_ENTER: - if (ultimate_selectable && saveSlotSelected == NOSAVESLOT) + if (ultimate_selectable && saveSlotSelected == NOSAVESLOT && !usedCheats) { loadgamescroll = 0; S_StartSound(NULL, sfx_skid); M_StartMessage("Are you sure you want to play\n\x85ultimate mode\x80? It isn't remotely fair,\nand you don't even get an emblem for it.\n\n(Press 'Y' to confirm)\n",M_SaveGameUltimateResponse,MM_YESNO); } + else if (saveSlotSelected != NOSAVESLOT && savegameinfo[saveSlotSelected-1].lives == -42 && usedCheats) + { + loadgamescroll = 0; + S_StartSound(NULL, sfx_skid); + M_StartMessage(M_GetText("This cannot be done in a cheated game.\n\n(Press a key)\n"), NULL, MM_NOTHING); + } else if (saveSlotSelected == NOSAVESLOT || savegameinfo[saveSlotSelected-1].lives != -666) // don't allow loading of "bad saves" { loadgamescroll = 0; diff --git a/src/p_inter.c b/src/p_inter.c index 1094c3045..b86bb39a6 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2583,7 +2583,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && numgameovers < maxgameovers) { numgameovers++; - if (cursaveslot > 0) + if (!usedCheats && cursaveslot > 0) G_SaveGameOver((UINT32)cursaveslot, (target->player->continues <= 0)); } } diff --git a/src/p_setup.c b/src/p_setup.c index c41a5d94e..a965c5142 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -7764,7 +7764,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) { // I'd love to do this in the menu code instead of here, but everything's a mess and I can't guarantee saving proper player struct info before the first act's started. You could probably refactor it, but it'd be a lot of effort. Easier to just work off known good code. ~toast 22/06/2020 if (!(ultimatemode || netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking || marathonmode) - && cursaveslot > 0) + && !usedCheats && cursaveslot > 0) { G_SaveGame((UINT32)cursaveslot, gamemap); } From f082acbbdbc6dcb535804c4c050f0a95ea3fb773 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 28 Feb 2022 12:48:18 -0500 Subject: [PATCH 023/108] Don't allow Record Attack in cheated games --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 81567662a..6d1dec19e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3519,7 +3519,7 @@ boolean M_Responder(event_t *ev) #ifndef DEVELOP // TODO: Replays are scary, so I left the remaining instances of this alone. // It'd be nice to get rid of this once and for all though! - if (((currentMenu->menuitems[itemOn].status & IT_CALLTYPE) & IT_CALL_NOTMODIFIED) && modifiedgame && !savemoddata) + if (((currentMenu->menuitems[itemOn].status & IT_CALLTYPE) & IT_CALL_NOTMODIFIED) && (modifiedgame && !savemoddata) && !usedCheats) { S_StartSound(NULL, sfx_skid); M_StartMessage(M_GetText("This cannot be done in a modified game.\n\n(Press a key)\n"), NULL, MM_NOTHING); From 947dbda045929e0577a52a898bd40e71a6066ac1 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Thu, 3 Mar 2022 10:48:44 -0500 Subject: [PATCH 024/108] Use savemoddata for ultimate file check --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 6d1dec19e..c5c49a7b8 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -9010,7 +9010,7 @@ static void M_HandleLoadSave(INT32 choice) break; case KEY_ENTER: - if (ultimate_selectable && saveSlotSelected == NOSAVESLOT && !usedCheats) + if (ultimate_selectable && saveSlotSelected == NOSAVESLOT && !savemoddata) { loadgamescroll = 0; S_StartSound(NULL, sfx_skid); From d3ff5342dd4cec3583523a8d53e6d1d6f7b7b591 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 1 May 2022 19:34:18 -0400 Subject: [PATCH 025/108] Minor adjustments --- src/m_cheat.c | 6 ------ src/m_menu.c | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 78fb3a505..18a5a8609 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -72,9 +72,6 @@ static UINT8 cheatf_ultimate(void) static UINT8 cheatf_warp(void) { - if (modifiedgame) - return 0; - if (menuactive && currentMenu != &MainDef) return 0; // Only on the main menu! @@ -97,9 +94,6 @@ static UINT8 cheatf_devmode(void) { UINT8 i; - if (modifiedgame) - return 0; - if (menuactive && currentMenu != &MainDef) return 0; // Only on the main menu! diff --git a/src/m_menu.c b/src/m_menu.c index c5c49a7b8..d26712f1e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6711,7 +6711,7 @@ static void M_DrawAddons(void) // draw save icon x = BASEVIDWIDTH - x - 16; - V_DrawSmallScaledPatch(x, y + 4, ((!modifiedgame || savemoddata) ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+4]); + V_DrawSmallScaledPatch(x, y + 4, (!usedCheats ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+4]); if (modifiedgame) V_DrawSmallScaledPatch(x, y + 4, 0, addonsp[NUM_EXT+2]); From 5103253e0b3828db68e1d58a6d3d0749d90ba8e2 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 12 Oct 2022 00:57:15 -0400 Subject: [PATCH 026/108] Allow unlockable executors again --- src/p_spec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 94659e0d7..810a7cd3f 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1797,7 +1797,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller { // Unlockable triggers required INT32 trigid = triggerline->args[1]; - if ((modifiedgame && !savemoddata) || (netgame || multiplayer)) + if (netgame || multiplayer) return false; else if (trigid < 0 || trigid > 31) // limited by 32 bit variable { @@ -1812,7 +1812,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller { // An unlockable itself must be unlocked! INT32 unlockid = triggerline->args[1]; - if ((modifiedgame && !savemoddata) || (netgame || multiplayer)) + if (netgame || multiplayer) return false; else if (unlockid < 0 || unlockid >= MAXUNLOCKABLES) // limited by unlockable count { From 969dc4813a4ebd41e1710e941bbd36f002c1796f Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sat, 19 Nov 2022 19:57:08 +0100 Subject: [PATCH 027/108] Allow cosmetic add-ons mid-save --- 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 deb308da2..d5e6100b7 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8074,7 +8074,7 @@ static boolean P_LoadAddon(UINT16 wadnum, UINT16 numlumps) ST_Start(); // Prevent savefile cheating - if (cursaveslot > 0) + if (modifiedgame && (cursaveslot > 0)) cursaveslot = 0; if (replacedcurrentmap && gamestate == GS_LEVEL && (netgame || multiplayer)) From 256d9b5fdb3411a79278e3ba2ec5000bc889770f Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sun, 20 Nov 2022 11:50:01 +0100 Subject: [PATCH 028/108] Uncap console opening/closing animation --- src/console.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/console.c b/src/console.c index 40fb43121..9af9eb9a8 100644 --- a/src/console.c +++ b/src/console.c @@ -643,33 +643,39 @@ static void CON_ChangeHeight(void) // static void CON_MoveConsole(void) { - fixed_t conspeed; + static fixed_t fracmovement = 0; Lock_state(); - conspeed = FixedDiv(cons_speed.value*vid.fdupy, FRACUNIT); - // instant if (!cons_speed.value) { con_curlines = con_destlines; + Unlock_state(); return; } - // up/down move to dest - if (con_curlines < con_destlines) + // Not instant - Increment fracmovement fractionally + fracmovement += FixedMul(cons_speed.value*vid.fdupy, renderdeltatics); + + if (con_curlines < con_destlines) // Move the console downwards { - con_curlines += FixedInt(conspeed); - if (con_curlines > con_destlines) - con_curlines = con_destlines; + con_curlines += FixedInt(fracmovement); // Move by fracmovement's integer value + if (con_curlines > con_destlines) // If we surpassed the destination... + con_curlines = con_destlines; // ...clamp to it! } - else if (con_curlines > con_destlines) + else // Move the console upwards { - con_curlines -= FixedInt(conspeed); + con_curlines -= FixedInt(fracmovement); if (con_curlines < con_destlines) con_curlines = con_destlines; + + if (con_destlines == 0) // If the console is being closed, not just moved up... + con_tick = 0; // ...don't show the blinking cursor } + fracmovement %= FRACUNIT; // Reset fracmovement's integer value, but keep the fraction + Unlock_state(); } @@ -752,10 +758,6 @@ void CON_Ticker(void) CON_ChangeHeight(); } - // console movement - if (con_destlines != con_curlines) - CON_MoveConsole(); - // clip the view, so that the part under the console is not drawn con_clipviewtop = -1; if (cons_backpic.value) // clip only when using an opaque background @@ -1866,6 +1868,10 @@ void CON_Drawer(void) CON_ClearHUD(); } + // console movement + if (con_curlines != con_destlines) + CON_MoveConsole(); + if (con_curlines > 0) CON_DrawConsole(); else if (gamestate == GS_LEVEL From 435e1f6e7e1fab7e47dfc2df2ab60660583fe53d Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sun, 20 Nov 2022 11:50:57 +0100 Subject: [PATCH 029/108] Make con_height adjustable on the fly --- src/console.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/console.c b/src/console.c index 9af9eb9a8..fb023c67e 100644 --- a/src/console.c +++ b/src/console.c @@ -110,6 +110,7 @@ static void CON_RecalcSize(void); static void CON_ChangeHeight(void); static void CON_DrawBackpic(void); +static void CONS_height_Change(void); static void CONS_hudlines_Change(void); static void CONS_backcolor_Change(void); @@ -136,7 +137,7 @@ static CV_PossibleValue_t speed_cons_t[] = {{0, "MIN"}, {64, "MAX"}, {0, NULL}}; static consvar_t cons_speed = CVAR_INIT ("con_speed", "8", CV_SAVE, speed_cons_t, NULL); // percentage of screen height to use for console -static consvar_t cons_height = CVAR_INIT ("con_height", "50", CV_SAVE, CV_Unsigned, NULL); +static consvar_t cons_height = CVAR_INIT ("con_height", "50", CV_CALL|CV_SAVE, CV_Unsigned, CONS_height_Change); static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}, {0, NULL}}; // whether to use console background picture, or translucent mode @@ -156,6 +157,18 @@ consvar_t cons_backcolor = CVAR_INIT ("con_backcolor", "Green", CV_CALL|CV_SAVE, static void CON_Print(char *msg); +// Change the console height on demand +// +static void CONS_height_Change(void) +{ + Lock_state(); + + if (con_destlines > 0 && !con_startup) // If the console is open (as in, not using "bind")... + CON_ChangeHeight(); // ...update its height now, not only when it's closed and re-opened + + Unlock_state(); +} + // // static void CONS_hudlines_Change(void) From 396db189e7cf541f325d653ef5be7fa5ed1b2037 Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sun, 20 Nov 2022 11:51:40 +0100 Subject: [PATCH 030/108] Draw the input prompt while the console is moving --- src/console.c | 52 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/console.c b/src/console.c index fb023c67e..6f85dbf1c 100644 --- a/src/console.c +++ b/src/console.c @@ -61,7 +61,7 @@ static boolean con_started = false; // console has been initialised static boolean con_forcepic = true; // at startup toggle console translucency when first off boolean con_recalc; // set true when screen size has changed -static tic_t con_tick; // console ticker for anim or blinking prompt cursor +static tic_t con_tick; // console ticker for blinking prompt cursor // con_scrollup should use time (currenttime - lasttime).. static boolean consoletoggle; // true when console key pushed, ticker will handle @@ -1824,41 +1824,41 @@ static void CON_DrawConsole(void) } // draw console text lines from top to bottom - if (con_curlines < minheight) - return; - - i = con_cy - con_scrollup; - - // skip the last empty line due to the cursor being at the start of a new line - i--; - - i -= (con_curlines - minheight) / charheight; - - if (rendermode == render_none) return; - - for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++) + if (con_curlines >= minheight) { - INT32 x; - size_t c; + i = con_cy - con_scrollup; - p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width]; + // skip the last empty line due to the cursor being at the start of a new line + i--; - for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++) + i -= (con_curlines - minheight) / charheight; + + if (rendermode == render_none) return; + + for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++) { - while (*p & 0x80) + INT32 x; + size_t c; + + p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width]; + + for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++) { - charflags = (*p & 0x7f) << V_CHARCOLORSHIFT; - p++; - c++; + while (*p & 0x80) + { + charflags = (*p & 0x7f) << V_CHARCOLORSHIFT; + p++; + c++; + } + if (c >= con_width) + break; + V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true); } - if (c >= con_width) - break; - V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true); } } // draw prompt if enough place (not while game startup) - if ((con_curlines == con_destlines) && (con_curlines >= minheight) && !con_startup) + if ((con_curlines >= (minheight-charheight)) && !con_startup) CON_DrawInput(); } From 5cb13f9d1c1a28575cd5fad4160407269e552d8c Mon Sep 17 00:00:00 2001 From: Eidolon Date: Thu, 17 Nov 2022 18:39:39 -0600 Subject: [PATCH 031/108] Bump SRB2VERSION and MODVERSION for 2.2.11 pre1 --- src/version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/version.h b/src/version.h index 7a12fbbbe..5e4c85be4 100644 --- a/src/version.h +++ b/src/version.h @@ -1,4 +1,4 @@ -#define SRB2VERSION "2.2.10"/* this must be the first line, for cmake !! */ +#define SRB2VERSION "2.2.11"/* this must be the first line, for cmake !! */ // The Modification ID; must be obtained from a Master Server Admin ( https://mb.srb2.org/members/?key=ms_admin ). // DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server. @@ -9,7 +9,7 @@ // 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 51 +#define MODVERSION 52 // Define this as a prerelease version suffix (pre#, RC#) -// #define BETAVERSION "pre1" +#define BETAVERSION "pre1" From df131ef131c5146b8f9a99af182849a2ed19f2e4 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Tue, 6 Dec 2022 18:43:59 -0600 Subject: [PATCH 032/108] Bump SRB2VERSION and MODVERSION for 2.2.11 pre2 --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index 5e4c85be4..5314314bf 100644 --- a/src/version.h +++ b/src/version.h @@ -12,4 +12,4 @@ #define MODVERSION 52 // Define this as a prerelease version suffix (pre#, RC#) -#define BETAVERSION "pre1" +#define BETAVERSION "pre2" From 9e191d0748df60eb7d11ef7beaaba038e1da6180 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Thu, 8 Dec 2022 21:27:24 -0600 Subject: [PATCH 033/108] Bump SRB2VERSION and MODVERSION for 2.2.11 pre3 --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index 5314314bf..f8b09ada6 100644 --- a/src/version.h +++ b/src/version.h @@ -12,4 +12,4 @@ #define MODVERSION 52 // Define this as a prerelease version suffix (pre#, RC#) -#define BETAVERSION "pre2" +#define BETAVERSION "pre3" From 30df486dacb53132d0045b0190a22a4468ca14ef Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 10 Dec 2022 15:32:06 -0600 Subject: [PATCH 034/108] Update zones.pk3 hash for pre3 (oops) --- src/config.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.h.in b/src/config.h.in index 928705b30..22cfd6481 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -29,7 +29,7 @@ * Last updated 2022 / 03 / 06 - v2.2.10 - main assets */ #define ASSET_HASH_SRB2_PK3 "ad911f29a28a18968ee5b2d11c2acb39" -#define ASSET_HASH_ZONES_PK3 "86ae55cae4e0a93ceda868635706a093" +#define ASSET_HASH_ZONES_PK3 "188a2bfd552196609323fc91ec1cdb22" #define ASSET_HASH_PLAYER_DTA "2e7aaae8a6b1b77d90ffe7606ceadb6c" #ifdef USE_PATCH_DTA #define ASSET_HASH_PATCH_PK3 "7d467a883f7887b3c311798ee2f56b6a" From 3b9ed3e8029431e8122b6c313f988b8837be017c Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 27 Dec 2022 10:54:24 +0100 Subject: [PATCH 035/108] EV_DoFloor: Set dummy tag correctly for chained linedef executing --- src/p_floor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_floor.c b/src/p_floor.c index a367a08d8..869384b53 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1660,7 +1660,7 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype) // chained linedef executing ability // Only set it on one of the moving sectors (the smallest numbered) if (line->args[3]) - dofloor->tag = firstone ? (INT16)line->args[3] : -1; + dofloor->tag = firstone ? (INT16)line->args[3] : 0; // flat changing ability dofloor->texture = line->args[4] ? line->frontsector->floorpic : -1; From 937127e987ac4e0e16101c44d184ac86b11d05cb Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 27 Dec 2022 16:49:52 +0100 Subject: [PATCH 036/108] Disable exit sectors in non-NiGHTS special stages because they interfere with the pits --- src/p_spec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_spec.c b/src/p_spec.c index 5c9caa82f..fd114ced0 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4579,6 +4579,9 @@ static void P_ProcessExitSector(player_t *player, mtag_t sectag) if (player->bot) return; + if (G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS)) + return; + // Exit (for FOF exits; others are handled in P_PlayerThink in p_user.c) P_DoPlayerFinish(player); From 6bbb032581828760585e22b64e9dbe395ea74ee1 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Fri, 30 Dec 2022 11:19:29 +0100 Subject: [PATCH 037/108] UDMF: Use string values for the sector "triggerer" field --- extras/conf/udb/Includes/SRB222_misc.cfg | 10 ++------- src/p_setup.c | 26 ++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/extras/conf/udb/Includes/SRB222_misc.cfg b/extras/conf/udb/Includes/SRB222_misc.cfg index fcc24741e..ed0488a3f 100644 --- a/extras/conf/udb/Includes/SRB222_misc.cfg +++ b/extras/conf/udb/Includes/SRB222_misc.cfg @@ -265,14 +265,8 @@ universalfields triggerer { - type = 0; - default = 0; - enum - { - 0 = "Player"; - 1 = "All players"; - 2 = "Object"; - } + type = 2; + default = "Player"; } } diff --git a/src/p_setup.c b/src/p_setup.c index eedda1b08..f31eca076 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1761,7 +1761,14 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char else if (fastcmp(param, "triggertag")) sectors[i].triggertag = atol(val); else if (fastcmp(param, "triggerer")) - sectors[i].triggerer = atol(val); + { + if (fastcmp(val, "Player")) + sectors[i].triggerer = TO_PLAYER; + if (fastcmp(val, "AllPlayers")) + sectors[i].triggerer = TO_ALLPLAYERS; + if (fastcmp(val, "Mobj")) + sectors[i].triggerer = TO_MOBJ; + } } static void ParseTextmapSidedefParameter(UINT32 i, const char *param, const char *val) @@ -2633,7 +2640,22 @@ static void P_WriteTextmap(void) if (wsectors[i].triggertag != 0) fprintf(f, "triggertag = %d;\n", wsectors[i].triggertag); if (wsectors[i].triggerer != 0) - fprintf(f, "triggerer = %d;\n", wsectors[i].triggerer); + { + switch (wsectors[i].triggerer) + { + case TO_PLAYER: + fprintf(f, "triggerer = \"Player\";\n"); + break; + case TO_ALLPLAYERS: + fprintf(f, "triggerer = \"AllPlayers\";\n"); + break; + case TO_MOBJ: + fprintf(f, "triggerer = \"Mobj\";\n"); + break; + default: + break; + } + } fprintf(f, "}\n"); fprintf(f, "\n"); } From 449d27749f6c245653db7d2846f12ab2dca34a40 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 31 Dec 2022 20:30:39 -0500 Subject: [PATCH 038/108] Fixes Issue #912 --- src/p_user.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index 4ca4e6c8a..0ef787641 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -11266,6 +11266,11 @@ static void P_DoTailsOverlay(player_t *player, mobj_t *tails) tails->y = player->mo->y + P_ReturnThrustY(tails, tails->angle, FixedMul(backwards, tails->scale)); tails->z = player->mo->z + zoffs; P_SetThingPosition(tails); + + if (player->mo->flags2 & MF2_SHADOW) + tails->flags2 |= MF2_SHADOW; + else + tails->flags2 &= ~MF2_SHADOW; } // Metal Sonic's jet fume From e909f8ec12a707e90d83f380e60a8e6c46a2f4e3 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 31 Dec 2022 21:06:39 -0500 Subject: [PATCH 039/108] Fixes Issue #711 --- src/p_map.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index 5c8ccbb19..f738cb97d 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -264,11 +264,13 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) { INT32 pflags = object->player->pflags & (PF_JUMPED|PF_NOJUMPDAMAGE|PF_SPINNING|PF_THOKKED|PF_BOUNCING); // Not identical to below... UINT8 secondjump = object->player->secondjump; + UINT16 tailsfly = object->player->powers[pw_tailsfly]; if (object->player->pflags & PF_GLIDING) P_SetPlayerMobjState(object, S_PLAY_FALL); P_ResetPlayer(object->player); object->player->pflags |= pflags; object->player->secondjump = secondjump; + object->player->powers[pw_tailsfly] = tailsfly; } } From 52384053ceef84ebf49a40ac9fc0a9071bae89a2 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 31 Dec 2022 22:46:08 -0500 Subject: [PATCH 040/108] When attaching to a wall to do a climb, the second sidedef wasn't be handled properly. --- src/p_map.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 5c8ccbb19..232bf3a50 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3506,11 +3506,9 @@ static void PTR_GlideClimbTraverse(line_t *li) if (fofline) whichside = 0; - if (!whichside) - { - slidemo->player->lastsidehit = checkline->sidenum[whichside]; - slidemo->player->lastlinehit = (INT16)(checkline - lines); - } + // Even if you attach to the second side of a linedef, we want to know the last hit. + slidemo->player->lastsidehit = checkline->sidenum[whichside]; + slidemo->player->lastlinehit = (INT16)(checkline - lines); P_Thrust(slidemo, slidemo->angle, FixedMul(5*FRACUNIT, slidemo->scale)); } From e472c551e112595f0836b34808a542c028763651 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 1 Jan 2023 11:31:44 +0100 Subject: [PATCH 041/108] Re-add P_ThingOnSpecial3DFloor for Lua backwards compatibility --- src/lua_baselib.c | 13 +++++++++++++ src/p_spec.c | 23 +++++++++++++++++++++++ src/p_spec.h | 1 + 3 files changed, 37 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index c94e9e91e..92ba95f99 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2335,6 +2335,18 @@ static int lib_pMobjTouchingSectorSpecial(lua_State *L) return 1; } +static int lib_pThingOnSpecial3DFloor(lua_State *L) +{ + mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + NOHUD + INLEVEL + if (!mo) + return LUA_ErrInvalid(L, "mobj_t"); + LUA_Deprecated(L, "P_ThingOnSpecial3DFloor", "P_MobjTouchingSectorSpecial\" or \"P_MobjTouchingSectorSpecialFlag"); + LUA_PushUserdata(L, P_ThingOnSpecial3DFloor(mo), META_SECTOR); + return 1; +} + static int lib_pMobjTouchingSectorSpecialFlag(lua_State *L) { mobj_t *mo = *((mobj_t**)luaL_checkudata(L, 1, META_MOBJ)); @@ -4213,6 +4225,7 @@ static luaL_Reg lib[] = { {"P_DoSuperTransformation",lib_pDoSuperTransformation}, {"P_ExplodeMissile",lib_pExplodeMissile}, {"P_MobjTouchingSectorSpecial",lib_pMobjTouchingSectorSpecial}, + {"P_ThingOnSpecial3DFloor",lib_pThingOnSpecial3DFloor}, {"P_MobjTouchingSectorSpecialFlag",lib_pMobjTouchingSectorSpecialFlag}, {"P_PlayerTouchingSectorSpecial",lib_pPlayerTouchingSectorSpecial}, {"P_PlayerTouchingSectorSpecialFlag",lib_pPlayerTouchingSectorSpecialFlag}, diff --git a/src/p_spec.c b/src/p_spec.c index 5c9caa82f..0bf11c53f 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4180,6 +4180,29 @@ sector_t *P_MobjTouchingSectorSpecial(mobj_t *mo, INT32 section, INT32 number) return NULL; } +// Deprecated in favor of P_MobjTouchingSectorSpecial +// Kept for Lua backwards compatibility only +sector_t *P_ThingOnSpecial3DFloor(mobj_t *mo) +{ + ffloor_t *rover; + + for (rover = mo->subsector->sector->ffloors; rover; rover = rover->next) + { + if (!rover->master->frontsector->special) + continue; + + if (!(rover->fofflags & FOF_EXISTS)) + continue; + + if (!P_IsMobjTouching3DFloor(mo, rover, mo->subsector->sector)) + continue; + + return rover->master->frontsector; + } + + return NULL; +} + sector_t *P_MobjTouchingSectorSpecialFlag(mobj_t *mo, sectorspecialflags_t flag) { msecnode_t *node; diff --git a/src/p_spec.h b/src/p_spec.h index cd97efa1a..779afdd05 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -496,6 +496,7 @@ void P_SpawnSpecials(boolean fromnetsave); // every tic void P_UpdateSpecials(void); sector_t *P_MobjTouchingSectorSpecial(mobj_t *mo, INT32 section, INT32 number); +sector_t *P_ThingOnSpecial3DFloor(mobj_t *mo); sector_t *P_MobjTouchingSectorSpecialFlag(mobj_t *mo, sectorspecialflags_t flag); sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 number); sector_t *P_PlayerTouchingSectorSpecialFlag(player_t *player, sectorspecialflags_t flag); From bd89b97e0a770944452da5829c27b78524a58e6b Mon Sep 17 00:00:00 2001 From: Arthur Date: Sun, 1 Jan 2023 20:59:11 -0500 Subject: [PATCH 042/108] Fixes issue #704 --- src/p_map.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index 5c8ccbb19..911d7927c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -418,7 +418,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) P_SetPlayerMobjState(object, S_PLAY_ROLL); } else - pflags = object->player->pflags & (PF_STARTJUMP|PF_JUMPED|PF_NOJUMPDAMAGE|PF_SPINNING|PF_THOKKED|PF_BOUNCING); // I still need these. + { + pflags = object->player->pflags & (PF_STARTJUMP | PF_JUMPED | PF_NOJUMPDAMAGE | PF_SPINNING | PF_THOKKED | PF_BOUNCING); // I still need these. + + if (pflags & PF_SPINNING) // Ensure we're in the rolling state, and not something like spindash. + P_SetPlayerMobjState(object, S_PLAY_ROLL); + } secondjump = object->player->secondjump; washoming = object->player->homing; P_ResetPlayer(object->player); From 7d53e4647b7317cb90708e86b7f8794241a307e1 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sun, 1 Jan 2023 21:07:15 -0500 Subject: [PATCH 043/108] Fixes issue #568 --- src/p_enemy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_enemy.c b/src/p_enemy.c index ece4f3814..3053e1fb8 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -13460,6 +13460,9 @@ static boolean PIT_DustDevilLaunch(mobj_t *thing) if (!player) return true; + if (player->spectator) + return true; + if (player->powers[pw_carry] != CR_DUSTDEVIL && (player->powers[pw_ignorelatch] & (1<<15))) return true; From af146071d87c588e140b3aa52995d1268f0cd928 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 2 Jan 2023 07:34:33 -0500 Subject: [PATCH 044/108] Check for spindash ability and dashspeed being > 0 before indiscriminately setting roll animation. --- src/p_map.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index 911d7927c..cb4309f80 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -419,9 +419,11 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) } else { + boolean wasSpindashing = object->player->dashspeed > 0 && (object->player->charability2 == CA2_SPINDASH); + pflags = object->player->pflags & (PF_STARTJUMP | PF_JUMPED | PF_NOJUMPDAMAGE | PF_SPINNING | PF_THOKKED | PF_BOUNCING); // I still need these. - if (pflags & PF_SPINNING) // Ensure we're in the rolling state, and not something like spindash. + if (wasSpindashing) // Ensure we're in the rolling state, and not spindash. P_SetPlayerMobjState(object, S_PLAY_ROLL); } secondjump = object->player->secondjump; From 28f97dcd0bd716a3f6773030efbc66640a319d6b Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 2 Jan 2023 08:07:13 -0500 Subject: [PATCH 045/108] Also fix STJr/SRB2#618 since it is highly related. --- src/p_map.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index cb4309f80..98a5360f6 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -425,6 +425,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (wasSpindashing) // Ensure we're in the rolling state, and not spindash. P_SetPlayerMobjState(object, S_PLAY_ROLL); + + if (object->player->charability == CA_GLIDEANDCLIMB && object->player->skidtime && (pflags & PF_JUMPED)) + { + object->player->skidtime = 0; // No skidding should be happening, either. + pflags &= ~PF_JUMPED; + } } secondjump = object->player->secondjump; washoming = object->player->homing; From 20724ad70bc44eee8d8c10c32cfbf88be94ef2f9 Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 27 Jan 2023 09:46:02 -0500 Subject: [PATCH 046/108] Also retain PF_CANCARRY --- src/p_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index f738cb97d..54e2003ba 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -262,7 +262,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) } else { - INT32 pflags = object->player->pflags & (PF_JUMPED|PF_NOJUMPDAMAGE|PF_SPINNING|PF_THOKKED|PF_BOUNCING); // Not identical to below... + INT32 pflags = object->player->pflags & (PF_JUMPED|PF_NOJUMPDAMAGE|PF_SPINNING|PF_THOKKED|PF_BOUNCING|PF_CANCARRY); // Not identical to below... UINT8 secondjump = object->player->secondjump; UINT16 tailsfly = object->player->powers[pw_tailsfly]; if (object->player->pflags & PF_GLIDING) From a6599c176d66f0c80af5fda458d4cdfe0a9296ae Mon Sep 17 00:00:00 2001 From: spherallic Date: Fri, 27 Jan 2023 16:49:53 +0100 Subject: [PATCH 047/108] Change gamepad defaults for 2.2.11 --- src/g_input.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/g_input.c b/src/g_input.c index 79bd2a4a2..262e68c6a 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -744,31 +744,31 @@ void G_DefineDefaultControls(void) gamecontroldefault[i][GC_CUSTOM1 ][1] = KEY_JOY1+1; // B gamecontroldefault[i][GC_CUSTOM2 ][1] = KEY_JOY1+3; // Y gamecontroldefault[i][GC_CUSTOM3 ][1] = KEY_JOY1+8; // Left Stick - gamecontroldefault[i][GC_CENTERVIEW ][1] = KEY_JOY1+9; // Right Stick - gamecontroldefault[i][GC_WEAPONPREV ][1] = KEY_JOY1+4; // LB - gamecontroldefault[i][GC_WEAPONNEXT ][1] = KEY_JOY1+5; // RB + gamecontroldefault[i][GC_CAMTOGGLE ][1] = KEY_JOY1+4; // LB + gamecontroldefault[i][GC_CENTERVIEW ][1] = KEY_JOY1+5; // RB gamecontroldefault[i][GC_SCREENSHOT ][1] = KEY_JOY1+6; // Back gamecontroldefault[i][GC_SYSTEMMENU ][0] = KEY_JOY1+7; // Start - gamecontroldefault[i][GC_CAMTOGGLE ][1] = KEY_HAT1+0; // D-Pad Up - gamecontroldefault[i][GC_VIEWPOINTNEXT][1] = KEY_HAT1+1; // D-Pad Down - gamecontroldefault[i][GC_TOSSFLAG ][1] = KEY_HAT1+2; // D-Pad Left - gamecontroldefault[i][GC_SCORES ][1] = KEY_HAT1+3; // D-Pad Right + gamecontroldefault[i][GC_WEAPONPREV ][1] = KEY_HAT1+2; // D-Pad Left + gamecontroldefault[i][GC_WEAPONNEXT ][1] = KEY_HAT1+3; // D-Pad Right + gamecontroldefault[i][GC_VIEWPOINTNEXT][1] = KEY_JOY1+9; // Right Stick + gamecontroldefault[i][GC_TOSSFLAG ][1] = KEY_HAT1+0; // D-Pad Up + gamecontroldefault[i][GC_SCORES ][1] = KEY_HAT1+1; // D-Pad Down // Second player controls only have joypad defaults - gamecontrolbisdefault[i][GC_JUMP ][1] = KEY_2JOY1+0; // A - gamecontrolbisdefault[i][GC_SPIN ][1] = KEY_2JOY1+2; // X - gamecontrolbisdefault[i][GC_CUSTOM1 ][1] = KEY_2JOY1+1; // B - gamecontrolbisdefault[i][GC_CUSTOM2 ][1] = KEY_2JOY1+3; // Y - gamecontrolbisdefault[i][GC_CUSTOM3 ][1] = KEY_2JOY1+8; // Left Stick - gamecontrolbisdefault[i][GC_CENTERVIEW ][1] = KEY_2JOY1+9; // Right Stick - gamecontrolbisdefault[i][GC_WEAPONPREV ][1] = KEY_2JOY1+4; // LB - gamecontrolbisdefault[i][GC_WEAPONNEXT ][1] = KEY_2JOY1+5; // RB - gamecontrolbisdefault[i][GC_SCREENSHOT ][1] = KEY_2JOY1+6; // Back + gamecontrolbisdefault[i][GC_JUMP ][1] = KEY_2JOY1+0; // A + gamecontrolbisdefault[i][GC_SPIN ][1] = KEY_2JOY1+2; // X + gamecontrolbisdefault[i][GC_CUSTOM1 ][1] = KEY_2JOY1+1; // B + gamecontrolbisdefault[i][GC_CUSTOM2 ][1] = KEY_2JOY1+3; // Y + gamecontrolbisdefault[i][GC_CUSTOM3 ][1] = KEY_2JOY1+8; // Left Stick + gamecontrolbisdefault[i][GC_CAMTOGGLE ][1] = KEY_2JOY1+4; // LB + gamecontrolbisdefault[i][GC_CENTERVIEW ][1] = KEY_2JOY1+5; // RB + gamecontrolbisdefault[i][GC_SCREENSHOT ][1] = KEY_2JOY1+6; // Back //gamecontrolbisdefault[i][GC_SYSTEMMENU ][0] = KEY_2JOY1+7; // Start - gamecontrolbisdefault[i][GC_CAMTOGGLE ][1] = KEY_2HAT1+0; // D-Pad Up - gamecontrolbisdefault[i][GC_VIEWPOINTNEXT][1] = KEY_2HAT1+1; // D-Pad Down - gamecontrolbisdefault[i][GC_TOSSFLAG ][1] = KEY_2HAT1+2; // D-Pad Left - //gamecontrolbisdefault[i][GC_SCORES ][1] = KEY_2HAT1+3; // D-Pad Right + gamecontrolbisdefault[i][GC_WEAPONPREV ][1] = KEY_2HAT1+2; // D-Pad Left + gamecontrolbisdefault[i][GC_WEAPONNEXT ][1] = KEY_2HAT1+3; // D-Pad Right + gamecontrolbisdefault[i][GC_VIEWPOINTNEXT][1] = KEY_2JOY1+9; // Right Stick + gamecontrolbisdefault[i][GC_TOSSFLAG ][1] = KEY_2HAT1+0; // D-Pad Up + //gamecontrolbisdefault[i][GC_SCORES ][1] = KEY_2HAT1+1; // D-Pad Down } } From b64dac714f39dadf9f44e474558c81d6420032d0 Mon Sep 17 00:00:00 2001 From: Jaime Ita Passos Date: Sat, 28 Jan 2023 00:12:29 -0300 Subject: [PATCH 048/108] Fix -Wnon-literal-null-conversion and -Wconstant-conversion warnings --- src/p_spec.c | 2 +- src/taglist.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 5c9caa82f..c104ce6c5 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4375,7 +4375,7 @@ sector_t *P_FindPlayerTrigger(player_t *player, line_t *sourceline) return loopsector; } - return false; + return NULL; } boolean P_IsPlayerValid(size_t playernum) diff --git a/src/taglist.c b/src/taglist.c index 305b05f04..405007614 100644 --- a/src/taglist.c +++ b/src/taglist.c @@ -472,5 +472,5 @@ mtag_t Tag_NextUnused(mtag_t start) start++; } - return MAXTAGS; + return (mtag_t)MAXTAGS; } From 4f8d2fcdc840b760e9d8c577b76498e4925b49a1 Mon Sep 17 00:00:00 2001 From: cobalt2727 <60624944+cobalt2727@users.noreply.github.com> Date: Wed, 8 Feb 2023 14:46:09 -0500 Subject: [PATCH 049/108] fix ARM builds being completely broken If merged, this is the quickest approach to resolve https://github.com/STJr/SRB2/issues/513 ...alternatively, we could just remove the option altogether but I don't have the time right now to test whether it's needed or not To the best of my knowledge, this covers all possible amd64 `CMAKE_SYSTEM_PROCESSOR` values based on what I'm seeing at https://stackoverflow.com/questions/70475665/what-are-the-possible-values-of-cmake-system-processor --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2c98019e8..b47706db0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -127,7 +127,9 @@ endif() # Compatibility flag with later versions of GCC # We should really fix our code to not need this if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields) + if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|x64|amd64|AMD64|em64t|EM64T)") + target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields) + endif() target_compile_options(SRB2SDL2 PRIVATE -Wno-trigraphs) endif() From aba57612d57de590b1b9db8891d1332fb1857460 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 19 Feb 2023 07:27:16 +0100 Subject: [PATCH 050/108] -Only print deprecated map effect warnings once on map load -Add missing unsupported effect warnings to P_WriteTextmap -Apply spikes MSF_TRIGGERSPECIAL_TOUCH hack in UDMF too --- src/p_setup.c | 20 ++++++++++++++++++++ src/p_spec.c | 29 +++++++++-------------------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index b0054119b..0330ea1e5 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2270,6 +2270,9 @@ static void P_WriteTextmap(void) case 10: CONS_Alert(CONS_WARNING, M_GetText("Sector %s has ring drainer effect, which is not supported in UDMF. Use linedef type 462 instead.\n"), sizeu1(i)); break; + case 15: + CONS_Alert(CONS_WARNING, M_GetText("Sector %s has bouncy FOF effect, which is not supported in UDMF. Use linedef type 76 instead.\n"), sizeu1(i)); + break; default: break; } @@ -2285,6 +2288,12 @@ static void P_WriteTextmap(void) case 9: CONS_Alert(CONS_WARNING, M_GetText("Sector %s has Egg Capsule type, which is not supported in UDMF. Use linedef type 464 instead.\n"), sizeu1(i)); break; + case 10: + CONS_Alert(CONS_WARNING, M_GetText("Sector %s has special stage time/spheres requirements effect, which is not supported in UDMF. Use the SpecialStageTime and SpecialStageSpheres level header options instead.\n"), sizeu1(i)); + break; + case 11: + CONS_Alert(CONS_WARNING, M_GetText("Sector %s has custom global gravity effect, which is not supported in UDMF. Use the Gravity level header option instead.\n"), sizeu1(i)); + break; default: break; } @@ -6008,6 +6017,9 @@ static void P_ConvertBinarySectorTypes(void) case 14: //Non-ramp sector sectors[i].specialflags |= SSF_NOSTEPDOWN; break; + case 15: //Bouncy FOF + CONS_Alert(CONS_WARNING, M_GetText("Deprecated bouncy FOF sector type detected. Please use linedef type 76 instead.\n")); + break; default: break; } @@ -6040,11 +6052,13 @@ static void P_ConvertBinarySectorTypes(void) sectors[i].triggerer = TO_PLAYER; break; case 6: //Trigger linedef executor (Emerald check) + CONS_Alert(CONS_WARNING, M_GetText("Deprecated emerald check sector type detected. Please use linedef types 337-339 instead.\n")); sectors[i].triggertag = tag; sectors[i].flags &= ~MSF_TRIGGERLINE_PLANE; sectors[i].triggerer = TO_PLAYEREMERALDS; break; case 7: //Trigger linedef executor (NiGHTS mare) + CONS_Alert(CONS_WARNING, M_GetText("Deprecated NiGHTS mare sector type detected. Please use linedef types 340-342 instead.\n")); sectors[i].triggertag = tag; sectors[i].flags &= ~MSF_TRIGGERLINE_PLANE; sectors[i].triggerer = TO_PLAYERNIGHTS; @@ -6052,6 +6066,12 @@ static void P_ConvertBinarySectorTypes(void) case 8: //Check for linedef executor on FOFs sectors[i].flags |= MSF_TRIGGERLINE_MOBJ; break; + case 10: //Special stage time/spheres requirements + CONS_Alert(CONS_WARNING, M_GetText("Deprecated sector type for special stage requirements detected. Please use the SpecialStageTime and SpecialStageSpheres level header options instead.\n")); + break; + case 11: //Custom global gravity + CONS_Alert(CONS_WARNING, M_GetText("Deprecated sector type for global gravity detected. Please use the Gravity level header option instead.\n")); + break; default: break; } diff --git a/src/p_spec.c b/src/p_spec.c index 6a52f19e8..2aec1ae36 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1760,13 +1760,11 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller { if (caller->triggerer == TO_PLAYEREMERALDS) { - CONS_Alert(CONS_WARNING, M_GetText("Deprecated emerald check sector type detected. Please use linedef types 337-339 instead.\n")); if (!(ALL7EMERALDS(emeralds))) return false; } else if (caller->triggerer == TO_PLAYERNIGHTS) { - CONS_Alert(CONS_WARNING, M_GetText("Deprecated NiGHTS mare sector type detected. Please use linedef types 340-342 instead.\n")); if (!P_CheckPlayerMareOld(triggerline)) return false; } @@ -5970,8 +5968,6 @@ static inline void P_AddCameraScanner(sector_t *sourcesec, sector_t *actionsecto { elevator_t *elevator; // Why not? LOL - CONS_Alert(CONS_WARNING, M_GetText("Detected a camera scanner effect (linedef type 5). This effect is deprecated and will be removed in the future!\n")); - // create and initialize new elevator thinker elevator = Z_Calloc(sizeof (*elevator), PU_LEVSPEC, NULL); P_AddThinker(THINK_MAIN, &elevator->thinker); @@ -6226,22 +6222,21 @@ void P_SpawnSpecials(boolean fromnetsave) circuitmap = true; } - if (!sector->special) + if (sector->damagetype == SD_SPIKE) { + //Terrible hack to replace an even worse hack: + //Spike damage automatically sets MSF_TRIGGERSPECIAL_TOUCH. + //Yes, this also affects other specials on the same sector. Sorry. + sector->flags |= MSF_TRIGGERSPECIAL_TOUCH; + } + + // Process deprecated binary sector specials + if (udmf || !sector->special) continue; // Process Section 1 switch(GETSECSPECIAL(sector->special, 1)) { - case 5: // Spikes - //Terrible hack to replace an even worse hack: - //Spike damage automatically sets MSF_TRIGGERSPECIAL_TOUCH. - //Yes, this also affects other specials on the same sector. Sorry. - sector->flags |= MSF_TRIGGERSPECIAL_TOUCH; - break; case 15: // Bouncy FOF - if (udmf) - break; - CONS_Alert(CONS_WARNING, M_GetText("Deprecated bouncy FOF sector type detected. Please use linedef type 76 instead.\n")); CheckForBouncySector = true; break; } @@ -6250,17 +6245,11 @@ void P_SpawnSpecials(boolean fromnetsave) switch(GETSECSPECIAL(sector->special, 2)) { case 10: // Time for special stage - if (udmf) - break; - CONS_Alert(CONS_WARNING, M_GetText("Deprecated sector type for special stage requirements detected. Please use the SpecialStageTime and SpecialStageSpheres level header options instead.\n")); sstimer = (sector->floorheight>>FRACBITS) * TICRATE + 6; // Time to finish ssspheres = sector->ceilingheight>>FRACBITS; // Ring count for special stage break; case 11: // Custom global gravity! - if (udmf) - break; - CONS_Alert(CONS_WARNING, M_GetText("Deprecated sector type for global gravity detected. Please use the Gravity level header option instead.\n")); gravity = sector->floorheight/1000; break; } From 9a9a16183f02b3570faa24c949c4fc68eda9d48f Mon Sep 17 00:00:00 2001 From: Eidolon Date: Fri, 24 Feb 2023 18:48:10 -0600 Subject: [PATCH 051/108] Disable floor splat slope interpolation Getting these to interpolate correctly is proving to be an absolute ordeal and I would rather have them look correct-but-not-interpolated than completely broken. --- src/hardware/hw_main.c | 6 +++--- src/r_splats.c | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 05d1be28f..321ed215f 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4102,7 +4102,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr) scale *= spr->shadowscale; if (spr->rotateflags & SRF_3D || renderflags & RF_NOSPLATBILLBOARD) - angle = spr->angle; + angle = spr->mobj->angle; else angle = viewangle; @@ -4157,8 +4157,8 @@ static void HWR_DrawSprite(gl_vissprite_t *spr) // Translate for (i = 0; i < 4; i++) { - wallVerts[i].x = rotated[i].x + spr->x1; - wallVerts[i].z = rotated[i].y + spr->z1; + wallVerts[i].x = rotated[i].x + FIXED_TO_FLOAT(spr->mobj->x); + wallVerts[i].z = rotated[i].y + FIXED_TO_FLOAT(spr->mobj->y); } if (renderflags & (RF_SLOPESPLAT | RF_OBJECTSLOPESPLAT)) diff --git a/src/r_splats.c b/src/r_splats.c index a58cfe536..bab89c89e 100644 --- a/src/r_splats.c +++ b/src/r_splats.c @@ -11,6 +11,7 @@ /// \brief Floor splats #include "r_draw.h" +#include "r_fps.h" #include "r_main.h" #include "r_splats.h" #include "r_bsp.h" @@ -185,7 +186,7 @@ void R_DrawFloorSplat(vissprite_t *spr) splat.scale = FixedMul(splat.scale, ((skin_t *)mobj->skin)->highresscale); if (spr->rotateflags & SRF_3D || renderflags & RF_NOSPLATBILLBOARD) - splatangle = spr->centerangle; + splatangle = mobj->angle; else splatangle = spr->viewpoint.angle; @@ -209,8 +210,8 @@ void R_DrawFloorSplat(vissprite_t *spr) xoffset = FixedMul(leftoffset, splat.xscale); yoffset = FixedMul(topoffset, splat.yscale); - x = spr->gx; - y = spr->gy; + x = mobj->x; + y = mobj->y; w = (splat.width * splat.xscale); h = (splat.height * splat.yscale); @@ -263,8 +264,8 @@ void R_DrawFloorSplat(vissprite_t *spr) // Translate for (i = 0; i < 4; i++) { - tr_x = rotated[i].x + x; - tr_y = rotated[i].y + y; + tr_x = rotated[i].x + mobj->x; + tr_y = rotated[i].y + mobj->y; if (splat.slope) { @@ -292,8 +293,8 @@ void R_DrawFloorSplat(vissprite_t *spr) tr_y = v3d->y - spr->viewpoint.y; // rotation around vertical y axis - rot_x = FixedMul(tr_x, sa) - FixedMul(tr_y, ca); - rot_y = FixedMul(tr_x, ca) + FixedMul(tr_y, sa); + rot_x = FixedMul(tr_x - (mobj->x - x), sa) - FixedMul(tr_y - (mobj->y - y), ca); + rot_y = FixedMul(tr_x - (mobj->x - x), ca) + FixedMul(tr_y - (mobj->y - y), sa); rot_z = v3d->z - spr->viewpoint.z; if (rot_y < FRACUNIT) From d58dad7f982e9486afd6945df2f223ed79abf721 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 25 Feb 2023 11:58:12 +0100 Subject: [PATCH 052/108] Move emblem float option to args[1], since args[0] is already occupied for NiGHTS emblems --- extras/conf/udb/Includes/SRB222_things.cfg | 2 +- src/p_mobj.c | 5 ++++- src/p_setup.c | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/extras/conf/udb/Includes/SRB222_things.cfg b/extras/conf/udb/Includes/SRB222_things.cfg index 1de661e29..b4508c91e 100644 --- a/extras/conf/udb/Includes/SRB222_things.cfg +++ b/extras/conf/udb/Includes/SRB222_things.cfg @@ -4546,7 +4546,7 @@ udmf sprite = "EMBMA0"; width = 16; height = 30; - arg0 + arg1 { title = "Float?"; type = 11; diff --git a/src/p_mobj.c b/src/p_mobj.c index 635d4f42b..412ef7ddb 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11849,7 +11849,6 @@ fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mt case MT_EMERHUNT: case MT_EMERALDSPAWN: case MT_TOKEN: - case MT_EMBLEM: case MT_RING: case MT_REDTEAMRING: case MT_BLUETEAMRING: @@ -11861,6 +11860,10 @@ fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mt offset += mthing->args[0] ? 0 : 24*FRACUNIT; break; + case MT_EMBLEM: + offset += mthing->args[1] ? 0 : 24 * FRACUNIT; + break; + // Remaining objects. default: if (P_WeaponOrPanel(mobjtype)) diff --git a/src/p_setup.c b/src/p_setup.c index b0054119b..1c052a148 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -6288,7 +6288,6 @@ static void P_ConvertBinaryThingTypes(void) case 312: //Emerald token case 320: //Emerald hunt location case 321: //Match chaos emerald spawn - case 322: //Emblem case 330: //Bounce ring panel case 331: //Rail ring panel case 332: //Automatic ring panel @@ -6301,6 +6300,9 @@ static void P_ConvertBinaryThingTypes(void) case 1800: //Coin mapthings[i].args[0] = !(mapthings[i].options & MTF_AMBUSH); break; + case 322: //Emblem + mapthings[i].args[1] = !(mapthings[i].options & MTF_AMBUSH); + break; case 409: //Extra life monitor mapthings[i].args[2] = !(mapthings[i].options & (MTF_AMBUSH|MTF_OBJECTSPECIAL)); break; From 283f7e8919ca62ef9d6d6d1d885858f6332aaf48 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 25 Feb 2023 13:24:14 +0100 Subject: [PATCH 053/108] Linedef type 14 UDMF conversion: Don't fill stringargs[0] if toptexture is empty --- src/p_setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_setup.c b/src/p_setup.c index b0054119b..c9e578922 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -4209,7 +4209,8 @@ static void P_ConvertBinaryLinedefTypes(void) lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; lines[i].args[1] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS; lines[i].args[2] = !!(lines[i].flags & ML_SKEWTD); - P_WriteConstant(sides[lines[i].sidenum[0]].toptexture, &lines[i].stringargs[0]); + if (sides[lines[i].sidenum[0]].toptexture) + P_WriteConstant(sides[lines[i].sidenum[0]].toptexture, &lines[i].stringargs[0]); break; case 16: //Minecart parameters lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; From 6e7ff6972096f37ce618507ec0cdc60d272c5dee Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 25 Feb 2023 15:03:52 +0100 Subject: [PATCH 054/108] Re-add code that sets MF2_AMBUSH if MTF_AMBUSH is set, but only for binary maps --- src/p_mobj.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 635d4f42b..f8f4ee2a6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -13277,6 +13277,23 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean return true; } +// Pre-UDMF backwards compatibility stuff. Remove for 2.3 +static void P_SetAmbush(mapthing_t *mthing, mobj_t *mobj) +{ + if (mobj->type == MT_NIGHTSBUMPER + || mobj->type == MT_AXIS + || mobj->type == MT_AXISTRANSFER + || mobj->type == MT_AXISTRANSFERLINE + || mobj->type == MT_NIGHTSBUMPER + || mobj->type == MT_STARPOST) + return; + + if ((mthing->options & MTF_OBJECTSPECIAL) && (mobj->flags & MF_PUSHABLE)) + return; + + mobj->flags2 |= MF2_AMBUSH; +} + static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y, fixed_t z, mobjtype_t i) { mobj_t *mobj = NULL; @@ -13299,6 +13316,9 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y, mthing->mobj = mobj; + if (!udmf && (mthing->options & MTF_AMBUSH)) + P_SetAmbush(mthing, mobj); + // Generic reverse gravity for individual objects flag. if (mthing->options & MTF_OBJECTFLIP) { From bb9e7045c5c3f5f433e7d9fb2be5ce9046f9298f Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 25 Feb 2023 15:43:51 +0100 Subject: [PATCH 055/108] Fix wrong flag being checked in P_ProcessTeamBase --- src/p_spec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index 6a52f19e8..b0840b30c 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4653,7 +4653,7 @@ static void P_ProcessTeamBase(player_t *player, boolean redteam) // Make sure the team still has their own // flag at their base so they can score. - if (!P_IsFlagAtBase(redteam ? MT_BLUEFLAG : MT_REDFLAG)) + if (!P_IsFlagAtBase(redteam ? MT_REDFLAG : MT_BLUEFLAG)) return; HU_SetCEchoFlags(V_AUTOFADEOUT|V_ALLOWLOWERCASE); From a32dc3daa0ce4f3f16674021198f194386212543 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sun, 26 Feb 2023 17:57:44 -0600 Subject: [PATCH 056/108] Fix software vsync This pre-SDL 2.0.18 hack from the interp branch is no longer needed when building with a new enough SDL version. This makes vid_wait toggleable at all times if SDL is at least 2.0.18. --- src/sdl/i_video.c | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 6e971a5d8..47d41ede5 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -102,8 +102,10 @@ rendermode_t chosenrendermode = render_none; // set by command line arguments boolean highcolor = false; +static void VidWaitChanged(void); + // synchronize page flipping with screen refresh -consvar_t cv_vidwait = CVAR_INIT ("vid_wait", "On", CV_SAVE, CV_OnOff, NULL); +consvar_t cv_vidwait = CVAR_INIT ("vid_wait", "On", CV_SAVE | CV_CALL, CV_OnOff, VidWaitChanged); static consvar_t cv_stretch = CVAR_INIT ("stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL); static consvar_t cv_alwaysgrabmouse = CVAR_INIT ("alwaysgrabmouse", "Off", CV_SAVE, CV_OnOff, NULL); @@ -274,6 +276,22 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen, SDL_bool } } +static void VidWaitChanged(void) +{ + if (renderer && rendermode == render_soft) + { +#if SDL_VERSION_ATLEAST(2, 0, 18) + SDL_RenderSetVSync(renderer, cv_vidwait.value ? 1 : 0); +#endif + } +#ifdef HWRENDER + else if (rendermode == render_opengl && sdlglcontext != NULL && SDL_GL_GetCurrentContext() == sdlglcontext) + { + SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0); + } +#endif +} + static INT32 Impl_SDL_Scancode_To_Keycode(SDL_Scancode code) { if (code >= SDL_SCANCODE_A && code <= SDL_SCANCODE_Z) @@ -1476,15 +1494,19 @@ static SDL_bool Impl_CreateContext(void) int flags = 0; // Use this to set SDL_RENDERER_* flags now if (usesdl2soft) flags |= SDL_RENDERER_SOFTWARE; -#if 0 - // This shit is BROKEN. - // - The version of SDL we're using cannot toggle VSync at runtime. We'll need a new SDL version implemented to have this work properly. - // - cv_vidwait is initialized before config is loaded, so it's forced to default value at runtime, and forced off when switching. The config loading code would need restructured. - // - With both this & frame interpolation on, I_FinishUpdate takes x10 longer. At this point, it is simpler to use a standard FPS cap. - // So you can probably guess why I'm kinda over this, I'm just disabling it. else if (cv_vidwait.value) + { +#if SDL_VERSION_ATLEAST(2, 0, 18) + // If SDL is new enough, we can turn off vsync later. flags |= SDL_RENDERER_PRESENTVSYNC; +#else + // However, if it isn't, we should just silently turn vid_wait off + // This is because the renderer will be created before the config + // is read and vid_wait is set from the user's preferences, and thus + // vid_wait will have no effect. + CV_StealthSetValue(cv_vidwait, 0); #endif + } if (!renderer) renderer = SDL_CreateRenderer(window, -1, flags); @@ -1571,6 +1593,7 @@ boolean VID_CheckRenderer(void) else if (vid.glstate == VID_GL_LIBRARY_ERROR) rendererchanged = false; } + else #endif if (!contextcreated) From c42ef9f1be3157f468f0ae881a855538c6fa540d Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sun, 26 Feb 2023 16:47:00 -0600 Subject: [PATCH 057/108] Fix IT and ctf flag sign interpolation --- src/info.c | 4 ++-- src/p_user.c | 57 +++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/info.c b/src/info.c index 174eb5cc4..b55302170 100644 --- a/src/info.c +++ b/src/info.c @@ -3429,10 +3429,10 @@ state_t states[NUMSTATES] = {SPR_LCKN, 2|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_LOCKONINF3 {SPR_LCKN, 3|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_LOCKONINF4 - {SPR_TTAG, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_TTAG + {SPR_TTAG, FF_FULLBRIGHT, 1, {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, 1, {NULL}, 0, 0, S_NULL}, // S_GOTFLAG // Finish flag {SPR_FNSF, FF_TRANS30, -1, {NULL}, 0, 0, S_NULL}, // S_FINISHFLAG diff --git a/src/p_user.c b/src/p_user.c index bdb164484..9d16bdda2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3108,14 +3108,25 @@ static void P_DoPlayerHeadSigns(player_t *player) if (G_TagGametype()) { // If you're "IT", show a big "IT" over your head for others to see. - if (player->pflags & PF_TAGIT) + if (player->pflags & PF_TAGIT && P_IsLocalPlayer(player)) { - if (!P_IsLocalPlayer(player)) // Don't display it on your own view. + mobj_t* it = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_TAG); + it->x = player->mo->x; + it->y = player->mo->y; + it->z = player->mo->z; + it->old_x = player->mo->old_x; + it->old_y = player->mo->old_y; + it->old_z = player->mo->old_z; + + if (!(player->mo->eflags & MFE_VERTICALFLIP)) { - if (!(player->mo->eflags & MFE_VERTICALFLIP)) - P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height, MT_TAG); - else - P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z - mobjinfo[MT_TAG].height, MT_TAG)->eflags |= MFE_VERTICALFLIP; + it->z += player->mo->height; + it->old_z += player->mo->height; + } + else + { + it->z -= mobjinfo[MT_TAG].height; + it->old_z -= mobjinfo[MT_TAG].height; } } } @@ -3123,17 +3134,34 @@ static void P_DoPlayerHeadSigns(player_t *player) { // Spawn a got-flag message over the head of the player that // has it (but not on your own screen if you have the flag). - if (splitscreen || player != &players[consoleplayer]) + if (splitscreen || player != &players[consoleplayer] || true) { - mobj_t *sign = P_SpawnMobj(player->mo->x+player->mo->momx, player->mo->y+player->mo->momy, - player->mo->z+player->mo->momz, MT_GOTFLAG); - if (player->mo->eflags & MFE_VERTICALFLIP) + fixed_t zofs; + mobj_t *sign; + boolean player_is_flipped = (player->mo->eflags & MFE_VERTICALFLIP) > 0; + + zofs = player->mo->momz; + if (player_is_flipped) { - sign->z += player->mo->height-P_GetPlayerHeight(player)-mobjinfo[MT_GOTFLAG].height-FixedMul(16*FRACUNIT, player->mo->scale); - sign->eflags |= MFE_VERTICALFLIP; + zofs += player->mo->height - P_GetPlayerHeight(player) - mobjinfo[MT_GOTFLAG].height - FixedMul(16 * FRACUNIT, player->mo->scale); } else - sign->z += P_GetPlayerHeight(player)+FixedMul(16*FRACUNIT, player->mo->scale); + { + zofs += P_GetPlayerHeight(player) + FixedMul(16 * FRACUNIT, player->mo->scale); + } + + sign = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_GOTFLAG); + sign->x = player->mo->x; + sign->y = player->mo->y; + sign->z = player->mo->z + zofs; + sign->old_x = player->mo->old_x; + sign->old_y = player->mo->old_y; + sign->old_z = player->mo->old_z + zofs; + + if (player_is_flipped) + { + sign->eflags |= MFE_VERTICALFLIP; + } if (player->gotflag & GF_REDFLAG) sign->frame = 1|FF_FULLBRIGHT; @@ -12028,7 +12056,6 @@ void P_PlayerThink(player_t *player) P_DoBubbleBreath(player); // Spawn Sonic's bubbles P_CheckUnderwaterAndSpaceTimer(player); // Display the countdown drown numbers! P_CheckInvincibilityTimer(player); // Spawn Invincibility Sparkles - P_DoPlayerHeadSigns(player); // Spawn Tag/CTF signs over player's head #if 1 // "Blur" a bit when you have speed shoes and are going fast enough @@ -12893,6 +12920,8 @@ void P_PlayerAfterThink(player_t *player) } } } + + P_DoPlayerHeadSigns(player); // Spawn Tag/CTF signs over player's head } void P_SetPlayerAngle(player_t *player, angle_t angle) From 851ca92aaaefc576d3be0fcca9a844bc6447a0fd Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 28 Feb 2023 17:51:26 +0000 Subject: [PATCH 058/108] revert Eidolon's edits for testing the IT/CTF flag sign fixes, they were left in by mistake --- src/p_user.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 26abc0220..60a0f5106 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1,4 +1,3 @@ - // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. @@ -3108,7 +3107,7 @@ static void P_DoPlayerHeadSigns(player_t *player) if (G_TagGametype()) { // If you're "IT", show a big "IT" over your head for others to see. - if (player->pflags & PF_TAGIT && P_IsLocalPlayer(player)) + if (player->pflags & PF_TAGIT && !P_IsLocalPlayer(player)) { mobj_t* it = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_TAG); it->x = player->mo->x; @@ -3134,7 +3133,7 @@ static void P_DoPlayerHeadSigns(player_t *player) { // Spawn a got-flag message over the head of the player that // has it (but not on your own screen if you have the flag). - if (splitscreen || player != &players[consoleplayer] || true) + if (splitscreen || player != &players[consoleplayer]) { fixed_t zofs; mobj_t *sign; From 57148ef9c28d78897852608e642c9028807a79c7 Mon Sep 17 00:00:00 2001 From: spherallic Date: Thu, 2 Mar 2023 18:10:47 +0100 Subject: [PATCH 059/108] Fix Explosion Ring explosion interpolation --- src/p_mobj.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b279a8a88..30e0183de 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6334,11 +6334,7 @@ void P_SpawnParaloop(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 numb mobj->fuse = (radius>>(FRACBITS+2)) + 1; if (spawncenter) - { - mobj->x = x; - mobj->y = y; - mobj->z = z; - } + P_SetOrigin(mobj, x, y, z); if (mobj->fuse <= 1) mobj->fuse = 2; From 2a50626b004110ec27d2d6259653d513f8546df7 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+TatsuruIKR@users.noreply.github.com> Date: Wed, 15 Mar 2023 17:50:13 -0300 Subject: [PATCH 060/108] Initial commit --- src/d_clisrv.c | 20 +++++++++++++++++--- src/d_clisrv.h | 1 + src/lua_baselib.c | 16 ++++++++++------ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 1ff053e5c..d3426ef14 100755 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1377,8 +1377,9 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.time = (tic_t)LONG(servertime); netbuffer->u.serverinfo.leveltime = (tic_t)LONG(leveltime); - netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers(); - netbuffer->u.serverinfo.maxplayer = (UINT8)cv_maxplayers.value; + // Exclude bots from both counts + netbuffer->u.serverinfo.numberofplayer = (UINT8)(D_NumPlayers() - D_NumBots()); + netbuffer->u.serverinfo.maxplayer = (UINT8)(cv_maxplayers.value - D_NumBots()); netbuffer->u.serverinfo.refusereason = GetRefuseReason(node); @@ -4077,7 +4078,7 @@ ConnectionRefused (SINT8 node, INT32 rejoinernum) { return va( "Maximum players reached: %d", - cv_maxplayers.value); + cv_maxplayers.value - D_NumBots()); } } @@ -5609,6 +5610,19 @@ INT32 D_NumPlayers(void) return num; } +/** Similar to the above, but counts only bots. + * Purpose is to remove bots from both the player count and the + * max player count on the server view +*/ +INT32 D_NumBots(void) +{ + INT32 num = 0, ix; + for (ix = 0; ix < MAXPLAYERS; ix++) + if (playeringame[ix] && players[ix].bot) + num++; + return num; +} + tic_t GetLag(INT32 node) { return gametic - nettics[node]; diff --git a/src/d_clisrv.h b/src/d_clisrv.h index e07864122..48480cfe5 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -447,6 +447,7 @@ extern char motd[254], server_context[8]; extern UINT8 playernode[MAXPLAYERS]; INT32 D_NumPlayers(void); +INT32 D_NumBots(void); void D_ResetTiccmds(void); tic_t GetLag(INT32 node); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index a4ad81358..04a9607a8 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -3541,7 +3541,6 @@ static int lib_gAddPlayer(lua_State *L) return 1; } - newplayernum = i; CL_ClearPlayer(newplayernum); @@ -3553,9 +3552,6 @@ static int lib_gAddPlayer(lua_State *L) newplayer->jointime = 0; newplayer->quittime = 0; - // Set the bot name (defaults to Bot #) - strcpy(player_names[newplayernum], va("Bot %d", botcount)); - // Read the skin argument (defaults to Sonic) if (!lua_isnoneornil(L, 1)) { @@ -3567,7 +3563,10 @@ static int lib_gAddPlayer(lua_State *L) if (!lua_isnoneornil(L, 2)) newplayer->skincolor = R_GetColorByName(luaL_checkstring(L, 2)); else - newplayer->skincolor = skins[newplayer->skin].prefcolor; + newplayer->skincolor = skins[skinnum].prefcolor; + + // Set the bot default name as the skin + strcpy(player_names[newplayernum], skins[skinnum].realname); // Read the bot name, if given if (!lua_isnoneornil(L, 3)) @@ -3583,14 +3582,19 @@ static int lib_gAddPlayer(lua_State *L) // Set the skin (can't do this until AFTER bot type is set!) SetPlayerSkinByNum(newplayernum, skinnum); - if (netgame) { char joinmsg[256]; + // Truncate bot name + player_names[newplayernum][sizeof(*player_names) - 7] = '\0'; // The length of colored [BOT] + 1 + strcpy(joinmsg, M_GetText("\x82*Bot %s has joined the game (player %d)")); strcpy(joinmsg, va(joinmsg, player_names[newplayernum], newplayernum)); HU_AddChatText(joinmsg, false); + + // Append blue [BOT] tag at the end + strlcat(player_names[newplayernum], "\x84[BOT]", sizeof(*player_names)); } LUA_PushUserdata(L, newplayer, META_PLAYER); From db4de0f50e527f1a22e2418921aa0f6116c77c48 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 16:39:53 -0700 Subject: [PATCH 061/108] sdl/i_video.c: fix compile prior to SDL 2.0.18 --- src/sdl/i_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 47d41ede5..02f0e462e 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1504,7 +1504,7 @@ static SDL_bool Impl_CreateContext(void) // This is because the renderer will be created before the config // is read and vid_wait is set from the user's preferences, and thus // vid_wait will have no effect. - CV_StealthSetValue(cv_vidwait, 0); + CV_StealthSetValue(&cv_vidwait, 0); #endif } From e48786961a865289b3cf4b9f86ba014a250bf14e Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 11:33:37 -0700 Subject: [PATCH 062/108] exec: pass on com_flags --- src/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command.c b/src/command.c index b22f03d1a..f73bb3b26 100644 --- a/src/command.c +++ b/src/command.c @@ -794,8 +794,8 @@ static void COM_Exec_f(void) CONS_Printf(M_GetText("executing %s\n"), COM_Argv(1)); // insert text file into the command buffer - COM_BufAddText((char *)buf); - COM_BufAddText("\n"); + COM_BufAddTextEx((char *)buf, com_flags); + COM_BufAddTextEx("\n", com_flags); // free buffer Z_Free(buf); From a39f69c9c7ebe35beb38132afbc232f25db17252 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 11:39:25 -0700 Subject: [PATCH 063/108] Reset com_flags at end of COM_BufExecute Fixes com_flags being discarded after the first command in a chain (semicolon list). --- src/command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/command.c b/src/command.c index f73bb3b26..de9da232e 100644 --- a/src/command.c +++ b/src/command.c @@ -264,6 +264,8 @@ void COM_BufExecute(void) break; } } + + com_flags = 0; } /** Executes a string immediately. Used for skirting around WAIT commands. @@ -440,7 +442,6 @@ static void COM_TokenizeString(char *ptext) com_argc = 0; com_args = NULL; - com_flags = 0; while (com_argc < MAX_ARGS) { From 5d08bfd7068997edbc435d1e50dfd3ae8a402bc8 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 11:43:53 -0700 Subject: [PATCH 064/108] Rename CV_NOLUA to CV_ALLOWLUA, opt IN to Lua mutability --- src/command.c | 19 ++++++++++++++++++- src/command.h | 2 +- src/deh_tables.c | 2 +- src/lua_consolelib.c | 5 +++-- src/screen.c | 2 +- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/command.c b/src/command.c index de9da232e..e027b45f3 100644 --- a/src/command.c +++ b/src/command.c @@ -57,6 +57,7 @@ static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr); static boolean CV_Command(void); consvar_t *CV_FindVar(const char *name); static const char *CV_StringValue(const char *var_name); +static boolean CV_Immutable(const consvar_t *var); static consvar_t *consvar_vars; // list of registered console variables static UINT16 consvar_number_of_netids = 0; @@ -2371,7 +2372,7 @@ static boolean CV_Command(void) if (!v) return false; - if (( com_flags & COM_SAFE ) && ( v->flags & CV_NOLUA )) + if (CV_Immutable(v)) { CONS_Alert(CONS_WARNING, "Variable '%s' cannot be changed from Lua.\n", v->name); return true; @@ -2460,6 +2461,22 @@ void CV_SaveVariables(FILE *f) } } +// Returns true if this cvar cannot be modified in current context. +// Such as if the cvar does not have CV_ALLOWLUA. +static boolean CV_Immutable(const consvar_t *var) +{ + // Currently operating from Lua + if (com_flags & COM_SAFE) + { + if (!(var->flags & CV_ALLOWLUA)) + { + return true; + } + } + + return false; +} + //============================================================================ // SCRIPT PARSE //============================================================================ diff --git a/src/command.h b/src/command.h index 30d7e5bbe..48827f99f 100644 --- a/src/command.h +++ b/src/command.h @@ -120,7 +120,7 @@ typedef enum // can only be set when we have the pointer to it // used on menus CV_CHEAT = 2048, // Don't let this be used in multiplayer unless cheats are on. - CV_NOLUA = 4096,/* don't let this be called from Lua */ + CV_ALLOWLUA = 4096,/* Let this be called from Lua */ } cvflags_t; typedef struct CV_PossibleValue_s diff --git a/src/deh_tables.c b/src/deh_tables.c index 4a3467f78..1031f44fa 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5525,7 +5525,7 @@ struct int_const_s const INT_CONST[] = { {"CV_HIDEN",CV_HIDEN}, {"CV_HIDDEN",CV_HIDEN}, {"CV_CHEAT",CV_CHEAT}, - {"CV_NOLUA",CV_NOLUA}, + {"CV_ALLOWLUA",CV_ALLOWLUA}, // v_video flags {"V_NOSCALEPATCH",V_NOSCALEPATCH}, diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index 816051199..f5e98e920 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -450,6 +450,7 @@ static int lib_cvRegisterVar(lua_State *L) return luaL_error(L, M_GetText("Variable %s has CV_CALL without a function"), cvar->name); } + cvar->flags |= CV_ALLOWLUA; // actually time to register it to the console now! Finally! cvar->flags |= CV_MODIFIED; CV_RegisterVar(cvar); @@ -478,7 +479,7 @@ static int CVarSetFunction ){ consvar_t *cvar = *(consvar_t **)luaL_checkudata(L, 1, META_CVAR); - if (cvar->flags & CV_NOLUA) + if (!(cvar->flags & CV_ALLOWLUA)) return luaL_error(L, "Variable '%s' cannot be set from Lua.", cvar->name); switch (lua_type(L, 2)) @@ -510,7 +511,7 @@ static int lib_cvAddValue(lua_State *L) { consvar_t *cvar = *(consvar_t **)luaL_checkudata(L, 1, META_CVAR); - if (cvar->flags & CV_NOLUA) + if (!(cvar->flags & CV_ALLOWLUA)) return luaL_error(L, "Variable %s cannot be set from Lua.", cvar->name); CV_AddValue(cvar, (INT32)luaL_checknumber(L, 2)); diff --git a/src/screen.c b/src/screen.c index 3842a365d..501ee358d 100644 --- a/src/screen.c +++ b/src/screen.c @@ -82,7 +82,7 @@ CV_PossibleValue_t cv_renderer_t[] = { {0, NULL} }; -consvar_t cv_renderer = CVAR_INIT ("renderer", "Software", CV_SAVE|CV_NOLUA|CV_CALL, cv_renderer_t, SCR_ChangeRenderer); +consvar_t cv_renderer = CVAR_INIT ("renderer", "Software", CV_SAVE|CV_CALL, cv_renderer_t, SCR_ChangeRenderer); static void SCR_ChangeFullscreen(void); From 15e3d0e667f97dad191260d3b699e9d60a9f7174 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 11:45:14 -0700 Subject: [PATCH 065/108] Fix toggle command and add command being able to bypass Lua restriction --- src/command.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/command.c b/src/command.c index e027b45f3..7ffa300b1 100644 --- a/src/command.c +++ b/src/command.c @@ -1000,6 +1000,9 @@ static void COM_Toggle_f(void) return; } + if (CV_Immutable(cvar)) + return; + if (!(cvar->PossibleValue == CV_YesNo || cvar->PossibleValue == CV_OnOff)) { CONS_Alert(CONS_NOTICE, M_GetText("%s is not a boolean value\n"), COM_Argv(1)); @@ -1029,6 +1032,9 @@ static void COM_Add_f(void) return; } + if (CV_Immutable(cvar)) + return; + if (( cvar->flags & CV_FLOAT )) { float n =FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2)); From ff0f6e9b74020bc587ba54906dbf1362362af577 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 12:35:10 -0700 Subject: [PATCH 066/108] Add CV_ALLOWLUA to a bunch of cvars These cvars can be modified by Lua. - advancemap - allowexitlevel - allowjoin - allowmlook - allowseenames - allowteamchange - autobalance - basenumlaps - cam2_adjust - cam2_centertoggle - cam2_curdist - cam2_curheight - cam2_dist - cam2_height - cam2_lockaimassist - cam2_lockedinput - cam2_orbit - cam2_rotate - cam2_rotspeed - cam2_shiftfacingchar - cam2_simpledist - cam2_simpleheight - cam2_speed - cam2_still - cam2_turnfacingability - cam2_turnfacingchar - cam2_turnfacinginput - cam2_turnfacingspindash - cam2_turnmultiplier - cam_adjust - cam_centertoggle - cam_curdist - cam_curheight - cam_dist - cam_height - cam_lockaimassist - cam_lockedinput - cam_orbit - cam_rotate - cam_rotspeed - cam_shiftfacingchar - cam_simpledist - cam_simpleheight - cam_speed - cam_still - cam_turnfacingability - cam_turnfacingchar - cam_turnfacinginput - cam_turnfacingspindash - cam_turnmultiplier - color - color2 - competitionboxes - cooplives - coopstarposts - countdowntime - exitmove - flagtime - forceskin - friendlyfire - gravity - hidetime - inttime - itemfinder - killingdead - matchboxes - maxplayers - mute - numlaps - overtime - pausepermission - playersforexit - pointlimit - powerstones - respawndelay - respawnitem - respawnitemtime - restrictskinchange - ringslinger - runscripts - scrambleonchange - seenames - servername - showhud - showinputjoy - skin - skin2 - specialrings - startinglives - tailspickup - teamscramble - timelimit - touchtag - tv_1up - tv_bombshield - tv_eggman - tv_forceshield - tv_invincibility - tv_jumpshield - tv_recycler - tv_ringshield - tv_superring - tv_supersneaker - tv_teleporter - tv_watershield --- src/d_clisrv.c | 4 +- src/d_netcmd.c | 108 ++++++++++++++++++++++++------------------------- src/g_game.c | 32 +++++++-------- src/mserv.c | 2 +- src/p_mobj.c | 6 +-- src/p_user.c | 52 ++++++++++++------------ src/r_main.c | 6 +-- 7 files changed, 105 insertions(+), 105 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 1ff053e5c..19e6bf0f7 100755 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3506,10 +3506,10 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) static CV_PossibleValue_t netticbuffer_cons_t[] = {{0, "MIN"}, {3, "MAX"}, {0, NULL}}; consvar_t cv_netticbuffer = CVAR_INIT ("netticbuffer", "1", CV_SAVE, netticbuffer_cons_t, NULL); -consvar_t cv_allownewplayer = CVAR_INIT ("allowjoin", "On", CV_SAVE|CV_NETVAR, CV_OnOff, NULL); +consvar_t cv_allownewplayer = CVAR_INIT ("allowjoin", "On", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL); consvar_t cv_joinnextround = CVAR_INIT ("joinnextround", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL); /// \todo not done static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}}; -consvar_t cv_maxplayers = CVAR_INIT ("maxplayers", "8", CV_SAVE|CV_NETVAR, maxplayers_cons_t, NULL); +consvar_t cv_maxplayers = CVAR_INIT ("maxplayers", "8", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, maxplayers_cons_t, NULL); static CV_PossibleValue_t joindelay_cons_t[] = {{1, "MIN"}, {3600, "MAX"}, {0, "Off"}, {0, NULL}}; consvar_t cv_joindelay = CVAR_INIT ("joindelay", "10", CV_SAVE|CV_NETVAR, joindelay_cons_t, NULL); static CV_PossibleValue_t rejointimeout_cons_t[] = {{1, "MIN"}, {60 * FRACUNIT, "MAX"}, {0, "Off"}, {0, NULL}}; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index f63f38a74..67099e848 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -203,37 +203,37 @@ static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Mystery"}, static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}}; static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}}; -consvar_t cv_showinputjoy = CVAR_INIT ("showinputjoy", "Off", 0, CV_OnOff, NULL); +consvar_t cv_showinputjoy = CVAR_INIT ("showinputjoy", "Off", CV_ALLOWLUA, CV_OnOff, NULL); #ifdef NETGAME_DEVMODE static consvar_t cv_fishcake = CVAR_INIT ("fishcake", "Off", CV_CALL|CV_NOSHOWHELP|CV_RESTRICT, CV_OnOff, Fishcake_OnChange); #endif static consvar_t cv_dummyconsvar = CVAR_INIT ("dummyconsvar", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff, DummyConsvar_OnChange); -consvar_t cv_restrictskinchange = CVAR_INIT ("restrictskinchange", "Yes", CV_SAVE|CV_NETVAR|CV_CHEAT, CV_YesNo, NULL); -consvar_t cv_allowteamchange = CVAR_INIT ("allowteamchange", "Yes", CV_SAVE|CV_NETVAR, CV_YesNo, NULL); +consvar_t cv_restrictskinchange = CVAR_INIT ("restrictskinchange", "Yes", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, CV_YesNo, NULL); +consvar_t cv_allowteamchange = CVAR_INIT ("allowteamchange", "Yes", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_YesNo, NULL); -consvar_t cv_startinglives = CVAR_INIT ("startinglives", "3", CV_SAVE|CV_NETVAR|CV_CHEAT, startingliveslimit_cons_t, NULL); +consvar_t cv_startinglives = CVAR_INIT ("startinglives", "3", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, startingliveslimit_cons_t, NULL); static CV_PossibleValue_t respawntime_cons_t[] = {{1, "MIN"}, {30, "MAX"}, {0, "Off"}, {0, NULL}}; -consvar_t cv_respawntime = CVAR_INIT ("respawndelay", "3", CV_SAVE|CV_NETVAR|CV_CHEAT, respawntime_cons_t, NULL); +consvar_t cv_respawntime = CVAR_INIT ("respawndelay", "3", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, respawntime_cons_t, NULL); -consvar_t cv_competitionboxes = CVAR_INIT ("competitionboxes", "Mystery", CV_SAVE|CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL); +consvar_t cv_competitionboxes = CVAR_INIT ("competitionboxes", "Mystery", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, competitionboxes_cons_t, NULL); static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}}; -consvar_t cv_seenames = CVAR_INIT ("seenames", "Ally/Foe", CV_SAVE, seenames_cons_t, 0); -consvar_t cv_allowseenames = CVAR_INIT ("allowseenames", "Yes", CV_SAVE|CV_NETVAR, CV_YesNo, NULL); +consvar_t cv_seenames = CVAR_INIT ("seenames", "Ally/Foe", CV_SAVE|CV_ALLOWLUA, seenames_cons_t, 0); +consvar_t cv_allowseenames = CVAR_INIT ("allowseenames", "Yes", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_YesNo, NULL); // names consvar_t cv_playername = CVAR_INIT ("name", "Sonic", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name_OnChange); consvar_t cv_playername2 = CVAR_INIT ("name2", "Tails", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name2_OnChange); // player colors UINT16 lastgoodcolor = SKINCOLOR_BLUE, lastgoodcolor2 = SKINCOLOR_BLUE; -consvar_t cv_playercolor = CVAR_INIT ("color", "Blue", CV_CALL|CV_NOINIT, Color_cons_t, Color_OnChange); -consvar_t cv_playercolor2 = CVAR_INIT ("color2", "Orange", CV_CALL|CV_NOINIT, Color_cons_t, Color2_OnChange); +consvar_t cv_playercolor = CVAR_INIT ("color", "Blue", CV_CALL|CV_NOINIT|CV_ALLOWLUA, Color_cons_t, Color_OnChange); +consvar_t cv_playercolor2 = CVAR_INIT ("color2", "Orange", CV_CALL|CV_NOINIT|CV_ALLOWLUA, Color_cons_t, Color2_OnChange); // player's skin, saved for commodity, when using a favorite skins wad.. -consvar_t cv_skin = CVAR_INIT ("skin", DEFAULTSKIN, CV_CALL|CV_NOINIT, NULL, Skin_OnChange); -consvar_t cv_skin2 = CVAR_INIT ("skin2", DEFAULTSKIN2, CV_CALL|CV_NOINIT, NULL, Skin2_OnChange); +consvar_t cv_skin = CVAR_INIT ("skin", DEFAULTSKIN, CV_CALL|CV_NOINIT|CV_ALLOWLUA, NULL, Skin_OnChange); +consvar_t cv_skin2 = CVAR_INIT ("skin2", DEFAULTSKIN2, CV_CALL|CV_NOINIT|CV_ALLOWLUA, NULL, Skin2_OnChange); // saved versions of the above six consvar_t cv_defaultplayercolor = CVAR_INIT ("defaultcolor", "Blue", CV_SAVE, Color_cons_t, NULL); @@ -268,43 +268,43 @@ consvar_t cv_mouse2opt = CVAR_INIT ("mouse2opt", "0", CV_SAVE, NULL, NULL); consvar_t cv_mouse2port = CVAR_INIT ("mouse2port", "COM2", CV_SAVE, mouse2port_cons_t, NULL); #endif -consvar_t cv_matchboxes = CVAR_INIT ("matchboxes", "Normal", CV_SAVE|CV_NETVAR|CV_CHEAT, matchboxes_cons_t, NULL); -consvar_t cv_specialrings = CVAR_INIT ("specialrings", "On", CV_SAVE|CV_NETVAR, CV_OnOff, NULL); -consvar_t cv_powerstones = CVAR_INIT ("powerstones", "On", CV_SAVE|CV_NETVAR, CV_OnOff, NULL); +consvar_t cv_matchboxes = CVAR_INIT ("matchboxes", "Normal", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, matchboxes_cons_t, NULL); +consvar_t cv_specialrings = CVAR_INIT ("specialrings", "On", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL); +consvar_t cv_powerstones = CVAR_INIT ("powerstones", "On", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL); -consvar_t cv_recycler = CVAR_INIT ("tv_recycler", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_teleporters = CVAR_INIT ("tv_teleporter", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_superring = CVAR_INIT ("tv_superring", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_supersneakers = CVAR_INIT ("tv_supersneaker", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_invincibility = CVAR_INIT ("tv_invincibility", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_jumpshield = CVAR_INIT ("tv_jumpshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_watershield = CVAR_INIT ("tv_watershield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_ringshield = CVAR_INIT ("tv_ringshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_forceshield = CVAR_INIT ("tv_forceshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_bombshield = CVAR_INIT ("tv_bombshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_1up = CVAR_INIT ("tv_1up", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); -consvar_t cv_eggmanbox = CVAR_INIT ("tv_eggman", "5", CV_SAVE|CV_NETVAR|CV_CHEAT, chances_cons_t, NULL); +consvar_t cv_recycler = CVAR_INIT ("tv_recycler", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_teleporters = CVAR_INIT ("tv_teleporter", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_superring = CVAR_INIT ("tv_superring", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_supersneakers = CVAR_INIT ("tv_supersneaker", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_invincibility = CVAR_INIT ("tv_invincibility", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_jumpshield = CVAR_INIT ("tv_jumpshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_watershield = CVAR_INIT ("tv_watershield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_ringshield = CVAR_INIT ("tv_ringshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_forceshield = CVAR_INIT ("tv_forceshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_bombshield = CVAR_INIT ("tv_bombshield", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_1up = CVAR_INIT ("tv_1up", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); +consvar_t cv_eggmanbox = CVAR_INIT ("tv_eggman", "5", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, chances_cons_t, NULL); -consvar_t cv_ringslinger = CVAR_INIT ("ringslinger", "No", CV_NETVAR|CV_NOSHOWHELP|CV_CALL|CV_CHEAT, CV_YesNo, Ringslinger_OnChange); -consvar_t cv_gravity = CVAR_INIT ("gravity", "0.5", CV_RESTRICT|CV_FLOAT|CV_CALL, NULL, Gravity_OnChange); +consvar_t cv_ringslinger = CVAR_INIT ("ringslinger", "No", CV_NETVAR|CV_NOSHOWHELP|CV_CALL|CV_CHEAT|CV_ALLOWLUA, CV_YesNo, Ringslinger_OnChange); +consvar_t cv_gravity = CVAR_INIT ("gravity", "0.5", CV_RESTRICT|CV_FLOAT|CV_CALL|CV_ALLOWLUA, NULL, Gravity_OnChange); consvar_t cv_soundtest = CVAR_INIT ("soundtest", "0", CV_CALL, NULL, SoundTest_OnChange); static CV_PossibleValue_t minitimelimit_cons_t[] = {{1, "MIN"}, {9999, "MAX"}, {0, NULL}}; -consvar_t cv_countdowntime = CVAR_INIT ("countdowntime", "60", CV_SAVE|CV_NETVAR|CV_CHEAT, minitimelimit_cons_t, NULL); +consvar_t cv_countdowntime = CVAR_INIT ("countdowntime", "60", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, minitimelimit_cons_t, NULL); -consvar_t cv_touchtag = CVAR_INIT ("touchtag", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL); -consvar_t cv_hidetime = CVAR_INIT ("hidetime", "30", CV_SAVE|CV_NETVAR|CV_CALL, minitimelimit_cons_t, Hidetime_OnChange); +consvar_t cv_touchtag = CVAR_INIT ("touchtag", "Off", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL); +consvar_t cv_hidetime = CVAR_INIT ("hidetime", "30", CV_SAVE|CV_NETVAR|CV_CALL|CV_ALLOWLUA, minitimelimit_cons_t, Hidetime_OnChange); -consvar_t cv_autobalance = CVAR_INIT ("autobalance", "Off", CV_SAVE|CV_NETVAR|CV_CALL, CV_OnOff, AutoBalance_OnChange); -consvar_t cv_teamscramble = CVAR_INIT ("teamscramble", "Off", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT, teamscramble_cons_t, TeamScramble_OnChange); -consvar_t cv_scrambleonchange = CVAR_INIT ("scrambleonchange", "Off", CV_SAVE|CV_NETVAR, teamscramble_cons_t, NULL); +consvar_t cv_autobalance = CVAR_INIT ("autobalance", "Off", CV_SAVE|CV_NETVAR|CV_CALL|CV_ALLOWLUA, CV_OnOff, AutoBalance_OnChange); +consvar_t cv_teamscramble = CVAR_INIT ("teamscramble", "Off", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, teamscramble_cons_t, TeamScramble_OnChange); +consvar_t cv_scrambleonchange = CVAR_INIT ("scrambleonchange", "Off", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, teamscramble_cons_t, NULL); -consvar_t cv_friendlyfire = CVAR_INIT ("friendlyfire", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL); -consvar_t cv_itemfinder = CVAR_INIT ("itemfinder", "Off", CV_CALL, CV_OnOff, ItemFinder_OnChange); +consvar_t cv_friendlyfire = CVAR_INIT ("friendlyfire", "Off", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL); +consvar_t cv_itemfinder = CVAR_INIT ("itemfinder", "Off", CV_CALL|CV_ALLOWLUA, CV_OnOff, ItemFinder_OnChange); // Scoring type options -consvar_t cv_overtime = CVAR_INIT ("overtime", "Yes", CV_SAVE|CV_NETVAR, CV_YesNo, NULL); +consvar_t cv_overtime = CVAR_INIT ("overtime", "Yes", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_YesNo, NULL); consvar_t cv_rollingdemos = CVAR_INIT ("rollingdemos", "On", CV_SAVE, CV_OnOff, NULL); @@ -315,13 +315,13 @@ static CV_PossibleValue_t powerupdisplay_cons_t[] = {{0, "Never"}, {1, "First-pe consvar_t cv_powerupdisplay = CVAR_INIT ("powerupdisplay", "First-person only", CV_SAVE, powerupdisplay_cons_t, NULL); static CV_PossibleValue_t pointlimit_cons_t[] = {{1, "MIN"}, {MAXSCORE, "MAX"}, {0, "None"}, {0, NULL}}; -consvar_t cv_pointlimit = CVAR_INIT ("pointlimit", "None", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT, pointlimit_cons_t, PointLimit_OnChange); +consvar_t cv_pointlimit = CVAR_INIT ("pointlimit", "None", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, pointlimit_cons_t, PointLimit_OnChange); static CV_PossibleValue_t timelimit_cons_t[] = {{1, "MIN"}, {30, "MAX"}, {0, "None"}, {0, NULL}}; -consvar_t cv_timelimit = CVAR_INIT ("timelimit", "None", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT, timelimit_cons_t, TimeLimit_OnChange); +consvar_t cv_timelimit = CVAR_INIT ("timelimit", "None", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, timelimit_cons_t, TimeLimit_OnChange); static CV_PossibleValue_t numlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, NULL}}; -consvar_t cv_numlaps = CVAR_INIT ("numlaps", "4", CV_NETVAR|CV_CALL|CV_NOINIT, numlaps_cons_t, NumLaps_OnChange); +consvar_t cv_numlaps = CVAR_INIT ("numlaps", "4", CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, numlaps_cons_t, NumLaps_OnChange); static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "Map default"}, {0, NULL}}; -consvar_t cv_basenumlaps = CVAR_INIT ("basenumlaps", "Map default", CV_SAVE|CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange); +consvar_t cv_basenumlaps = CVAR_INIT ("basenumlaps", "Map default", CV_SAVE|CV_NETVAR|CV_CALL|CV_CHEAT|CV_ALLOWLUA, basenumlaps_cons_t, BaseNumLaps_OnChange); // Point and time limits for every gametype INT32 pointlimits[NUMGAMETYPES]; @@ -330,11 +330,11 @@ INT32 timelimits[NUMGAMETYPES]; // log elemental hazards -- not a netvar, is local to current player consvar_t cv_hazardlog = CVAR_INIT ("hazardlog", "Yes", 0, CV_YesNo, NULL); -consvar_t cv_forceskin = CVAR_INIT ("forceskin", "None", CV_NETVAR|CV_CALL|CV_CHEAT, NULL, ForceSkin_OnChange); +consvar_t cv_forceskin = CVAR_INIT ("forceskin", "None", CV_NETVAR|CV_CALL|CV_CHEAT|CV_ALLOWLUA, NULL, ForceSkin_OnChange); consvar_t cv_downloading = CVAR_INIT ("downloading", "On", 0, CV_OnOff, NULL); -consvar_t cv_allowexitlevel = CVAR_INIT ("allowexitlevel", "No", CV_SAVE|CV_NETVAR, CV_YesNo, NULL); +consvar_t cv_allowexitlevel = CVAR_INIT ("allowexitlevel", "No", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_YesNo, NULL); -consvar_t cv_killingdead = CVAR_INIT ("killingdead", "Off", CV_NETVAR, CV_OnOff, NULL); +consvar_t cv_killingdead = CVAR_INIT ("killingdead", "Off", CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL); consvar_t cv_netstat = CVAR_INIT ("netstat", "Off", 0, CV_OnOff, NULL); // show bandwidth statistics static CV_PossibleValue_t nettimeout_cons_t[] = {{TICRATE/7, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}}; @@ -352,26 +352,26 @@ consvar_t cv_showping = CVAR_INIT ("showping", "Warning", CV_SAVE, showping_cons // Intermission time Tails 04-19-2002 static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}}; -consvar_t cv_inttime = CVAR_INIT ("inttime", "10", CV_SAVE|CV_NETVAR, inttime_cons_t, NULL); +consvar_t cv_inttime = CVAR_INIT ("inttime", "10", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, inttime_cons_t, NULL); static CV_PossibleValue_t coopstarposts_cons_t[] = {{0, "Per-player"}, {1, "Shared"}, {2, "Teamwork"}, {0, NULL}}; -consvar_t cv_coopstarposts = CVAR_INIT ("coopstarposts", "Per-player", CV_SAVE|CV_NETVAR|CV_CALL, coopstarposts_cons_t, CoopStarposts_OnChange); +consvar_t cv_coopstarposts = CVAR_INIT ("coopstarposts", "Per-player", CV_SAVE|CV_NETVAR|CV_CALL|CV_ALLOWLUA, coopstarposts_cons_t, CoopStarposts_OnChange); static CV_PossibleValue_t cooplives_cons_t[] = {{0, "Infinite"}, {1, "Per-player"}, {2, "Avoid Game Over"}, {3, "Single pool"}, {0, NULL}}; -consvar_t cv_cooplives = CVAR_INIT ("cooplives", "Avoid Game Over", CV_SAVE|CV_NETVAR|CV_CALL|CV_CHEAT, cooplives_cons_t, CoopLives_OnChange); +consvar_t cv_cooplives = CVAR_INIT ("cooplives", "Avoid Game Over", CV_SAVE|CV_NETVAR|CV_CALL|CV_CHEAT|CV_ALLOWLUA, cooplives_cons_t, CoopLives_OnChange); static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {0, NULL}}; -consvar_t cv_advancemap = CVAR_INIT ("advancemap", "Next", CV_SAVE|CV_NETVAR, advancemap_cons_t, NULL); +consvar_t cv_advancemap = CVAR_INIT ("advancemap", "Next", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, advancemap_cons_t, NULL); 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 = CVAR_INIT ("playersforexit", "All", CV_SAVE|CV_NETVAR, playersforexit_cons_t, NULL); +consvar_t cv_playersforexit = CVAR_INIT ("playersforexit", "All", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, playersforexit_cons_t, NULL); -consvar_t cv_exitmove = CVAR_INIT ("exitmove", "On", CV_SAVE|CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange); +consvar_t cv_exitmove = CVAR_INIT ("exitmove", "On", CV_SAVE|CV_NETVAR|CV_CALL|CV_ALLOWLUA, CV_OnOff, ExitMove_OnChange); -consvar_t cv_runscripts = CVAR_INIT ("runscripts", "Yes", 0, CV_YesNo, NULL); +consvar_t cv_runscripts = CVAR_INIT ("runscripts", "Yes", CV_ALLOWLUA, CV_YesNo, NULL); -consvar_t cv_pause = CVAR_INIT ("pausepermission", "Server", CV_SAVE|CV_NETVAR, pause_cons_t, NULL); -consvar_t cv_mute = CVAR_INIT ("mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange); +consvar_t cv_pause = CVAR_INIT ("pausepermission", "Server", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, pause_cons_t, NULL); +consvar_t cv_mute = CVAR_INIT ("mute", "Off", CV_NETVAR|CV_CALL|CV_ALLOWLUA, CV_OnOff, Mute_OnChange); consvar_t cv_sleep = CVAR_INIT ("cpusleep", "1", CV_SAVE, sleeping_cons_t, NULL); diff --git a/src/g_game.c b/src/g_game.c index 74bc42711..d9a043482 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -364,36 +364,36 @@ consvar_t cv_autobrake2 = CVAR_INIT ("autobrake2", "On", CV_SAVE|CV_CALL, CV_OnO // hi here's some new controls static CV_PossibleValue_t zerotoone_cons_t[] = {{0, "MIN"}, {FRACUNIT, "MAX"}, {0, NULL}}; consvar_t cv_cam_shiftfacing[2] = { - CVAR_INIT ("cam_shiftfacingchar", "0.375", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), - CVAR_INIT ("cam2_shiftfacingchar", "0.375", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), + CVAR_INIT ("cam_shiftfacingchar", "0.375", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), + CVAR_INIT ("cam2_shiftfacingchar", "0.375", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), }; consvar_t cv_cam_turnfacing[2] = { - CVAR_INIT ("cam_turnfacingchar", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), - CVAR_INIT ("cam2_turnfacingchar", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), + CVAR_INIT ("cam_turnfacingchar", "0.25", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), + CVAR_INIT ("cam2_turnfacingchar", "0.25", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), }; consvar_t cv_cam_turnfacingability[2] = { - CVAR_INIT ("cam_turnfacingability", "0.125", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), - CVAR_INIT ("cam2_turnfacingability", "0.125", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), + CVAR_INIT ("cam_turnfacingability", "0.125", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), + CVAR_INIT ("cam2_turnfacingability", "0.125", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), }; consvar_t cv_cam_turnfacingspindash[2] = { - CVAR_INIT ("cam_turnfacingspindash", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), - CVAR_INIT ("cam2_turnfacingspindash", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), + CVAR_INIT ("cam_turnfacingspindash", "0.25", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), + CVAR_INIT ("cam2_turnfacingspindash", "0.25", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), }; consvar_t cv_cam_turnfacinginput[2] = { - CVAR_INIT ("cam_turnfacinginput", "0.375", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), - CVAR_INIT ("cam2_turnfacinginput", "0.375", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL), + CVAR_INIT ("cam_turnfacinginput", "0.375", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), + CVAR_INIT ("cam2_turnfacinginput", "0.375", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, zerotoone_cons_t, NULL), }; static CV_PossibleValue_t centertoggle_cons_t[] = {{0, "Hold"}, {1, "Toggle"}, {2, "Sticky Hold"}, {0, NULL}}; consvar_t cv_cam_centertoggle[2] = { - CVAR_INIT ("cam_centertoggle", "Hold", CV_SAVE, centertoggle_cons_t, NULL), - CVAR_INIT ("cam2_centertoggle", "Hold", CV_SAVE, centertoggle_cons_t, NULL), + CVAR_INIT ("cam_centertoggle", "Hold", CV_SAVE|CV_ALLOWLUA, centertoggle_cons_t, NULL), + CVAR_INIT ("cam2_centertoggle", "Hold", CV_SAVE|CV_ALLOWLUA, centertoggle_cons_t, NULL), }; static CV_PossibleValue_t lockedinput_cons_t[] = {{0, "Strafe"}, {1, "Turn"}, {0, NULL}}; consvar_t cv_cam_lockedinput[2] = { - CVAR_INIT ("cam_lockedinput", "Strafe", CV_SAVE, lockedinput_cons_t, NULL), - CVAR_INIT ("cam2_lockedinput", "Strafe", CV_SAVE, lockedinput_cons_t, NULL), + CVAR_INIT ("cam_lockedinput", "Strafe", CV_SAVE|CV_ALLOWLUA, lockedinput_cons_t, NULL), + CVAR_INIT ("cam2_lockedinput", "Strafe", CV_SAVE|CV_ALLOWLUA, lockedinput_cons_t, NULL), }; static CV_PossibleValue_t lockedassist_cons_t[] = { @@ -405,8 +405,8 @@ static CV_PossibleValue_t lockedassist_cons_t[] = { {0, NULL} }; consvar_t cv_cam_lockonboss[2] = { - CVAR_INIT ("cam_lockaimassist", "Full", CV_SAVE, lockedassist_cons_t, NULL), - CVAR_INIT ("cam2_lockaimassist", "Full", CV_SAVE, lockedassist_cons_t, NULL), + CVAR_INIT ("cam_lockaimassist", "Full", CV_SAVE|CV_ALLOWLUA, lockedassist_cons_t, NULL), + CVAR_INIT ("cam2_lockaimassist", "Full", CV_SAVE|CV_ALLOWLUA, lockedassist_cons_t, NULL), }; consvar_t cv_moveaxis = CVAR_INIT ("joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL); diff --git a/src/mserv.c b/src/mserv.c index bff562c95..5e198c9fd 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -62,7 +62,7 @@ static CV_PossibleValue_t masterserver_update_rate_cons_t[] = { }; consvar_t cv_masterserver = CVAR_INIT ("masterserver", "https://mb.srb2.org/MS/0", CV_SAVE|CV_CALL, NULL, MasterServer_OnChange); -consvar_t cv_servername = CVAR_INIT ("servername", "SRB2 server", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT, NULL, Update_parameters); +consvar_t cv_servername = CVAR_INIT ("servername", "SRB2 server", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT|CV_ALLOWLUA, NULL, Update_parameters); consvar_t cv_masterserver_update_rate = CVAR_INIT ("masterserver_update_rate", "15", CV_SAVE|CV_CALL|CV_NOINIT, masterserver_update_rate_cons_t, Update_parameters); diff --git a/src/p_mobj.c b/src/p_mobj.c index 30e0183de..8646d13bf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11228,10 +11228,10 @@ void P_RemoveSavegameMobj(mobj_t *mobj) } static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}}; -consvar_t cv_itemrespawntime = CVAR_INIT ("respawnitemtime", "30", CV_SAVE|CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL); -consvar_t cv_itemrespawn = CVAR_INIT ("respawnitem", "On", CV_SAVE|CV_NETVAR, CV_OnOff, NULL); +consvar_t cv_itemrespawntime = CVAR_INIT ("respawnitemtime", "30", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, respawnitemtime_cons_t, NULL); +consvar_t cv_itemrespawn = CVAR_INIT ("respawnitem", "On", CV_SAVE|CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL); static CV_PossibleValue_t flagtime_cons_t[] = {{0, "MIN"}, {300, "MAX"}, {0, NULL}}; -consvar_t cv_flagtime = CVAR_INIT ("flagtime", "30", CV_SAVE|CV_NETVAR|CV_CHEAT, flagtime_cons_t, NULL); +consvar_t cv_flagtime = CVAR_INIT ("flagtime", "30", CV_SAVE|CV_NETVAR|CV_CHEAT|CV_ALLOWLUA, flagtime_cons_t, NULL); void P_SpawnPrecipitation(void) { diff --git a/src/p_user.c b/src/p_user.c index 60a0f5106..11f5efe10 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9647,45 +9647,45 @@ static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {25, "MAX"}, {0, NULL static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NULL}}; static CV_PossibleValue_t multiplier_cons_t[] = {{0, "MIN"}, {3*FRACUNIT, "MAX"}, {0, NULL}}; -consvar_t cv_cam_dist = CVAR_INIT ("cam_curdist", "160", CV_FLOAT, NULL, NULL); -consvar_t cv_cam_height = CVAR_INIT ("cam_curheight", "25", CV_FLOAT, NULL, NULL); -consvar_t cv_cam_still = CVAR_INIT ("cam_still", "Off", 0, CV_OnOff, NULL); -consvar_t cv_cam_speed = CVAR_INIT ("cam_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL); -consvar_t cv_cam_rotate = CVAR_INIT ("cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange); -consvar_t cv_cam_rotspeed = CVAR_INIT ("cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL); -consvar_t cv_cam_turnmultiplier = CVAR_INIT ("cam_turnmultiplier", "0.75", CV_FLOAT|CV_SAVE, multiplier_cons_t, NULL); -consvar_t cv_cam_orbit = CVAR_INIT ("cam_orbit", "Off", CV_SAVE, CV_OnOff, NULL); -consvar_t cv_cam_adjust = CVAR_INIT ("cam_adjust", "On", CV_SAVE, CV_OnOff, NULL); -consvar_t cv_cam2_dist = CVAR_INIT ("cam2_curdist", "160", CV_FLOAT, NULL, NULL); -consvar_t cv_cam2_height = CVAR_INIT ("cam2_curheight", "25", CV_FLOAT, NULL, NULL); -consvar_t cv_cam2_still = CVAR_INIT ("cam2_still", "Off", 0, CV_OnOff, NULL); -consvar_t cv_cam2_speed = CVAR_INIT ("cam2_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL); -consvar_t cv_cam2_rotate = CVAR_INIT ("cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange); -consvar_t cv_cam2_rotspeed = CVAR_INIT ("cam2_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL); -consvar_t cv_cam2_turnmultiplier = CVAR_INIT ("cam2_turnmultiplier", "0.75", CV_FLOAT|CV_SAVE, multiplier_cons_t, NULL); -consvar_t cv_cam2_orbit = CVAR_INIT ("cam2_orbit", "Off", CV_SAVE, CV_OnOff, NULL); -consvar_t cv_cam2_adjust = CVAR_INIT ("cam2_adjust", "On", CV_SAVE, CV_OnOff, NULL); +consvar_t cv_cam_dist = CVAR_INIT ("cam_curdist", "160", CV_FLOAT|CV_ALLOWLUA, NULL, NULL); +consvar_t cv_cam_height = CVAR_INIT ("cam_curheight", "25", CV_FLOAT|CV_ALLOWLUA, NULL, NULL); +consvar_t cv_cam_still = CVAR_INIT ("cam_still", "Off", CV_ALLOWLUA, CV_OnOff, NULL); +consvar_t cv_cam_speed = CVAR_INIT ("cam_speed", "0.3", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, CV_CamSpeed, NULL); +consvar_t cv_cam_rotate = CVAR_INIT ("cam_rotate", "0", CV_CALL|CV_NOINIT|CV_ALLOWLUA, CV_CamRotate, CV_CamRotate_OnChange); +consvar_t cv_cam_rotspeed = CVAR_INIT ("cam_rotspeed", "10", CV_SAVE|CV_ALLOWLUA, rotation_cons_t, NULL); +consvar_t cv_cam_turnmultiplier = CVAR_INIT ("cam_turnmultiplier", "0.75", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, multiplier_cons_t, NULL); +consvar_t cv_cam_orbit = CVAR_INIT ("cam_orbit", "Off", CV_SAVE|CV_ALLOWLUA, CV_OnOff, NULL); +consvar_t cv_cam_adjust = CVAR_INIT ("cam_adjust", "On", CV_SAVE|CV_ALLOWLUA, CV_OnOff, NULL); +consvar_t cv_cam2_dist = CVAR_INIT ("cam2_curdist", "160", CV_FLOAT|CV_ALLOWLUA, NULL, NULL); +consvar_t cv_cam2_height = CVAR_INIT ("cam2_curheight", "25", CV_FLOAT|CV_ALLOWLUA, NULL, NULL); +consvar_t cv_cam2_still = CVAR_INIT ("cam2_still", "Off", CV_ALLOWLUA, CV_OnOff, NULL); +consvar_t cv_cam2_speed = CVAR_INIT ("cam2_speed", "0.3", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, CV_CamSpeed, NULL); +consvar_t cv_cam2_rotate = CVAR_INIT ("cam2_rotate", "0", CV_CALL|CV_NOINIT|CV_ALLOWLUA, CV_CamRotate, CV_CamRotate2_OnChange); +consvar_t cv_cam2_rotspeed = CVAR_INIT ("cam2_rotspeed", "10", CV_SAVE|CV_ALLOWLUA, rotation_cons_t, NULL); +consvar_t cv_cam2_turnmultiplier = CVAR_INIT ("cam2_turnmultiplier", "0.75", CV_FLOAT|CV_SAVE|CV_ALLOWLUA, multiplier_cons_t, NULL); +consvar_t cv_cam2_orbit = CVAR_INIT ("cam2_orbit", "Off", CV_SAVE|CV_ALLOWLUA, CV_OnOff, NULL); +consvar_t cv_cam2_adjust = CVAR_INIT ("cam2_adjust", "On", CV_SAVE|CV_ALLOWLUA, CV_OnOff, NULL); // [standard vs simple][p1 or p2] consvar_t cv_cam_savedist[2][2] = { { // standard - CVAR_INIT ("cam_dist", "192", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist), - CVAR_INIT ("cam2_dist", "192", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist), + CVAR_INIT ("cam_dist", "192", CV_FLOAT|CV_SAVE|CV_CALL|CV_ALLOWLUA, NULL, CV_UpdateCamDist), + CVAR_INIT ("cam2_dist", "192", CV_FLOAT|CV_SAVE|CV_CALL|CV_ALLOWLUA, NULL, CV_UpdateCam2Dist), }, { // simple - CVAR_INIT ("cam_simpledist", "256", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist), - CVAR_INIT ("cam2_simpledist", "256", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist), + CVAR_INIT ("cam_simpledist", "256", CV_FLOAT|CV_SAVE|CV_CALL|CV_ALLOWLUA, NULL, CV_UpdateCamDist), + CVAR_INIT ("cam2_simpledist", "256", CV_FLOAT|CV_SAVE|CV_CALL|CV_ALLOWLUA, NULL, CV_UpdateCam2Dist), } }; consvar_t cv_cam_saveheight[2][2] = { { // standard - CVAR_INIT ("cam_height", "40", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist), - CVAR_INIT ("cam2_height", "40", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist), + CVAR_INIT ("cam_height", "40", CV_FLOAT|CV_SAVE|CV_CALL|CV_ALLOWLUA, NULL, CV_UpdateCamDist), + CVAR_INIT ("cam2_height", "40", CV_FLOAT|CV_SAVE|CV_CALL|CV_ALLOWLUA, NULL, CV_UpdateCam2Dist), }, { // simple - CVAR_INIT ("cam_simpleheight", "60", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist), - CVAR_INIT ("cam2_simpleheight", "60", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist), + CVAR_INIT ("cam_simpleheight", "60", CV_FLOAT|CV_SAVE|CV_CALL|CV_ALLOWLUA, NULL, CV_UpdateCamDist), + CVAR_INIT ("cam2_simpleheight", "60", CV_FLOAT|CV_SAVE|CV_CALL|CV_ALLOWLUA, NULL, CV_UpdateCam2Dist), } }; diff --git a/src/r_main.c b/src/r_main.c index 187925408..19477103f 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -149,7 +149,7 @@ static void FlipCam2_OnChange(void); void SendWeaponPref(void); void SendWeaponPref2(void); -consvar_t cv_tailspickup = CVAR_INIT ("tailspickup", "On", CV_NETVAR, CV_OnOff, NULL); +consvar_t cv_tailspickup = CVAR_INIT ("tailspickup", "On", CV_NETVAR|CV_ALLOWLUA, CV_OnOff, NULL); consvar_t cv_chasecam = CVAR_INIT ("chasecam", "On", CV_CALL, CV_OnOff, ChaseCam_OnChange); consvar_t cv_chasecam2 = CVAR_INIT ("chasecam2", "On", CV_CALL, CV_OnOff, ChaseCam2_OnChange); consvar_t cv_flipcam = CVAR_INIT ("flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange); @@ -158,8 +158,8 @@ consvar_t cv_flipcam2 = CVAR_INIT ("flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, consvar_t cv_shadow = CVAR_INIT ("shadow", "On", CV_SAVE, CV_OnOff, NULL); consvar_t cv_skybox = CVAR_INIT ("skybox", "On", CV_SAVE, CV_OnOff, NULL); consvar_t cv_ffloorclip = CVAR_INIT ("ffloorclip", "On", CV_SAVE, CV_OnOff, NULL); -consvar_t cv_allowmlook = CVAR_INIT ("allowmlook", "Yes", CV_NETVAR, CV_YesNo, NULL); -consvar_t cv_showhud = CVAR_INIT ("showhud", "Yes", CV_CALL, CV_YesNo, R_SetViewSize); +consvar_t cv_allowmlook = CVAR_INIT ("allowmlook", "Yes", CV_NETVAR|CV_ALLOWLUA, CV_YesNo, NULL); +consvar_t cv_showhud = CVAR_INIT ("showhud", "Yes", CV_CALL|CV_ALLOWLUA, CV_YesNo, R_SetViewSize); consvar_t cv_translucenthud = CVAR_INIT ("translucenthud", "10", CV_SAVE, translucenthud_cons_t, NULL); consvar_t cv_translucency = CVAR_INIT ("translucency", "On", CV_SAVE, CV_OnOff, NULL); From 0405df1a47aece4aa1b8c904cdd1d8b7f51ccf96 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 11:57:39 -0700 Subject: [PATCH 067/108] Merge COM_SAFE with other COM flags Renames COM_SAFE to COM_LUA. --- src/command.c | 10 +++++----- src/command.h | 20 +++++++++----------- src/lua_consolelib.c | 4 ++-- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/command.c b/src/command.c index 7ffa300b1..8659ce3a4 100644 --- a/src/command.c +++ b/src/command.c @@ -109,6 +109,7 @@ static cmdalias_t *com_alias; // aliases list // ========================================================================= static vsbuf_t com_text; // variable sized buffer +static com_flags_t com_flags = 0; /** Purges control characters out of some text. * @@ -141,7 +142,7 @@ COM_Purge (char *s, int *np) * \param ptext The text to add. * \sa COM_BufInsertTextEx */ -void COM_BufAddTextEx(const char *ptext, int flags) +void COM_BufAddTextEx(const char *ptext, com_flags_t flags) { int l; char *text; @@ -164,7 +165,7 @@ void COM_BufAddTextEx(const char *ptext, int flags) * \param ptext The text to execute. A newline is automatically added. * \sa COM_BufAddTextEx */ -void COM_BufInsertTextEx(const char *ptext, int flags) +void COM_BufInsertTextEx(const char *ptext, com_flags_t flags) { const INT32 old_wait = com_wait; @@ -320,7 +321,6 @@ static size_t com_argc; static char *com_argv[MAX_ARGS]; static const char *com_null_string = ""; static char *com_args = NULL; // current command args or NULL -static int com_flags; static void Got_NetVar(UINT8 **p, INT32 playernum); @@ -1124,7 +1124,7 @@ void VS_Write(vsbuf_t *buf, const void *data, size_t length) M_Memcpy(VS_GetSpace(buf, length), data, length); } -void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags) +void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, com_flags_t flags) { char *p; p = VS_GetSpace(buf, 2 + length); @@ -2472,7 +2472,7 @@ void CV_SaveVariables(FILE *f) static boolean CV_Immutable(const consvar_t *var) { // Currently operating from Lua - if (com_flags & COM_SAFE) + if (com_flags & COM_LUA) { if (!(var->flags & CV_ALLOWLUA)) { diff --git a/src/command.h b/src/command.h index 48827f99f..ea5d525a7 100644 --- a/src/command.h +++ b/src/command.h @@ -20,19 +20,17 @@ // Command buffer & command execution //=================================== -/* Lua command registration flags. */ -enum +/* Command registration flags. */ +typedef enum { COM_ADMIN = 1, COM_SPLITSCREEN = 2, COM_LOCAL = 4, -}; -/* Command buffer flags. */ -enum -{ - COM_SAFE = 1, -}; + // COM_BufInsertText etc: can only access cvars + // with CV_ALLOWLUA set. + COM_LUA = 8, +} com_flags_t; typedef void (*com_func_t)(void); @@ -53,11 +51,11 @@ const char *COM_CompleteAlias(const char *partial, INT32 skips); // insert at queu (at end of other command) #define COM_BufAddText(s) COM_BufAddTextEx(s, 0) -void COM_BufAddTextEx(const char *btext, int flags); +void COM_BufAddTextEx(const char *btext, com_flags_t flags); // insert in head (before other command) #define COM_BufInsertText(s) COM_BufInsertTextEx(s, 0) -void COM_BufInsertTextEx(const char *btext, int flags); +void COM_BufInsertTextEx(const char *btext, com_flags_t flags); // don't bother inserting, just do immediately void COM_ImmedExecute(const char *ptext); @@ -89,7 +87,7 @@ void VS_Free(vsbuf_t *buf); void VS_Clear(vsbuf_t *buf); void *VS_GetSpace(vsbuf_t *buf, size_t length); void VS_Write(vsbuf_t *buf, const void *data, size_t length); -void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags); +void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, com_flags_t flags); void VS_Print(vsbuf_t *buf, const char *data); // strcats onto the sizebuf //================== diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index f5e98e920..43dde280d 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -253,7 +253,7 @@ static int lib_comBufAddText(lua_State *L) plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); if (plr && plr != &players[consoleplayer]) return 0; - COM_BufAddTextEx(va("%s\n", luaL_checkstring(L, 2)), COM_SAFE); + COM_BufAddTextEx(va("%s\n", luaL_checkstring(L, 2)), COM_LUA); return 0; } @@ -269,7 +269,7 @@ static int lib_comBufInsertText(lua_State *L) plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); if (plr && plr != &players[consoleplayer]) return 0; - COM_BufInsertTextEx(va("%s\n", luaL_checkstring(L, 2)), COM_SAFE); + COM_BufInsertTextEx(va("%s\n", luaL_checkstring(L, 2)), COM_LUA); return 0; } From 8a6f2e568bf28a3732b631886fb04daf438ba2d8 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 15:53:40 -0700 Subject: [PATCH 068/108] Add a flags parameter to COM_AddCommand --- src/command.c | 25 ++++---- src/command.h | 2 +- src/console.c | 4 +- src/d_clisrv.c | 26 ++++----- src/d_netcmd.c | 146 +++++++++++++++++++++++----------------------- src/hu_stuff.c | 8 +-- src/m_menu.c | 2 +- src/mserv.c | 4 +- src/s_sound.c | 4 +- src/sdl/i_video.c | 8 +-- src/z_zone.c | 4 +- 11 files changed, 118 insertions(+), 115 deletions(-) diff --git a/src/command.c b/src/command.c index 8659ce3a4..3d3271ddb 100644 --- a/src/command.c +++ b/src/command.c @@ -312,6 +312,7 @@ typedef struct xcommand_s const char *name; struct xcommand_s *next; com_func_t function; + com_flags_t flags; } xcommand_t; static xcommand_t *com_commands = NULL; // current commands @@ -332,16 +333,16 @@ void COM_Init(void) VS_Alloc(&com_text, COM_BUF_SIZE); // add standard commands - COM_AddCommand("alias", COM_Alias_f); - COM_AddCommand("echo", COM_Echo_f); - COM_AddCommand("cecho", COM_CEcho_f); - COM_AddCommand("cechoflags", COM_CEchoFlags_f); - COM_AddCommand("cechoduration", COM_CEchoDuration_f); - COM_AddCommand("exec", COM_Exec_f); - COM_AddCommand("wait", COM_Wait_f); - COM_AddCommand("help", COM_Help_f); - COM_AddCommand("toggle", COM_Toggle_f); - COM_AddCommand("add", COM_Add_f); + COM_AddCommand("alias", COM_Alias_f, 0); + COM_AddCommand("echo", COM_Echo_f, 0); + COM_AddCommand("cecho", COM_CEcho_f, 0); + COM_AddCommand("cechoflags", COM_CEchoFlags_f, 0); + COM_AddCommand("cechoduration", COM_CEchoDuration_f, 0); + COM_AddCommand("exec", COM_Exec_f, 0); + COM_AddCommand("wait", COM_Wait_f, 0); + COM_AddCommand("help", COM_Help_f, 0); + COM_AddCommand("toggle", COM_Toggle_f, 0); + COM_AddCommand("add", COM_Add_f, 0); RegisterNetXCmd(XD_NETVAR, Got_NetVar); } @@ -480,7 +481,7 @@ static void COM_TokenizeString(char *ptext) * \param name Name of the command. * \param func Function called when the command is run. */ -void COM_AddCommand(const char *name, com_func_t func) +void COM_AddCommand(const char *name, com_func_t func, com_flags_t flags) { xcommand_t *cmd; @@ -510,6 +511,7 @@ void COM_AddCommand(const char *name, com_func_t func) cmd = ZZ_Alloc(sizeof *cmd); cmd->name = name; cmd->function = func; + cmd->flags = flags; cmd->next = com_commands; com_commands = cmd; } @@ -542,6 +544,7 @@ int COM_AddLuaCommand(const char *name) cmd = ZZ_Alloc(sizeof *cmd); cmd->name = name; cmd->function = COM_Lua_f; + cmd->flags = 0; cmd->next = com_commands; com_commands = cmd; return 0; diff --git a/src/command.h b/src/command.h index ea5d525a7..93adfd418 100644 --- a/src/command.h +++ b/src/command.h @@ -34,7 +34,7 @@ typedef enum typedef void (*com_func_t)(void); -void COM_AddCommand(const char *name, com_func_t func); +void COM_AddCommand(const char *name, com_func_t func, com_flags_t flags); int COM_AddLuaCommand(const char *name); size_t COM_Argc(void); diff --git a/src/console.c b/src/console.c index 40fb43121..9b464e31b 100644 --- a/src/console.c +++ b/src/console.c @@ -443,7 +443,7 @@ void CON_Init(void) // register our commands // - COM_AddCommand("cls", CONS_Clear_f); + COM_AddCommand("cls", CONS_Clear_f, 0); //COM_AddCommand("english", CONS_English_f); // set console full screen for game startup MAKE SURE VID_Init() done !!! Lock_state(); @@ -470,7 +470,7 @@ void CON_Init(void) CV_RegisterVar(&cons_height); CV_RegisterVar(&cons_backpic); CV_RegisterVar(&cons_backcolor); - COM_AddCommand("bind", CONS_Bind_f); + COM_AddCommand("bind", CONS_Bind_f, 0); } else { diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 19e6bf0f7..232b41bd0 100755 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3537,22 +3537,22 @@ void D_ClientServerInit(void) VERSION/100, VERSION%100, SUBVERSION)); #ifndef NONET - COM_AddCommand("getplayernum", Command_GetPlayerNum); - COM_AddCommand("kick", Command_Kick); - COM_AddCommand("ban", Command_Ban); - COM_AddCommand("banip", Command_BanIP); - COM_AddCommand("clearbans", Command_ClearBans); - COM_AddCommand("showbanlist", Command_ShowBan); - COM_AddCommand("reloadbans", Command_ReloadBan); - COM_AddCommand("connect", Command_connect); - COM_AddCommand("nodes", Command_Nodes); - COM_AddCommand("resendgamestate", Command_ResendGamestate); + COM_AddCommand("getplayernum", Command_GetPlayerNum, 0); + COM_AddCommand("kick", Command_Kick, 0); + COM_AddCommand("ban", Command_Ban, 0); + COM_AddCommand("banip", Command_BanIP, 0); + COM_AddCommand("clearbans", Command_ClearBans, 0); + COM_AddCommand("showbanlist", Command_ShowBan, 0); + COM_AddCommand("reloadbans", Command_ReloadBan, 0); + COM_AddCommand("connect", Command_connect, 0); + COM_AddCommand("nodes", Command_Nodes, 0); + COM_AddCommand("resendgamestate", Command_ResendGamestate, 0); #ifdef PACKETDROP - COM_AddCommand("drop", Command_Drop); - COM_AddCommand("droprate", Command_Droprate); + COM_AddCommand("drop", Command_Drop, 0); + COM_AddCommand("droprate", Command_Droprate, 0); #endif #ifdef _DEBUG - COM_AddCommand("numnodes", Command_Numnodes); + COM_AddCommand("numnodes", Command_Numnodes, 0); #endif #endif diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 67099e848..ef00ec431 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -464,57 +464,57 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_LUAFILE, Got_LuaFile); // Remote Administration - COM_AddCommand("password", Command_Changepassword_f); - COM_AddCommand("login", Command_Login_f); // useful in dedicated to kick off remote admin - COM_AddCommand("promote", Command_Verify_f); + COM_AddCommand("password", Command_Changepassword_f, 0); + COM_AddCommand("login", Command_Login_f, 0); // useful in dedicated to kick off remote admin + COM_AddCommand("promote", Command_Verify_f, 0); RegisterNetXCmd(XD_VERIFIED, Got_Verification); - COM_AddCommand("demote", Command_RemoveAdmin_f); + COM_AddCommand("demote", Command_RemoveAdmin_f, 0); RegisterNetXCmd(XD_DEMOTED, Got_Removal); - COM_AddCommand("motd", Command_MotD_f); + COM_AddCommand("motd", Command_MotD_f, 0); RegisterNetXCmd(XD_SETMOTD, Got_MotD_f); // For remote admin RegisterNetXCmd(XD_TEAMCHANGE, Got_Teamchange); - COM_AddCommand("serverchangeteam", Command_ServerTeamChange_f); + COM_AddCommand("serverchangeteam", Command_ServerTeamChange_f, 0); RegisterNetXCmd(XD_CLEARSCORES, Got_Clearscores); - COM_AddCommand("clearscores", Command_Clearscores_f); - COM_AddCommand("map", Command_Map_f); + COM_AddCommand("clearscores", Command_Clearscores_f, 0); + COM_AddCommand("map", Command_Map_f, 0); - COM_AddCommand("exitgame", Command_ExitGame_f); - COM_AddCommand("retry", Command_Retry_f); - COM_AddCommand("exitlevel", Command_ExitLevel_f); - COM_AddCommand("showmap", Command_Showmap_f); - COM_AddCommand("mapmd5", Command_Mapmd5_f); + COM_AddCommand("exitgame", Command_ExitGame_f, 0); + COM_AddCommand("retry", Command_Retry_f, 0); + COM_AddCommand("exitlevel", Command_ExitLevel_f, 0); + COM_AddCommand("showmap", Command_Showmap_f, 0); + COM_AddCommand("mapmd5", Command_Mapmd5_f, 0); - COM_AddCommand("addfolder", Command_Addfolder); - COM_AddCommand("addfile", Command_Addfile); - COM_AddCommand("listwad", Command_ListWADS_f); + COM_AddCommand("addfolder", Command_Addfolder, 0); + COM_AddCommand("addfile", Command_Addfile, 0); + COM_AddCommand("listwad", Command_ListWADS_f, 0); - COM_AddCommand("runsoc", Command_RunSOC); - COM_AddCommand("pause", Command_Pause); - COM_AddCommand("suicide", Command_Suicide); + COM_AddCommand("runsoc", Command_RunSOC, 0); + COM_AddCommand("pause", Command_Pause, 0); + COM_AddCommand("suicide", Command_Suicide, 0); - COM_AddCommand("gametype", Command_ShowGametype_f); - COM_AddCommand("version", Command_Version_f); + COM_AddCommand("gametype", Command_ShowGametype_f, 0); + COM_AddCommand("version", Command_Version_f, 0); #ifdef UPDATE_ALERT - COM_AddCommand("mod_details", Command_ModDetails_f); + COM_AddCommand("mod_details", Command_ModDetails_f, 0); #endif - COM_AddCommand("quit", Command_Quit_f); + COM_AddCommand("quit", Command_Quit_f, 0); - COM_AddCommand("saveconfig", Command_SaveConfig_f); - COM_AddCommand("loadconfig", Command_LoadConfig_f); - COM_AddCommand("changeconfig", Command_ChangeConfig_f); - COM_AddCommand("isgamemodified", Command_Isgamemodified_f); // test - COM_AddCommand("showscores", Command_ShowScores_f); - COM_AddCommand("showtime", Command_ShowTime_f); - COM_AddCommand("cheats", Command_Cheats_f); // test + COM_AddCommand("saveconfig", Command_SaveConfig_f, 0); + COM_AddCommand("loadconfig", Command_LoadConfig_f, 0); + COM_AddCommand("changeconfig", Command_ChangeConfig_f, 0); + COM_AddCommand("isgamemodified", Command_Isgamemodified_f, 0); // test + COM_AddCommand("showscores", Command_ShowScores_f, 0); + COM_AddCommand("showtime", Command_ShowTime_f, 0); + COM_AddCommand("cheats", Command_Cheats_f, 0); // test #ifdef _DEBUG - COM_AddCommand("togglemodified", Command_Togglemodified_f); - COM_AddCommand("archivetest", Command_Archivetest_f); + COM_AddCommand("togglemodified", Command_Togglemodified_f, 0); + COM_AddCommand("archivetest", Command_Archivetest_f, 0); #endif - COM_AddCommand("downloads", Command_Downloads_f); + COM_AddCommand("downloads", Command_Downloads_f, 0); // for master server connection AddMServCommands(); @@ -601,7 +601,7 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_blamecfail); #endif - COM_AddCommand("ping", Command_Ping_f); + COM_AddCommand("ping", Command_Ping_f, 0); CV_RegisterVar(&cv_nettimeout); CV_RegisterVar(&cv_jointimeout); @@ -645,25 +645,25 @@ void D_RegisterClientCommands(void) if (dedicated) return; - COM_AddCommand("numthinkers", Command_Numthinkers_f); - COM_AddCommand("countmobjs", Command_CountMobjs_f); + COM_AddCommand("numthinkers", Command_Numthinkers_f, 0); + COM_AddCommand("countmobjs", Command_CountMobjs_f, 0); - COM_AddCommand("changeteam", Command_Teamchange_f); - COM_AddCommand("changeteam2", Command_Teamchange2_f); + COM_AddCommand("changeteam", Command_Teamchange_f, 0); + COM_AddCommand("changeteam2", Command_Teamchange2_f, 0); - COM_AddCommand("playdemo", Command_Playdemo_f); - COM_AddCommand("timedemo", Command_Timedemo_f); - COM_AddCommand("stopdemo", Command_Stopdemo_f); - COM_AddCommand("playintro", Command_Playintro_f); + COM_AddCommand("playdemo", Command_Playdemo_f, 0); + COM_AddCommand("timedemo", Command_Timedemo_f, 0); + COM_AddCommand("stopdemo", Command_Stopdemo_f, 0); + COM_AddCommand("playintro", Command_Playintro_f, 0); - COM_AddCommand("resetcamera", Command_ResetCamera_f); + COM_AddCommand("resetcamera", Command_ResetCamera_f, 0); - COM_AddCommand("setcontrol", Command_Setcontrol_f); - COM_AddCommand("setcontrol2", Command_Setcontrol2_f); + COM_AddCommand("setcontrol", Command_Setcontrol_f, 0); + COM_AddCommand("setcontrol2", Command_Setcontrol2_f, 0); - COM_AddCommand("screenshot", M_ScreenShot); - COM_AddCommand("startmovie", Command_StartMovie_f); - COM_AddCommand("stopmovie", Command_StopMovie_f); + COM_AddCommand("screenshot", M_ScreenShot, 0); + COM_AddCommand("startmovie", Command_StartMovie_f, 0); + COM_AddCommand("stopmovie", Command_StopMovie_f, 0); CV_RegisterVar(&cv_screenshot_option); CV_RegisterVar(&cv_screenshot_folder); @@ -725,7 +725,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_ghost_last); CV_RegisterVar(&cv_ghost_guest); - COM_AddCommand("displayplayer", Command_Displayplayer_f); + COM_AddCommand("displayplayer", Command_Displayplayer_f, 0); // FIXME: not to be here.. but needs be done for config loading CV_RegisterVar(&cv_globalgamma); @@ -881,7 +881,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_ps_descriptor); // ingame object placing - COM_AddCommand("objectplace", Command_ObjectPlace_f); + COM_AddCommand("objectplace", Command_ObjectPlace_f, 0); //COM_AddCommand("writethings", Command_Writethings_f); CV_RegisterVar(&cv_speed); CV_RegisterVar(&cv_opflags); @@ -893,32 +893,32 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_freedemocamera); // add cheat commands - COM_AddCommand("noclip", Command_CheatNoClip_f); - COM_AddCommand("god", Command_CheatGod_f); - COM_AddCommand("notarget", Command_CheatNoTarget_f); - COM_AddCommand("getallemeralds", Command_Getallemeralds_f); - COM_AddCommand("resetemeralds", Command_Resetemeralds_f); - COM_AddCommand("setrings", Command_Setrings_f); - COM_AddCommand("setlives", Command_Setlives_f); - COM_AddCommand("setcontinues", Command_Setcontinues_f); - COM_AddCommand("devmode", Command_Devmode_f); - COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f); - COM_AddCommand("scale", Command_Scale_f); - COM_AddCommand("gravflip", Command_Gravflip_f); - COM_AddCommand("hurtme", Command_Hurtme_f); - COM_AddCommand("jumptoaxis", Command_JumpToAxis_f); - COM_AddCommand("charability", Command_Charability_f); - COM_AddCommand("charspeed", Command_Charspeed_f); - COM_AddCommand("teleport", Command_Teleport_f); - COM_AddCommand("rteleport", Command_RTeleport_f); - COM_AddCommand("skynum", Command_Skynum_f); - COM_AddCommand("weather", Command_Weather_f); - COM_AddCommand("toggletwod", Command_Toggletwod_f); + COM_AddCommand("noclip", Command_CheatNoClip_f, 0); + COM_AddCommand("god", Command_CheatGod_f, 0); + COM_AddCommand("notarget", Command_CheatNoTarget_f, 0); + COM_AddCommand("getallemeralds", Command_Getallemeralds_f, 0); + COM_AddCommand("resetemeralds", Command_Resetemeralds_f, 0); + COM_AddCommand("setrings", Command_Setrings_f, 0); + COM_AddCommand("setlives", Command_Setlives_f, 0); + COM_AddCommand("setcontinues", Command_Setcontinues_f, 0); + COM_AddCommand("devmode", Command_Devmode_f, 0); + COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f, 0); + COM_AddCommand("scale", Command_Scale_f, 0); + COM_AddCommand("gravflip", Command_Gravflip_f, 0); + COM_AddCommand("hurtme", Command_Hurtme_f, 0); + COM_AddCommand("jumptoaxis", Command_JumpToAxis_f, 0); + COM_AddCommand("charability", Command_Charability_f, 0); + COM_AddCommand("charspeed", Command_Charspeed_f, 0); + COM_AddCommand("teleport", Command_Teleport_f, 0); + COM_AddCommand("rteleport", Command_RTeleport_f, 0); + COM_AddCommand("skynum", Command_Skynum_f, 0); + COM_AddCommand("weather", Command_Weather_f, 0); + COM_AddCommand("toggletwod", Command_Toggletwod_f, 0); #ifdef _DEBUG - COM_AddCommand("causecfail", Command_CauseCfail_f); + COM_AddCommand("causecfail", Command_CauseCfail_f, 0); #endif #ifdef LUA_ALLOW_BYTECODE - COM_AddCommand("dumplua", Command_Dumplua_f); + COM_AddCommand("dumplua", Command_Dumplua_f, 0); #endif } diff --git a/src/hu_stuff.c b/src/hu_stuff.c index c037abcd7..2b1cbfcaf 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -328,10 +328,10 @@ void HU_LoadGraphics(void) void HU_Init(void) { #ifndef NONET - COM_AddCommand("say", Command_Say_f); - COM_AddCommand("sayto", Command_Sayto_f); - COM_AddCommand("sayteam", Command_Sayteam_f); - COM_AddCommand("csay", Command_CSay_f); + COM_AddCommand("say", Command_Say_f, 0); + COM_AddCommand("sayto", Command_Sayto_f, 0); + COM_AddCommand("sayteam", Command_Sayteam_f, 0); + COM_AddCommand("csay", Command_CSay_f, 0); RegisterNetXCmd(XD_SAY, Got_Saycmd); #endif diff --git a/src/m_menu.c b/src/m_menu.c index 82d078062..9ca21841b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3909,7 +3909,7 @@ void M_Init(void) { int i; - COM_AddCommand("manual", Command_Manual_f); + COM_AddCommand("manual", Command_Manual_f, 0); CV_RegisterVar(&cv_nextmap); CV_RegisterVar(&cv_newgametype); diff --git a/src/mserv.c b/src/mserv.c index 5e198c9fd..376774b23 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -97,8 +97,8 @@ void AddMServCommands(void) CV_RegisterVar(&cv_masterserver_token); CV_RegisterVar(&cv_servername); #ifdef MASTERSERVER - COM_AddCommand("listserv", Command_Listserv_f); - COM_AddCommand("masterserver_update", Update_parameters); // allows people to updates manually in case you were delisted by accident + COM_AddCommand("listserv", Command_Listserv_f, 0); + COM_AddCommand("masterserver_update", Update_parameters, 0); // allows people to updates manually in case you were delisted by accident #endif #endif } diff --git a/src/s_sound.c b/src/s_sound.c index f28a77a80..c230ea3c4 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -289,8 +289,8 @@ void S_RegisterSoundStuff(void) CV_RegisterVar(&cv_miditimiditypath); #endif - COM_AddCommand("tunes", Command_Tunes_f); - COM_AddCommand("restartaudio", Command_RestartAudio_f); + COM_AddCommand("tunes", Command_Tunes_f, 0); + COM_AddCommand("restartaudio", Command_RestartAudio_f, 0); } static void SetChannelsNum(void) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 02f0e462e..2ad97108c 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1784,10 +1784,10 @@ void I_StartupGraphics(void) if (graphics_started) return; - COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f); - COM_AddCommand ("vid_info", VID_Command_Info_f); - COM_AddCommand ("vid_modelist", VID_Command_ModeList_f); - COM_AddCommand ("vid_mode", VID_Command_Mode_f); + COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f, 0); + COM_AddCommand ("vid_info", VID_Command_Info_f, 0); + COM_AddCommand ("vid_modelist", VID_Command_ModeList_f, 0); + COM_AddCommand ("vid_mode", VID_Command_Mode_f, 0); CV_RegisterVar (&cv_vidwait); CV_RegisterVar (&cv_stretch); CV_RegisterVar (&cv_alwaysgrabmouse); diff --git a/src/z_zone.c b/src/z_zone.c index b949730e3..d0722b84c 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -116,10 +116,10 @@ void Z_Init(void) CONS_Printf("System memory: %uMB - Free: %uMB\n", total>>20, memfree); // Note: This allocates memory. Watch out. - COM_AddCommand("memfree", Command_Memfree_f); + COM_AddCommand("memfree", Command_Memfree_f, 0); #ifdef ZDEBUG - COM_AddCommand("memdump", Command_Memdump_f); + COM_AddCommand("memdump", Command_Memdump_f, 0); #endif } From 49f1462f751e9681ccf4cde44c18cc7040fb094d Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 16:32:28 -0700 Subject: [PATCH 069/108] Only let Lua run commands registered with COM_LUA --- src/command.c | 8 +++++++- src/command.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/command.c b/src/command.c index 3d3271ddb..c2926c473 100644 --- a/src/command.c +++ b/src/command.c @@ -544,7 +544,7 @@ int COM_AddLuaCommand(const char *name) cmd = ZZ_Alloc(sizeof *cmd); cmd->name = name; cmd->function = COM_Lua_f; - cmd->flags = 0; + cmd->flags = COM_LUA; cmd->next = com_commands; com_commands = cmd; return 0; @@ -640,6 +640,12 @@ static void COM_ExecuteString(char *ptext) { if (!stricmp(com_argv[0], cmd->name)) //case insensitive now that we have lower and uppercase! { + if ((com_flags & COM_LUA) && !(cmd->flags & COM_LUA)) + { + CONS_Alert(CONS_WARNING, "Command '%s' cannot be run from Lua.\n", cmd->name); + return; + } + cmd->function(); return; } diff --git a/src/command.h b/src/command.h index 93adfd418..55b5ed8c6 100644 --- a/src/command.h +++ b/src/command.h @@ -29,6 +29,8 @@ typedef enum // COM_BufInsertText etc: can only access cvars // with CV_ALLOWLUA set. + // COM_AddCommand: without this flag, the command + // CANNOT be run from Lua. COM_LUA = 8, } com_flags_t; From 07e4497320512d0fd6c14f32c2e04b0405bb0487 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 17:21:13 -0700 Subject: [PATCH 070/108] Add COM_LUA to a bunch of commands These commands be run from Lua: - add - addfile - addfolder - archivetest - ban - banip - causecfail - cecho - cechoduration - cechoflags - changeteam - changeteam2 - charability - charspeed - cheats - clearbans - clearscores - connect - countmobjs - csay - demote - devmode - displayplayer - downloads - drop - droprate - dumplua - echo - exitgame - exitlevel - gametype - getallemeralds - getplayernum - god - gravflip - help - hurtme - isgamemodified - jumptoaxis - kick - listwad - login - manual - map - mapmd5 - masterserver_update - memdump - memfree - mod_details - motd - noclip - nodes - notarget - numnodes - numthinkers - objectplace - password - pause - ping - playintro - promote - quit - reloadbans - resendgamestate - resetcamera - resetemeralds - restartaudio - retry - rteleport - runsoc - savecheckpoint - say - sayteam - sayto - scale - screenshot - serverchangeteam - setcontinues - setlives - setrings - showbanlist - showmap - showscores - showtime - skynum - startmovie - stopdemo - stopmovie - suicide - teleport - toggle - togglemodified - toggletwod - tunes - version - vid_info - vid_modelist - vid_nummodes - weather --- src/command.c | 14 ++--- src/d_clisrv.c | 26 ++++----- src/d_netcmd.c | 132 +++++++++++++++++++++++----------------------- src/hu_stuff.c | 8 +-- src/m_menu.c | 2 +- src/mserv.c | 2 +- src/s_sound.c | 4 +- src/sdl/i_video.c | 6 +-- src/z_zone.c | 4 +- 9 files changed, 99 insertions(+), 99 deletions(-) diff --git a/src/command.c b/src/command.c index c2926c473..bef6e2cdd 100644 --- a/src/command.c +++ b/src/command.c @@ -334,15 +334,15 @@ void COM_Init(void) // add standard commands COM_AddCommand("alias", COM_Alias_f, 0); - COM_AddCommand("echo", COM_Echo_f, 0); - COM_AddCommand("cecho", COM_CEcho_f, 0); - COM_AddCommand("cechoflags", COM_CEchoFlags_f, 0); - COM_AddCommand("cechoduration", COM_CEchoDuration_f, 0); + COM_AddCommand("echo", COM_Echo_f, COM_LUA); + COM_AddCommand("cecho", COM_CEcho_f, COM_LUA); + COM_AddCommand("cechoflags", COM_CEchoFlags_f, COM_LUA); + COM_AddCommand("cechoduration", COM_CEchoDuration_f, COM_LUA); COM_AddCommand("exec", COM_Exec_f, 0); COM_AddCommand("wait", COM_Wait_f, 0); - COM_AddCommand("help", COM_Help_f, 0); - COM_AddCommand("toggle", COM_Toggle_f, 0); - COM_AddCommand("add", COM_Add_f, 0); + COM_AddCommand("help", COM_Help_f, COM_LUA); + COM_AddCommand("toggle", COM_Toggle_f, COM_LUA); + COM_AddCommand("add", COM_Add_f, COM_LUA); RegisterNetXCmd(XD_NETVAR, Got_NetVar); } diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 232b41bd0..9740c7f22 100755 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3537,22 +3537,22 @@ void D_ClientServerInit(void) VERSION/100, VERSION%100, SUBVERSION)); #ifndef NONET - COM_AddCommand("getplayernum", Command_GetPlayerNum, 0); - COM_AddCommand("kick", Command_Kick, 0); - COM_AddCommand("ban", Command_Ban, 0); - COM_AddCommand("banip", Command_BanIP, 0); - COM_AddCommand("clearbans", Command_ClearBans, 0); - COM_AddCommand("showbanlist", Command_ShowBan, 0); - COM_AddCommand("reloadbans", Command_ReloadBan, 0); - COM_AddCommand("connect", Command_connect, 0); - COM_AddCommand("nodes", Command_Nodes, 0); - COM_AddCommand("resendgamestate", Command_ResendGamestate, 0); + COM_AddCommand("getplayernum", Command_GetPlayerNum, COM_LUA); + COM_AddCommand("kick", Command_Kick, COM_LUA); + COM_AddCommand("ban", Command_Ban, COM_LUA); + COM_AddCommand("banip", Command_BanIP, COM_LUA); + COM_AddCommand("clearbans", Command_ClearBans, COM_LUA); + COM_AddCommand("showbanlist", Command_ShowBan, COM_LUA); + COM_AddCommand("reloadbans", Command_ReloadBan, COM_LUA); + COM_AddCommand("connect", Command_connect, COM_LUA); + COM_AddCommand("nodes", Command_Nodes, COM_LUA); + COM_AddCommand("resendgamestate", Command_ResendGamestate, COM_LUA); #ifdef PACKETDROP - COM_AddCommand("drop", Command_Drop, 0); - COM_AddCommand("droprate", Command_Droprate, 0); + COM_AddCommand("drop", Command_Drop, COM_LUA); + COM_AddCommand("droprate", Command_Droprate, COM_LUA); #endif #ifdef _DEBUG - COM_AddCommand("numnodes", Command_Numnodes, 0); + COM_AddCommand("numnodes", Command_Numnodes, COM_LUA); #endif #endif diff --git a/src/d_netcmd.c b/src/d_netcmd.c index ef00ec431..676b6e7a0 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -464,57 +464,57 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_LUAFILE, Got_LuaFile); // Remote Administration - COM_AddCommand("password", Command_Changepassword_f, 0); - COM_AddCommand("login", Command_Login_f, 0); // useful in dedicated to kick off remote admin - COM_AddCommand("promote", Command_Verify_f, 0); + COM_AddCommand("password", Command_Changepassword_f, COM_LUA); + COM_AddCommand("login", Command_Login_f, COM_LUA); // useful in dedicated to kick off remote admin + COM_AddCommand("promote", Command_Verify_f, COM_LUA); RegisterNetXCmd(XD_VERIFIED, Got_Verification); - COM_AddCommand("demote", Command_RemoveAdmin_f, 0); + COM_AddCommand("demote", Command_RemoveAdmin_f, COM_LUA); RegisterNetXCmd(XD_DEMOTED, Got_Removal); - COM_AddCommand("motd", Command_MotD_f, 0); + COM_AddCommand("motd", Command_MotD_f, COM_LUA); RegisterNetXCmd(XD_SETMOTD, Got_MotD_f); // For remote admin RegisterNetXCmd(XD_TEAMCHANGE, Got_Teamchange); - COM_AddCommand("serverchangeteam", Command_ServerTeamChange_f, 0); + COM_AddCommand("serverchangeteam", Command_ServerTeamChange_f, COM_LUA); RegisterNetXCmd(XD_CLEARSCORES, Got_Clearscores); - COM_AddCommand("clearscores", Command_Clearscores_f, 0); - COM_AddCommand("map", Command_Map_f, 0); + COM_AddCommand("clearscores", Command_Clearscores_f, COM_LUA); + COM_AddCommand("map", Command_Map_f, COM_LUA); - COM_AddCommand("exitgame", Command_ExitGame_f, 0); - COM_AddCommand("retry", Command_Retry_f, 0); - COM_AddCommand("exitlevel", Command_ExitLevel_f, 0); - COM_AddCommand("showmap", Command_Showmap_f, 0); - COM_AddCommand("mapmd5", Command_Mapmd5_f, 0); + COM_AddCommand("exitgame", Command_ExitGame_f, COM_LUA); + COM_AddCommand("retry", Command_Retry_f, COM_LUA); + COM_AddCommand("exitlevel", Command_ExitLevel_f, COM_LUA); + COM_AddCommand("showmap", Command_Showmap_f, COM_LUA); + COM_AddCommand("mapmd5", Command_Mapmd5_f, COM_LUA); - COM_AddCommand("addfolder", Command_Addfolder, 0); - COM_AddCommand("addfile", Command_Addfile, 0); - COM_AddCommand("listwad", Command_ListWADS_f, 0); + COM_AddCommand("addfolder", Command_Addfolder, COM_LUA); + COM_AddCommand("addfile", Command_Addfile, COM_LUA); + COM_AddCommand("listwad", Command_ListWADS_f, COM_LUA); - COM_AddCommand("runsoc", Command_RunSOC, 0); - COM_AddCommand("pause", Command_Pause, 0); - COM_AddCommand("suicide", Command_Suicide, 0); + COM_AddCommand("runsoc", Command_RunSOC, COM_LUA); + COM_AddCommand("pause", Command_Pause, COM_LUA); + COM_AddCommand("suicide", Command_Suicide, COM_LUA); - COM_AddCommand("gametype", Command_ShowGametype_f, 0); - COM_AddCommand("version", Command_Version_f, 0); + COM_AddCommand("gametype", Command_ShowGametype_f, COM_LUA); + COM_AddCommand("version", Command_Version_f, COM_LUA); #ifdef UPDATE_ALERT - COM_AddCommand("mod_details", Command_ModDetails_f, 0); + COM_AddCommand("mod_details", Command_ModDetails_f, COM_LUA); #endif - COM_AddCommand("quit", Command_Quit_f, 0); + COM_AddCommand("quit", Command_Quit_f, COM_LUA); COM_AddCommand("saveconfig", Command_SaveConfig_f, 0); COM_AddCommand("loadconfig", Command_LoadConfig_f, 0); COM_AddCommand("changeconfig", Command_ChangeConfig_f, 0); - COM_AddCommand("isgamemodified", Command_Isgamemodified_f, 0); // test - COM_AddCommand("showscores", Command_ShowScores_f, 0); - COM_AddCommand("showtime", Command_ShowTime_f, 0); - COM_AddCommand("cheats", Command_Cheats_f, 0); // test + COM_AddCommand("isgamemodified", Command_Isgamemodified_f, COM_LUA); // test + COM_AddCommand("showscores", Command_ShowScores_f, COM_LUA); + COM_AddCommand("showtime", Command_ShowTime_f, COM_LUA); + COM_AddCommand("cheats", Command_Cheats_f, COM_LUA); // test #ifdef _DEBUG - COM_AddCommand("togglemodified", Command_Togglemodified_f, 0); - COM_AddCommand("archivetest", Command_Archivetest_f, 0); + COM_AddCommand("togglemodified", Command_Togglemodified_f, COM_LUA); + COM_AddCommand("archivetest", Command_Archivetest_f, COM_LUA); #endif - COM_AddCommand("downloads", Command_Downloads_f, 0); + COM_AddCommand("downloads", Command_Downloads_f, COM_LUA); // for master server connection AddMServCommands(); @@ -601,7 +601,7 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_blamecfail); #endif - COM_AddCommand("ping", Command_Ping_f, 0); + COM_AddCommand("ping", Command_Ping_f, COM_LUA); CV_RegisterVar(&cv_nettimeout); CV_RegisterVar(&cv_jointimeout); @@ -645,25 +645,25 @@ void D_RegisterClientCommands(void) if (dedicated) return; - COM_AddCommand("numthinkers", Command_Numthinkers_f, 0); - COM_AddCommand("countmobjs", Command_CountMobjs_f, 0); + COM_AddCommand("numthinkers", Command_Numthinkers_f, COM_LUA); + COM_AddCommand("countmobjs", Command_CountMobjs_f, COM_LUA); - COM_AddCommand("changeteam", Command_Teamchange_f, 0); - COM_AddCommand("changeteam2", Command_Teamchange2_f, 0); + COM_AddCommand("changeteam", Command_Teamchange_f, COM_LUA); + COM_AddCommand("changeteam2", Command_Teamchange2_f, COM_LUA); COM_AddCommand("playdemo", Command_Playdemo_f, 0); COM_AddCommand("timedemo", Command_Timedemo_f, 0); - COM_AddCommand("stopdemo", Command_Stopdemo_f, 0); - COM_AddCommand("playintro", Command_Playintro_f, 0); + COM_AddCommand("stopdemo", Command_Stopdemo_f, COM_LUA); + COM_AddCommand("playintro", Command_Playintro_f, COM_LUA); - COM_AddCommand("resetcamera", Command_ResetCamera_f, 0); + COM_AddCommand("resetcamera", Command_ResetCamera_f, COM_LUA); COM_AddCommand("setcontrol", Command_Setcontrol_f, 0); COM_AddCommand("setcontrol2", Command_Setcontrol2_f, 0); - COM_AddCommand("screenshot", M_ScreenShot, 0); - COM_AddCommand("startmovie", Command_StartMovie_f, 0); - COM_AddCommand("stopmovie", Command_StopMovie_f, 0); + COM_AddCommand("screenshot", M_ScreenShot, COM_LUA); + COM_AddCommand("startmovie", Command_StartMovie_f, COM_LUA); + COM_AddCommand("stopmovie", Command_StopMovie_f, COM_LUA); CV_RegisterVar(&cv_screenshot_option); CV_RegisterVar(&cv_screenshot_folder); @@ -725,7 +725,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_ghost_last); CV_RegisterVar(&cv_ghost_guest); - COM_AddCommand("displayplayer", Command_Displayplayer_f, 0); + COM_AddCommand("displayplayer", Command_Displayplayer_f, COM_LUA); // FIXME: not to be here.. but needs be done for config loading CV_RegisterVar(&cv_globalgamma); @@ -881,7 +881,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_ps_descriptor); // ingame object placing - COM_AddCommand("objectplace", Command_ObjectPlace_f, 0); + COM_AddCommand("objectplace", Command_ObjectPlace_f, COM_LUA); //COM_AddCommand("writethings", Command_Writethings_f); CV_RegisterVar(&cv_speed); CV_RegisterVar(&cv_opflags); @@ -893,32 +893,32 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_freedemocamera); // add cheat commands - COM_AddCommand("noclip", Command_CheatNoClip_f, 0); - COM_AddCommand("god", Command_CheatGod_f, 0); - COM_AddCommand("notarget", Command_CheatNoTarget_f, 0); - COM_AddCommand("getallemeralds", Command_Getallemeralds_f, 0); - COM_AddCommand("resetemeralds", Command_Resetemeralds_f, 0); - COM_AddCommand("setrings", Command_Setrings_f, 0); - COM_AddCommand("setlives", Command_Setlives_f, 0); - COM_AddCommand("setcontinues", Command_Setcontinues_f, 0); - COM_AddCommand("devmode", Command_Devmode_f, 0); - COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f, 0); - COM_AddCommand("scale", Command_Scale_f, 0); - COM_AddCommand("gravflip", Command_Gravflip_f, 0); - COM_AddCommand("hurtme", Command_Hurtme_f, 0); - COM_AddCommand("jumptoaxis", Command_JumpToAxis_f, 0); - COM_AddCommand("charability", Command_Charability_f, 0); - COM_AddCommand("charspeed", Command_Charspeed_f, 0); - COM_AddCommand("teleport", Command_Teleport_f, 0); - COM_AddCommand("rteleport", Command_RTeleport_f, 0); - COM_AddCommand("skynum", Command_Skynum_f, 0); - COM_AddCommand("weather", Command_Weather_f, 0); - COM_AddCommand("toggletwod", Command_Toggletwod_f, 0); + COM_AddCommand("noclip", Command_CheatNoClip_f, COM_LUA); + COM_AddCommand("god", Command_CheatGod_f, COM_LUA); + COM_AddCommand("notarget", Command_CheatNoTarget_f, COM_LUA); + COM_AddCommand("getallemeralds", Command_Getallemeralds_f, COM_LUA); + COM_AddCommand("resetemeralds", Command_Resetemeralds_f, COM_LUA); + COM_AddCommand("setrings", Command_Setrings_f, COM_LUA); + COM_AddCommand("setlives", Command_Setlives_f, COM_LUA); + COM_AddCommand("setcontinues", Command_Setcontinues_f, COM_LUA); + COM_AddCommand("devmode", Command_Devmode_f, COM_LUA); + COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f, COM_LUA); + COM_AddCommand("scale", Command_Scale_f, COM_LUA); + COM_AddCommand("gravflip", Command_Gravflip_f, COM_LUA); + COM_AddCommand("hurtme", Command_Hurtme_f, COM_LUA); + COM_AddCommand("jumptoaxis", Command_JumpToAxis_f, COM_LUA); + COM_AddCommand("charability", Command_Charability_f, COM_LUA); + COM_AddCommand("charspeed", Command_Charspeed_f, COM_LUA); + COM_AddCommand("teleport", Command_Teleport_f, COM_LUA); + COM_AddCommand("rteleport", Command_RTeleport_f, COM_LUA); + COM_AddCommand("skynum", Command_Skynum_f, COM_LUA); + COM_AddCommand("weather", Command_Weather_f, COM_LUA); + COM_AddCommand("toggletwod", Command_Toggletwod_f, COM_LUA); #ifdef _DEBUG - COM_AddCommand("causecfail", Command_CauseCfail_f, 0); + COM_AddCommand("causecfail", Command_CauseCfail_f, COM_LUA); #endif #ifdef LUA_ALLOW_BYTECODE - COM_AddCommand("dumplua", Command_Dumplua_f, 0); + COM_AddCommand("dumplua", Command_Dumplua_f, COM_LUA); #endif } diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 2b1cbfcaf..9322770fa 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -328,10 +328,10 @@ void HU_LoadGraphics(void) void HU_Init(void) { #ifndef NONET - COM_AddCommand("say", Command_Say_f, 0); - COM_AddCommand("sayto", Command_Sayto_f, 0); - COM_AddCommand("sayteam", Command_Sayteam_f, 0); - COM_AddCommand("csay", Command_CSay_f, 0); + COM_AddCommand("say", Command_Say_f, COM_LUA); + COM_AddCommand("sayto", Command_Sayto_f, COM_LUA); + COM_AddCommand("sayteam", Command_Sayteam_f, COM_LUA); + COM_AddCommand("csay", Command_CSay_f, COM_LUA); RegisterNetXCmd(XD_SAY, Got_Saycmd); #endif diff --git a/src/m_menu.c b/src/m_menu.c index 9ca21841b..82d21bc55 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3909,7 +3909,7 @@ void M_Init(void) { int i; - COM_AddCommand("manual", Command_Manual_f, 0); + COM_AddCommand("manual", Command_Manual_f, COM_LUA); CV_RegisterVar(&cv_nextmap); CV_RegisterVar(&cv_newgametype); diff --git a/src/mserv.c b/src/mserv.c index 376774b23..64632016e 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -98,7 +98,7 @@ void AddMServCommands(void) CV_RegisterVar(&cv_servername); #ifdef MASTERSERVER COM_AddCommand("listserv", Command_Listserv_f, 0); - COM_AddCommand("masterserver_update", Update_parameters, 0); // allows people to updates manually in case you were delisted by accident + COM_AddCommand("masterserver_update", Update_parameters, COM_LUA); // allows people to updates manually in case you were delisted by accident #endif #endif } diff --git a/src/s_sound.c b/src/s_sound.c index c230ea3c4..c3e5626fa 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -289,8 +289,8 @@ void S_RegisterSoundStuff(void) CV_RegisterVar(&cv_miditimiditypath); #endif - COM_AddCommand("tunes", Command_Tunes_f, 0); - COM_AddCommand("restartaudio", Command_RestartAudio_f, 0); + COM_AddCommand("tunes", Command_Tunes_f, COM_LUA); + COM_AddCommand("restartaudio", Command_RestartAudio_f, COM_LUA); } static void SetChannelsNum(void) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 2ad97108c..57c6e48e9 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1784,9 +1784,9 @@ void I_StartupGraphics(void) if (graphics_started) return; - COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f, 0); - COM_AddCommand ("vid_info", VID_Command_Info_f, 0); - COM_AddCommand ("vid_modelist", VID_Command_ModeList_f, 0); + COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f, COM_LUA); + COM_AddCommand ("vid_info", VID_Command_Info_f, COM_LUA); + COM_AddCommand ("vid_modelist", VID_Command_ModeList_f, COM_LUA); COM_AddCommand ("vid_mode", VID_Command_Mode_f, 0); CV_RegisterVar (&cv_vidwait); CV_RegisterVar (&cv_stretch); diff --git a/src/z_zone.c b/src/z_zone.c index d0722b84c..6ffe9aedd 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -116,10 +116,10 @@ void Z_Init(void) CONS_Printf("System memory: %uMB - Free: %uMB\n", total>>20, memfree); // Note: This allocates memory. Watch out. - COM_AddCommand("memfree", Command_Memfree_f, 0); + COM_AddCommand("memfree", Command_Memfree_f, COM_LUA); #ifdef ZDEBUG - COM_AddCommand("memdump", Command_Memdump_f, 0); + COM_AddCommand("memdump", Command_Memdump_f, COM_LUA); #endif } From 62aef145f5c8f922b7a730eaf9227c0119b10f2f Mon Sep 17 00:00:00 2001 From: LJ Sonic Date: Sun, 19 Mar 2023 14:44:18 +0100 Subject: [PATCH 071/108] Fix time functions not starting from zero --- src/i_time.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/i_time.c b/src/i_time.c index c1cc9dfd4..b302c6025 100644 --- a/src/i_time.c +++ b/src/i_time.c @@ -43,18 +43,20 @@ tic_t I_GetTime(void) void I_InitializeTime(void) { - g_time.time = 0; - g_time.timefrac = 0; - - enterprecise = 0; - oldenterprecise = 0; - tictimer = 0.0; - CV_RegisterVar(&cv_timescale); // I_StartupTimer is preserved for potential subsystems that need to setup // timing information for I_GetPreciseTime and sleeping I_StartupTimer(); + + g_time.time = 0; + g_time.timefrac = 0; + + enterprecise = I_GetPreciseTime(); + oldenterprecise = enterprecise; + entertic = 0; + oldentertics = 0; + tictimer = 0.0; } void I_UpdateTime(fixed_t timescale) From 0f9c5582a397c531d421ebcc24abb7df969fae6b Mon Sep 17 00:00:00 2001 From: LJ Sonic Date: Sun, 19 Mar 2023 14:52:12 +0100 Subject: [PATCH 072/108] Add basic rate limitation for Lua file access --- src/blua/liolib.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index e029650c0..545f9c144 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -24,12 +24,14 @@ #include "../byteptr.h" #include "../lua_script.h" #include "../m_misc.h" +#include "../i_time.h" #define IO_INPUT 1 #define IO_OUTPUT 2 -#define FILELIMIT (1024 * 1024) // Size limit for reading/writing files +#define MAXBYTESPERMINUTE (10 * 1024 * 1024) // Rate limit for writing files +#define MAXOPENSPERMINUTE 50 // Rate limit for opening new files #define FMT_FILECALLBACKID "file_callback_%d" @@ -46,6 +48,10 @@ static const char *whitelist[] = { }; +static INT64 numwrittenbytes = 0; +static INT64 numopenedfiles = 0; + + static int pushresult (lua_State *L, int i, const char *filename) { int en = errno; /* calls to Lua API may change this value */ if (i) { @@ -252,6 +258,17 @@ static int io_openlocal (lua_State *L) { "Files can't be opened while being downloaded\n", filename); + // Reading not restricted + if (client && (strchr(mode, 'w') || strchr(mode, 'a') || strchr(mode, '+'))) + { + if (numopenedfiles >= (I_GetTime() / (60*TICRATE) + 1) * MAXOPENSPERMINUTE) + I_Error("Access denied to %s\n" + "File opening rate exceeded\n", + filename); + + numopenedfiles++; + } + MakePathDirs(realfilename); // Open and return the file @@ -527,9 +544,12 @@ static int g_write (lua_State *L, FILE *f, int arg) { else { size_t l; const char *s = luaL_checklstring(L, arg, &l); - if (ftell(f) + l > FILELIMIT) { - luaL_error(L,"write limit bypassed in file. Changes have been discarded."); - break; + if (client) { + if (numwrittenbytes + l > (I_GetTime() / (60*TICRATE) + 1) * MAXBYTESPERMINUTE) { + luaL_error(L,"file write rate limit exceeded; changes have been discarded"); + break; + } + numwrittenbytes += l; } status = status && (fwrite(s, sizeof(char), l, f) == l); } From 540c5d6cc0271a255a89566f06247f034d0978d1 Mon Sep 17 00:00:00 2001 From: spherallic Date: Mon, 20 Mar 2023 15:46:15 +0100 Subject: [PATCH 073/108] Add flag to action 433 to force MFE_VERTICALFLIP --- extras/conf/SRB2-22.cfg | 1 + extras/conf/udb/Includes/SRB222_linedefs.cfg | 10 ++++++++++ src/p_setup.c | 1 + src/p_spec.c | 2 ++ 4 files changed, 14 insertions(+) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 952ce6969..ae905b637 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -2341,6 +2341,7 @@ linedeftypes { title = "Enable/Disable Gravity Flip"; prefix = "(433)"; + flags2text = "[1] Force MFE_VERTICALFLIP"; flags8text = "[3] Set delay by backside sector"; flags32text = "[5] Invert current gravity"; flags64text = "[6] Return to normal"; diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index 99c305659..3a3bd80cc 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -4223,6 +4223,16 @@ udmf 1 = "Yes"; } } + arg2 + { + title = "Force MFE_VERTICALFLIP"; + type = 11; + enum + { + 0 = "No"; + 1 = "Yes"; + } + } } 434 diff --git a/src/p_setup.c b/src/p_setup.c index d6cda7d4f..dc1111531 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -5299,6 +5299,7 @@ static void P_ConvertBinaryLinedefTypes(void) case 433: //Enable/disable gravity flip lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB); lines[i].args[1] = !!(lines[i].flags & ML_SKEWTD); + lines[i].args[2] = !!(lines[i].flags & ML_BLOCKMONSTERS); break; case 434: //Award power-up if (sides[lines[i].sidenum[0]].text) diff --git a/src/p_spec.c b/src/p_spec.c index 4e6ef531f..6f798421a 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2786,6 +2786,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) mo->flags2 &= ~MF2_OBJECTFLIP; else mo->flags2 |= MF2_OBJECTFLIP; + if (line->args[2]) + mo->eflags |= MFE_VERTICALFLIP; if (bot) bot->flags2 = (bot->flags2 & ~MF2_OBJECTFLIP) | (mo->flags2 & MF2_OBJECTFLIP); break; From 498c9da85943886fda0538e1689fc66dbfebe64d Mon Sep 17 00:00:00 2001 From: spherallic Date: Wed, 29 Mar 2023 16:41:45 +0200 Subject: [PATCH 074/108] Don't attract bomb spheres with Attraction shield --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 30e0183de..f5a951d65 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9686,7 +9686,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) P_RingThinker(mobj); if (mobj->flags2 & MF2_NIGHTSPULL) P_NightsItemChase(mobj); - else + else if (mobj->type != MT_BOMBSPHERE) // prevent shields from attracting bomb spheres A_AttractChase(mobj); return false; // Flung items From 91ef59f76b19f72eaf134a3274e96d14314aa31f Mon Sep 17 00:00:00 2001 From: spherallic Date: Fri, 31 Mar 2023 13:36:54 +0200 Subject: [PATCH 075/108] Fix tiny regression with special stage tally --- src/y_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index 7faceff50..1e070260e 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1139,7 +1139,7 @@ void Y_Ticker(void) data.spec.emeraldmomy = 20; data.spec.emeraldy = -40; } - else + else if (P_GetNextEmerald() < 7) { if (!stagefailed) { From 1470d099e338aff3aad25178894e15bb6d1e8232 Mon Sep 17 00:00:00 2001 From: spherallic Date: Fri, 31 Mar 2023 14:53:31 +0200 Subject: [PATCH 076/108] Update copyright year & credits --- assets/README.txt | 2 +- src/Makefile | 4 ++-- 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 | 4 ++-- 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/deh_lua.c | 2 +- src/deh_lua.h | 2 +- src/deh_soc.c | 2 +- src/deh_soc.h | 2 +- src/deh_tables.c | 2 +- src/deh_tables.h | 2 +- src/dehacked.c | 2 +- src/dehacked.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 | 4 ++-- src/f_finale.h | 2 +- src/f_wipe.c | 2 +- src/g_demo.c | 2 +- src/g_demo.h | 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/hw_batching.c | 2 +- src/hardware/hw_batching.h | 2 +- src/hardware/hw_cache.c | 2 +- src/hardware/hw_data.h | 2 +- src/hardware/hw_defs.h | 2 +- src/hardware/hw_draw.c | 2 +- src/hardware/hw_drv.h | 2 +- src/hardware/hw_glob.h | 2 +- src/hardware/hw_light.c | 2 +- src/hardware/hw_light.h | 2 +- src/hardware/hw_main.c | 2 +- src/hardware/hw_main.h | 2 +- src/hardware/hw_md2.c | 2 +- src/hardware/hw_md2.h | 2 +- src/hardware/r_opengl/r_opengl.c | 2 +- src/http-mserv.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_threads.h | 2 +- src/i_time.c | 2 +- src/i_time.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 | 4 ++-- 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_hudlib_drawlist.c | 2 +- src/lua_hudlib_drawlist.h | 2 +- src/lua_infolib.c | 2 +- src/lua_inputlib.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_polyobjlib.c | 4 ++-- src/lua_script.c | 2 +- src/lua_script.h | 2 +- src/lua_skinlib.c | 2 +- src/lua_taglib.c | 4 ++-- 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_easing.c | 2 +- src/m_easing.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_perfstats.c | 2 +- src/m_perfstats.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 | 4 ++-- src/mserv.h | 4 ++-- 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 | 2 +- src/r_patchrotation.c | 2 +- src/r_patchrotation.h | 2 +- src/r_picformats.c | 4 ++-- src/r_picformats.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_skins.c | 2 +- src/r_skins.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_textures.c | 2 +- src/r_textures.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_threads.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 | 2 +- src/tables.c | 2 +- src/tables.h | 2 +- src/taglist.c | 4 ++-- src/taglist.h | 4 ++-- 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 +- 236 files changed, 249 insertions(+), 249 deletions(-) diff --git a/assets/README.txt b/assets/README.txt index 5480cb7b0..e384333ed 100644 --- a/assets/README.txt +++ b/assets/README.txt @@ -39,7 +39,7 @@ https://facebook.com/SonicRoboBlast2 COPYRIGHT AND DISCLAIMER -Design and content in Sonic Robo Blast 2 is copyright 1998-2022 by Sonic Team Jr. +Design and content in Sonic Robo Blast 2 is copyright 1998-2023 by Sonic Team Jr. All original material in this game is copyrighted by their respective owners, and no copyright infringement is intended. Sonic Team Jr. is in no way affiliated with SEGA or Sonic Team, and we do not claim ownership of any of SEGA's intellectual property used in SRB2. diff --git a/src/Makefile b/src/Makefile index 7571c8089..36b1a7efa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,8 +2,8 @@ # the poly3 Makefile adapted over and over... # # Copyright 1998-2000 DooM Legacy Team. -# Copyright 2020-2022 James R. -# Copyright 2003-2022 Sonic Team Junior. +# Copyright 2020-2023 James R. +# Copyright 2003-2023 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 65a57c09e..331d1a5e0 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 89c4ad9fa..a202bece1 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 f4c08d979..11d3ab9f5 100644 --- a/src/apng.c +++ b/src/apng.c @@ -1,5 +1,5 @@ /* -Copyright 2019-2022, James R. +Copyright 2019-2023, 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 6b9347424..ed30549e2 100644 --- a/src/apng.h +++ b/src/apng.h @@ -1,5 +1,5 @@ /* -Copyright 2019-2022, James R. +Copyright 2019-2023, 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 a8c60f19e..48f8da0d8 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 2774337cc..d1465f891 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-2022 by Sonic Team Junior. +// Copyright (C) 2011-2023 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -118,7 +118,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd) return; } - // Adapted from CobaltBW's tails_AI.wad + // Adapted from clairebun's tails_AI.wad // Check water if (water) diff --git a/src/b_bot.h b/src/b_bot.h index c29974c50..bbe0829be 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 3aa2aa508..8ab359c4c 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 b22f03d1a..3340641e8 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 30d7e5bbe..c60bf33a1 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 40fb43121..0a910858b 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 1cd032ac1..f22f8dcbc 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 1ff053e5c..aa2b2fd6b 100755 --- 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 e07864122..8767445d4 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 c0b9cef77..5aa435060 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 3566e7f3d..6903369e4 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -1224,7 +1224,7 @@ void D_SRB2Main(void) // Print GPL notice for our console users (Linux) CONS_Printf( "\n\nSonic Robo Blast 2\n" - "Copyright (C) 1998-2022 by Sonic Team Junior\n\n" + "Copyright (C) 1998-2023 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 8189a9f2b..197423fb3 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 a7e1eb16d..7de3dba56 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 5baa593a0..ddedbef4a 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 f63f38a74..1fbdfdce2 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 0beeae154..26bf4d5c6 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 edbef30bb..e60af2c2c 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 f778a518f..ecec976be 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 42e9c3a82..756c7141e 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 90a58ab68..bdb5db3f5 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 e632a74a8..2481ed738 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/deh_lua.c b/src/deh_lua.c index 09dc155cf..1a87e38a5 100644 --- a/src/deh_lua.c +++ b/src/deh_lua.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/deh_lua.h b/src/deh_lua.h index 657e66b6e..c400351b8 100644 --- a/src/deh_lua.h +++ b/src/deh_lua.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/deh_soc.c b/src/deh_soc.c index cbc7940f7..2af7b65bf 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/deh_soc.h b/src/deh_soc.h index f972ec26e..0cab545f6 100644 --- a/src/deh_soc.h +++ b/src/deh_soc.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/deh_tables.c b/src/deh_tables.c index 4a3467f78..00dd7525e 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/deh_tables.h b/src/deh_tables.h index 850194a96..8943ab71a 100644 --- a/src/deh_tables.h +++ b/src/deh_tables.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 3f339e477..17768eb7f 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 b4651c66a..902404df7 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/doomdata.h b/src/doomdata.h index 56fb5e9e9..4c5bdefaf 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 2b62bcd6e..2bab63829 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 bce43416b..632381b1c 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 456f56380..d29bd35f2 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 86297f0cb..87f752471 100644 --- a/src/endian.h +++ b/src/endian.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2014-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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 bca8e3ba6..ea5ce62bd 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -1138,7 +1138,7 @@ static const char *credits[] = { "Dave \"DemonTomatoDave\" Bulmer", "Paul \"Boinciel\" Clempson", "\"Cyan Helkaraxe\"", - "Shane \"CobaltBW\" Ellis", + "Claire \"clairebun\" Ellis", "James \"SeventhSentinel\" Hall", "Kepa \"Nev3r\" Iceta", "Iestyn \"Monster Iestyn\" Jealous", diff --git a/src/f_finale.h b/src/f_finale.h index efdc9d4ad..e37b45253 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 ab869ca60..6014fb7f9 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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_demo.c b/src/g_demo.c index 2da5a76ab..0403da16d 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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_demo.h b/src/g_demo.h index 37664dc71..f25315a58 100644 --- a/src/g_demo.h +++ b/src/g_demo.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 74bc42711..e49308c5f 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 dca043f2e..55b771274 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 262e68c6a..9d5656253 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 400e3fd12..e9c909e6e 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 a6ac1970d..8f97930bb 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_batching.c b/src/hardware/hw_batching.c index f9c6542ae..d1b84a5ee 100644 --- a/src/hardware/hw_batching.c +++ b/src/hardware/hw_batching.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Sonic Team Junior. +// Copyright (C) 2020-2023 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/hw_batching.h b/src/hardware/hw_batching.h index df5c478a3..c7fd7afe3 100644 --- a/src/hardware/hw_batching.h +++ b/src/hardware/hw_batching.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Sonic Team Junior. +// Copyright (C) 2020-2023 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/hw_cache.c b/src/hardware/hw_cache.c index 3e207025c..d6245df64 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_data.h b/src/hardware/hw_data.h index ceefe9abd..af65a4e65 100644 --- a/src/hardware/hw_data.h +++ b/src/hardware/hw_data.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_defs.h b/src/hardware/hw_defs.h index fca9b80a3..b0859f478 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_draw.c b/src/hardware/hw_draw.c index ada2a6bf8..eb0b9e332 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_drv.h b/src/hardware/hw_drv.h index 3b9b8681c..426d2f283 100644 --- a/src/hardware/hw_drv.h +++ b/src/hardware/hw_drv.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_glob.h b/src/hardware/hw_glob.h index 1ec9101c3..4c7c56d17 100644 --- a/src/hardware/hw_glob.h +++ b/src/hardware/hw_glob.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_light.c b/src/hardware/hw_light.c index eb3c9bbbb..c1f0b3407 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_light.h b/src/hardware/hw_light.h index a0a9e93ad..e9d87933d 100644 --- a/src/hardware/hw_light.h +++ b/src/hardware/hw_light.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_main.c b/src/hardware/hw_main.c index 321ed215f..343fa43bf 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_main.h b/src/hardware/hw_main.h index cd822c0c1..4a1b412fc 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_md2.c b/src/hardware/hw_md2.c index f33d67bbb..6b1d0c6fc 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/hw_md2.h b/src/hardware/hw_md2.h index 966ed016b..f1cca763c 100644 --- a/src/hardware/hw_md2.h +++ b/src/hardware/hw_md2.h @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 0b51fa05c..569ddfee8 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 1998-2022 by Sonic Team Junior. +// Copyright (C) 1998-2023 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/http-mserv.c b/src/http-mserv.c index 6e3de4535..b4dba0db9 100644 --- a/src/http-mserv.c +++ b/src/http-mserv.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by James R. +// Copyright (C) 2020-2023 by James R. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/hu_stuff.c b/src/hu_stuff.c index c037abcd7..c5a32dbd2 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 110486378..8647e4500 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 49aadf27d..9efaff4da 100644 --- a/src/i_addrinfo.c +++ b/src/i_addrinfo.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2011-2022 by Sonic Team Junior. +// Copyright (C) 2011-2023 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 592e693f4..79cfb05b2 100644 --- a/src/i_addrinfo.h +++ b/src/i_addrinfo.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2011-2022 by Sonic Team Junior. +// Copyright (C) 2011-2023 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 27584cea6..95caed4fd 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 62b7528d5..9f2c38c7b 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 6358fbefb..c51d8e4f4 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 7153aa735..957150fe6 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 8838ba725..3820155b8 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 b6e5b9235..ae9983bf1 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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_threads.h b/src/i_threads.h index c7b71d26c..fe6ab4fb0 100644 --- a/src/i_threads.h +++ b/src/i_threads.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by James R. +// Copyright (C) 2020-2023 by James R. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/i_time.c b/src/i_time.c index c1cc9dfd4..55d1557bd 100644 --- a/src/i_time.c +++ b/src/i_time.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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_time.h b/src/i_time.h index cab36133b..997ba7ef2 100644 --- a/src/i_time.h +++ b/src/i_time.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 d66b2d95f..8efca5f9a 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 b55302170..09452a74f 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 a9f68721f..502ecd726 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 df12c95ae..689f15fef 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 a4ad81358..8fec7bd63 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 8c63a9d6d..8d47f3dc1 100644 --- a/src/lua_blockmaplib.c +++ b/src/lua_blockmaplib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2016-2022 by Iestyn "Monster Iestyn" Jealous. -// Copyright (C) 2016-2022 by Sonic Team Junior. +// Copyright (C) 2016-2023 by Iestyn "Monster Iestyn" Jealous. +// Copyright (C) 2016-2023 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 816051199..da4094732 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 4fa3a1a17..cb0e30d87 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 c4083c9ad..039a9677f 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 0d629d233..ba102f2f4 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-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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 785124fec..1a0599757 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-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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_drawlist.c b/src/lua_hudlib_drawlist.c index bcf132ec6..f46f207c1 100644 --- a/src/lua_hudlib_drawlist.c +++ b/src/lua_hudlib_drawlist.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2014-2016 by John "JTE" Muniz. -// Copyright (C) 2014-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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_drawlist.h b/src/lua_hudlib_drawlist.h index 57d3de3c3..b2df39747 100644 --- a/src/lua_hudlib_drawlist.h +++ b/src/lua_hudlib_drawlist.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2022-2022 by Sonic Team Junior. +// Copyright (C) 2022-2023 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 ac41de419..7388632d3 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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_inputlib.c b/src/lua_inputlib.c index 1710b0355..1f75ee6fe 100644 --- a/src/lua_inputlib.c +++ b/src/lua_inputlib.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2021-2022 by Sonic Team Junior. +// Copyright (C) 2021-2023 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 b4a891edb..7f8d21f38 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 b4565121d..7abe820a5 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 c7501da60..d0fe6863f 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 2aec48c90..7d2c77595 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 58cfab76c..f7e14e78f 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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_polyobjlib.c b/src/lua_polyobjlib.c index a91c354f4..c3d9d9d1a 100644 --- a/src/lua_polyobjlib.c +++ b/src/lua_polyobjlib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Iestyn "Monster Iestyn" Jealous. -// Copyright (C) 2020-2022 by Sonic Team Junior. +// Copyright (C) 2020-2023 by Iestyn "Monster Iestyn" Jealous. +// Copyright (C) 2020-2023 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 f166fb4e6..8f7b04430 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 e586b04a8..fe04e5e60 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 9c7c4ad03..5c21b04c3 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-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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_taglib.c b/src/lua_taglib.c index b69416362..2ba60df99 100644 --- a/src/lua_taglib.c +++ b/src/lua_taglib.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by James R. -// Copyright (C) 2020-2022 by Sonic Team Junior. +// Copyright (C) 2020-2023 by James R. +// Copyright (C) 2020-2023 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 963fdbd5a..cff92f34d 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 522e38a53..a530395f6 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 ed011644e..91716f346 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 41765e6e1..90e4c69ce 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-2022 by Sonic Team Junior. +// Copyright (C) 2013-2023 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 ad64dff7b..060c5f585 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-2022 by Sonic Team Junior. +// Copyright (C) 2013-2023 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 1444f0c38..475be23a3 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 cdb6aa246..2d74ca150 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 7fde0c171..75c84385a 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 588000fae..046e325a9 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 89c8009ae..1056ecb02 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 086117579..f4ac01d84 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 1406317c5..769ff90be 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 f36c80009..d49dc920b 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-2022 by Sonic Team Junior. +// Copyright (C) 2012-2023 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 d8ca6648a..06a479422 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-2022 by Sonic Team Junior. +// Copyright (C) 2005-2023 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_easing.c b/src/m_easing.c index 0f1cc1d02..48fe1efbc 100644 --- a/src/m_easing.c +++ b/src/m_easing.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Jaime "Lactozilla" Passos. +// Copyright (C) 2020-2023 by Jaime "Lactozilla" Passos. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_easing.h b/src/m_easing.h index 229222a15..eaa5d6773 100644 --- a/src/m_easing.h +++ b/src/m_easing.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Jaime "Lactozilla" Passos. +// Copyright (C) 2020-2023 by Jaime "Lactozilla" Passos. // // 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 ded294b0a..ad2831196 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 73e629f44..4a5b7ce2a 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 82d078062..4451af4fd 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 a7072b0c1..35c77cc43 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 d98c949cf..49eb7f1ef 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 2959ba44e..8cad7ba9a 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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_perfstats.c b/src/m_perfstats.c index 9f65a7616..17e026b3e 100644 --- a/src/m_perfstats.c +++ b/src/m_perfstats.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Sonic Team Junior. +// Copyright (C) 2020-2023 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_perfstats.h b/src/m_perfstats.h index f6a7c1f74..db250be2a 100644 --- a/src/m_perfstats.h +++ b/src/m_perfstats.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Sonic Team Junior. +// Copyright (C) 2020-2023 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 2cc3f7cb8..1c10a6692 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-2022 by Sonic Team Junior. +// Copyright (C) 2003-2023 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 071f9d8fa..b1ad22bf5 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-2022 by Sonic Team Junior. +// Copyright (C) 2003-2023 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 112795500..3d0774a60 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 aa5ffb0bb..824287e27 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 df5f3e907..b63089bcb 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 bff562c95..dc0cc136a 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -1,8 +1,8 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. -// Copyright (C) 2020-2022 by James R. +// Copyright (C) 1999-2023 by Sonic Team Junior. +// Copyright (C) 2020-2023 by James R. // // 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 23b26fbc5..1c8d742d8 100644 --- a/src/mserv.h +++ b/src/mserv.h @@ -1,8 +1,8 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. -// Copyright (C) 2020-2022 by James R. +// Copyright (C) 1999-2023 by Sonic Team Junior. +// Copyright (C) 2020-2023 by James R. // // 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 66f2dd58e..98e931362 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 c376c2db4..63d430eb6 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 869384b53..9c24f5851 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 dd3e0f9c2..8bc5c95e4 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 4c783f884..75455da73 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 2b3020997..cc060e4ee 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 54e2003ba..a7d1f4abd 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 260bcc074..b6a320730 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 b7779d88a..08de0cb0b 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 30e0183de..c8adb6f1d 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 60601692c..2cf177d23 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 7ef956ff1..b207bb740 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-2022 by Sonic Team Junior. +// Copyright (C) 2006-2023 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 7e7b70c17..0573f6350 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-2022 by Sonic Team Junior. +// Copyright (C) 2006-2023 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 4136c2118..69e5eeeb3 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 42125dae7..880466d37 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 9f4a2633f..73fcfd583 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 d6cda7d4f..a125760cf 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 36d19f66d..c6f4f741c 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 4023744dc..3e92bec86 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 2c0e3d88b..cf7807d4e 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-2022 by Sonic Team Junior. +// Copyright (C) 2015-2023 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 f4b0535e7..096bf8f82 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-2022 by Sonic Team Junior. +// Copyright (C) 2015-2023 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 4e6ef531f..5a262e87a 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 779afdd05..91dfccb70 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 4d10f1df3..66b05ff01 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 fe6a4d33f..0357258e8 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 d355bc6d7..594bbc7af 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 60a0f5106..d5fb17364 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 c9c169a51..121ddaae5 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 88757cf4b..55199405a 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 51ed15dd6..4b7492f90 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 63772e7b0..ef5c967e5 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 3746643c6..6d2b7d3d8 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 601fb4bb2..b0467e4f7 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 cb4e4482a..ea03a8e3d 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 763fd1631..2ed5a2a8e 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 31abe70b8..b80a47984 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 8b02fb90d..faf1cdba8 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 a5b590e5c..65fad64d0 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 187925408..4d801dc80 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 94103ceed..f08070d0f 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 e771e5c94..7c561e959 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Jaime "Lactozilla" Passos. +// Copyright (C) 2020-2023 by Jaime "Lactozilla" Passos. // // 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 26c28e1f9..d2106a390 100644 --- a/src/r_patch.h +++ b/src/r_patch.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Jaime "Lactozilla" Passos. +// Copyright (C) 2020-2023 by Jaime "Lactozilla" Passos. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_patchrotation.c b/src/r_patchrotation.c index b24e065ba..3d3c6c512 100644 --- a/src/r_patchrotation.c +++ b/src/r_patchrotation.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Jaime "Lactozilla" Passos. +// Copyright (C) 2020-2023 by Jaime "Lactozilla" Passos. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_patchrotation.h b/src/r_patchrotation.h index e6bee80ed..a239ac5fa 100644 --- a/src/r_patchrotation.h +++ b/src/r_patchrotation.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by Jaime "Lactozilla" Passos. +// Copyright (C) 2020-2023 by Jaime "Lactozilla" Passos. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/r_picformats.c b/src/r_picformats.c index 5a7aebcf7..9aea8c6c1 100644 --- a/src/r_picformats.c +++ b/src/r_picformats.c @@ -2,8 +2,8 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 2005-2009 by Andrey "entryway" Budko. -// Copyright (C) 2018-2022 by Jaime "Lactozilla" Passos. -// Copyright (C) 2019-2022 by Sonic Team Junior. +// Copyright (C) 2018-2023 by Jaime "Lactozilla" Passos. +// Copyright (C) 2019-2023 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_picformats.h b/src/r_picformats.h index f3080479f..4f9637460 100644 --- a/src/r_picformats.h +++ b/src/r_picformats.h @@ -1,8 +1,8 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. -// Copyright (C) 2018-2022 by Jaime "Lactozilla" Passos. -// Copyright (C) 2019-2022 by Sonic Team Junior. +// Copyright (C) 2018-2023 by Jaime "Lactozilla" Passos. +// Copyright (C) 2019-2023 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 56cf869ef..c568484b6 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 ea793fce2..9870a43e2 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 4d4132133..e594f960a 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 687ee058f..f90f05fbc 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 43a7f945f..71fc9f9b2 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 4075cc0bb..09c68b27e 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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_skins.c b/src/r_skins.c index 92fd6cfae..56e322e87 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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_skins.h b/src/r_skins.h index aeaa9f3e0..361ebb102 100644 --- a/src/r_skins.h +++ b/src/r_skins.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 e21b7cbf1..c47029f0b 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 31c821d22..012f47d23 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 bab89c89e..72bfe74b3 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 ec6885e26..dcae2789c 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 69989e7ac..b36697f73 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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_textures.c b/src/r_textures.c index 98c2788a2..69e64074d 100644 --- a/src/r_textures.c +++ b/src/r_textures.c @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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_textures.h b/src/r_textures.h index b9b48da8c..4a3c10b9e 100644 --- a/src/r_textures.h +++ b/src/r_textures.h @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 461761977..2916482fb 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 35eeb9ce1..de9ea5dfd 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 f28a77a80..3bbbad479 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 6223c4fdb..288859c8d 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 3842a365d..ab04f68bf 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 add048b25..19103b0df 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 818d0f0c4..e328bedc2 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-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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_threads.c b/src/sdl/i_threads.c index a182ae197..c05936072 100644 --- a/src/sdl/i_threads.c +++ b/src/sdl/i_threads.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2020-2022 by James R. +// Copyright (C) 2020-2023 by James R. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 02f0e462e..5ebd276ef 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.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-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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 e56a5bc1b..f13aaef5d 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2014-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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 67e98d4f5..db0538195 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-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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 9744bc6f1..bd1d699ff 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-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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 0de3788fe..2ca35b954 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-2022 by Sonic Team Junior. +// Copyright (C) 2014-2023 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 6b6e79d97..db736880d 100644 --- a/src/sdl/sdlmain.h +++ b/src/sdl/sdlmain.h @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// Copyright (C) 2006-2022 by Sonic Team Junior. +// Copyright (C) 2006-2023 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 43525d568..19b69dd28 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 eec518689..102881e99 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 3e75750a8..cce8ea9f2 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 c59bc2ac6..68ac900f7 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 6affde364..2796f11d5 100644 --- a/src/strcasestr.c +++ b/src/strcasestr.c @@ -2,7 +2,7 @@ strcasestr -- case insensitive substring searching function. */ /* -Copyright 2019-2022 James R. +Copyright 2019-2023 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 5534a3f0c..28bb7d2d1 100644 --- a/src/string.c +++ b/src/string.c @@ -1,7 +1,7 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 2006 by Graue. -// Copyright (C) 2006-2022 by Sonic Team Junior. +// Copyright (C) 2006-2023 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 f8b8030c9..315fe1d7a 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 172ade378..2736f03e8 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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/taglist.c b/src/taglist.c index 405007614..e4e385b9e 100644 --- a/src/taglist.c +++ b/src/taglist.c @@ -1,8 +1,8 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. -// Copyright (C) 2020-2022 by Nev3r. +// Copyright (C) 1999-2023 by Sonic Team Junior. +// Copyright (C) 2020-2023 by Nev3r. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/taglist.h b/src/taglist.h index de6e9abd5..d42a48f05 100644 --- a/src/taglist.h +++ b/src/taglist.h @@ -1,8 +1,8 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2022 by Sonic Team Junior. -// Copyright (C) 2020-2022 by Nev3r. +// Copyright (C) 1999-2023 by Sonic Team Junior. +// Copyright (C) 2020-2023 by Nev3r. // // 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 f096c8141..85091cbd5 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-2022 by Sonic Team Junior. +;; Copyright (C) 1999-2023 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 5bb2dea12..d98d82e25 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 8e307f42b..d8967178c 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 5312f3c76..a45667e23 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-2022 by Sonic Team Junior. +;; Copyright (C) 2010-2023 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 44b2d2e7b..c85cf7003 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-2022 by Sonic Team Junior. +;; Copyright (C) 1999-2023 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 84d7978cb..461a5e3bc 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 2831230a3..ff03836b5 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 8e43e23c1..1473a3856 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 42c6bf83b..40073fc55 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 c4de55d77..ffb9095ba 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 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 2236beca1..07898dbc1 100644 --- a/src/win32/Srb2win.rc +++ b/src/win32/Srb2win.rc @@ -98,7 +98,7 @@ BEGIN VALUE "FileDescription", "Sonic Robo Blast 2\0" VALUE "FileVersion", VERSIONSTRING_RC VALUE "InternalName", "srb2\0" - VALUE "LegalCopyright", "Copyright 1998-2022 by Sonic Team Junior\0" + VALUE "LegalCopyright", "Copyright 1998-2023 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 1e070260e..7b4b6f5cf 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2004-2022 by Sonic Team Junior. +// Copyright (C) 2004-2023 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 74183066e..6b249ca0d 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -1,6 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 2004-2022 by Sonic Team Junior. +// Copyright (C) 2004-2023 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 b949730e3..ec2b70815 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-2022 by Sonic Team Junior. +// Copyright (C) 2006-2023 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 d7e1ed528..c3cd4f011 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-2022 by Sonic Team Junior. +// Copyright (C) 1999-2023 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. From 2e3963fd16f1cfe435ef1eb3d4a57ccce53021e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Sun, 2 Apr 2023 21:58:42 +0200 Subject: [PATCH 077/108] Fix buffer overflow for setcontrol with 2 arguments --- src/g_input.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/g_input.c b/src/g_input.c index 9d5656253..826dcecbd 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -993,7 +993,7 @@ static void setcontrol(INT32 (*gc)[2]) { INT32 numctrl; const char *namectrl; - INT32 keynum, keynum1, keynum2; + INT32 keynum, keynum1, keynum2 = 0; INT32 player = ((void*)gc == (void*)&gamecontrolbis ? 1 : 0); boolean nestedoverride = false; @@ -1009,7 +1009,8 @@ static void setcontrol(INT32 (*gc)[2]) return; } keynum1 = G_KeyNameToNum(COM_Argv(2)); - keynum2 = G_KeyNameToNum(COM_Argv(3)); + if (COM_Argc() > 3) + keynum2 = G_KeyNameToNum(COM_Argv(3)); keynum = G_FilterKeyByVersion(numctrl, 0, player, &keynum1, &keynum2, &nestedoverride); if (keynum >= 0) From 8218ce0fe290f7047999328304ea69cfb4c39934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Fri, 7 Apr 2023 14:49:31 +0200 Subject: [PATCH 078/108] Fix use-after-free when Metal Sonic charges energy balls --- src/p_mobj.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index c8adb6f1d..4281d6e76 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -5665,21 +5665,25 @@ static void P_Boss9Thinker(mobj_t *mobj) missile->fuse = 1; if (missile->fuse > mobj->fuse) - P_RemoveMobj(missile); - - if (mobj->health > mobj->info->damage) { - P_SetScale(missile, FRACUNIT/3); - missile->color = SKINCOLOR_MAGENTA; // sonic OVA/4 purple power + P_RemoveMobj(missile); } else { - P_SetScale(missile, FRACUNIT/5); - missile->color = SKINCOLOR_SUNSET; // sonic cd electric power + if (mobj->health > mobj->info->damage) + { + P_SetScale(missile, FRACUNIT/3); + missile->color = SKINCOLOR_MAGENTA; // sonic OVA/4 purple power + } + else + { + P_SetScale(missile, FRACUNIT/5); + missile->color = SKINCOLOR_SUNSET; // sonic cd electric power + } + missile->destscale = missile->scale*2; + missile->scalespeed = abs(missile->scale - missile->destscale)/missile->fuse; + missile->colorized = true; } - missile->destscale = missile->scale*2; - missile->scalespeed = abs(missile->scale - missile->destscale)/missile->fuse; - missile->colorized = true; } // ...then down. easier than changing the missile's momz after-the-fact From 16ad23f06de09fd00800c055e6da5b78ab3875f6 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Mon, 10 Apr 2023 14:08:53 +0200 Subject: [PATCH 079/108] Fix flag mixup in P_GetOldFOFFlags() --- src/lua_maplib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 7abe820a5..898651520 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1910,10 +1910,10 @@ static INT32 P_GetOldFOFFlags(ffloor_t *fflr) result |= FF_OLD_SPINBUST; if (fflr->busttype == BT_STRONG) result |= FF_OLD_STRONGBUST; - if (fflr->fofflags & FF_OLD_RIPPLE) - result |= FOF_RIPPLE; - if (fflr->fofflags & FF_OLD_COLORMAPONLY) - result |= FOF_COLORMAPONLY; + if (fflr->fofflags & FOF_RIPPLE) + result |= FF_OLD_RIPPLE; + if (fflr->fofflags & FOF_COLORMAPONLY) + result |= FF_OLD_COLORMAPONLY; return result; } From 8b77af73780f72bfc128f4e960e4c6a8f07df5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Mon, 10 Apr 2023 14:55:19 +0200 Subject: [PATCH 080/108] Fix segfault when killing wall spike while it moves --- src/p_mobj.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index c8adb6f1d..a290bd074 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10061,6 +10061,8 @@ static boolean P_FuseThink(mobj_t *mobj) case MT_SPIKE: case MT_WALLSPIKE: P_SetMobjState(mobj, mobj->state->nextstate); + if (P_MobjWasRemoved(mobj)) + return false; mobj->fuse = mobj->spawnpoint ? mobj->spawnpoint->args[0] : mobj->info->speed; break; case MT_NIGHTSCORE: @@ -10222,6 +10224,9 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->flags2 & MF2_FIRING) P_FiringThink(mobj); + if (P_MobjWasRemoved(mobj)) + return; + if (mobj->type == MT_AMBIENT) { if (leveltime % mobj->health) From 4c02bde4e9771281e96352a0c87222dedb61f0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Mon, 10 Apr 2023 18:31:12 +0200 Subject: [PATCH 081/108] Fix crash during debug when escaping pterabyte --- 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 d5fb17364..f8df5a023 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -12808,7 +12808,7 @@ void P_PlayerAfterThink(player_t *player) P_KillMobj(ptera, player->mo, player->mo, 0); P_SetObjectMomZ(player->mo, 12*FRACUNIT, false); player->pflags |= PF_APPLYAUTOBRAKE|PF_JUMPED|PF_THOKKED; - P_SetMobjState(player->mo, S_PLAY_ROLL); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); break; } From 1cd5e10ab084b2df0649ad3f89e6900c7e852ed4 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 11 Apr 2023 16:19:27 +0200 Subject: [PATCH 082/108] Fix custom ambient sound mobjs not working --- src/m_cheat.c | 2 +- src/p_mobj.c | 8 +++++++- src/p_mobj.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 1056ecb02..4ea8d13b4 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1004,7 +1004,7 @@ static void OP_CycleThings(INT32 amt) } while (mobjinfo[op_currentthing].doomednum == -1 || op_currentthing == MT_NIGHTSDRONE - || mobjinfo[op_currentthing].flags & MF_NOSECTOR + || mobjinfo[op_currentthing].flags & (MF_AMBIENT|MF_NOSECTOR) || (states[mobjinfo[op_currentthing].spawnstate].sprite == SPR_NULL && states[mobjinfo[op_currentthing].seestate].sprite == SPR_NULL) ); diff --git a/src/p_mobj.c b/src/p_mobj.c index c8adb6f1d..0776e4484 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10222,7 +10222,7 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->flags2 & MF2_FIRING) P_FiringThink(mobj); - if (mobj->type == MT_AMBIENT) + if (mobj->flags & MF_AMBIENT) { if (leveltime % mobj->health) return; @@ -13272,6 +13272,12 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean mobj->flags2 |= MF2_STRONGBOX; } } + // Custom ambient sounds + if ((mobj->flags & MF_AMBIENT) && mobj->type != MT_AMBIENT) + { + mobj->threshold = mobj->info->seesound; + mobj->health = mobj->info->spawnhealth; + } return true; } diff --git a/src/p_mobj.h b/src/p_mobj.h index 2cf177d23..a839eaba6 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -118,7 +118,7 @@ typedef enum // Don't apply gravity (every tic); object will float, keeping current height // or changing it actively. MF_NOGRAVITY = 1<<9, - // This object is an ambient sound. Obsolete, but keep this around for backwards compatibility. + // This object is an ambient sound. MF_AMBIENT = 1<<10, // Slide this object when it hits a wall. MF_SLIDEME = 1<<11, From 846cf71e6a0ce18cb806e74669265d81654163ec Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 11 Apr 2023 18:48:23 +0200 Subject: [PATCH 083/108] F_StartTitleScreen: Make sure the level header for gamemap always exists --- src/f_finale.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/f_finale.c b/src/f_finale.c index ea5ce62bd..fe94b924c 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2503,6 +2503,8 @@ void F_StartTitleScreen(void) { titlemapinaction = TITLEMAP_OFF; gamemap = 1; // g_game.c + if (!mapheaderinfo[gamemap-1]) + P_AllocMapHeader(gamemap-1); CON_ClearHUD(); } From 8486bd083a0eb96bd801dec5f6d86ee1295714b6 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 11 Apr 2023 19:13:30 +0200 Subject: [PATCH 084/108] R_SkinUsable: Only check header of current map if one exists --- src/r_skins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_skins.c b/src/r_skins.c index 56e322e87..b10a78c18 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -225,7 +225,7 @@ boolean R_SkinUsable(INT32 playernum, INT32 skinnum) return true; } - if (Playing() && (R_SkinAvailable(mapheaderinfo[gamemap-1]->forcecharacter) == skinnum)) + if (Playing() && mapheaderinfo[gamemap-1] && (R_SkinAvailable(mapheaderinfo[gamemap-1]->forcecharacter) == skinnum)) { // Force 1. return true; From cb849ca4f03a6d209cdfb972ec88ecbfd941d6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Tue, 11 Apr 2023 22:13:29 +0200 Subject: [PATCH 085/108] Fix segfault when first mobj in overlaycap is removed --- src/p_mobj.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index c8adb6f1d..d6352bc2a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6900,6 +6900,13 @@ static void P_AddOverlay(mobj_t *thing) static void P_RemoveOverlay(mobj_t *thing) { mobj_t *mo; + if (overlaycap == thing) + { + P_SetTarget(&overlaycap, thing->hnext); + P_SetTarget(&thing->hnext, NULL); + return; + } + for (mo = overlaycap; mo; mo = mo->hnext) { if (mo->hnext != thing) From cf67ba1d0113cea9105a81b19083d0ed93d2fb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Tue, 11 Apr 2023 22:51:18 +0200 Subject: [PATCH 086/108] fixup! Fix segfault when killing wall spike while it moves --- src/p_mobj.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index a290bd074..6a089074c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10224,9 +10224,6 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->flags2 & MF2_FIRING) P_FiringThink(mobj); - if (P_MobjWasRemoved(mobj)) - return; - if (mobj->type == MT_AMBIENT) { if (leveltime % mobj->health) From 4b6de096e516bf4579d2367639ae71d12ea865d2 Mon Sep 17 00:00:00 2001 From: spherallic Date: Wed, 12 Apr 2023 00:59:08 +0200 Subject: [PATCH 087/108] Define cv_addons_folder in dedicated --- src/d_netcmd.c | 4 ++-- src/r_main.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 1fbdfdce2..28e7727e1 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -794,8 +794,8 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_digitaldeadzone2); // filesrch.c - CV_RegisterVar(&cv_addons_option); - CV_RegisterVar(&cv_addons_folder); + //CV_RegisterVar(&cv_addons_option); // These two are now defined + //CV_RegisterVar(&cv_addons_folder); // in R_RegisterEngineStuff CV_RegisterVar(&cv_addons_md5); CV_RegisterVar(&cv_addons_showall); CV_RegisterVar(&cv_addons_search_type); diff --git a/src/r_main.c b/src/r_main.c index 4d801dc80..53f6ee2f9 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -36,6 +36,7 @@ #include "r_main.h" #include "i_system.h" // I_GetPreciseTime #include "r_fps.h" // Frame interpolation/uncapped +#include "filesrch.c" // cv_addons_folder #ifdef HWRENDER #include "hardware/hw_main.h" @@ -1589,6 +1590,10 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_flipcam); CV_RegisterVar(&cv_flipcam2); + // Other filesrch.c consvars are defined in D_RegisterClientCommands + CV_RegisterVar(&cv_addons_option); + CV_RegisterVar(&cv_addons_folder); + // Enough for dedicated server if (dedicated) return; From 488f0fdfab57e30478dcb87032ac0368cd064c5c Mon Sep 17 00:00:00 2001 From: spherallic Date: Wed, 12 Apr 2023 20:06:02 +0200 Subject: [PATCH 088/108] bruh --- src/d_netcmd.c | 6 +++++- src/r_main.c | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 64a61d701..0eedd4542 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -613,6 +613,10 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_allowseenames); + // Other filesrch.c consvars are defined in D_RegisterClientCommands + CV_RegisterVar(&cv_addons_option); + CV_RegisterVar(&cv_addons_folder); + CV_RegisterVar(&cv_dummyconsvar); } @@ -795,7 +799,7 @@ void D_RegisterClientCommands(void) // filesrch.c //CV_RegisterVar(&cv_addons_option); // These two are now defined - //CV_RegisterVar(&cv_addons_folder); // in R_RegisterEngineStuff + //CV_RegisterVar(&cv_addons_folder); // in D_RegisterServerCommands CV_RegisterVar(&cv_addons_md5); CV_RegisterVar(&cv_addons_showall); CV_RegisterVar(&cv_addons_search_type); diff --git a/src/r_main.c b/src/r_main.c index 2a31227d1..ebf7a28bf 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -36,7 +36,6 @@ #include "r_main.h" #include "i_system.h" // I_GetPreciseTime #include "r_fps.h" // Frame interpolation/uncapped -#include "filesrch.c" // cv_addons_folder #ifdef HWRENDER #include "hardware/hw_main.h" @@ -1590,10 +1589,6 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_flipcam); CV_RegisterVar(&cv_flipcam2); - // Other filesrch.c consvars are defined in D_RegisterClientCommands - CV_RegisterVar(&cv_addons_option); - CV_RegisterVar(&cv_addons_folder); - // Enough for dedicated server if (dedicated) return; From c61594931debe50e520b1737810331c39f7d776c Mon Sep 17 00:00:00 2001 From: spherallic Date: Fri, 14 Apr 2023 00:28:14 +0200 Subject: [PATCH 089/108] Fix titlecard hook being inconsistent on map load --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index cce8ea9f2..206c93273 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1412,7 +1412,7 @@ void ST_drawTitleCard(void) lt_lasttic = lt_ticker; luahook: - if (renderisnewtic) + //if (renderisnewtic) { LUA_HUD_ClearDrawList(luahuddrawlist_titlecard); LUA_HUDHOOK(titlecard, luahuddrawlist_titlecard); From 930b1355ed5634110dfa6895b14d0f510c4a70f6 Mon Sep 17 00:00:00 2001 From: spherallic Date: Fri, 14 Apr 2023 12:03:21 +0200 Subject: [PATCH 090/108] Don't call P_ResetCamera when spawning a bot --- src/g_game.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 8c497a72d..a0ea9ae88 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2825,6 +2825,9 @@ void G_MovePlayerToSpawnOrStarpost(INT32 playernum) R_ResetMobjInterpolationState(players[playernum].mo); + if (players[playernum].bot) // don't reset the camera for bots + return; + if (playernum == consoleplayer) P_ResetCamera(&players[playernum], &camera); else if (playernum == secondarydisplayplayer) From e4f92cc6676afe8af23c01b1d1be6cc1dd3f4dc2 Mon Sep 17 00:00:00 2001 From: spherallic Date: Tue, 18 Apr 2023 02:04:23 +0200 Subject: [PATCH 091/108] Always important --- src/w_wad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/w_wad.c b/src/w_wad.c index 40073fc55..456afef7b 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1035,7 +1035,7 @@ UINT16 W_InitFolder(const char *path, boolean mainfile, boolean startup) return W_InitFileError(path, startup); } - important = 0; /// \todo Implement a W_VerifyFolder. + important = 1; /// \todo Implement a W_VerifyFolder. // Remove path delimiters. p = path + (strlen(path) - 1); From 072dd2eda761981df5dbd4165d4ec6638d599cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Tue, 18 Apr 2023 20:46:13 +0200 Subject: [PATCH 092/108] Fix segfault when removing source from ShouldDamage --- src/p_inter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_inter.c b/src/p_inter.c index 8bc5c95e4..de13202ab 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3546,6 +3546,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da UINT8 shouldForce = LUA_HookShouldDamage(target, inflictor, source, damage, damagetype); if (P_MobjWasRemoved(target)) return (shouldForce == 1); // mobj was removed + if (P_MobjWasRemoved(source)) + source = NULL; if (shouldForce == 1) force = true; else if (shouldForce == 2) From ad412c9700cb19dec4ad795857796f8bb5900ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Tue, 18 Apr 2023 22:08:26 +0200 Subject: [PATCH 093/108] Fix segfault when damaging mobj with no painstate --- src/p_inter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_inter.c b/src/p_inter.c index 8bc5c95e4..fc193ac94 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3763,6 +3763,9 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da else P_SetMobjState(target, target->info->painstate); + if (P_MobjWasRemoved(target)) + return false; + if (target->type == MT_HIVEELEMENTAL) target->extravalue1 += 3; From e5a1fee7596a5ed15034f5604693a22c9635d739 Mon Sep 17 00:00:00 2001 From: spherallic Date: Wed, 19 Apr 2023 00:21:10 +0200 Subject: [PATCH 094/108] Adjust default look/turn axis for new SDL2 version --- src/g_game.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index a0ea9ae88..b7f3eb24a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -411,8 +411,8 @@ consvar_t cv_cam_lockonboss[2] = { consvar_t cv_moveaxis = CVAR_INIT ("joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL); consvar_t cv_sideaxis = CVAR_INIT ("joyaxis_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL); -consvar_t cv_lookaxis = CVAR_INIT ("joyaxis_look", "Y-Rudder-", CV_SAVE, joyaxis_cons_t, NULL); -consvar_t cv_turnaxis = CVAR_INIT ("joyaxis_turn", "X-Rudder", CV_SAVE, joyaxis_cons_t, NULL); +consvar_t cv_lookaxis = CVAR_INIT ("joyaxis_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL); +consvar_t cv_turnaxis = CVAR_INIT ("joyaxis_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL); consvar_t cv_jumpaxis = CVAR_INIT ("joyaxis_jump", "None", CV_SAVE, joyaxis_cons_t, NULL); consvar_t cv_spinaxis = CVAR_INIT ("joyaxis_spin", "None", CV_SAVE, joyaxis_cons_t, NULL); consvar_t cv_fireaxis = CVAR_INIT ("joyaxis_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL); @@ -422,8 +422,8 @@ consvar_t cv_digitaldeadzone = CVAR_INIT ("joy_digdeadzone", "0.25", CV_FLOAT|CV consvar_t cv_moveaxis2 = CVAR_INIT ("joyaxis2_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL); consvar_t cv_sideaxis2 = CVAR_INIT ("joyaxis2_side", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL); -consvar_t cv_lookaxis2 = CVAR_INIT ("joyaxis2_look", "Y-Rudder-", CV_SAVE, joyaxis_cons_t, NULL); -consvar_t cv_turnaxis2 = CVAR_INIT ("joyaxis2_turn", "X-Rudder", CV_SAVE, joyaxis_cons_t, NULL); +consvar_t cv_lookaxis2 = CVAR_INIT ("joyaxis2_look", "X-Rudder-", CV_SAVE, joyaxis_cons_t, NULL); +consvar_t cv_turnaxis2 = CVAR_INIT ("joyaxis2_turn", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL); consvar_t cv_jumpaxis2 = CVAR_INIT ("joyaxis2_jump", "None", CV_SAVE, joyaxis_cons_t, NULL); consvar_t cv_spinaxis2 = CVAR_INIT ("joyaxis2_spin", "None", CV_SAVE, joyaxis_cons_t, NULL); consvar_t cv_fireaxis2 = CVAR_INIT ("joyaxis2_fire", "Z-Rudder", CV_SAVE, joyaxis_cons_t, NULL); From 6ff37b47d9b60b8c71768ba3ca2cb9d1d8aae333 Mon Sep 17 00:00:00 2001 From: spherallic Date: Wed, 19 Apr 2023 12:13:29 +0200 Subject: [PATCH 095/108] Skip emerald bounce logic in Y_Ticker on dedicated --- src/y_inter.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index 7b4b6f5cf..cfd1e106e 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1133,7 +1133,11 @@ void Y_Ticker(void) } // emerald bounce - if (intertic <= 1) + if (dedicated) + { + // dedicated servers don't need this, especially since it crashes when stagefailed + } + else if (intertic <= 1) { data.spec.emeraldbounces = 0; data.spec.emeraldmomy = 20; From c2c430853ccb47174281908f131f87a0059ac560 Mon Sep 17 00:00:00 2001 From: spherallic Date: Wed, 19 Apr 2023 20:17:50 +0200 Subject: [PATCH 096/108] If Lua disabled intermission emeralds, skip sounds --- src/y_inter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index cfd1e106e..f0777add7 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1133,9 +1133,10 @@ void Y_Ticker(void) } // emerald bounce - if (dedicated) + if (dedicated || !LUA_HudEnabled(hud_intermissionemeralds)) { // dedicated servers don't need this, especially since it crashes when stagefailed + // also skip this if Lua disabled intermission emeralds, so it doesn't play sounds } else if (intertic <= 1) { From 2d3153079b046ae9c5f585e77d677022aabf957b Mon Sep 17 00:00:00 2001 From: SteelT Date: Fri, 21 Apr 2023 12:57:37 -0400 Subject: [PATCH 097/108] A_PointyThink crash fix (patch from #827) Fixes A_PointyThink crashing in certain scenarios --- src/p_enemy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_enemy.c b/src/p_enemy.c index 63d430eb6..ca947fc20 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -1589,6 +1589,10 @@ void A_PointyThink(mobj_t *actor) if (!actor->tracer) // For some reason we do not have spike balls... return; + // Catch case where actor lastlook is -1 (which segfaults the following blocks) + if (actor->lastlook < 0) + return; + // Position spike balls relative to the value of 'lastlook'. ball = actor->tracer; From d6cafea571cab556c89ff31343af0242a797378b Mon Sep 17 00:00:00 2001 From: spherallic Date: Fri, 28 Apr 2023 15:30:02 +0200 Subject: [PATCH 098/108] Don't force FLS to false after a pre-map cutscene --- src/f_finale.c | 13 +++++++------ src/f_finale.h | 2 +- src/g_game.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index fe94b924c..6560c24f1 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -337,7 +337,7 @@ static tic_t introscenetime[NUMINTROSCENES] = }; // custom intros -void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer); +void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer, boolean FLS); void F_StartIntro(void) { @@ -349,7 +349,7 @@ void F_StartIntro(void) if (!cutscenes[introtoplay - 1]) D_StartTitle(); else - F_StartCustomCutscene(introtoplay - 1, false, false); + F_StartCustomCutscene(introtoplay - 1, false, false, false); return; } @@ -1257,7 +1257,7 @@ void F_StartCredits(void) if (creditscutscene) { - F_StartCustomCutscene(creditscutscene - 1, false, false); + F_StartCustomCutscene(creditscutscene - 1, false, false, false); return; } @@ -3859,7 +3859,7 @@ static INT32 scenenum, cutnum; static INT32 picxpos, picypos, picnum, pictime, picmode, numpics, pictoloop; static INT32 textxpos, textypos; static boolean cutsceneover = false; -static boolean runningprecutscene = false, precutresetplayer = false; +static boolean runningprecutscene = false, precutresetplayer = false, precutFLS = false; static void F_AdvanceToNextScene(void) { @@ -3928,7 +3928,7 @@ void F_EndCutScene(void) if (runningprecutscene) { if (server) - D_MapChange(gamemap, gametype, ultimatemode, precutresetplayer, 0, true, false); + D_MapChange(gamemap, gametype, ultimatemode, precutresetplayer, 0, true, precutFLS); } else { @@ -3943,7 +3943,7 @@ void F_EndCutScene(void) } } -void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer) +void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer, boolean FLS) { if (!cutscenes[cutscenenum]) return; @@ -3962,6 +3962,7 @@ void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean reset cutsceneover = false; runningprecutscene = precutscene; precutresetplayer = resetplayer; + precutFLS = FLS; scenenum = picnum = 0; cutnum = cutscenenum; diff --git a/src/f_finale.h b/src/f_finale.h index e37b45253..6ea1b5537 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -52,7 +52,7 @@ void F_EndingDrawer(void); void F_CreditTicker(void); void F_CreditDrawer(void); -void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer); +void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer, boolean FLS); void F_CutsceneDrawer(void); void F_EndCutScene(void); diff --git a/src/g_game.c b/src/g_game.c index b7f3eb24a..0d5181b07 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4108,7 +4108,7 @@ void G_AfterIntermission(void) && stagefailed == false) { // Start a custom cutscene. - F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false); + F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false, false); } else { @@ -4958,7 +4958,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean imcontinuing = false; if ((gametyperules & GTR_CUTSCENES) && !skipprecutscene && mapheaderinfo[gamemap-1]->precutscenenum && !modeattacking && !(marathonmode & MA_NOCUTSCENES)) // Start a custom cutscene. - F_StartCustomCutscene(mapheaderinfo[gamemap-1]->precutscenenum-1, true, resetplayer); + F_StartCustomCutscene(mapheaderinfo[gamemap-1]->precutscenenum-1, true, resetplayer, FLS); else G_DoLoadLevel(resetplayer); From 03971f58a924e41c0f794a9dcbe459052835a381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Thu, 4 May 2023 22:42:51 +0200 Subject: [PATCH 099/108] Fix segfault when shields are removed after thinking --- src/p_mobj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index ee4440b73..0704c15a7 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6765,7 +6765,8 @@ void P_RunShields(void) // run shields for (i = 0; i < numshields; i++) { - P_ShieldLook(shields[i], shields[i]->threshold); + if (!P_MobjWasRemoved(shields[i])) + P_ShieldLook(shields[i], shields[i]->threshold); P_SetTarget(&shields[i], NULL); } numshields = 0; From ed46dd08a6a2ae85f7eebc9d15cb5c2c024e0e96 Mon Sep 17 00:00:00 2001 From: spherallic Date: Sun, 7 May 2023 17:33:12 +0200 Subject: [PATCH 100/108] Prevent tmthing crash with P_SpawnParaloop in Lua --- src/lua_baselib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 6e258c82a..db06d53dd 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -874,6 +874,7 @@ static int lib_pGetClosestAxis(lua_State *L) static int lib_pSpawnParaloop(lua_State *L) { + mobj_t *ptmthing = tmthing; fixed_t x = luaL_checkfixed(L, 1); fixed_t y = luaL_checkfixed(L, 2); fixed_t z = luaL_checkfixed(L, 3); @@ -890,6 +891,7 @@ static int lib_pSpawnParaloop(lua_State *L) if (nstate >= NUMSTATES) return luaL_error(L, "state %d out of range (0 - %d)", nstate, NUMSTATES-1); P_SpawnParaloop(x, y, z, radius, number, type, nstate, rotangle, spawncenter); + P_SetTarget(&tmthing, ptmthing); return 0; } From b99ecde7b85ae78482762f0e73162b817e7edcfd Mon Sep 17 00:00:00 2001 From: spherallic Date: Sun, 7 May 2023 17:42:39 +0200 Subject: [PATCH 101/108] Fix [BOT] indicator color not being cleared --- src/lua_baselib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index db06d53dd..6f5b46e30 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -3589,14 +3589,14 @@ static int lib_gAddPlayer(lua_State *L) char joinmsg[256]; // Truncate bot name - player_names[newplayernum][sizeof(*player_names) - 7] = '\0'; // The length of colored [BOT] + 1 + player_names[newplayernum][sizeof(*player_names) - 8] = '\0'; // The length of colored [BOT] + 1 strcpy(joinmsg, M_GetText("\x82*Bot %s has joined the game (player %d)")); strcpy(joinmsg, va(joinmsg, player_names[newplayernum], newplayernum)); HU_AddChatText(joinmsg, false); // Append blue [BOT] tag at the end - strlcat(player_names[newplayernum], "\x84[BOT]", sizeof(*player_names)); + strlcat(player_names[newplayernum], "\x84[BOT]\x80", sizeof(*player_names)); } LUA_PushUserdata(L, newplayer, META_PLAYER); From b487a71533e4d3058b703362b6a828d51069c6cc Mon Sep 17 00:00:00 2001 From: spherallic Date: Sun, 14 May 2023 16:26:34 +0200 Subject: [PATCH 102/108] Fix light fades being unable to lower light levels --- src/p_lights.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_lights.c b/src/p_lights.c index 75455da73..4b6a3673b 100644 --- a/src/p_lights.c +++ b/src/p_lights.c @@ -353,8 +353,8 @@ void P_FadeLightBySector(sector_t *sector, INT32 destvalue, INT32 speed, boolean else { // Speed means increment per tic (literally speed). - ll->timer = FixedDiv((destvalue<fixedcurlevel, speed<>FRACBITS; - ll->fixedpertic = speed<timer = abs(FixedDiv((destvalue<fixedcurlevel, speed<>FRACBITS); + ll->fixedpertic = ll->destlevel < ll->sourcelevel ? -speed< Date: Thu, 4 May 2023 16:17:10 +0200 Subject: [PATCH 103/108] 2.2.11 --- appveyor.yml | 2 +- assets/CMakeLists.txt | 1 + src/config.h.in | 5 +++-- src/doomdef.h | 2 +- src/version.h | 2 +- src/win32/Srb2win.rc | 4 ++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 348b727b1..e3348d35c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.2.10.{branch}-{build} +version: 2.2.11.{branch}-{build} os: MinGW environment: diff --git a/assets/CMakeLists.txt b/assets/CMakeLists.txt index de164b23f..dfb2f4180 100644 --- a/assets/CMakeLists.txt +++ b/assets/CMakeLists.txt @@ -29,6 +29,7 @@ set(SRB2_ASSETS_GAME "srb2.pk3" "player.dta" "zones.pk3" + "patch.pk3" "music.dta" "models.dat" ) diff --git a/src/config.h.in b/src/config.h.in index 22cfd6481..3d6d98375 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -27,12 +27,13 @@ * Last updated 2020 / 10 / 02 - v2.2.8 - patch.pk3 * Last updated 2021 / 05 / 06 - v2.2.9 - patch.pk3 & zones.pk3 * Last updated 2022 / 03 / 06 - v2.2.10 - main assets + * Last updated 2023 / 05 / 02 - v2.2.11 - patch.pk3 & zones.pk3 */ #define ASSET_HASH_SRB2_PK3 "ad911f29a28a18968ee5b2d11c2acb39" -#define ASSET_HASH_ZONES_PK3 "188a2bfd552196609323fc91ec1cdb22" +#define ASSET_HASH_ZONES_PK3 "1c8adf8d079ecb87d00081f158acf3c7" #define ASSET_HASH_PLAYER_DTA "2e7aaae8a6b1b77d90ffe7606ceadb6c" #ifdef USE_PATCH_DTA -#define ASSET_HASH_PATCH_PK3 "7d467a883f7887b3c311798ee2f56b6a" +#define ASSET_HASH_PATCH_PK3 "2e69558bce3b9610624549a75e29e19b" #endif #endif diff --git a/src/doomdef.h b/src/doomdef.h index 3abe27112..d521d4fbb 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 // Enforce a limit of loaded WAD files. //#define ENFORCE_WAD_LIMIT diff --git a/src/version.h b/src/version.h index f8b09ada6..083c53134 100644 --- a/src/version.h +++ b/src/version.h @@ -12,4 +12,4 @@ #define MODVERSION 52 // Define this as a prerelease version suffix (pre#, RC#) -#define BETAVERSION "pre3" +//#define BETAVERSION "pre1" diff --git a/src/win32/Srb2win.rc b/src/win32/Srb2win.rc index 07898dbc1..869c0e7d3 100644 --- a/src/win32/Srb2win.rc +++ b/src/win32/Srb2win.rc @@ -77,8 +77,8 @@ END #include "../doomdef.h" // Needed for version string VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,2,10,0 - PRODUCTVERSION 2,2,10,0 + FILEVERSION 2,2,11,0 + PRODUCTVERSION 2,2,11,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L From 6bb3ee226f825a013bd17b200d4d491e3170d780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Tue, 16 May 2023 19:16:14 +0200 Subject: [PATCH 104/108] Fix segfault when going up steep slopes in rare cases --- src/p_slopes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index cf7807d4e..48a13a07d 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -869,7 +869,7 @@ fixed_t P_GetWallTransferMomZ(mobj_t *mo, pslope_t *slope) vector3_t slopemom, axis; angle_t ang; - if (mo->standingslope->flags & SL_NOPHYSICS) + if (slope->flags & SL_NOPHYSICS) return 0; // If there's physics, time for launching. From d4951f7cdd804a237ded2ed66711d69901673636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Tue, 16 May 2023 22:18:11 +0200 Subject: [PATCH 105/108] Fix segfault when Crushstaceans hit a player with Armageddon shield --- src/p_enemy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index ca947fc20..618665c97 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2231,7 +2231,7 @@ void A_CrushclawLaunch(mobj_t *actor) } } - if (!actor->target) + if (P_MobjWasRemoved(actor->target)) return; { From 2f98cd3b972b35427ef42978af46bade61874f5e Mon Sep 17 00:00:00 2001 From: Jaime Ita Passos Date: Fri, 19 May 2023 14:26:30 -0300 Subject: [PATCH 106/108] Fix I_GetFreeMem --- src/android/i_system.c | 2 +- src/dummy/i_system.c | 2 +- src/i_system.h | 2 +- src/sdl/i_system.c | 13 ++++++------- src/z_zone.c | 10 +++++----- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/android/i_system.c b/src/android/i_system.c index f0edcc17e..ff8b88de5 100644 --- a/src/android/i_system.c +++ b/src/android/i_system.c @@ -24,7 +24,7 @@ static INT64 start_time; // as microseconds since the epoch // I should probably return how much memory is remaining // for this process, considering Android's process memory limit. -UINT32 I_GetFreeMem(UINT32 *total) +size_t I_GetFreeMem(size_t *total) { // what the heck? sysinfo() is partially missing in bionic? /* struct sysinfo si; */ diff --git a/src/dummy/i_system.c b/src/dummy/i_system.c index 997115ad0..00550c410 100644 --- a/src/dummy/i_system.c +++ b/src/dummy/i_system.c @@ -8,7 +8,7 @@ UINT8 graphics_started = 0; UINT8 keyboard_started = 0; -UINT32 I_GetFreeMem(UINT32 *total) +size_t I_GetFreeMem(UINT32 *total) { *total = 0; return 0; diff --git a/src/i_system.h b/src/i_system.h index 957150fe6..deea9f8a8 100644 --- a/src/i_system.h +++ b/src/i_system.h @@ -40,7 +40,7 @@ extern UINT8 keyboard_started; \return free memory in the system */ -UINT32 I_GetFreeMem(UINT32 *total); +size_t I_GetFreeMem(size_t *total); /** \brief Returns precise time value for performance measurement. The precise time should be a monotonically increasing counter, and will wrap. diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index e328bedc2..67ee8d668 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -2962,8 +2962,7 @@ static long get_entry(const char* name, const char* buf) } #endif -// quick fix for compil -UINT32 I_GetFreeMem(UINT32 *total) +size_t I_GetFreeMem(size_t *total) { #ifdef FREEBSD struct vmmeter sum; @@ -3011,14 +3010,14 @@ UINT32 I_GetFreeMem(UINT32 *total) info.dwLength = sizeof (MEMORYSTATUS); GlobalMemoryStatus( &info ); if (total) - *total = (UINT32)info.dwTotalPhys; - return (UINT32)info.dwAvailPhys; + *total = (size_t)info.dwTotalPhys; + return (size_t)info.dwAvailPhys; #elif defined (__linux__) /* Linux */ char buf[1024]; char *memTag; - UINT32 freeKBytes; - UINT32 totalKBytes; + size_t freeKBytes; + size_t totalKBytes; INT32 n; INT32 meminfo_fd = -1; long Cached; @@ -3049,7 +3048,7 @@ UINT32 I_GetFreeMem(UINT32 *total) } memTag += sizeof (MEMTOTAL); - totalKBytes = atoi(memTag); + totalKBytes = (size_t)atoi(memTag); if ((memTag = strstr(buf, MEMAVAILABLE)) == NULL) { diff --git a/src/z_zone.c b/src/z_zone.c index c012816ff..11c4bcb2c 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -106,14 +106,14 @@ static void Command_Memdump_f(void); */ void Z_Init(void) { - UINT32 total, memfree; + size_t total, memfree; memset(&head, 0x00, sizeof(head)); head.next = head.prev = &head; memfree = I_GetFreeMem(&total)>>20; - CONS_Printf("System memory: %uMB - Free: %uMB\n", total>>20, memfree); + CONS_Printf("System memory: %sMB - Free: %sMB\n", sizeu1(total>>20), sizeu2(memfree)); // Note: This allocates memory. Watch out. COM_AddCommand("memfree", Command_Memfree_f, COM_LUA); @@ -791,7 +791,7 @@ size_t Z_TagsUsage(INT32 lowtag, INT32 hightag) */ static void Command_Memfree_f(void) { - UINT32 freebytes, totalbytes; + size_t freebytes, totalbytes; Z_CheckHeap(-1); CONS_Printf("\x82%s", M_GetText("Memory Info\n")); @@ -824,8 +824,8 @@ static void Command_Memfree_f(void) CONS_Printf("\x82%s", M_GetText("System Memory Info\n")); freebytes = I_GetFreeMem(&totalbytes); - CONS_Printf(M_GetText(" Total physical memory: %7u KB\n"), totalbytes>>10); - CONS_Printf(M_GetText("Available physical memory: %7u KB\n"), freebytes>>10); + CONS_Printf(M_GetText(" Total physical memory: %s KB\n"), sizeu1(totalbytes>>10)); + CONS_Printf(M_GetText("Available physical memory: %s KB\n"), sizeu1(freebytes>>10)); } #ifdef ZDEBUG From 7dc74fc364b688a44279a7d29322798fb838fd99 Mon Sep 17 00:00:00 2001 From: Jaime Ita Passos Date: Fri, 19 May 2023 15:12:20 -0300 Subject: [PATCH 107/108] Fix declaration of I_GetFreeMem in src/dummy/i_system.c --- src/dummy/i_system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dummy/i_system.c b/src/dummy/i_system.c index 00550c410..8556c0248 100644 --- a/src/dummy/i_system.c +++ b/src/dummy/i_system.c @@ -8,7 +8,7 @@ UINT8 graphics_started = 0; UINT8 keyboard_started = 0; -size_t I_GetFreeMem(UINT32 *total) +size_t I_GetFreeMem(size_t *total) { *total = 0; return 0; From b9c86a0f7f579253f622fc00ca8e5ac9b513f89d Mon Sep 17 00:00:00 2001 From: spherallic Date: Tue, 23 May 2023 17:51:56 +0200 Subject: [PATCH 108/108] Zone Builder config updates --- extras/conf/SRB2-22.cfg | 299 ++++++++++++++++++++++------------------ 1 file changed, 163 insertions(+), 136 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index ae905b637..b5078cd0c 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -41,6 +41,9 @@ linetagindicatesectors = true; // The format interface handles the map data format - DoomMapSetIO for SRB2DB2, SRB2MapSetIO for Zone Builder formatinterface = "SRB2MapSetIO"; + +//Maximum safe map size check (0 means skip check) +safeboundary = 0; //Sky textures for vanilla maps defaultskytextures @@ -77,7 +80,7 @@ defaultskytextures defaultlumpname = "MAP01"; // Default testing parameters -testparameters = "-file \"%AP\" \"%F\" -warp %L"; +testparameters = "-folder \"%AF\" -file \"%AA\" \"%F\" -warp %L"; testshortpaths = true; // Default nodebuilder configurations @@ -437,6 +440,8 @@ sectortypes 144 = "Egg Capsule"; 160 = "Special Stage Time/Spheres Parameters "; 176 = "Custom Global Gravity "; + 512 = "Wind/Current "; + 1024 = "Conveyor Belt "; 1280 = "Speed Pad"; 1536 = "Flip Gravity on Jump"; 4096 = "Star Post Activator"; @@ -496,6 +501,8 @@ gen_sectortypes third { 0 = "Normal"; + 512 = "Wind/Current "; + 1024 = "Conveyor Belt "; 1280 = "Speed Pad"; 1536 = "Flip Gravity on Jump"; } @@ -578,7 +585,7 @@ linedeftypes title = "Per-Sector Gravity"; prefix = "(1)"; flags64text = "[6] Flip in reverse gravity"; - flags8192text = "[13] Reverse while inside"; + flags8192text = "[13] Cancel MF2_OBJECTFLIP"; } 5 @@ -641,35 +648,35 @@ linedeftypes 96 { - title = "Apply Tag to Tagged Sectors"; + title = "Add Front Sector Tag to Tagged Sectors"; prefix = "(96)"; flags1024text = "[10] Offsets are target tags"; - flags8192text = "[13] Use front side offsets"; - flags32768text = "[15] Use back side offsets"; + flags8192text = "[13] Add front side offsets"; + flags32768text = "[15] Add back side offsets"; } 97 { - title = "Apply Tag to Front Sector"; + title = "Add Tag to Front Sector"; prefix = "(97)"; - flags8192text = "[13] Use front side offsets"; - flags32768text = "[15] Use back side offsets"; + flags8192text = "[13] Add front side offsets"; + flags32768text = "[15] Add back side offsets"; } 98 { - title = "Apply Tag to Back Sector"; + title = "Add Tag to Back Sector"; prefix = "(98)"; - flags8192text = "[13] Use front side offsets"; - flags32768text = "[15] Use back side offsets"; + flags8192text = "[13] Add front side offsets"; + flags32768text = "[15] Add back side offsets"; } 99 { - title = "Apply Tag to Front and Back Sectors"; + title = "Add Tag to Front and Back Sectors"; prefix = "(99)"; - flags8192text = "[13] Use front side offsets"; - flags32768text = "[15] Use back side offsets"; + flags8192text = "[13] Add front side offsets"; + flags32768text = "[15] Add back side offsets"; } 540 @@ -990,6 +997,7 @@ linedeftypes flags128text = "[7] Only block non-players"; 3dfloor = true; 3dfloorflags = "47"; + invisiblefof = true; } 140 @@ -1227,6 +1235,7 @@ linedeftypes prefix = "(223)"; 3dfloor = true; 3dfloorflags = "41"; + invisiblefof = true; } } @@ -1524,6 +1533,7 @@ linedeftypes prefix = "(200)"; 3dfloor = true; 3dfloorflags = "20201"; + invisiblefof = true; } 201 @@ -1532,6 +1542,7 @@ linedeftypes prefix = "(201)"; 3dfloor = true; 3dfloorflags = "201"; + invisiblefof = true; } 202 @@ -1539,7 +1550,8 @@ linedeftypes title = "Fog Block"; prefix = "(202)"; 3dfloor = true; - 3dfloorflags = "3EF19"; + 3dfloorflags = "3EF01"; + invisiblefof = true; } 250 @@ -3624,7 +3636,7 @@ thingtypes 3328 = "3D Mode Start"; } - + starts { color = 1; // Blue @@ -3814,7 +3826,7 @@ thingtypes enemies { - color = 9; // Light_Blue + color = 9; // Light Blue arrow = 1; title = "Enemies"; @@ -4124,7 +4136,7 @@ thingtypes bosses { - color = 8; // Dark_Gray + color = 4; // Dark Red arrow = 1; title = "Bosses"; @@ -4223,6 +4235,7 @@ thingtypes sprite = "internal:capsule"; angletext = "Tag"; fixedrotation = 1; + tagthing = true; } 292 { @@ -4310,13 +4323,13 @@ thingtypes 308 { title = "CTF Team Ring (Red)"; - sprite = "internal:TRNGA0r"; + sprite = "internal:TRNGA0R"; width = 16; } 309 { title = "CTF Team Ring (Blue)"; - sprite = "internal:TRNGA0b"; + sprite = "internal:TRNGA0B"; width = 16; } 330 @@ -4353,7 +4366,7 @@ thingtypes collectibles { - color = 10; // Light_Green + color = 10; // Light Green title = "Other Collectibles"; width = 16; height = 32; @@ -4457,6 +4470,7 @@ thingtypes flags8text = "[8] Random (Weak)"; angletext = "Tag"; fixedrotation = 1; + tagthing = true; 400 { @@ -4589,6 +4603,7 @@ thingtypes flags1text = "[1] Run linedef executor on pop"; angletext = "Tag"; fixedrotation = 1; + tagthing = true; 431 { @@ -4659,7 +4674,7 @@ thingtypes generic { - color = 11; // Light_Cyan + color = 11; // Light Cyan title = "Generic Items & Hazards"; 500 @@ -4765,7 +4780,7 @@ thingtypes springs { - color = 12; // Light_Red + color = 12; // Light Red title = "Springs and Fans"; width = 20; height = 16; @@ -4927,13 +4942,13 @@ thingtypes { arrow = 0; title = "5 Vertical Rings (Yellow Spring)"; - sprite = "RINGA0"; + sprite = "internal:ringverticalyellow"; } 601 { arrow = 0; title = "5 Vertical Rings (Red Spring)"; - sprite = "RINGA0"; + sprite = "internal:ringverticalred"; height = 1024; } 602 @@ -4951,7 +4966,7 @@ thingtypes 604 { title = "Circle of Rings"; - sprite = "RINGA0"; + sprite = "internal:circlering"; width = 96; height = 192; unflippable = true; @@ -4960,7 +4975,7 @@ thingtypes 605 { title = "Circle of Rings (Big)"; - sprite = "RINGA0"; + sprite = "internal:circlebigring"; width = 192; unflippable = true; centerHitbox = true; @@ -4968,7 +4983,7 @@ thingtypes 606 { title = "Circle of Blue Spheres"; - sprite = "SPHRA0"; + sprite = "internal:circlesphere"; width = 96; height = 192; unflippable = true; @@ -4977,7 +4992,7 @@ thingtypes 607 { title = "Circle of Blue Spheres (Big)"; - sprite = "SPHRA0"; + sprite = "internal:circlebigsphere"; width = 192; unflippable = true; centerHitbox = true; @@ -4985,7 +5000,7 @@ thingtypes 608 { title = "Circle of Rings and Spheres"; - sprite = "SPHRA0"; + sprite = "internal:circleringsphere"; width = 96; height = 192; unflippable = true; @@ -4994,13 +5009,77 @@ thingtypes 609 { title = "Circle of Rings and Spheres (Big)"; - sprite = "SPHRA0"; + sprite = "internal:circlebigringsphere"; width = 192; unflippable = true; centerHitbox = true; } } + ambience + { + color = 8; // Dark Gray + title = "Ambience"; + width = 8; + height = 16; + sprite = "internal:ambiance"; + + 700 + { + title = "Water Ambience A (Large)"; + } + + 701 + { + title = "Water Ambience B (Large)"; + } + + 702 + { + title = "Water Ambience C (Medium)"; + } + + 703 + { + title = "Water Ambience D (Medium)"; + } + + 704 + { + title = "Water Ambience E (Small)"; + } + + 705 + { + title = "Water Ambience F (Small)"; + } + + 706 + { + title = "Water Ambience G (Extra Large)"; + } + + 707 + { + title = "Water Ambience H (Extra Large)"; + } + + 708 + { + title = "Disco Ambience"; + } + + 709 + { + title = "Volcano Ambience"; + } + + 710 + { + title = "Machine Ambience"; + } + } + invisible { color = 15; // White @@ -5009,72 +5088,6 @@ thingtypes height = 16; sprite = "UNKNA0"; - 700 - { - title = "Water Ambience A (Large)"; - sprite = "internal:ambiance"; - } - - 701 - { - title = "Water Ambience B (Large)"; - sprite = "internal:ambiance"; - } - - 702 - { - title = "Water Ambience C (Medium)"; - sprite = "internal:ambiance"; - } - - 703 - { - title = "Water Ambience D (Medium)"; - sprite = "internal:ambiance"; - } - - 704 - { - title = "Water Ambience E (Small)"; - sprite = "internal:ambiance"; - } - - 705 - { - title = "Water Ambience F (Small)"; - sprite = "internal:ambiance"; - } - - 706 - { - title = "Water Ambience G (Extra Large)"; - sprite = "internal:ambiance"; - } - - 707 - { - title = "Water Ambience H (Extra Large)"; - sprite = "internal:ambiance"; - } - - 708 - { - title = "Disco Ambience"; - sprite = "internal:ambiance"; - } - - 709 - { - title = "Volcano Ambience"; - sprite = "internal:ambiance"; - } - - 710 - { - title = "Machine Ambience"; - sprite = "internal:ambiance"; - } - 750 { title = "Slope Vertex"; @@ -5083,6 +5096,7 @@ thingtypes fixedrotation = 1; parametertext = "Absolute?"; flagsvaluetext = "Absolute Z"; + tagthing = true; } 751 @@ -5128,20 +5142,22 @@ thingtypes 756 { title = "Blast Linedef Executor"; - sprite = "TOADA0"; + sprite = "internal:blastexec"; width = 32; height = 16; angletext = "Tag"; fixedrotation = 1; + tagthing = true; } 757 { title = "Fan Particle Generator"; - sprite = "PRTLA0"; + sprite = "internal:fanparticles"; width = 8; height = 16; angletext = "Tag"; fixedrotation = 1; + tagthing = true; } 758 { @@ -5154,6 +5170,8 @@ thingtypes sprite = "internal:polyanchor"; angletext = "Tag"; fixedrotation = 1; + tagthing = true; + unflippable = true; } 761 @@ -5162,6 +5180,8 @@ thingtypes sprite = "internal:polycenter"; angletext = "Tag"; fixedrotation = 1; + tagthing = true; + unflippable = true; } 762 @@ -5170,6 +5190,8 @@ thingtypes sprite = "internal:polycentercrush"; angletext = "Tag"; fixedrotation = 1; + tagthing = true; + unflippable = true; } 780 { @@ -5183,7 +5205,7 @@ thingtypes greenflower { - color = 10; // Green + color = 2; // Green title = "Greenflower"; 800 @@ -5288,7 +5310,7 @@ thingtypes technohill { - color = 10; // Green + color = 2; // Green title = "Techno Hill"; 900 @@ -5332,7 +5354,7 @@ thingtypes deepsea { - color = 10; // Green + color = 2; // Green title = "Deep Sea"; 1000 @@ -5467,7 +5489,7 @@ thingtypes castleeggman { - color = 10; // Green + color = 2; // Green title = "Castle Eggman"; 1100 @@ -5516,6 +5538,7 @@ thingtypes angletext = "Tag"; parametertext = "Spokes"; fixedrotation = 1; + tagthing = true; } 1105 { @@ -5528,6 +5551,7 @@ thingtypes angletext = "Tag"; parametertext = "Spokes"; fixedrotation = 1; + tagthing = true; } 1106 { @@ -5540,23 +5564,25 @@ thingtypes angletext = "Tag"; parametertext = "Spokes"; fixedrotation = 1; + tagthing = true; } 1107 { title = "Chain Spawnpoint"; - sprite = "BMCHA0"; + sprite = "BMCHB0"; width = 17; height = 34; flags8text = "[8] Double size"; angletext = "Tag"; parametertext = "Spokes"; fixedrotation = 1; + tagthing = true; } 1108 { arrow = 1; title = "Hidden Chain Spawnpoint"; - sprite = "internal:chain3"; + sprite = "SMCHA0"; width = 17; height = 34; flags8text = "[8] Double size"; @@ -5572,6 +5598,7 @@ thingtypes angletext = "Tag"; parametertext = "Spokes"; fixedrotation = 1; + tagthing = true; } 1110 { @@ -5583,6 +5610,7 @@ thingtypes angletext = "Tag"; parametertext = "Spokes"; fixedrotation = 1; + tagthing = true; } 1111 { @@ -5736,7 +5764,7 @@ thingtypes aridcanyon { - color = 10; // Green + color = 2; // Green title = "Arid Canyon"; 1200 @@ -5764,6 +5792,7 @@ thingtypes height = 16; angletext = "Tag"; fixedrotation = 1; + tagthing = true; } 1203 { @@ -5955,7 +5984,7 @@ thingtypes redvolcano { - color = 10; // Green + color = 2; // Green title = "Red Volcano"; 1300 @@ -6055,7 +6084,7 @@ thingtypes botanicserenity { - color = 10; // Green + color = 2; // Green title = "Botanic Serenity"; width = 16; height = 32; @@ -6298,7 +6327,7 @@ thingtypes azuretemple { - color = 10; // Green + color = 2; // Green title = "Azure Temple"; 1500 @@ -6374,7 +6403,7 @@ thingtypes dreamhill { - color = 10; // Green + color = 2; // Green title = "Dream Hill"; 1600 @@ -6402,8 +6431,8 @@ thingtypes nightstrk { - color = 13; // Pink - title = "NiGHTS Track"; + color = 16; // Light Pink + title = "NiGHTS Track & Basics"; width = 8; height = 4096; sprite = "UNKNA0"; @@ -6438,6 +6467,19 @@ thingtypes flagsvaluetext = "Order"; parametertext = "Mare"; } + 1703 + { + title = "Ideya Drone"; + sprite = "NDRNA1"; + width = 16; + height = 56; + flags1text = "[1] Align player to middle"; + flags4text = "[4] Align player to top"; + flags8text = "[8] Die upon time up"; + angletext = "Time limit"; + fixedrotation = 1; + parametertext = "Height"; + } 1710 { title = "Ideya Capture"; @@ -6455,20 +6497,6 @@ thingtypes title = "NiGHTS Items"; width = 16; height = 32; - - 1703 - { - title = "Ideya Drone"; - sprite = "NDRNA1"; - width = 16; - height = 56; - flags1text = "[1] Align player to middle"; - flags4text = "[4] Align player to top"; - flags8text = "[8] Die upon time up"; - angletext = "Time limit"; - fixedrotation = 1; - parametertext = "Height"; - } 1704 { arrow = 1; @@ -6479,13 +6507,12 @@ thingtypes unflippable = true; flagsvaluetext = "Pitch"; angletext = "Yaw"; - fixedrotation = 1; } 1705 { arrow = 1; title = "Hoop (Generic)"; - sprite = "HOOPA0"; + sprite = "internal:nightshoop"; width = 80; height = 160; unflippable = true; @@ -6502,7 +6529,6 @@ thingtypes height = 24; flags8height = 24; flags8text = "[8] Float"; - unflippable = true; } 1707 { @@ -6547,7 +6573,7 @@ thingtypes flags2text = "[2] Radius +32"; flags4text = "[4] Radius +64"; flags8text = "[8] Radius +128"; - sprite = "HOOPA0"; + sprite = "internal:nightshoop"; width = 80; height = 160; unflippable = true; @@ -6657,7 +6683,7 @@ thingtypes christmasdisco { - color = 10; // Green + color = 2; // Green title = "Christmas & Disco"; 1850 @@ -6760,7 +6786,7 @@ thingtypes stalagmites { - color = 10; // Green + color = 2; // Green title = "Stalagmites"; width = 16; height = 40; @@ -6839,7 +6865,7 @@ thingtypes hauntedheights { - color = 10; // Green + color = 2; // Green title = "Haunted Heights"; 2000 @@ -6928,7 +6954,7 @@ thingtypes frozenhillside { - color = 10; // Green + color = 2; // Green title = "Frozen Hillside"; 2100 @@ -6979,7 +7005,7 @@ thingtypes tutorial { - color = 10; // Green + color = 2; // Green title = "Tutorial"; 799 @@ -6990,10 +7016,11 @@ thingtypes height = 144; parametertext = "Start frame"; } + } flickies { - color = 10; // Green + color = 3; // Teal title = "Flickies"; width = 8; height = 20;