From 5d68fd690b3dd6c0c1b59b95b25b469bb56734aa Mon Sep 17 00:00:00 2001 From: Indev Date: Sat, 3 Aug 2024 23:19:43 +0300 Subject: [PATCH 01/13] Add ctrl-w (delete word), ctrl-left (move to word beginning) and ctrl-right (move to word end) shortcuts for console --- src/console.c | 109 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 103 insertions(+), 6 deletions(-) diff --git a/src/console.c b/src/console.c index 8bd8518f9..5c2e04eb3 100644 --- a/src/console.c +++ b/src/console.c @@ -850,9 +850,36 @@ static void CON_InputAddString(const char *c) Unlock_state(); } +static void CON_InputDel(size_t start, size_t end) +{ + size_t len; + + Lock_state(); + + len = (end - start); + + if (end != input_len) + memmove(&inputlines[inputline][start], &inputlines[inputline][end], input_len-end); + memset(&inputlines[inputline][input_len - len], 0, len); + + input_len -= len; + + if (input_sel >= end) + input_sel -= len; + else if (input_sel > start) + input_sel = start; + + if (input_cur >= end) + input_cur -= len; + else if (input_cur > start) + input_cur = start; + + Unlock_state(); +} + static void CON_InputDelSelection(void) { - size_t start, end, len; + size_t start, end; Lock_state(); @@ -866,18 +893,56 @@ static void CON_InputDelSelection(void) start = input_cur; end = input_sel; } - len = (end - start); - if (end != input_len) - memmove(&inputlines[inputline][start], &inputlines[inputline][end], input_len-end); - memset(&inputlines[inputline][input_len - len], 0, len); + CON_InputDel(start, end); - input_len -= len; input_sel = input_cur = start; Unlock_state(); } +static void CON_ToWordEnd(boolean move_sel) +{ + Lock_state(); + + // Skip spaces + while (input_cur < input_len && isspace(inputlines[inputline][input_cur])) + ++input_cur; + + // Skip word + while (input_cur < input_len && !isspace(inputlines[inputline][input_cur])) + ++input_cur; + + if (move_sel) input_sel = input_cur; + + Unlock_state(); +} + +static void CON_ToWordBegin(boolean move_sel) +{ + Lock_state(); + + // Hack, always move back 1 character if possible so if we press ctrl-left at a word beginning + // we move to previous word + if (input_cur) --input_cur; + + // Skip spaces + while (input_cur && isspace(inputlines[inputline][input_cur])) + --input_cur; + + // Skip word + while (input_cur && !isspace(inputlines[inputline][input_cur])) + --input_cur; + + // Unless we reached beginning of line, we're pointing at a space before word, so move cursor + // forward to fix that + if (input_cur) ++input_cur; + + if (move_sel) input_sel = input_cur; + + Unlock_state(); +} + static void CON_InputAddChar(char c) { if (input_len >= CON_MAXPROMPTCHARS-1) @@ -1055,6 +1120,38 @@ boolean CON_Responder(event_t *ev) completion[0] = 0; return true; } + else if (key == 'w' || key == 'W') + { + size_t word_start, word_end, i; + word_end = i = input_cur; + + // Unless we're pointing at the beginning of line, decrement i so we only start + // removing symbols that come before the cursor + if (i) --i; + + // We might be pointing to spaces, skip them first + while (i && isspace(inputlines[inputline][i])) + --i; + + // Now skip the "word" + while (i && !isspace(inputlines[inputline][i])) + --i; + + // Unless we reached beginning of line, i is pointing at first space that was found + // before word start, and we don't want to remove it + if (i) ++i; + + word_start = i; + + if (word_start != word_end) + CON_InputDel(word_start, word_end); + + return true; + } + else if (key == KEY_RIGHTARROW) + CON_ToWordEnd(!shiftdown); + else if (key == KEY_LEFTARROW) + CON_ToWordBegin(!shiftdown); // Select all if (key == 'a' || key == 'A') From 0f994a0676fac3ee7d9408e1ce8873e0e5107655 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 3 Aug 2024 22:33:08 +0200 Subject: [PATCH 02/13] expose viewroll to lua --- src/lua_playerlib.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 74e6b0f32..dd4cf7b03 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -51,6 +51,9 @@ int player_localskin_setter(lua_State *L); int player_sliproll_getter(lua_State *L); int player_sliproll_noset(lua_State *L); +int player_viewrollangle_getter(lua_State *L); +int player_viewrollangle_noset(lua_State *L); + #define FIELD(type, field_name, getter, setter) { #field_name, offsetof(type, field_name), getter, setter } static const udata_field_t player_fields[] = { // Player doesn't actually have field "name" so macro fails. Need to declare field manually. @@ -159,6 +162,7 @@ static const udata_field_t player_fields[] = { #endif // Same as player.name { "sliproll", 0, player_sliproll_getter, player_sliproll_noset }, + { "viewrollangle", 0, player_viewrollangle_getter, player_viewrollangle_noset }, { "ping", 0, player_ping_getter, player_ping_noset }, // Hmm originally setter doesn't exist so data is written as unreachable custom field... { NULL, 0, NULL, NULL }, }; @@ -217,6 +221,7 @@ NOSET(bot) NOSET(splitscreenindex) NOSET(ping) NOSET(sliproll) +NOSET(viewrollangle) #undef NOSET @@ -372,6 +377,15 @@ int player_sliproll_getter(lua_State *L) return 1; } +int player_viewrollangle_getter(lua_State *L) +{ + player_t *plr = GETPLAYER(); + + lua_pushangle(L, R_ViewRollAngle(plr)); + + return 1; +} + static int lib_iteratePlayers(lua_State *L) { INT32 i = -1; From 22b9915ad7ed97ea19af15657f7d599d6d15e1c0 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 3 Aug 2024 22:44:57 +0200 Subject: [PATCH 03/13] smol fix to viewroll interp --- src/r_fps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_fps.c b/src/r_fps.c index 17e357a16..b46c6e51b 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -147,7 +147,7 @@ static void R_SetupFreelook(void) void R_InterpolateViewRollAngle(fixed_t frac) { - viewroll = oldview->roll + R_LerpAngle(oldview->roll, newview->roll, frac); + viewroll = R_LerpAngle(oldview->roll, newview->roll, frac); } void R_InterpolateView(fixed_t frac, boolean forceinvalid) From 852651cefe57c1c68be2b9c1f8f2460a3704cd0f Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 3 Aug 2024 23:49:31 +0200 Subject: [PATCH 04/13] better statdisplay offsets in splitscreen lots of trial and error..... --- src/k_kart.c | 79 ++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 46 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 293e5209b..a3cfb55b0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7712,49 +7712,6 @@ static void K_drawKartStats(void) if (!LUA_HudEnabled(hud_statdisplay)) return; - - // I tried my best, but this is still mess :/ - if (splitscreen) - { - if (splitscreen == 1) - { - // If we are in 2-player splitscreen, for player 1 we move hud to up and remove snapping - // to bottom - if (splitnum == 0) - { - y /= 2; - flags = V_SNAPTOLEFT; - } - else - { - // Can move it down a bit - y += 20; - } - } - else - { - // In 4-player splitscreen... - flags = 0; - - // ...For players 2 and 4, which are at right side, we move x coordinate... - if (splitnum == 1 || splitnum == 3) - x += BASEVIDWIDTH/2; - // ...Else, for players on left side we can snap position to left... - else - flags |= V_SNAPTOLEFT; - - // ...For players 1 and 2, which are at top side, we move y coordinate... - if (splitnum == 0 || splitnum == 1) - y /= 2; - // ...Else, for players on bottom side we can snap position to bottom - else - { - flags |= V_SNAPTOBOTTOM; - // Can move it down a bit - y += 20; - } - } - } //Internal offset for speedometer if (cv_kartspeedometer.value) @@ -7766,17 +7723,47 @@ static void K_drawKartStats(void) } else spdoffset = 0; - + // Customizations c: if (!splitscreen) { x += 18 + cv_stat_xoffset.value; y += cv_stat_yoffset.value + (G_BattleGametype() ? (stplyr->kartstuff[k_bumper] ? -5 : -8) : 0) + spdoffset; } + else if (splitscreen == 1) // I tried my best, but this is still mess :/ < :Blobcatpats: c: + { + x -= 10; + y -= 40; + y += (G_BattleGametype() ? (stplyr->kartstuff[k_bumper] ? -5 : -8) : 0); + + // If we are in 2-player splitscreen, for player 1 we move hud to up and remove snapping + // to bottom + if (splitnum == 0) + { + y /= 2; + flags = V_SNAPTOLEFT; + } + else + { + // Can move it down a bit + y += 45; + } + } else { - x += 18; - y += (G_BattleGametype() ? (stplyr->kartstuff[k_bumper] ? -5 : -8) : 0) + spdoffset; + if (splitnum == 0 || splitnum == 2) // If we are P1 or P3... + { + // ye i just align it to position number lol + x = POSI_X + 19; + y = POSI_Y - 6; + flags = V_SNAPTOLEFT|((splitnum == 2) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P3 to the bottom. + } + else // else, that means we're P2 or P4. + { + x = POSI2_X - 75; + y = POSI2_Y - 6; + flags = V_SNAPTORIGHT|((splitnum == 3) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom + } } flags |= V_HUDTRANS; From 7b95df150ae4eb9b004ad0b0c352e30a26f9af25 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 4 Aug 2024 12:45:23 +0200 Subject: [PATCH 05/13] support gcc 14.2.1 + fix some stuff --- src/Makefile.cfg | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 77779f7d5..abf9ed1d3 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -12,7 +12,7 @@ # to avoid a false positive with the version detection... SUPPORTED_GCC_VERSIONS:=\ - 141 14\ + 142 141 14\ 132 131 130 13\ 123 122 121 120 12\ 114 113 112 111 110 11\ @@ -24,7 +24,7 @@ SUPPORTED_GCC_VERSIONS:=\ 55 54 53 52 51 50\ 49 48 47 46 45 44 43 42 41 40 -LATEST_GCC_VERSION=14.1 +LATEST_GCC_VERSION=14.2.1 # gcc or g++ ifdef PREFIX @@ -78,12 +78,20 @@ ifeq (,$(filter GCC%,$(.VARIABLES))) endif endif -ifdef GCC141 +ifdef GCC142 GCC141=1 endif +ifdef GCC141 +GCC140=1 +endif + ifdef GCC14 -GCC14=1 +GCC140=1 +endif + +ifdef GCC140 +GCC132=1 endif ifdef GCC132 From caeec35c66642380952d04248cc85b2b6cacbd45 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 4 Aug 2024 12:46:30 +0200 Subject: [PATCH 06/13] fix warning in director --- src/k_director.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/k_director.c b/src/k_director.c index c0687494d..fdf636d46 100644 --- a/src/k_director.c +++ b/src/k_director.c @@ -37,7 +37,7 @@ struct directorinfo INT32 boredom[MAXPLAYERS]; // how long has a given position had no credible attackers? } directorinfo; -static boolean race_rules() +static boolean race_rules(void) { return gametype = GT_RACE; } @@ -69,21 +69,6 @@ void K_InitDirector(void) } } -/*static fixed_t K_GetFinishGap(INT32 leader, INT32 follower) -{ - fixed_t dista = players[follower].distancetofinish; - fixed_t distb = players[leader].distancetofinish; - - if (players[follower].position < players[leader].position) - { - return distb - dista; - } - else - { - return dista - distb; - } -}*/ - static fixed_t K_GetDistanceToFinish(player_t player) { mobj_t *mo; From 6791f2e883e2909fee54da1a01a468b5fc254122 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 4 Aug 2024 12:50:31 +0200 Subject: [PATCH 07/13] forgor --- src/Makefile.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index abf9ed1d3..4c304539a 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -12,7 +12,7 @@ # to avoid a false positive with the version detection... SUPPORTED_GCC_VERSIONS:=\ - 142 141 14\ + 142 141 140 14\ 132 131 130 13\ 123 122 121 120 12\ 114 113 112 111 110 11\ From 4235801ae45d334f1a9db7c418dafc6e746dd54a Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 4 Aug 2024 13:01:45 +0200 Subject: [PATCH 08/13] proper pass fwrapv to gcc --- src/Makefile | 2 +- src/Makefile.cfg | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index ee2e90cbc..78dfdd4f7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -285,7 +285,7 @@ else $(OBJDIR)/hw_md2load.o $(OBJDIR)/hw_md3load.o $(OBJDIR)/hw_model.o $(OBJDIR)/u_list.o $(OBJDIR)/hw_batching.o $(OBJDIR)/hw_shaders.o endif -OPTS += -DCOMPVERSION +OPTS += -DCOMPVERSION -fwrapv ifndef NONX86 ifndef GCC29 diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 4c304539a..cba731b9c 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -445,9 +445,6 @@ endif ifdef GCC44 WFLAGS+=-Wno-error=array-bounds endif -ifdef GCC45 -opts+=-fwrapv -endif ifdef GCC46 WFLAGS+=-Wno-error=suggest-attribute=noreturn endif From 9c4b2b0abf3c37ed9461b754f2b96c0731932776 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 4 Aug 2024 14:07:54 +0200 Subject: [PATCH 09/13] no need for this --- src/p_tick.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/p_tick.c b/src/p_tick.c index 5acb8b5fb..b3a934cd4 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -372,18 +372,10 @@ void P_RunChaseCameras(void) { UINT8 i; - if (!splitscreen) + for (i = 0; i <= splitscreen; i++) { - if (camera[0].chase) - P_MoveChaseCamera(&players[displayplayers[0]], &camera[0], false); - } - else - { - for (i = 0; i <= splitscreen; i++) - { - if (camera[i].chase) - P_MoveChaseCamera(&players[displayplayers[i]], &camera[i], false); - } + if (camera[i].chase) + P_MoveChaseCamera(&players[displayplayers[i]], &camera[i], false); } } From a83d364ba77e826e6b53c9a7bc457ef7808dd48d Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 4 Aug 2024 14:51:19 +0200 Subject: [PATCH 10/13] update led status in main loop makes this whole ordeal alot less hacky tbh player color always gets updated if it changes still allows for directly setting led color elsewhere by using G_SetPlayerGamepadIndicatorColor directly hoping crap doesent cost any perf but honestly shouldnt --- src/d_main.c | 28 ++++++++++++++++++++++++++++ src/d_netcmd.c | 10 ---------- src/g_game.c | 6 ------ src/g_input.c | 4 ++-- src/g_input.h | 2 ++ src/lua_baselib.c | 1 + 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 79f564e1f..ade74830c 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -170,6 +170,31 @@ UINT8 ctrldown = 0; // 0x1 left, 0x2 right UINT8 altdown = 0; // 0x1 left, 0x2 right boolean capslock = 0; // gee i wonder what this does. +static inline void D_DeviceLEDTick(void) +{ + UINT8 i; + UINT16 color[MAXSPLITSCREENPLAYERS]; + UINT16 curcolor[MAXSPLITSCREENPLAYERS]; + + // no gamepads connected + if (I_NumJoys() == 0) + return; + + for (i = 0; i <= splitscreen; i++) + { + if (G_GetDeviceForPlayer(i) == 0) + continue; + + color[i] = G_GetSkinColor(i); + + if (curcolor[i] == color[i]) // dont update if same colour + continue; + + G_SetPlayerGamepadIndicatorColor(i, color[i]); + curcolor[i] = color[i]; + } +} + // // D_ProcessEvents // Send all the events of the given timestamp down the responder chain @@ -839,6 +864,9 @@ void D_SRB2Loop(void) else menuInputDelayTimer = 0; + if (!dedicated && renderisnewtic) // idk does this need dedi check?? + D_DeviceLEDTick(); + // Fully completed frame made. finishprecise = I_GetPreciseTime(); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 3103b4fc8..140bc7076 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -6065,8 +6065,6 @@ static void Command_SkinSearch(void) */ static void Color_OnChange(void) { - G_SetPlayerGamepadIndicatorColor(0, 0); // i want this to always change so its here - if (!Playing()) return; // do whatever you want @@ -6086,8 +6084,6 @@ static void Color_OnChange(void) CV_StealthSetValue(&cv_playercolor, players[consoleplayer].skincolor); } - - G_SetPlayerGamepadIndicatorColor(0, 0); // update again } /** Sends a color change for the secondary splitscreen player, unless that @@ -6110,8 +6106,6 @@ static void Color2_OnChange(void) CV_StealthSetValue(&cv_playercolor2, players[displayplayers[1]].skincolor); } - - G_SetPlayerGamepadIndicatorColor(1, 0); } static void Color3_OnChange(void) @@ -6129,8 +6123,6 @@ static void Color3_OnChange(void) CV_StealthSetValue(&cv_playercolor3, players[displayplayers[2]].skincolor); } - - G_SetPlayerGamepadIndicatorColor(2, 0); } static void Color4_OnChange(void) @@ -6148,8 +6140,6 @@ static void Color4_OnChange(void) CV_StealthSetValue(&cv_playercolor4, players[displayplayers[3]].skincolor); } - - G_SetPlayerGamepadIndicatorColor(3, 0); } /** Displays the result of the chat being muted or unmuted. diff --git a/src/g_game.c b/src/g_game.c index 89d299c28..e05e7fcc0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2136,8 +2136,6 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive) if (viewnum == 1 && demo.playback) consoleplayer = displayplayers[0]; - - G_SetPlayerGamepadIndicatorColor(viewnum-1, 0); } // @@ -8544,12 +8542,8 @@ boolean G_DemoTitleResponder(event_t *ev) // void G_SetGamestate(gamestate_t newstate) { - SINT8 i; gamestate = newstate; - for (i = 0; i <= splitscreen; i++) - G_SetPlayerGamepadIndicatorColor(i, 0); // dumb hack but works - #ifdef HAVE_DISCORDRPC DRPC_UpdatePresence(); #endif diff --git a/src/g_input.c b/src/g_input.c index f7057d4e4..00a57d7bc 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -865,7 +865,7 @@ static const char *gamecontrolname[num_gamecontrols] = #include "k_kart.h" -static INT32 G_GetDeviceForPlayer(INT32 player) +INT32 G_GetDeviceForPlayer(INT32 player) { switch (player) { @@ -887,7 +887,7 @@ static INT32 G_GetDeviceForPlayer(INT32 player) } } -static UINT16 G_GetSkinColor(INT32 player) +inline UINT16 G_GetSkinColor(INT32 player) { if (players[displayplayers[player]].skincolor && gamestate == GS_LEVEL) return players[displayplayers[player]].skincolor; diff --git a/src/g_input.h b/src/g_input.h index 92444cccc..8522be618 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -132,6 +132,8 @@ extern INT32 gamecontrol4[num_gamecontrols][2]; // peace to my little coder fingers! // check a gamecontrol being active or not +UINT16 G_GetSkinColor(INT32 player); +INT32 G_GetDeviceForPlayer(INT32 player); void G_SetPlayerGamepadIndicatorColor(INT32 player, UINT16 color); void G_PlayerDeviceRumble(INT32 player, UINT16 low_strength, UINT16 high_strength, UINT32 duration); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index f5763dc09..cd43e40bf 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -3022,6 +3022,7 @@ static int lib_gSetPlayerGamepadIndicatorColor(lua_State *L) // Not a local player if (player == -1) return 0; + // pls update with color 0 when youre done with changing led stuff so it can get player color again G_SetPlayerGamepadIndicatorColor(player, color); return 0; From dd6056a07ad023fd80796f9a5de1f16243549cf5 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 4 Aug 2024 14:51:35 +0200 Subject: [PATCH 11/13] check if theres even controllers in rumble ticker --- src/p_tick.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_tick.c b/src/p_tick.c index b3a934cd4..8054ee554 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -319,7 +319,7 @@ static inline void P_DeviceRumbleTick(void) { UINT8 i; - if (cv_rumble[0].value == 0 && cv_rumble[1].value == 0 && cv_rumble[2].value == 0 && cv_rumble[3].value == 0) + if (I_NumJoys() == 0 || (cv_rumble[0].value == 0 && cv_rumble[1].value == 0 && cv_rumble[2].value == 0 && cv_rumble[3].value == 0)) { return; } @@ -336,6 +336,9 @@ static inline void P_DeviceRumbleTick(void) if (!playeringame[i] || player->spectator) continue; + if (G_GetDeviceForPlayer(i) == 0) + continue; + if (player->exiting) continue; From 6c764a8487cbe4417006928026c7fc678575162f Mon Sep 17 00:00:00 2001 From: Indev Date: Sun, 4 Aug 2024 16:52:14 +0300 Subject: [PATCH 12/13] Fix chat not saving in console Not sure why it was working before but broke now, maybe making va use snprintf instead of sprintf broke that --- src/hu_stuff.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index cd0f42a9c..934b77105 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -594,7 +594,10 @@ void HU_AddChatText(const char *text, boolean playsound) if (OLDCHAT) // if we're using oldchat, print directly in console CONS_Printf("%s\n", text); else // if we aren't, still save the message to log.txt - CON_LogMessage(va("%s\n", text)); + { + CON_LogMessage(text); + CON_LogMessage("\n"); // Add newline. Don't use va for that, since `text` might be refering to va's buffer itself + } #else (void)playsound; CONS_Printf("%s\n", text); From 8f2d36aab0ecd25a52cad8c67719ee92fb71ec3a Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 5 Aug 2024 12:40:06 +0200 Subject: [PATCH 13/13] smol cleanup --- src/hardware/hw_main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 2a0ff0c66..ba8d8cef1 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4772,6 +4772,7 @@ void HWR_ProjectSprite(mobj_t *thing) size_t lumpoff; unsigned rot; UINT8 flip; + boolean vflip; boolean mirrored; boolean hflip; @@ -4795,6 +4796,7 @@ void HWR_ProjectSprite(mobj_t *thing) if (!thing) return; + vflip = (thing->eflags & MFE_VERTICALFLIP); mirrored = thing->mirrored; hflip = (!(thing->frame & FF_HORIZONTALFLIP) != !mirrored); papersprite = (thing->frame & FF_PAPERSPRITE); @@ -4924,7 +4926,7 @@ void HWR_ProjectSprite(mobj_t *thing) } if (thing->skin && ((skin_t *)( (thing->localskin) ? thing->localskin : thing->skin ))->flags & SF_HIRES) - this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)( (thing->localskin) ? thing->localskin : thing->skin ))->highresscale); + this_scale *= FIXED_TO_FLOAT(((skin_t *)( (thing->localskin) ? thing->localskin : thing->skin ))->highresscale); spr_width = spritecachedinfo[lumpoff].width; spr_height = spritecachedinfo[lumpoff].height; @@ -5016,7 +5018,7 @@ void HWR_ProjectSprite(mobj_t *thing) x1 = tr_x + x1 * rightcos; x2 = tr_x - x2 * rightcos; - if (thing->eflags & MFE_VERTICALFLIP) + if (vflip) { gz = FIXED_TO_FLOAT(interp.z + thing->height) - (FIXED_TO_FLOAT(spr_topoffset) * spriteyscale); gzt = gz + (FIXED_TO_FLOAT(spr_height) * spriteyscale); @@ -5076,7 +5078,6 @@ void HWR_ProjectSprite(mobj_t *thing) vis->mobj = thing; - //Hurdler: 25/04/2000: now support colormap in hardware mode if ((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash" { @@ -5113,10 +5114,7 @@ void HWR_ProjectSprite(mobj_t *thing) //CONS_Debug(DBG_RENDER, "------------------\nH: sprite : %d\nH: frame : %x\nH: type : %d\nH: sname : %s\n\n", // thing->sprite, thing->frame, thing->type, sprnames[thing->sprite]); - if (thing->eflags & MFE_VERTICALFLIP) - vis->vflip = true; - else - vis->vflip = false; + vis->vflip = vflip; vis->precip = false; }