Remove 'none' as an option for the frame limiter in the menu and fix a bug with the slider for the offset

git-svn-id: https://svn.eduke32.com/eduke32@7298 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-12-23 23:23:46 +00:00
parent caf2a8c9c9
commit 5ff83a5f5f

View file

@ -522,8 +522,8 @@ static MenuOptionSet_t MEOS_VIDEOSETUP_VSYNC = MAKE_MENUOPTIONSET(MEOSN_VIDEOSET
static MenuOption_t MEO_VIDEOSETUP_VSYNC = MAKE_MENUOPTION(&MF_Redfont, &MEOS_VIDEOSETUP_VSYNC, &newvsync);
static MenuEntry_t ME_VIDEOSETUP_VSYNC = MAKE_MENUENTRY("VSync:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_VSYNC, Option);
static char const *MEOSN_VIDEOSETUP_FRAMELIMIT [] = { "None", "30 fps", "60 fps", "120 fps", "144 fps", "165 fps", "240 fps" };
static int32_t MEOSV_VIDEOSETUP_FRAMELIMIT [] = { 0, 30, 60, 120, 144, 165, 240 };
static char const *MEOSN_VIDEOSETUP_FRAMELIMIT [] = { "30 fps", "60 fps", "120 fps", "144 fps", "165 fps", "240 fps" };
static int32_t MEOSV_VIDEOSETUP_FRAMELIMIT [] = { 30, 60, 120, 144, 165, 240 };
static MenuOptionSet_t MEOS_VIDEOSETUP_FRAMELIMIT = MAKE_MENUOPTIONSET(MEOSN_VIDEOSETUP_FRAMELIMIT, MEOSV_VIDEOSETUP_FRAMELIMIT, 0x0);
static MenuOption_t MEO_VIDEOSETUP_FRAMELIMIT= MAKE_MENUOPTION(&MF_Redfont, &MEOS_VIDEOSETUP_FRAMELIMIT, &r_maxfps);
static MenuEntry_t ME_VIDEOSETUP_FRAMELIMIT = MAKE_MENUENTRY("Framerate limit:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_FRAMELIMIT, Option);
@ -3221,11 +3221,7 @@ static int32_t Menu_EntryOptionModify(MenuEntry_t *entry, int32_t newOption)
}
else if (entry == &ME_VIDEOSETUP_FRAMELIMIT)
{
g_frameDelay = newOption ? (timerGetFreqU64()/(newOption + r_maxfpsoffset)) : 0;
}
else if (entry == &ME_VIDEOSETUP_FRAMELIMITOFFSET)
{
g_frameDelay = r_maxfps ? (timerGetFreqU64()/(r_maxfps + newOption)) : 0;
g_frameDelay = (newOption + r_maxfpsoffset) ? (timerGetFreqU64()/(newOption + r_maxfpsoffset)) : 0;
}
switch (g_currentMenu)
@ -3333,6 +3329,8 @@ static int32_t Menu_EntryRangeInt32Modify(MenuEntry_t *entry, int32_t newValue)
joySetDeadZone(M_JOYSTICKAXES.currentEntry, newValue, *MEO_JOYSTICKAXIS_SATU.variable);
else if (entry == &ME_JOYSTICKAXIS_SATU)
joySetDeadZone(M_JOYSTICKAXES.currentEntry, *MEO_JOYSTICKAXIS_DEAD.variable, newValue);
else if (entry == &ME_VIDEOSETUP_FRAMELIMITOFFSET)
g_frameDelay = (r_maxfps + newValue) ? (timerGetFreqU64()/(r_maxfps + newValue)) : 0;
return 0;
}