From 1a7458a2908c7bbf7de97253e9fcf8702ec46e46 Mon Sep 17 00:00:00 2001 From: Raf <> Date: Tue, 29 Aug 2023 16:26:33 +0800 Subject: [PATCH] fix whitespace issues --- port/src/input.c | 2 +- src/game/activemenutick.c | 38 +++++++++++++++++++------------------- src/include/types.h | 4 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/port/src/input.c b/port/src/input.c index d5f247793..ddfc7369d 100644 --- a/port/src/input.c +++ b/port/src/input.c @@ -480,7 +480,7 @@ static inline s32 inputAxisScale(s32 x, const s32 deadzone, const f32 scale) if (abs(x) < deadzone) { return 0; } else { - // rescale to fit the non-deadzone range + // rescale to fit the non-deadzone range if (x < 0) { x += deadzone; } else { diff --git a/src/game/activemenutick.c b/src/game/activemenutick.c index f7ea359ac..a7823299c 100644 --- a/src/game/activemenutick.c +++ b/src/game/activemenutick.c @@ -68,21 +68,21 @@ void amTick(void) g_AmMenus[g_AmIndex].allbots = false; #ifndef PLATFORM_N64 - if (j == 0 && g_Vars.currentplayernum == 0 && inputMouseIsLocked()) { - f32 mdx, mdy; - struct activemenu *am = &g_AmMenus[g_AmIndex]; - inputMouseGetScaledDelta(&mdx, &mdy); - if (mdx || mdy) { - am->mousex += mdx * 4.f; - am->mousey += mdy * 4.f; - am->mousex = (am->mousex > 127.f) ? 127.f : (am->mousex < -128.f) ? -128.f : am->mousex; - am->mousey = (am->mousey > 127.f) ? 127.f : (am->mousey < -128.f) ? -128.f : am->mousey; - } - const s32 newstickx = (s32)cstickx + (s32)am->mousex; - const s32 newsticky = (s32)csticky - (s32)am->mousey; - cstickx = (newstickx < -128) ? -128 : (newstickx > 127) ? 127 : newstickx; - csticky = (newsticky < -128) ? -128 : (newsticky > 127) ? 127 : newsticky; - } + if (j == 0 && g_Vars.currentplayernum == 0 && inputMouseIsLocked()) { + f32 mdx, mdy; + struct activemenu *am = &g_AmMenus[g_AmIndex]; + inputMouseGetScaledDelta(&mdx, &mdy); + if (mdx || mdy) { + am->mousex += mdx * 4.f; + am->mousey += mdy * 4.f; + am->mousex = (am->mousex > 127.f) ? 127.f : (am->mousex < -128.f) ? -128.f : am->mousex; + am->mousey = (am->mousey > 127.f) ? 127.f : (am->mousey < -128.f) ? -128.f : am->mousey; + } + const s32 newstickx = (s32)cstickx + (s32)am->mousex; + const s32 newsticky = (s32)csticky - (s32)am->mousey; + cstickx = (newstickx < -128) ? -128 : (newstickx > 127) ? 127 : newstickx; + csticky = (newsticky < -128) ? -128 : (newsticky > 127) ? 127 : newsticky; + } #endif if (g_Vars.currentplayer->activemenumode == AMMODE_EDIT) { @@ -360,10 +360,10 @@ void amTick(void) } } #ifndef PLATFORM_N64 - else { - g_AmMenus[g_AmIndex].mousex = 0.f; - g_AmMenus[g_AmIndex].mousey = 0.f; - } + else { + g_AmMenus[g_AmIndex].mousex = 0.f; + g_AmMenus[g_AmIndex].mousey = 0.f; + } #endif if (g_Vars.currentplayer->activemenumode != AMMODE_EDIT) { diff --git a/src/include/types.h b/src/include/types.h index 5f5e46f6f..8cd8b306e 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -4308,8 +4308,8 @@ struct activemenu { /*0x34*/ s8 origscreennum; // original screen number before using allbots #ifndef PLATFORM_N64 - /* */ f32 mousex; - /* */ f32 mousey; + /* */ f32 mousex; + /* */ f32 mousey; #endif };