mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Merge branch 'master' into next
This commit is contained in:
commit
5dac9c6875
2 changed files with 15 additions and 16 deletions
11
src/g_game.c
11
src/g_game.c
|
@ -1044,19 +1044,18 @@ static INT32 G_BasicDeadZoneCalculation(INT32 magnitude, fixed_t deadZone)
|
|||
{
|
||||
const INT32 jdeadzone = (JOYAXISRANGE * deadZone) / FRACUNIT;
|
||||
INT32 deadzoneAppliedValue = 0;
|
||||
|
||||
if (jdeadzone > 0)
|
||||
{
|
||||
if (magnitude > jdeadzone)
|
||||
{
|
||||
INT32 adjustedMagnitude = abs(magnitude);
|
||||
|
||||
if (jdeadzone >= JOYAXISRANGE && adjustedMagnitude >= JOYAXISRANGE) // If the deadzone and magnitude are both 100%...
|
||||
return JOYAXISRANGE; // ...return 100% input directly, to avoid dividing by 0
|
||||
else if (adjustedMagnitude > jdeadzone) // Otherwise, calculate how much the magnitude exceeds the deadzone
|
||||
{
|
||||
adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE);
|
||||
|
||||
adjustedMagnitude -= jdeadzone;
|
||||
|
||||
deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone);
|
||||
}
|
||||
}
|
||||
|
||||
return deadzoneAppliedValue;
|
||||
}
|
||||
|
|
12
src/m_menu.c
12
src/m_menu.c
|
@ -2204,7 +2204,7 @@ menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE(
|
|||
menu_t OP_ScreenshotOptionsDef =
|
||||
{
|
||||
MN_OP_MAIN + (MN_OP_DATA << 6) + (MN_OP_SCREENSHOTS << 12),
|
||||
"M_DATA",
|
||||
"M_SCREEN",
|
||||
sizeof (OP_ScreenshotOptionsMenu)/sizeof (menuitem_t),
|
||||
&OP_DataOptionsDef,
|
||||
OP_ScreenshotOptionsMenu,
|
||||
|
@ -10099,13 +10099,13 @@ static void M_ReplayTimeAttack(INT32 choice)
|
|||
static void M_EraseGuest(INT32 choice)
|
||||
{
|
||||
const char *rguest = va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value));
|
||||
(void)choice;
|
||||
|
||||
if (choice == 'y' || choice == KEY_ENTER)
|
||||
{
|
||||
if (FIL_FileExists(rguest))
|
||||
remove(rguest);
|
||||
if (currentMenu == &SP_NightsGuestReplayDef)
|
||||
M_SetupNextMenu(&SP_NightsAttackDef);
|
||||
else
|
||||
M_SetupNextMenu(&SP_TimeAttackDef);
|
||||
}
|
||||
M_SetupNextMenu(currentMenu->prevMenu->prevMenu);
|
||||
Nextmap_OnChange();
|
||||
M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue