Frontend fix

This commit is contained in:
Sergeanur 2021-06-24 21:19:12 +03:00
parent 14c71f39ff
commit e5aa150557
2 changed files with 11 additions and 6 deletions

View File

@ -1429,15 +1429,17 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
if (m_nOptionHighlightTransitionBlend <= 255) { if (m_nOptionHighlightTransitionBlend <= 255) {
static uint32 blendChangeCounter = 0; static uint32 blendChangeCounter = 0;
if (CTimer::GetTimeInMillisecondsPauseMode() - lastBlendChange > 20 if (CTimer::GetTimeInMillisecondsPauseMode() - lastBlendChange > 20
#ifndef FIX_HIGH_FPS_BUGS_ON_FRONTEND // Dirty dirty hack
|| blendChangeCounter > 20 || blendChangeCounter > 20
#endif
) { ) {
m_nOptionHighlightTransitionBlend += 50; m_nOptionHighlightTransitionBlend += 50;
lastBlendChange = CTimer::GetTimeInMillisecondsPauseMode(); lastBlendChange = CTimer::GetTimeInMillisecondsPauseMode();
blendChangeCounter = 0; blendChangeCounter = 0;
} }
#ifdef FIX_BUGS
blendChangeCounter += CTimer::GetLogicalFramesPassed();
#else
++blendChangeCounter; ++blendChangeCounter;
#endif
} }
} }
@ -2382,17 +2384,22 @@ CMenuManager::DrawBackground(bool transitionCall)
if (m_nMenuFadeAlpha < 255) { if (m_nMenuFadeAlpha < 255) {
static uint8 forceFadeInCounter = 0; static uint8 forceFadeInCounter = 0;
if (CTimer::GetTimeInMillisecondsPauseMode() - LastFade > 30 if (CTimer::GetTimeInMillisecondsPauseMode() - LastFade > 30
#ifndef FIX_HIGH_FPS_BUGS_ON_FRONTEND // Dirty dirty hack
|| forceFadeInCounter > 30 || forceFadeInCounter > 30
#endif
) { ) {
m_nMenuFadeAlpha += 20; m_nMenuFadeAlpha += 20;
if (m_firstStartCounter < 255) { if (m_firstStartCounter < 255) {
m_firstStartCounter = Min(m_firstStartCounter + 20, 255); m_firstStartCounter = Min(m_firstStartCounter + 20, 255);
} }
LastFade = CTimer::GetTimeInMillisecondsPauseMode(); LastFade = CTimer::GetTimeInMillisecondsPauseMode();
#ifdef FIX_BUGS
forceFadeInCounter = 0;
#endif
} }
#ifdef FIX_BUGS
forceFadeInCounter += CTimer::GetLogicalFramesPassed();
#else
forceFadeInCounter++; forceFadeInCounter++;
#endif
} else if (m_nMenuFadeAlpha > 255) } else if (m_nMenuFadeAlpha > 255)
m_nMenuFadeAlpha = 255; m_nMenuFadeAlpha = 255;

View File

@ -247,7 +247,6 @@ enum Config {
#define MORE_LANGUAGES // Add more translations to the game #define MORE_LANGUAGES // Add more translations to the game
#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible #define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible
#define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS #define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS
#define FIX_HIGH_FPS_BUGS_ON_FRONTEND
#define NO_MOVIES // add option to disable intro videos #define NO_MOVIES // add option to disable intro videos
@ -453,7 +452,6 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#undef MORE_LANGUAGES #undef MORE_LANGUAGES
#undef COMPATIBLE_SAVES #undef COMPATIBLE_SAVES
#undef LOAD_INI_SETTINGS #undef LOAD_INI_SETTINGS
#undef FIX_HIGH_FPS_BUGS_ON_FRONTEND
#undef ASPECT_RATIO_SCALE #undef ASPECT_RATIO_SCALE
#undef PROPER_SCALING #undef PROPER_SCALING