From 7d3be06795eb9f79ccfde737294c70c701c5e98a Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 30 Apr 2024 23:42:27 -0400 Subject: [PATCH 01/26] Full FREE PLAY item reel All items in the game are put into the FREE PLAY item reel, instead of the fake "time attack" behavior. Everyone's already just turning off items to get a particular one, so turn it into a feature. Tutorials are specifically set to be unaffected. --- src/k_roulette.c | 53 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/src/k_roulette.c b/src/k_roulette.c index 2e05b1862..900b851d2 100644 --- a/src/k_roulette.c +++ b/src/k_roulette.c @@ -1356,7 +1356,7 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet } else if (K_TimeAttackRules() == true) { - kartitems_t *presetlist = K_KartItemReelRingSneaker; + kartitems_t *presetlist = NULL; // If the objective is not to go fast, it's to cause serious damage. if (battleprisons == true) @@ -1367,10 +1367,55 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet { presetlist = K_KartItemReelSPBAttack; } - - for (i = 0; presetlist[i] != KITEM_NONE; i++) + else if (gametype == GT_TUTORIAL) { - K_PushToRouletteItemList(roulette, presetlist[i]); + presetlist = K_KartItemReelRingSneaker; + } + + if (presetlist != NULL) + { + for (i = 0; presetlist[i] != KITEM_NONE; i++) + { + K_PushToRouletteItemList(roulette, presetlist[i]); + } + } + else + { + // New FREE PLAY behavior; + // every item in the game! + + // Create the same item reel given the same inputs. + P_SetRandSeed(PR_ITEM_ROULETTE, ITEM_REEL_SEED); + + for (i = 1; i < NUMKARTRESULTS; i++) + { + if (K_ItemEnabled(i) == true) + { + spawnChance[i] = ( totalSpawnChance++ ); + } + } + + while (totalSpawnChance > 0) + { + rngRoll = P_RandomKey(PR_ITEM_ROULETTE, totalSpawnChance); + for (i = 1; i < NUMKARTRESULTS && spawnChance[i] <= rngRoll; i++) + { + continue; + } + + K_AddItemToReel(player, roulette, i); + + for (; i < NUMKARTRESULTS; i++) + { + // Be sure to fix the remaining items' odds too. + if (spawnChance[i] > 0) + { + spawnChance[i]--; + } + } + + totalSpawnChance--; + } } return; From dcd0fe7feb4ae94695a5df782e009cb231c6f0cf Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 1 May 2024 18:08:36 +0100 Subject: [PATCH 02/26] G_SaveDemo: Defer save for eversavedreplay event Prevents challenge success noise from being eaten by gamestate transition --- src/g_demo.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/g_demo.cpp b/src/g_demo.cpp index 4e0bfd437..bb6aff69b 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -4174,8 +4174,11 @@ void G_SaveDemo(void) if (gamedata->eversavedreplay == false) { gamedata->eversavedreplay = true; - M_UpdateUnlockablesAndExtraEmblems(true, true); - G_SaveGameData(); + // The following will IMMEDIATELY happen on either next level load + // or returning to menu, so don't make the sound just to get cut off + //M_UpdateUnlockablesAndExtraEmblems(true, true); + //G_SaveGameData(); + gamedata->deferredsave = true; } } else From 7390ee54427327467787d94d1d5935d8b36107c4 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 1 May 2024 19:54:09 +0100 Subject: [PATCH 03/26] G_SaveDemo: Resolve memory errors that could result in crashes - Empty `demo.titlename` case - Don't try to save demo of name `.lmp` - Doesn't fall back to anything, because emptying out the name field can be reasonably treated as not wanting to save - `demo.titlename` consists only of invalid characters - Don't try to save demo of name `-.lmp` - Falls back to the default demo title, because the user clearly wanted to save and just happened to provide invalid text --- src/g_demo.cpp | 31 +++++++++++++++++++++++++------ src/st_stuff.c | 2 +- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/g_demo.cpp b/src/g_demo.cpp index bb6aff69b..310510ae5 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -4135,7 +4135,7 @@ void G_SaveDemo(void) strindex++; dash = false; } - else if (!dash) + else if (strindex && !dash) { demo_slug[strindex] = '-'; strindex++; @@ -4143,12 +4143,31 @@ void G_SaveDemo(void) } } - demo_slug[strindex] = 0; - if (dash) demo_slug[strindex-1] = 0; + if (dash && strindex) + { + strindex--; + } + demo_slug[strindex] = '\0'; - writepoint = strstr(strrchr(demoname, *PATHSEP), "-") + 1; - demo_slug[128 - (writepoint - demoname) - 4] = 0; - sprintf(writepoint, "%s.lmp", demo_slug); + if (demo_slug[0] != '\0') + { + // Slug is valid, write the chosen filename. + writepoint = strstr(strrchr(demoname, *PATHSEP), "-") + 1; + demo_slug[128 - (writepoint - demoname) - 4] = 0; + sprintf(writepoint, "%s.lmp", demo_slug); + } + else if (demo.titlename[0] == '\0') + { + // Slug is completely blank? Will crash if we attempt to save + // No bailout because empty seems like a good "no thanks" choice + G_ResetDemoRecording(); + return; + } + // If a title that is invalid is provided, the user clearly wanted + // to save. But we can't do so at that name, so we only apply the + // title INSIDE the file, not in the naked filesystem. + // (A hypothetical example is bamboozling bot behaviour causing + // a player to write "?????????".) ~toast 010524 } length = *(UINT32 *)demoinfo_p; diff --git a/src/st_stuff.c b/src/st_stuff.c index 21e0669b1..69e0b4d34 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1490,7 +1490,7 @@ void ST_DrawSaveReplayHint(INT32 flags) V_DrawRightAlignedThinString( BASEVIDWIDTH - 2, 2, flags|V_YELLOWMAP, - demo.willsave ? "Replay will be saved. \xAB Change title" : "\xAB or \xAD Save replay" + (demo.willsave && demo.titlename[0]) ? "Replay will be saved. \xAB Change title" : "\xAB or \xAD Save replay" ); } From 9d0c9ece4b4d2fdb08bb52395f4a3fcab2665327 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 1 May 2024 19:55:30 +0100 Subject: [PATCH 04/26] Demos: Use long lumpname when handling staff ghost information Implements new W_CheckLongNameForNum funcs, which are broadly copypasted from W_CheckNameForNum --- src/k_credits.cpp | 1 - src/p_setup.cpp | 2 +- src/w_wad.cpp | 13 +++++++++++++ src/w_wad.h | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/k_credits.cpp b/src/k_credits.cpp index d867e2b6e..6c14f4dc1 100644 --- a/src/k_credits.cpp +++ b/src/k_credits.cpp @@ -555,7 +555,6 @@ static boolean F_CreditsPlayDemo(void) UINT8 ghost_id = M_RandomKey( mapheaderinfo[map_id]->ghostCount ); brief = mapheaderinfo[map_id]->ghostBrief[ghost_id]; - std::string demo_name = static_cast(W_CheckNameForNumPwad(brief->wad, brief->lump)); demo.attract = DEMO_ATTRACT_CREDITS; demo.ignorefiles = true; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 058f4a792..b1d011b07 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -7901,7 +7901,7 @@ static void P_LoadRecordGhosts(void) savebuffer_t buf = {0}; staffbrief_t* ghostbrief = mapheaderinfo[gamemap-1]->ghostBrief[i - 1]; - const char* lumpname = W_CheckNameForNumPwad(ghostbrief->wad, ghostbrief->lump); + const char* lumpname = W_CheckLongNameForNumPwad(ghostbrief->wad, ghostbrief->lump); size_t lumplength = W_LumpLengthPwad(ghostbrief->wad, ghostbrief->lump); if (lumplength == 0) { diff --git a/src/w_wad.cpp b/src/w_wad.cpp index 604ed203e..8d31c97a1 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -1021,6 +1021,19 @@ const char *W_CheckNameForNum(lumpnum_t lumpnum) return W_CheckNameForNumPwad(WADFILENUM(lumpnum),LUMPNUM(lumpnum)); } +const char *W_CheckLongNameForNumPwad(UINT16 wad, UINT16 lump) +{ + if (lump >= wadfiles[wad]->numlumps || !TestValidLump(wad, 0)) + return NULL; + + return wadfiles[wad]->lumpinfo[lump].longname; +} + +const char *W_CheckLongNameForNum(lumpnum_t lumpnum) +{ + return W_CheckLongNameForNumPwad(WADFILENUM(lumpnum),LUMPNUM(lumpnum)); +} + // // wadid is a wad number // (Used for sprites loading) diff --git a/src/w_wad.h b/src/w_wad.h index d224475d9..a928ffc44 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -154,6 +154,8 @@ INT32 W_InitMultipleFiles(char **filenames, boolean addons); const char *W_CheckNameForNumPwad(UINT16 wad, UINT16 lump); const char *W_CheckNameForNum(lumpnum_t lumpnum); +const char *W_CheckLongNameForNumPwad(UINT16 wad, UINT16 lump); +const char *W_CheckLongNameForNum(lumpnum_t lumpnum); UINT16 W_FindNextEmptyInPwad(UINT16 wad, UINT16 startlump); // checks only in one pwad From db6e4afdaa3c20d1386b95ec646248f43a61ccd7 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Wed, 1 May 2024 21:21:29 -0700 Subject: [PATCH 05/26] Disallow restartlevel in rule-restricted gameplay --- src/d_netcmd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2f15f2840..43d5b5a75 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2982,6 +2982,12 @@ static void Command_RestartLevel(void) return; } + if (K_CanChangeRules(false) == false && CV_CheatsEnabled() == false) + { + CONS_Printf(M_GetText("Cheats must be enabled.\n")); + return; + } + if (cv_kartencore.value != 0) { newencore = (cv_kartencore.value == 1) || encoremode; From c44fbc8200560a1187a4e8de0ecfee8447bb3928 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 2 May 2024 20:49:45 +0100 Subject: [PATCH 06/26] Communicate the total number of Spray Cans to grab on the Courses & Medals page of the Statistics screen --- src/k_menudraw.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 5cbd79f73..a6f4880b7 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -8093,13 +8093,24 @@ static void M_DrawStatsMaps(void) return; } - INT32 mapsunfinished = 0; + INT32 mapsunfinished = 0, medalspos; - V_DrawThinString(30, 60, 0, va("x %d/%d", statisticsmenu.gotmedals, statisticsmenu.nummedals)); + char *medalcountstr = va("x %d/%d", statisticsmenu.gotmedals, statisticsmenu.nummedals); + + V_DrawThinString(30, 60, 0, medalcountstr); V_DrawMappedPatch(20, 60, 0, W_CachePatchName("GOTITA", PU_CACHE), R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_GOLD, GTC_MENUCACHE)); - INT32 medalspos = BASEVIDWIDTH - 20; + if (gamedata->numspraycans) + { + medalspos = 30 + V_ThinStringWidth(medalcountstr, 0); + medalcountstr = va("x %d/%d", gamedata->gotspraycans, gamedata->numspraycans); + V_DrawThinString(20 + medalspos, 60, 0, medalcountstr); + V_DrawMappedPatch(10 + medalspos, 60, 0, W_CachePatchName("GOTCAN", PU_CACHE), + R_GetTranslationColormap(TC_DEFAULT, gamedata->spraycans[0].col, GTC_MENUCACHE)); + } + + medalspos = BASEVIDWIDTH - 20; boolean timeattack[3]; timeattack[0] = M_SecretUnlocked(SECRET_TIMEATTACK, true); From 44923c2b2aa0ad9409c69a34820eb45243e1f5f3 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 3 May 2024 00:57:05 -0700 Subject: [PATCH 07/26] Line sweep polyobject sides Gremlin III vanquished for Balloon Park elephants. --- src/g_demo.cpp | 1 + src/p_map.c | 4 ++-- src/p_polyobj.c | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/g_demo.cpp b/src/g_demo.cpp index 4e0bfd437..3055f035c 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -164,6 +164,7 @@ demoghost *ghosts = NULL; // - 0x000A (Ring Racers v2.0) // - A bug was preventing control after ending a drift. // Older behavior is kept around for staff ghost compat. +// - Also, polyobject bounce-back was fixed! #define DEMOVERSION 0x000B diff --git a/src/p_map.c b/src/p_map.c index 84126fb8d..bb7868dd4 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2186,6 +2186,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y, TryMoveResult_t *re } } + P_ClearTestLines(); + // The bounding box is extended by MAXRADIUS // because mobj_ts are grouped into mapblocks // based on their origin point, and can overlap @@ -2323,8 +2325,6 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y, TryMoveResult_t *re validcount++; - P_ClearTestLines(); - // check lines for (bx = xl; bx <= xh; bx++) { diff --git a/src/p_polyobj.c b/src/p_polyobj.c index 80f03d0f7..82eb95432 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -201,6 +201,10 @@ boolean P_BBoxInsidePolyobj(polyobj_t *po, fixed_t *bbox) { if (P_BoxOnLineSide(bbox, po->lines[i]) == 0) return false; + if (g_tm.sweep && !G_CompatLevel(0x000A)) + { + P_TestLine(po->lines[i]); + } } return true; From cfacbd91be0e8326f440ba2982c63200fbf03680 Mon Sep 17 00:00:00 2001 From: bitten2up <575-bitten2up@users.noreply.git.do.srb2.org> Date: Fri, 3 May 2024 17:53:53 +0000 Subject: [PATCH 08/26] Fix implicit casts of int expecting 4-byte width This fixes the issue with certain compilers that have int set to different sizes by either explicitly casting or setting templates manually --- src/acs/call-funcs.cpp | 2 +- src/g_build_ticcmd.cpp | 12 ++++++------ src/g_demo.cpp | 1 + src/hardware/hw_md2.c | 2 +- src/k_credits.cpp | 4 ++-- src/k_dialogue.cpp | 4 ++-- src/k_director.cpp | 4 ++-- src/k_endcam.cpp | 2 +- src/k_hud.cpp | 14 +++++++------- src/k_hud_track.cpp | 8 ++++---- src/k_tally.cpp | 16 ++++++++-------- src/k_waypoint.cpp | 4 ++-- src/m_misc.cpp | 4 ++-- src/menus/transient/pause-addonoptions.cpp | 4 ++-- src/menus/transient/pause-cheats.cpp | 2 +- src/objects/checkpoint.cpp | 4 ++-- src/objects/destroyed-kart.cpp | 2 +- src/objects/gachabom-rebound.cpp | 4 ++-- src/objects/powerup-spinner.cpp | 2 +- src/objects/pulley.cpp | 2 +- src/p_setup.cpp | 10 +++++----- src/r_debug.cpp | 4 ++-- src/r_plane.cpp | 2 +- src/r_segs.cpp | 4 ++-- src/r_things.cpp | 10 +++++----- src/rhi/gl2/gl2_rhi.cpp | 2 +- src/sdl/i_video.cpp | 2 +- src/v_video.cpp | 18 +++++++++--------- src/y_inter.cpp | 4 ++-- thirdparty/libwebm/mkvmuxer/mkvmuxer.h | 2 +- thirdparty/libwebm/mkvmuxer/mkvmuxertypes.h | 9 +++++---- 31 files changed, 83 insertions(+), 81 deletions(-) diff --git a/src/acs/call-funcs.cpp b/src/acs/call-funcs.cpp index 196c31d01..3283bb865 100644 --- a/src/acs/call-funcs.cpp +++ b/src/acs/call-funcs.cpp @@ -2026,7 +2026,7 @@ bool CallFunc_SetLineRenderStyle(ACSVM::Thread *thread, const ACSVM::Word *argV, } alpha = argV[2]; - alpha = std::clamp(alpha, 0, FRACUNIT); + alpha = std::clamp(alpha, 0, FRACUNIT); TAG_ITER_LINES(tag, lineId) { diff --git a/src/g_build_ticcmd.cpp b/src/g_build_ticcmd.cpp index 72655ada4..b74f48d2d 100644 --- a/src/g_build_ticcmd.cpp +++ b/src/g_build_ticcmd.cpp @@ -64,7 +64,7 @@ INT32 G_BasicDeadZoneCalculation(INT32 magnitude, fixed_t deadZone) } // Calculate how much the magnitude exceeds the deadzone - adjustedMagnitude = std::min(adjustedMagnitude, JOYAXISRANGE) - jdeadzone; + adjustedMagnitude = std::min(adjustedMagnitude, JOYAXISRANGE) - jdeadzone; return (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone); } @@ -133,10 +133,10 @@ class TiccmdBuilder joystickvector.yaxis = (normalisedYAxis * normalisedMagnitude) / JOYAXISRANGE; // Cap the values so they don't go above the correct maximum - joystickvector.xaxis = std::min(joystickvector.xaxis, JOYAXISRANGE); - joystickvector.xaxis = std::max(joystickvector.xaxis, -JOYAXISRANGE); - joystickvector.yaxis = std::min(joystickvector.yaxis, JOYAXISRANGE); - joystickvector.yaxis = std::max(joystickvector.yaxis, -JOYAXISRANGE); + joystickvector.xaxis = std::min(joystickvector.xaxis, JOYAXISRANGE); + joystickvector.xaxis = std::max(joystickvector.xaxis, -JOYAXISRANGE); + joystickvector.yaxis = std::min(joystickvector.yaxis, JOYAXISRANGE); + joystickvector.yaxis = std::max(joystickvector.yaxis, -JOYAXISRANGE); } void hook() @@ -379,7 +379,7 @@ class TiccmdBuilder kart_analog_input(); // Digital users can input diagonal-back for shallow turns. - // + // // There's probably some principled way of doing this in the gamepad handler itself, // by only applying this filtering to inputs sourced from an axis. This is a little // ugly with the current abstractions, though, and there's a fortunate trick here: diff --git a/src/g_demo.cpp b/src/g_demo.cpp index f11e6e214..4fc8642ec 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -19,6 +19,7 @@ #include #include "doomdef.h" +#include "doomtype.h" #include "console.h" #include "d_main.h" #include "d_player.h" diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 08a4e28cc..c6c25cb10 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -592,7 +592,7 @@ modelfound: fclose(f); } -void HWR_AddPlayerModel(int skin) // For skins that were added after startup +void HWR_AddPlayerModel(INT32 skin) // For skins that were added after startup { FILE *f; char name[24], filename[32]; diff --git a/src/k_credits.cpp b/src/k_credits.cpp index 36c364d1d..ad316c37e 100644 --- a/src/k_credits.cpp +++ b/src/k_credits.cpp @@ -564,7 +564,7 @@ void F_TickCreditsDemoExit(void) if (!menuactive && M_MenuConfirmPressed(0)) { - g_credits.demo_exit = std::max(g_credits.demo_exit, kDemoExitTicCount - 64); + g_credits.demo_exit = std::max(g_credits.demo_exit, kDemoExitTicCount - 64); } if (INT32 val = F_CreditsDemoExitFade(); val >= 0) @@ -654,7 +654,7 @@ static boolean F_TickCreditsSlide(void) if (g_credits.transition < FRACUNIT) { - g_credits.transition = std::min(g_credits.transition + (FRACUNIT / TICRATE), FRACUNIT); + g_credits.transition = std::min(g_credits.transition + (FRACUNIT / TICRATE), FRACUNIT); if (g_credits.split_slide_id < g_credits.split_slide_strings.size()) { diff --git a/src/k_dialogue.cpp b/src/k_dialogue.cpp index 61bd6982a..74abfa72e 100644 --- a/src/k_dialogue.cpp +++ b/src/k_dialogue.cpp @@ -307,7 +307,7 @@ void Dialogue::Tick(void) } } - slide = std::clamp(slide, 0, FRACUNIT); + slide = std::clamp(slide, 0, FRACUNIT); if (slide != FRACUNIT) { @@ -354,7 +354,7 @@ void Dialogue::Draw(void) INT32 speakernameedge = -6; - srb2::Draw drawer = + srb2::Draw drawer = srb2::Draw( BASEVIDWIDTH, BASEVIDHEIGHT - FixedToFloat(SlideAmount(height) - height) ).flags(V_SNAPTOBOTTOM); diff --git a/src/k_director.cpp b/src/k_director.cpp index b3881256f..00035f023 100644 --- a/src/k_director.cpp +++ b/src/k_director.cpp @@ -3,7 +3,7 @@ // Copyright (C) 2024 by AJ "Tyron" Martinez. // Copyright (C) 2024 by James Robert Roman. // Copyright (C) 2024 by Kart Krew. -// +// // This program is free software distributed under the // terms of the GNU General Public License, version 2. // See the 'LICENSE' file for more details. @@ -219,7 +219,7 @@ private: if (playerstat[position].gap >= BREAKAWAYDIST) { - playerstat[position].boredom = std::min(BOREDOMTIME * 2, playerstat[position].boredom + 1); + playerstat[position].boredom = std::min(BOREDOMTIME * 2, playerstat[position].boredom + 1); } else if (playerstat[position].boredom > 0) { diff --git a/src/k_endcam.cpp b/src/k_endcam.cpp index 6bb26672c..378e00cc0 100644 --- a/src/k_endcam.cpp +++ b/src/k_endcam.cpp @@ -34,7 +34,7 @@ namespace fixed_t interval(tic_t t, tic_t d) { - return (std::min(t, d) * FRACUNIT) / std::max(d, 1u); + return (std::min(t, d) * FRACUNIT) / std::max(d, 1u); } fixed_t interval(tic_t t, tic_t s, tic_t d) diff --git a/src/k_hud.cpp b/src/k_hud.cpp index c4853b4db..f1f91cc4c 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -1696,7 +1696,7 @@ static void K_drawKartItem(void) // Quick Eggman numbers if (stplyr->eggmanexplode > 1) - V_DrawScaledPatch(fx+17, fy+13-offset, V_HUDTRANS|V_SLIDEIN|fflags, kp_eggnum[std::min(5, G_TicsToSeconds(stplyr->eggmanexplode))]); + V_DrawScaledPatch(fx+17, fy+13-offset, V_HUDTRANS|V_SLIDEIN|fflags, kp_eggnum[std::min(5, G_TicsToSeconds(stplyr->eggmanexplode))]); if (stplyr->itemtype == KITEM_FLAMESHIELD && stplyr->flamelength > 0) { @@ -2693,7 +2693,7 @@ static void K_drawBossHealthBar(void) ; else if (bossinfo.visualbarimpact) { - INT32 mag = std::min((bossinfo.visualbarimpact/4) + 1, 8u); + INT32 mag = std::min((bossinfo.visualbarimpact/4) + 1, 8u); if (bossinfo.visualbarimpact & 1) starty -= mag; else @@ -2987,7 +2987,7 @@ static void K_drawRingCounter(boolean gametypeinfoshown) if (stplyr->hudrings <= 0 && stplyr->ringvisualwarning > 1) { - colorring = true; + colorring = true; if ((leveltime/2 & 1)) { ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_CRIMSON, GTC_CACHE); @@ -3862,7 +3862,7 @@ static void K_DrawNameTagSphereMeter(INT32 x, INT32 y, INT32 width, INT32 sphere // see also K_drawBlueSphereMeter const UINT8 segColors[] = {73, 64, 52, 54, 55, 35, 34, 33, 202, 180, 181, 182, 164, 165, 166, 153, 152}; - spheres = std::clamp(spheres, 0, 40); + spheres = std::clamp(spheres, 0, 40); int colorIndex = (spheres * sizeof segColors) / (40 + 1); int px = r_splitscreen > 1 ? 1 : 2; @@ -5295,7 +5295,7 @@ static void K_drawInput(void) char mode = ((stplyr->pflags & PF_ANALOGSTICK) ? '4' : '2') + (r_splitscreen > 1); bool local = !demo.playback && P_IsMachineLocalPlayer(stplyr); fixed_t slide = K_GetDialogueSlide(FRACUNIT); - INT32 tallySlide = [] + INT32 tallySlide = [] -> INT32 { if (r_splitscreen <= 1) { @@ -5309,7 +5309,7 @@ static void K_drawInput(void) if (stplyr->tally.state == TALLY_ST_GOTTHRU_SLIDEIN || stplyr->tally.state == TALLY_ST_GAMEOVER_SLIDEIN) { - return Easing_OutQuad(std::min(stplyr->tally.transition * 2, FRACUNIT), 0, kSlideDown); + return static_cast(Easing_OutQuad(std::min(stplyr->tally.transition * 2, FRACUNIT), 0, kSlideDown)); } return kSlideDown; }(); @@ -5348,7 +5348,7 @@ static void K_drawChallengerScreen(void) 19,20,19,20,19,20,19,20,19,20, // frame 20-21, 1 tic, 5 alternating: all text vibrates from impact 21,22,23,24 // frame 22-25, 1 tic: CHALLENGER turns gold }; - const UINT8 offset = std::min(52-1u, (3*TICRATE)-mapreset); + const UINT8 offset = std::min(52-1u, (3*TICRATE)-mapreset); V_DrawFadeScreen(0xFF00, 16); // Fade out V_DrawScaledPatch(0, 0, 0, kp_challenger[anim[offset]]); diff --git a/src/k_hud_track.cpp b/src/k_hud_track.cpp index 31fbe2d5d..4dd89cfcc 100644 --- a/src/k_hud_track.cpp +++ b/src/k_hud_track.cpp @@ -752,10 +752,10 @@ void K_CullTargetList(std::vector& targetList) y2 = tr.result.y + kTrackerRadius; } - x1 = std::max(x1 / kBlockWidth / FRACUNIT, 0); - x2 = std::min(x2 / kBlockWidth / FRACUNIT, kXBlocks - 1); - y1 = std::max(y1 / kBlockHeight / FRACUNIT, 0); - y2 = std::min(y2 / kBlockHeight / FRACUNIT, kYBlocks - 1); + x1 = std::max(x1 / kBlockWidth / FRACUNIT, 0); + x2 = std::min(x2 / kBlockWidth / FRACUNIT, kXBlocks - 1); + y1 = std::max(y1 / kBlockHeight / FRACUNIT, 0); + y2 = std::min(y2 / kBlockHeight / FRACUNIT, kYBlocks - 1); bool allMine = true; diff --git a/src/k_tally.cpp b/src/k_tally.cpp index 2f32ca16a..ee9b0373d 100644 --- a/src/k_tally.cpp +++ b/src/k_tally.cpp @@ -303,7 +303,7 @@ void level_tally_t::Init(player_t *player) : (tutorialchallenge == TUTORIALSKIP_INPROGRESS && K_IsPlayerLosing(player)) ); - time = std::min(static_cast(player->realtime), (100 * 60 * TICRATE) - 1); + time = std::min(static_cast(player->realtime), (100 * 60 * TICRATE) - 1); ringPool = player->totalring; livesAdded = 0; @@ -372,7 +372,7 @@ void level_tally_t::Init(player_t *player) { if (playeringame[i] == true && players[i].spectator == false) { - pointLimit = std::min(pointLimit, static_cast(-players[i].roundscore)); + pointLimit = std::min(pointLimit, static_cast(-players[i].roundscore)); } } } @@ -920,7 +920,7 @@ void level_tally_t::Tick(void) done = true; break; } - + default: { // error occured, silently fix @@ -1244,7 +1244,7 @@ void level_tally_t::Draw(void) work_tics % 10 )); - if (modeattacking && !demo.playback && (state == TALLY_ST_DONE || state == TALLY_ST_TEXT_PAUSE) + if (modeattacking && !demo.playback && (state == TALLY_ST_DONE || state == TALLY_ST_TEXT_PAUSE) && !K_IsPlayerLosing(&players[consoleplayer]) && players[consoleplayer].realtime < oldbest) { drawer_text @@ -1422,7 +1422,7 @@ void K_TickPlayerTally(player_t *player) G_PlayerInputDown(G_LocalSplitscreenPartyPosition(player - players), gc_a, 0); boolean allowFastForward = player->tally.state > TALLY_ST_GOTTHRU_SLIDEIN && player->tally.state <= TALLY_ST_DONE - && player->tally.releasedFastForward + && player->tally.releasedFastForward // - Not allowed online so we don't have to do any // networking. // - Not allowed in replays because splitscreen party @@ -1439,8 +1439,8 @@ void K_TickPlayerTally(player_t *player) player->tally.Tick(); while (player->tally.state != TALLY_ST_DONE && player->tally.state != TALLY_ST_GAMEOVER_DONE); - player->tally.delay = std::min(player->tally.delay, TICRATE); - + player->tally.delay = std::min(player->tally.delay, TICRATE); + if (Y_ShouldDoIntermission()) musiccountdown = 2; // gets decremented to 1 in G_Ticker to immediately trigger intermission music [blows raspberry] } @@ -1457,7 +1457,7 @@ void K_TickPlayerTally(player_t *player) { player->tally.releasedFastForward = false; } - + } void K_DrawPlayerTally(void) diff --git a/src/k_waypoint.cpp b/src/k_waypoint.cpp index 95eed059c..88d54ae0c 100644 --- a/src/k_waypoint.cpp +++ b/src/k_waypoint.cpp @@ -2546,8 +2546,8 @@ static INT32 K_CalculateTrackComplexity(void) if (delta < 0) { - dist_factor = FixedDiv(FRACUNIT, std::max(1, dist_factor)); - radius_factor = FixedDiv(FRACUNIT, std::max(1, radius_factor)); + dist_factor = FixedDiv(FRACUNIT, std::max(1, dist_factor)); + radius_factor = FixedDiv(FRACUNIT, std::max(1, radius_factor)); } else { diff --git a/src/m_misc.cpp b/src/m_misc.cpp index bbb4a3167..d6788a729 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -779,8 +779,8 @@ static void M_CreateScreenShotPalette(void) for (i = 0, j = 0; i < 768; i += 3, j++) { RGBA_t locpal = ((cv_screenshot_colorprofile.value) - ? pLocalPalette[(std::max(st_palette,0)*256)+j] - : pMasterPalette[(std::max(st_palette,0)*256)+j]); + ? pLocalPalette[(std::max(st_palette,0)*256)+j] + : pMasterPalette[(std::max(st_palette,0)*256)+j]); screenshot_palette[i] = locpal.s.red; screenshot_palette[i+1] = locpal.s.green; screenshot_palette[i+2] = locpal.s.blue; diff --git a/src/menus/transient/pause-addonoptions.cpp b/src/menus/transient/pause-addonoptions.cpp index 01cff6a2e..42e238234 100644 --- a/src/menus/transient/pause-addonoptions.cpp +++ b/src/menus/transient/pause-addonoptions.cpp @@ -201,7 +201,7 @@ void menu_open() g_menu.insert( g_menu.begin(), menuitem_t {IT_DISABLED, "No addon options!", nullptr, nullptr, {}, 0, 0} - ); + ); } group_menu(); @@ -267,7 +267,7 @@ void draw_menu() K_drawButton((draw.x() + 8) * FRACUNIT, (draw.y() + 8) * FRACUNIT, 0, kp_button_y[0], M_MenuButtonHeld(0, MBT_Y)); draw = draw.y(32 + kMargin); - currentMenu->y = std::min(static_cast(draw.y()), (BASEVIDHEIGHT/2) - g_menu_offsets[itemOn]); + currentMenu->y = std::min(static_cast(draw.y()), (BASEVIDHEIGHT/2) - g_menu_offsets[itemOn]); V_SetClipRect(0, draw.y() * FRACUNIT, BASEVIDWIDTH * FRACUNIT, (BASEVIDHEIGHT - draw.y() - kMargin) * FRACUNIT, 0); M_DrawGenericMenu(); diff --git a/src/menus/transient/pause-cheats.cpp b/src/menus/transient/pause-cheats.cpp index 00cca24e0..bbd9a4d8b 100644 --- a/src/menus/transient/pause-cheats.cpp +++ b/src/menus/transient/pause-cheats.cpp @@ -211,7 +211,7 @@ void draw_menu() K_drawButton((draw.x() + 8) * FRACUNIT, (draw.y() + 8) * FRACUNIT, 0, kp_button_y[0], M_MenuButtonHeld(0, MBT_Y)); draw = draw.y(32 + kMargin); - currentMenu->y = std::min(static_cast(draw.y()), (BASEVIDHEIGHT/2) - g_menu_offsets[itemOn]); + currentMenu->y = std::min(static_cast(draw.y()), (BASEVIDHEIGHT/2) - g_menu_offsets[itemOn]); V_SetClipRect(0, draw.y() * FRACUNIT, BASEVIDWIDTH * FRACUNIT, (BASEVIDHEIGHT - draw.y() - kMargin) * FRACUNIT, 0); M_DrawGenericMenu(); diff --git a/src/objects/checkpoint.cpp b/src/objects/checkpoint.cpp index 512046398..7269e5b79 100644 --- a/src/objects/checkpoint.cpp +++ b/src/objects/checkpoint.cpp @@ -181,7 +181,7 @@ struct Checkpoint : mobj_t if (!clip_var()) { - speed(speed() - FixedDiv(speed() / 50, std::max(speed_multiplier(), 1))); + speed(speed() - FixedDiv(speed() / 50, std::max(speed_multiplier(), 1))); } } else if (!activated()) @@ -324,7 +324,7 @@ private: if (xy_momentum) { P_Thrust(p, dir, xy_momentum); - p->momz = P_RandomKey(PR_DECORATION, std::max(z_momentum, 1)); + p->momz = P_RandomKey(PR_DECORATION, std::max(z_momentum, 1)); p->destscale = 0; p->scalespeed = p->scale / 35; p->color = SKINCOLOR_ULTRAMARINE; diff --git a/src/objects/destroyed-kart.cpp b/src/objects/destroyed-kart.cpp index e027c1cf0..b029d8304 100644 --- a/src/objects/destroyed-kart.cpp +++ b/src/objects/destroyed-kart.cpp @@ -387,7 +387,7 @@ private: { fixed_t f = burning() * FRACUNIT / burn_duration(); - if ((leveltime % std::max(1, Easing_OutCubic(f, 8, 1))) == 0) + if ((leveltime % std::max(1, Easing_OutCubic(f, 8, 1))) == 0) { vfx(f); } diff --git a/src/objects/gachabom-rebound.cpp b/src/objects/gachabom-rebound.cpp index f8fa3fb83..f278aa58e 100644 --- a/src/objects/gachabom-rebound.cpp +++ b/src/objects/gachabom-rebound.cpp @@ -88,7 +88,7 @@ bool award_target(mobj_t* mobj) player->itemamount++; if (player->roundconditions.gachabom_miser == 1) player->roundconditions.gachabom_miser = 0; - + //S_StartSoundAtVolume(target, sfx_grbnd3, 255/3); S_StartSound(target, sfx_mbs54); @@ -127,7 +127,7 @@ void chase_rebound_target(mobj_t* mobj) mobj->momz = zDelta / 4; const tic_t t = distance_to_target(mobj) / travelDistance; - const fixed_t newSpeed = std::abs(mobj->scale - mobj->destscale) / std::max(t, 1u); + const fixed_t newSpeed = std::abs(mobj->scale - mobj->destscale) / std::max(t, 1u); if (newSpeed > mobj->scalespeed) { diff --git a/src/objects/powerup-spinner.cpp b/src/objects/powerup-spinner.cpp index f77254d11..100c1bf27 100644 --- a/src/objects/powerup-spinner.cpp +++ b/src/objects/powerup-spinner.cpp @@ -45,7 +45,7 @@ struct Spinner : Mobj void think() { - fixed_t f = FRACUNIT - std::clamp(fuse, 0, duration()) * FRACUNIT / std::max(duration(), 1); + fixed_t f = FRACUNIT - std::clamp(fuse, 0, duration()) * FRACUNIT / std::max(duration(), 1); if (fuse == duration() - 20) { diff --git a/src/objects/pulley.cpp b/src/objects/pulley.cpp index 3963a6f71..16fcb4b72 100644 --- a/src/objects/pulley.cpp +++ b/src/objects/pulley.cpp @@ -246,7 +246,7 @@ private: return; rope()->z = hook()->top(); - rope()->spriteyscale(Fixed {std::max(0, z - hook()->top())} / std::max(1, 32 * rope()->scale())); + rope()->spriteyscale(Fixed {std::max(0, z - hook()->top())} / std::max(1, 32 * rope()->scale())); } }; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 058f4a792..b68a5670a 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3444,8 +3444,8 @@ static void P_ProcessLinedefsAfterSidedefs(void) if (ld->flags & ML_DONTPEGBOTTOM) // alternate alpha (by texture offsets) { extracolormap_t *exc = R_CopyColormap(sides[ld->sidenum[0]].colormap_data, false); - INT16 alpha = std::max(std::min(sides[ld->sidenum[0]].textureoffset >> FRACBITS, 25), -25); - INT16 fadealpha = std::max(std::min(sides[ld->sidenum[0]].rowoffset >> FRACBITS, 25), -25); + INT16 alpha = std::max(std::min(sides[ld->sidenum[0]].textureoffset >> FRACBITS, 25), -25); + INT16 fadealpha = std::max(std::min(sides[ld->sidenum[0]].rowoffset >> FRACBITS, 25), -25); // If alpha is negative, set "subtract alpha" flag and store absolute value if (alpha < 0) @@ -5840,12 +5840,12 @@ static void P_ConvertBinaryLinedefTypes(void) lines[i].args[0] = tag; if (lines[i].flags & ML_DONTPEGBOTTOM) { - lines[i].args[1] = std::max(sides[lines[i].sidenum[0]].textureoffset >> FRACBITS, 0); + lines[i].args[1] = std::max(sides[lines[i].sidenum[0]].textureoffset >> FRACBITS, 0); // failsafe: if user specifies Back Y Offset and NOT Front Y Offset, use the Back Offset // to be consistent with other light and fade specials lines[i].args[2] = ((lines[i].sidenum[1] != 0xFFFF && !(sides[lines[i].sidenum[0]].rowoffset >> FRACBITS)) ? - std::max(std::min(sides[lines[i].sidenum[1]].rowoffset >> FRACBITS, 255), 0) - : std::max(std::min(sides[lines[i].sidenum[0]].rowoffset >> FRACBITS, 255), 0)); + std::max(std::min(sides[lines[i].sidenum[1]].rowoffset >> FRACBITS, 255), 0) + : std::max(std::min(sides[lines[i].sidenum[0]].rowoffset >> FRACBITS, 255), 0)); } else { diff --git a/src/r_debug.cpp b/src/r_debug.cpp index b7c7cdbb9..7dc8b2c2b 100644 --- a/src/r_debug.cpp +++ b/src/r_debug.cpp @@ -46,7 +46,7 @@ INT32 R_AdjustLightLevel(INT32 light) if (!debugrender_highlight && cv_debugrender_contrast.value == 0) { const fixed_t darken = FixedMul(FixedMul(g_darkness.value[R_GetViewNumber()], mapheaderinfo[gamemap-1]->darkness), kRange); - return std::clamp((light * FRACUNIT) - darken, 0, kRange) / FRACUNIT; + return std::clamp((light * FRACUNIT) - darken, 0, kRange) / FRACUNIT; } const fixed_t adjust = FixedMul(cv_debugrender_contrast.value, kRange); @@ -60,7 +60,7 @@ INT32 R_AdjustLightLevel(INT32 light) } else { - light = std::clamp((light * FRACUNIT) - adjust, 0, kRange); + light = std::clamp((light * FRACUNIT) - adjust, 0, kRange); } return light / FRACUNIT; diff --git a/src/r_plane.cpp b/src/r_plane.cpp index decda706a..90f263126 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -233,7 +233,7 @@ static void R_MapTiltedPlane(drawspandata_t *ds, void(*spanfunc)(drawspandata_t* { ds->bgofs = R_CalculateRippleOffset(ds, y); - R_SetTiltedSpan(ds, std::clamp(y, 0, viewheight)); + R_SetTiltedSpan(ds, std::clamp(y, 0, viewheight)); R_CalculatePlaneRipple(ds, ds->currentplane->viewangle + ds->currentplane->plangle); R_SetSlopePlaneVectors(ds, ds->currentplane, y, (ds->xoffs + ds->planeripple.xfrac), (ds->yoffs + ds->planeripple.yfrac)); diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 2455a5ab1..65a68c7b3 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -215,7 +215,7 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3 ldef = curline->linedef; tripwire = P_IsLineTripWire(ldef); - range = std::max(drawseg->x2-drawseg->x1, 1); + range = std::max(drawseg->x2-drawseg->x1, 1); // Setup lighting based on the presence/lack-of 3D floors. dc->numlights = 0; @@ -874,7 +874,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) R_SetColumnFunc(COLDRAWFUNC_FOG, brightmapped); } - range = std::max(ds->x2-ds->x1, 1); + range = std::max(ds->x2-ds->x1, 1); //SoM: Moved these up here so they are available for my lightlist calculations rw_scalestep = ds->scalestep; spryscale = ds->scale1 + (x1 - ds->x1)*rw_scalestep; diff --git a/src/r_things.cpp b/src/r_things.cpp index e2590dcec..60bb2be45 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1082,7 +1082,7 @@ static void R_DrawVisSprite(vissprite_t *vis) // Vertically sheared sprite for (dc.x = vis->x1; dc.x <= vis->x2; dc.x++, frac += vis->xiscale, dc.texturemid -= vis->shear.tan) { - texturecolumn = std::clamp(frac >> FRACBITS, 0, patch->width - 1); + texturecolumn = std::clamp(frac >> FRACBITS, 0, patch->width - 1); column = (column_t *)((UINT8 *)patch->columns + (patch->columnofs[texturecolumn])); if (bmpatch) @@ -1119,7 +1119,7 @@ static void R_DrawVisSprite(vissprite_t *vis) // Non-paper drawing loop for (dc.x = vis->x1; dc.x <= vis->x2; dc.x++, frac += vis->xiscale, sprtopscreen += vis->shear.tan) { - texturecolumn = std::clamp(frac >> FRACBITS, 0, patch->width - 1); + texturecolumn = std::clamp(frac >> FRACBITS, 0, patch->width - 1); column = (column_t *)((UINT8 *)patch->columns + (patch->columnofs[texturecolumn])); @@ -2373,7 +2373,7 @@ static void R_ProjectSprite(mobj_t *thing) } // Less change in contrast in dark sectors - extralight = FixedMul(extralight, std::min(std::max(0, lightnum), LIGHTLEVELS - 1) * FRACUNIT / (LIGHTLEVELS - 1)); + extralight = FixedMul(extralight, std::min(std::max(0, lightnum), LIGHTLEVELS - 1) * FRACUNIT / (LIGHTLEVELS - 1)); if (papersprite) { @@ -2385,7 +2385,7 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t n = FixedDiv(FixedMul(xscale, LIGHTRESOLUTIONFIX), ((MAXLIGHTSCALE-1) << LIGHTSCALESHIFT)); // Less change in contrast at further distances, to counteract DOOM diminished light - extralight = FixedMul(extralight, std::min(n, FRACUNIT)); + extralight = FixedMul(extralight, std::min(n, FRACUNIT)); // Contrast is stronger for normal sprites, stronger than wall lighting is at the same distance lightnum += FixedFloor((extralight / 4) + (FRACUNIT / 2)) / FRACUNIT; @@ -2551,7 +2551,7 @@ static void R_ProjectSprite(mobj_t *thing) lindex = FixedMul(xscale, LIGHTRESOLUTIONFIX)>>(LIGHTSCALESHIFT); // Mitigate against negative xscale and arithmetic overflow - lindex = std::clamp(lindex, 0, MAXLIGHTSCALE - 1); + lindex = std::clamp(lindex, 0, MAXLIGHTSCALE - 1); if (vis->cut & SC_SEMIBRIGHT) lindex = (MAXLIGHTSCALE/2) + (lindex >> 1); diff --git a/src/rhi/gl2/gl2_rhi.cpp b/src/rhi/gl2/gl2_rhi.cpp index 6d9024358..4c209aeb8 100644 --- a/src/rhi/gl2/gl2_rhi.cpp +++ b/src/rhi/gl2/gl2_rhi.cpp @@ -1918,7 +1918,7 @@ void Gl2Rhi::finish() // I sure hope creating FBOs isn't costly on the driver! for (auto& fbset : framebuffers_) { - gl_->DeleteFramebuffers(1, &fbset.second); + gl_->DeleteFramebuffers(1, (GLuint*)&fbset.second); GL_ASSERT; } framebuffers_.clear(); diff --git a/src/sdl/i_video.cpp b/src/sdl/i_video.cpp index 3786b92d3..065ee3958 100644 --- a/src/sdl/i_video.cpp +++ b/src/sdl/i_video.cpp @@ -171,7 +171,7 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen); //static void Impl_SetWindowName(const char *title); static void Impl_SetWindowIcon(void); -static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen, SDL_bool reposition) +static void SDLSetMode(int width, int height, SDL_bool fullscreen, SDL_bool reposition) { static SDL_bool wasfullscreen = SDL_FALSE; diff --git a/src/v_video.cpp b/src/v_video.cpp index dfab8889e..00db53b0d 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -1088,8 +1088,8 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) if (y < clip->top) y = clip->top; - w = std::max(0, x2 - x); - h = std::max(0, y2 - y); + w = std::max(0, x2 - x); + h = std::max(0, y2 - y); } g_2d.begin_quad() @@ -2117,7 +2117,7 @@ void V_DrawTitleCardStringFixed(fixed_t x, fixed_t y, fixed_t scale, const char // otherwise; scalex must start at 0 // let's have each letter do 4 spins (360*4 + 90 = 1530 "degrees") - fakeang = std::min(360 + 90, let_time*41) * ANG1; + fakeang = std::min(360 + 90, let_time*41) * ANG1; scalex = FINESINE(fakeang>>ANGLETOFINESHIFT); } else if (!bossmode && let_time > threshold) @@ -2125,7 +2125,7 @@ void V_DrawTitleCardStringFixed(fixed_t x, fixed_t y, fixed_t scale, const char // Make letters disappear... let_time -= threshold; - fakeang = std::max(0, (360+90) - let_time*41)*ANG1; + fakeang = std::max(0, (360+90) - let_time*41)*ANG1; scalex = FINESINE(fakeang>>ANGLETOFINESHIFT); } @@ -2205,7 +2205,7 @@ static inline fixed_t BunchedCharacterDim( (void)chw; (void)hchw; (void)dupx; - (*cwp) = FixedMul(std::max(1, (*cwp) - 1) << FRACBITS, scale); + (*cwp) = FixedMul(std::max(1, (*cwp) - 1) << FRACBITS, scale); return 0; } @@ -2219,7 +2219,7 @@ static inline fixed_t MenuCharacterDim( (void)chw; (void)hchw; (void)dupx; - (*cwp) = FixedMul(std::max(1, (*cwp) - 2) << FRACBITS, scale); + (*cwp) = FixedMul(std::max(1, (*cwp) - 2) << FRACBITS, scale); return 0; } @@ -2233,7 +2233,7 @@ static inline fixed_t GamemodeCharacterDim( (void)chw; (void)hchw; (void)dupx; - (*cwp) = FixedMul(std::max(1, (*cwp) - 2) << FRACBITS, scale); + (*cwp) = FixedMul(std::max(1, (*cwp) - 2) << FRACBITS, scale); return 0; } @@ -2247,7 +2247,7 @@ static inline fixed_t FileCharacterDim( (void)chw; (void)hchw; (void)dupx; - (*cwp) = FixedMul(std::max(1, (*cwp) - 3) << FRACBITS, scale); + (*cwp) = FixedMul(std::max(1, (*cwp) - 3) << FRACBITS, scale); return 0; } @@ -2261,7 +2261,7 @@ static inline fixed_t LSTitleCharacterDim( (void)chw; (void)hchw; (void)dupx; - (*cwp) = FixedMul(std::max(1, (*cwp) - 4) << FRACBITS, scale); + (*cwp) = FixedMul(std::max(1, (*cwp) - 4) << FRACBITS, scale); return 0; } diff --git a/src/y_inter.cpp b/src/y_inter.cpp index 9f2372180..977374dca 100644 --- a/src/y_inter.cpp +++ b/src/y_inter.cpp @@ -952,7 +952,7 @@ void Y_RoundQueueDrawer(y_data_t *standings, INT32 offset, boolean doanimations, SINT8 deferxoffs = 0; const INT32 desiredx2 = (290 + bufferspace); - spacetospecial = std::max(desiredx2 - widthofroundqueue - (24 - bufferspace), 16); + spacetospecial = std::max(desiredx2 - widthofroundqueue - (24 - bufferspace), 16); if (roundqueue.position == roundqueue.size) { @@ -2234,7 +2234,7 @@ void Y_StartIntermission(void) else { // Minimum two seconds for match results, then two second slideover approx halfway through - sorttic = std::max((timer/2) - 2*TICRATE, 2*TICRATE); + sorttic = std::max((timer/2) - 2*TICRATE, 2*TICRATE); } // TODO: code's a mess, I'm just making it extra clear diff --git a/thirdparty/libwebm/mkvmuxer/mkvmuxer.h b/thirdparty/libwebm/mkvmuxer/mkvmuxer.h index 2c4bb9e93..6400f6de0 100644 --- a/thirdparty/libwebm/mkvmuxer/mkvmuxer.h +++ b/thirdparty/libwebm/mkvmuxer/mkvmuxer.h @@ -1770,7 +1770,7 @@ class Segment { // accounted for. // index - index in the list of Cues which is currently being adjusted. // cue_size - sum of size of all the CuePoint elements. - void MoveCuesBeforeClustersHelper(uint64_t diff, int index, + void MoveCuesBeforeClustersHelper(uint64_t diff, int32_t index, uint64_t* cue_size); // Seeds the random number generator used to make UIDs. diff --git a/thirdparty/libwebm/mkvmuxer/mkvmuxertypes.h b/thirdparty/libwebm/mkvmuxer/mkvmuxertypes.h index e5db12160..bc91ff139 100644 --- a/thirdparty/libwebm/mkvmuxer/mkvmuxertypes.h +++ b/thirdparty/libwebm/mkvmuxer/mkvmuxertypes.h @@ -8,14 +8,15 @@ #ifndef MKVMUXER_MKVMUXERTYPES_H_ #define MKVMUXER_MKVMUXERTYPES_H_ +#include namespace mkvmuxer { typedef unsigned char uint8; typedef short int16; -typedef int int32; -typedef unsigned int uint32; -typedef long long int64; -typedef unsigned long long uint64; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; } // namespace mkvmuxer // Copied from Chromium basictypes.h From 092bd77bd4f54115abd2c31244f10dd8c0607142 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Fri, 3 May 2024 16:00:14 -0700 Subject: [PATCH 09/26] Don't overwrite Tutorial objectives when failing tricks --- src/k_kart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index d8d8c93f4..323f459d6 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -13520,7 +13520,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->tumbleHeight = 30; // Base tumble bounce height player->trickpanel = TRICKSTATE_NONE; P_SetPlayerMobjState(player->mo, S_KART_SPINOUT); - K_AddMessageForPlayer(player, "Press + to trick!", true, false); + if (gametype != GT_TUTORIAL) + K_AddMessageForPlayer(player, "Press + to trick!", true, false); if (player->itemflags & (IF_ITEMOUT|IF_EGGMANOUT)) { //K_PopPlayerShield(player); // shield is just being yeeted, don't pop From 9ce7520e53ccc7a7c5ae4aa4250785b75aa21974 Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Fri, 3 May 2024 19:59:53 -0400 Subject: [PATCH 10/26] Auto Roulette Warning Warn the player that we didn't fucking design an RNG-baed game LOL --- src/k_menufunc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 4a42243d1..f36cfb5f9 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -210,6 +210,27 @@ static void M_ChangeCvar(INT32 choice) } #endif +if (cvar == &cv_dummyprofileautoroulette && + // Turning Auto Roulette on + cv_dummyprofileautoroulette.value == 1 && + // Not setting to default (ie changing the value) + choice != -1) + { + M_StartMessage( + "Turning on Auto Roulette", + "\"Ring Racers\" is not designed with random items in mind. With Auto Roulette, you cannot select the item results you want." + "\n" + "You will be at a distinct \x85" "disadvantage. \x80\n" + "\n" + "ARE YOU SURE?", + M_ChangeCvarResponse, + MM_YESNO, + NULL, + NULL + ); + return; + } + M_ChangeCvarDirect(choice, cvar); } From 2f527f736eccd2a23a0927c7e2d2d41fbc119c2f Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 3 May 2024 17:08:14 -0700 Subject: [PATCH 11/26] K_drawInput: fix lambda syntax --- src/k_hud.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_hud.cpp b/src/k_hud.cpp index 7168e376f..3ac3e189b 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -5297,7 +5297,7 @@ static void K_drawInput(void) char mode = ((stplyr->pflags & PF_ANALOGSTICK) ? '4' : '2') + (r_splitscreen > 1); bool local = !demo.playback && P_IsMachineLocalPlayer(stplyr); fixed_t slide = K_GetDialogueSlide(FRACUNIT); - INT32 tallySlide = [] -> INT32 + INT32 tallySlide = []() -> INT32 { if (r_splitscreen <= 1) { From 81ef7a3e1c1283e2256c2c6b0135b16a9dca9787 Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Fri, 3 May 2024 20:23:00 -0400 Subject: [PATCH 12/26] Make it actually work properly Flipped 1 to 0 so it happens when you turn it ON, also extended the message --- src/k_menufunc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_menufunc.c b/src/k_menufunc.c index f36cfb5f9..624625dab 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -210,15 +210,15 @@ static void M_ChangeCvar(INT32 choice) } #endif -if (cvar == &cv_dummyprofileautoroulette && + if (cvar == &cv_dummyprofileautoroulette && // Turning Auto Roulette on - cv_dummyprofileautoroulette.value == 1 && + cv_dummyprofileautoroulette.value == 0 && // Not setting to default (ie changing the value) choice != -1) { M_StartMessage( "Turning on Auto Roulette", - "\"Ring Racers\" is not designed with random items in mind. With Auto Roulette, you cannot select the item results you want." + "\"Ring Racers\" is not designed with random items in mind. With Auto Roulette, you cannot select the item results you want or select an item early." "\n" "You will be at a distinct \x85" "disadvantage. \x80\n" "\n" From 020cb6c60b709de8aa247b678c97135687050981 Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Fri, 3 May 2024 20:33:25 -0400 Subject: [PATCH 13/26] Turn Auto Roulette off in new versions Turns off auto roulette in profiles from internal version 2 -> 3 --- src/k_profiles.cpp | 9 +++++++++ src/k_profiles.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/k_profiles.cpp b/src/k_profiles.cpp index 89354bb1c..d6109bfe5 100644 --- a/src/k_profiles.cpp +++ b/src/k_profiles.cpp @@ -518,6 +518,15 @@ void PR_LoadProfiles(void) converted = true; } + if (js.prof.version == 2) + { + // Version 2 -> 3: + // - Auto Roulette is turned off again so people have to see the warning message + newprof->autoroulette == false; + + converted = true; + } + if (converted) { CONS_Printf("Profile '%s' was converted from version %d to version %d\n", diff --git a/src/k_profiles.h b/src/k_profiles.h index 0870c5d5e..70d3abd68 100644 --- a/src/k_profiles.h +++ b/src/k_profiles.h @@ -112,8 +112,9 @@ extern "C" { // Version history: // 1 - first // 2 - litesteer is off by default, old profiles litesteer +// 3 - auto roulette is switched off again // option is reset to default -#define PROFILEVER 2 +#define PROFILEVER 3 #define MAXPROFILES 16 #define PROFILESFILE "ringprofiles.prf" #define PROFILE_GUEST 0 From 544125bb994735eb9af9a21e97085fdaa4829bb1 Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Fri, 3 May 2024 20:43:24 -0400 Subject: [PATCH 14/26] Make it actually build Oops, extra "." in version check and used comparison instead of "=" --- src/k_profiles.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_profiles.cpp b/src/k_profiles.cpp index d6109bfe5..a421a692c 100644 --- a/src/k_profiles.cpp +++ b/src/k_profiles.cpp @@ -518,11 +518,11 @@ void PR_LoadProfiles(void) converted = true; } - if (js.prof.version == 2) + if (jsprof.version == 2) { // Version 2 -> 3: // - Auto Roulette is turned off again so people have to see the warning message - newprof->autoroulette == false; + newprof->autoroulette = false; converted = true; } From d5141a9ea1dadc67557bf90ae4d1612f738fe76b Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Fri, 3 May 2024 22:54:37 -0400 Subject: [PATCH 15/26] Update k_roulette.c --- src/k_roulette.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_roulette.c b/src/k_roulette.c index 900b851d2..1c6984b0c 100644 --- a/src/k_roulette.c +++ b/src/k_roulette.c @@ -1391,7 +1391,7 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet { if (K_ItemEnabled(i) == true) { - spawnChance[i] = ( totalSpawnChance++ ); + spawnChance[i] = ( totalSpawnChance += 1 ); } } @@ -1403,7 +1403,7 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet continue; } - K_AddItemToReel(player, roulette, i); + K_PushToRouletteItemList(roulette, i); for (; i < NUMKARTRESULTS; i++) { From f93b0c581198f02cbe91c3deaff2ba84cd693bc3 Mon Sep 17 00:00:00 2001 From: JugadorXEI Date: Sat, 4 May 2024 06:52:49 +0200 Subject: [PATCH 16/26] Change mindelay max to 15, MAXPREDICTTICS to 30 --- src/cvars.cpp | 2 +- src/d_ticcmd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cvars.cpp b/src/cvars.cpp index fcb0e08cd..feeed0c97 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -399,7 +399,7 @@ consvar_t cv_menuframeskip = Player("menuframeskip", "Off").values({ {144, "MAX"}, {0, "Off"}, }); -consvar_t cv_mindelay = Player("mindelay", "2").min_max(0, 30); +consvar_t cv_mindelay = Player("mindelay", "2").min_max(0, 15); consvar_t cv_movebob = Player("movebob", "1.0").floating_point().min_max(0, 4*FRACUNIT); consvar_t cv_netstat = Player("netstat", "Off").on_off().dont_save(); // show bandwidth statistics consvar_t cv_netticbuffer = Player("netticbuffer", "1").min_max(0, 3); diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h index 7f083d72b..046488a98 100644 --- a/src/d_ticcmd.h +++ b/src/d_ticcmd.h @@ -22,7 +22,7 @@ extern "C" { #endif -#define MAXPREDICTTICS 12 +#define MAXPREDICTTICS 30 // Button/action code definitions. typedef enum From 1d596ac6a548e479b9d434218bce03584e99063f Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Sat, 4 May 2024 00:55:02 -0400 Subject: [PATCH 17/26] Changed == 2 to < 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @jartha ยท 25 minutes ago Should be jsprof.version < 3 to upgrade 2.0 profiles too. --- src/k_profiles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_profiles.cpp b/src/k_profiles.cpp index a421a692c..1076cfc78 100644 --- a/src/k_profiles.cpp +++ b/src/k_profiles.cpp @@ -518,7 +518,7 @@ void PR_LoadProfiles(void) converted = true; } - if (jsprof.version == 2) + if (jsprof.version < 3) { // Version 2 -> 3: // - Auto Roulette is turned off again so people have to see the warning message From 6ee0e40c1a2b50353b8e635c62c876c8aa9932d1 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sat, 4 May 2024 00:45:27 -0700 Subject: [PATCH 18/26] Play character sounds + follower horns on charsel --- src/menus/play-char-select.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/menus/play-char-select.c b/src/menus/play-char-select.c index 06c6b0090..dfba309e0 100644 --- a/src/menus/play-char-select.c +++ b/src/menus/play-char-select.c @@ -777,6 +777,7 @@ static void M_HandleBeginningFollowers(setup_player_t *p) static void M_HandleBeginningColorsOrFollowers(setup_player_t *p) { + S_StartSound(NULL, skins[p->skin].soundsid[S_sfx[sfx_kattk1].skinsound]); if (M_HandleBeginningColors(p)) S_StartSound(NULL, sfx_s3k63); else @@ -1173,6 +1174,7 @@ static void M_HandleFollowerRotate(setup_player_t *p, UINT8 num) p->mdepth = CSSTEP_FOLLOWERCOLORS; M_NewPlayerColors(p); S_StartSound(NULL, sfx_s3k63); + S_StartSound(NULL, followers[p->followern].hornsound); } else { From ce1c5d03d36dd38479a306a09255d1942764f57d Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sat, 4 May 2024 04:23:26 -0700 Subject: [PATCH 19/26] Safety check t. nosegoblins --- src/menus/play-char-select.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/menus/play-char-select.c b/src/menus/play-char-select.c index dfba309e0..ed8606ff0 100644 --- a/src/menus/play-char-select.c +++ b/src/menus/play-char-select.c @@ -777,7 +777,8 @@ static void M_HandleBeginningFollowers(setup_player_t *p) static void M_HandleBeginningColorsOrFollowers(setup_player_t *p) { - S_StartSound(NULL, skins[p->skin].soundsid[S_sfx[sfx_kattk1].skinsound]); + if (p->skin != -1) + S_StartSound(NULL, skins[p->skin].soundsid[S_sfx[sfx_kattk1].skinsound]); if (M_HandleBeginningColors(p)) S_StartSound(NULL, sfx_s3k63); else @@ -1174,7 +1175,8 @@ static void M_HandleFollowerRotate(setup_player_t *p, UINT8 num) p->mdepth = CSSTEP_FOLLOWERCOLORS; M_NewPlayerColors(p); S_StartSound(NULL, sfx_s3k63); - S_StartSound(NULL, followers[p->followern].hornsound); + if (p->followern != -1) + S_StartSound(NULL, followers[p->followern].hornsound); } else { From 1b2ac7c1c5749a00ffb63e537b47aa044215c919 Mon Sep 17 00:00:00 2001 From: Logan Aerl Arias Date: Sat, 4 May 2024 17:18:36 +0000 Subject: [PATCH 20/26] use gitlabrunner to make builds for Win32 --- .gitlab-ci.yml | 61 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7482477f1..424d64f54 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -202,7 +202,7 @@ Debian testing GCC: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.camke -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -218,17 +218,19 @@ Debian testing GCC: Windows x86: stage: build - when: manual + when: on_success artifacts: paths: - - "build.cmake/bin/" - - "build.cmake/src/config.h" + - "build/ninja-x86_mingw_static_vcpkg-debug/bin/" + - "build/ninja-x86_mingw_static_vcpkg-debug/src/config.h" expose_as: "Win32" name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win32" variables: PREFIX: i686-w64-mingw32 + CC: /usr/bin/i686-w64-mingw32-gcc-posix + CXX: /usr/bin/i686-w64-mingw32-g++-posix script: - - | @@ -239,10 +241,19 @@ Windows x86: # apt_toolchain echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K" + - - | + # apt_development + echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages" + - apt-get install ninja-build + - | + # apt_development + echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K" + - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake --preset ninja-x86_mingw_static_vcpkg-debug -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DCMAKE_C_COMPILER=/usr/bin/i686-w64-mingw32-gcc-posix -DCMAKE_CXX_COMPILER=/usr/bin/i686-w64-mingw32-g++-posix -G "Unix Makefiles" -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/toolchains/mingw.cmake + - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -250,7 +261,7 @@ Windows x86: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going + - cmake --build --preset ninja-x86_mingw_static_vcpkg-debug -- -k -j8 || cmake --build --preset ninja-x86_mingw_static_vcpkg-debug -- -k - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" @@ -294,7 +305,7 @@ Debian stable:amd64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -343,7 +354,7 @@ Debian oldstable:amd64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -394,7 +405,7 @@ Debian stable:i386: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -447,7 +458,7 @@ Debian stable:arm64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -496,7 +507,7 @@ Debian oldstable:arm64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -543,7 +554,7 @@ batocera:arm64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -561,10 +572,12 @@ Windows x64: when: manual + allow_failure: true + artifacts: paths: - - "bin/" - - "src/comptime.h" + - "build.cmake/bin/" + - "build.cmake/src/config.h" expose_as: "Win64" name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win64" @@ -580,10 +593,18 @@ Windows x64: # apt_toolchain echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K" + - - | + # apt_development + echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages" + - apt-get install ninja-build + - | + # apt_development + echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K" + - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.clang -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -DSRB2_CONFIG_ENABLE_DISCORDRPC=OFF -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/toolchains/mingw.cmake - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -637,7 +658,7 @@ Debian stable Clang: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.clang -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.clang -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -780,7 +801,7 @@ Alpine 3 GCC: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.alpine3 -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.alpine3 -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -841,7 +862,7 @@ Alpine 3 GCC Dedicated: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.alpine3ded -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.alpine3ded -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -880,7 +901,7 @@ osxcross x86_64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" @@ -923,7 +944,7 @@ osxcross arm64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" + - cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -G "Unix Makefiles" - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" From 8b4c32dfdbc2cb47ecfe1e185301ddd127f63913 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 4 May 2024 12:21:46 -0500 Subject: [PATCH 21/26] Add empty param list to lambda to fix warning --- src/k_hud.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_hud.cpp b/src/k_hud.cpp index f1f91cc4c..ff53093e8 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -5295,7 +5295,7 @@ static void K_drawInput(void) char mode = ((stplyr->pflags & PF_ANALOGSTICK) ? '4' : '2') + (r_splitscreen > 1); bool local = !demo.playback && P_IsMachineLocalPlayer(stplyr); fixed_t slide = K_GetDialogueSlide(FRACUNIT); - INT32 tallySlide = [] -> INT32 + INT32 tallySlide = []() -> INT32 { if (r_splitscreen <= 1) { From c26455d8b4d22935f36c1c309b60b7f13f859392 Mon Sep 17 00:00:00 2001 From: Ashnal Date: Sat, 4 May 2024 14:07:27 -0400 Subject: [PATCH 22/26] Fix slope pushback force to scale with mapobject and player grow/shrink scale --- 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 fc0c0bd23..4a36b19ae 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1917,7 +1917,7 @@ static void P_3dMovement(player_t *player) vector3_t totalthrust; totalthrust.x = totalthrust.y = 0; // I forget if this is needed - totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes + totalthrust.z = FixedMul(mapobjectscale, K_GrowShrinkSpeedMul(player))*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes if (K_SlopeResistance(player) == true) { From f74280ad0af0fccf3f384c2de02c7a4e971809ea Mon Sep 17 00:00:00 2001 From: Ashnal Date: Sat, 4 May 2024 14:24:44 -0400 Subject: [PATCH 23/26] Compat level guarding --- src/g_demo.cpp | 6 +++++- src/p_user.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/g_demo.cpp b/src/g_demo.cpp index db3391707..f73407198 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -166,8 +166,12 @@ demoghost *ghosts = NULL; // - A bug was preventing control after ending a drift. // Older behavior is kept around for staff ghost compat. // - Also, polyobject bounce-back was fixed! +// - 0x000B (Ring Racers v2.1 + In dev revisions) +// - SPB cup TA replays were recorded at this time +// - Slope physics changed with a scaling fix +// - 0x000C (Ring Racers v2.2) -#define DEMOVERSION 0x000B +#define DEMOVERSION 0x000C boolean G_CompatLevel(UINT16 level) { diff --git a/src/p_user.c b/src/p_user.c index 4a36b19ae..bec4a06a6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1917,7 +1917,11 @@ static void P_3dMovement(player_t *player) vector3_t totalthrust; totalthrust.x = totalthrust.y = 0; // I forget if this is needed - totalthrust.z = FixedMul(mapobjectscale, K_GrowShrinkSpeedMul(player))*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes + + if (G_CompatLevel(0x000B)) // Ring Racers 2.1 behavior + totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes + else + totalthrust.z = FixedMul(mapobjectscale, K_GrowShrinkSpeedMul(player))*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes if (K_SlopeResistance(player) == true) { From 7b6f5c9d231b9026c08adf5855033c3c5eebb378 Mon Sep 17 00:00:00 2001 From: Ashnal Date: Sat, 4 May 2024 14:32:01 -0400 Subject: [PATCH 24/26] More informative comment --- 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 bec4a06a6..c23f9e1f8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1921,7 +1921,7 @@ static void P_3dMovement(player_t *player) if (G_CompatLevel(0x000B)) // Ring Racers 2.1 behavior totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes else - totalthrust.z = FixedMul(mapobjectscale, K_GrowShrinkSpeedMul(player))*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes + totalthrust.z = FixedMul(mapobjectscale, K_GrowShrinkSpeedMul(player))*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes, but scaled for mapobject and player size if (K_SlopeResistance(player) == true) { From 0f762b320ddfb7a4d0b470348130d081b9696ac6 Mon Sep 17 00:00:00 2001 From: Aurora Latius Date: Sat, 4 May 2024 13:52:27 -0500 Subject: [PATCH 25/26] Add 'score' to hud disable options --- src/lua_hudlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index d9501acc3..5f8389cbd 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -44,7 +44,7 @@ static const char *const hud_disable_options[] = { "stagetitle", "textspectator", "crosshair", - + "score, "time", "gametypeinfo", // Bumpers / Karma / Laps depending on gametype "minimap", From 937f28c038f4f6b31f704d4c29daaf20841acf70 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 4 May 2024 13:53:30 -0500 Subject: [PATCH 26/26] I may or may not have typo'd something --- src/lua_hudlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 5f8389cbd..824825fe7 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -44,7 +44,7 @@ static const char *const hud_disable_options[] = { "stagetitle", "textspectator", "crosshair", - "score, + "score", "time", "gametypeinfo", // Bumpers / Karma / Laps depending on gametype "minimap",