Remove separate menu FPS throttling
We should let VSync/m_max_fps (which defaults to 120) do their job. If a monitor has a refresh rate even slightly higher than 60FPS (e.g. 60.0007FPS), throttling will introduce stutters, even more so at modern high refresh rates (75, 90, 120, etc.) This also cleans up the code, e.g. the var name `m_throttle_fps` was also being used in the main loop for a different function, despite having the same var name.
This commit is contained in:
parent
1e90c734a3
commit
4b47cf3f24
@ -54,7 +54,6 @@ Screen::Screen(const char* file, bool pause_race)
|
||||
m_magic_number = 0xCAFEC001;
|
||||
|
||||
m_filename = file;
|
||||
m_throttle_FPS = true;
|
||||
m_render_3d = false;
|
||||
m_loaded = false;
|
||||
m_pause_race = pause_race;
|
||||
|
@ -99,8 +99,6 @@ protected:
|
||||
/** True if this screen is resizable
|
||||
*/
|
||||
bool m_resizable;
|
||||
|
||||
bool m_throttle_FPS;
|
||||
private:
|
||||
/** True if the race (if it is running) should be paused when this
|
||||
* screen is shown. The RaceResultGUI uses this to leave the race
|
||||
@ -165,8 +163,6 @@ protected:
|
||||
/** \return whether this screen is currently loaded */
|
||||
bool isLoaded() const { return m_loaded; }
|
||||
|
||||
bool throttleFPS() const { return m_throttle_FPS; }
|
||||
|
||||
void addWidgets();
|
||||
|
||||
void calculateLayout();
|
||||
@ -350,7 +346,6 @@ protected:
|
||||
CutsceneScreen(const char* name) : Screen(name, false)
|
||||
{
|
||||
setNeeds3D(true);
|
||||
m_throttle_FPS = false;
|
||||
}
|
||||
|
||||
virtual void onCutsceneEnd() = 0;
|
||||
|
@ -297,9 +297,7 @@ float MainLoop::getLimitedDt()
|
||||
const int max_fps = (irr_driver->isRecording() &&
|
||||
UserConfigParams::m_limit_game_fps )
|
||||
? UserConfigParams::m_record_fps
|
||||
: ( StateManager::get()->throttleFPS()
|
||||
? 60
|
||||
: UserConfigParams::m_max_fps );
|
||||
: UserConfigParams::m_max_fps;
|
||||
#endif
|
||||
const int current_fps = (int)(1000.0f / dt);
|
||||
if (!m_throttle_fps || current_fps <= max_fps ||
|
||||
|
@ -119,8 +119,6 @@ void CreditsScreen::loadedFromFile()
|
||||
{
|
||||
reset();
|
||||
|
||||
m_throttle_FPS = false;
|
||||
|
||||
std::string creditsfile = file_manager->getAsset("CREDITS");
|
||||
|
||||
std::ifstream file(
|
||||
|
@ -153,23 +153,6 @@ void StateManager::resetActivePlayers()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if 0
|
||||
#pragma mark -
|
||||
#pragma mark misc stuff
|
||||
#endif
|
||||
|
||||
bool StateManager::throttleFPS()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
return m_game_mode != GUIEngine::GAME && GUIEngine::getCurrentScreen() &&
|
||||
GUIEngine::getCurrentScreen()->throttleFPS();
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
} // throttleFPS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void StateManager::escapePressed()
|
||||
{
|
||||
// in input sensing mode
|
||||
|
@ -188,13 +188,6 @@ public:
|
||||
unsigned int activePlayerCount();
|
||||
void resetActivePlayers();
|
||||
|
||||
/** \return whether to reduce FPS at the moment
|
||||
* \note this can be useful to avoid being too CPU/GPU intensive in
|
||||
* parts of the game that don't require high framerates, like
|
||||
* menus
|
||||
*/
|
||||
bool throttleFPS();
|
||||
|
||||
/** \brief implementing callback from base class AbstractStateManager */
|
||||
void escapePressed();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user