summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-01-28 23:44:33 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-01-28 23:44:33 +0100
commit810bad9fd8cf344f7d73b82f042910a4c443b0f7 (patch)
tree642eb40736bd71d12edbe5cdc7afa1a70ffe7c36 /src/core
parentfix (diff)
downloadre3-810bad9fd8cf344f7d73b82f042910a4c443b0f7.tar
re3-810bad9fd8cf344f7d73b82f042910a4c443b0f7.tar.gz
re3-810bad9fd8cf344f7d73b82f042910a4c443b0f7.tar.bz2
re3-810bad9fd8cf344f7d73b82f042910a4c443b0f7.tar.lz
re3-810bad9fd8cf344f7d73b82f042910a4c443b0f7.tar.xz
re3-810bad9fd8cf344f7d73b82f042910a4c443b0f7.tar.zst
re3-810bad9fd8cf344f7d73b82f042910a4c443b0f7.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Frontend.cpp25
-rw-r--r--src/core/main.cpp5
2 files changed, 21 insertions, 9 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 5fe3d6be..f38efb66 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -5567,33 +5567,40 @@ void
CMenuManager::DrawQuitGameScreen(void)
{
static int32 exitSignalTimer = 0;
+
+#ifdef FIX_BUGS
+ int alpha = clamp(m_nMenuFadeAlpha, 0, 255);
+#else
+ int alpha = m_nMenuFadeAlpha;
+#endif
+
#ifndef MUCH_SHORTER_OUTRO_SCREEN
static PauseModeTime lastTickIncrease = 0;
- if (m_nMenuFadeAlpha == 255 && CTimer::GetTimeInMillisecondsPauseMode() - lastTickIncrease > 10) {
+ if (alpha == 255 && CTimer::GetTimeInMillisecondsPauseMode() - lastTickIncrease > 10) {
exitSignalTimer++;
lastTickIncrease = CTimer::GetTimeInMillisecondsPauseMode();
}
#else
- static PauseModeTime sincePress = 0;
- sincePress += frameTime;
- if (sincePress > 500)
+ static PauseModeTime firstTick = CTimer::GetTimeInMillisecondsPauseMode();
+ if (alpha == 255 && CTimer::GetTimeInMillisecondsPauseMode() - firstTick > 1000) {
exitSignalTimer = 150;
+ }
#endif
static CSprite2d *splash = nil;
if (splash == nil)
splash = LoadSplash("OUTRO");
- m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(28.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, -(m_nMenuFadeAlpha + 1)));
+ m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(28.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, 255 - alpha));
// Or we can see menu background from sides
#ifdef ASPECT_RATIO_SCALE
- CSprite2d::DrawRect(CRect(0, 0, MENU_X_LEFT_ALIGNED(0.f), SCREEN_HEIGHT), CRGBA(0, 0, 0, m_nMenuFadeAlpha));
- CSprite2d::DrawRect(CRect(MENU_X_RIGHT_ALIGNED(0.f), 0, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(0, 0, 0, m_nMenuFadeAlpha));
+ CSprite2d::DrawRect(CRect(0, 0, MENU_X_LEFT_ALIGNED(0.f), SCREEN_HEIGHT), CRGBA(0, 0, 0, alpha));
+ CSprite2d::DrawRect(CRect(MENU_X_RIGHT_ALIGNED(0.f), 0, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(0, 0, 0, alpha));
#endif
- splash->Draw(CRect(MENU_X_LEFT_ALIGNED(0.f), 0, MENU_X_RIGHT_ALIGNED(0.f), SCREEN_HEIGHT), CRGBA(255, 255, 255, m_nMenuFadeAlpha));
- if (m_nMenuFadeAlpha == 255 && exitSignalTimer == 150)
+ splash->Draw(CRect(MENU_X_LEFT_ALIGNED(0.f), 0, MENU_X_RIGHT_ALIGNED(0.f), SCREEN_HEIGHT), CRGBA(255, 255, 255, alpha));
+ if (alpha == 255 && exitSignalTimer == 150)
RsEventHandler(rsQUITAPP, nil);
m_bShowMouse = false;
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 9a0308dd..a08a9535 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -1065,8 +1065,13 @@ DisplayGameDebugText()
#endif
FrameSamples++;
+#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
+ FramesPerSecondCounter += frameTime / 1000.f; // convert to seconds
+ FramesPerSecond = FrameSamples / FramesPerSecondCounter;
+#else
FramesPerSecondCounter += 1000.0f / (CTimer::GetTimeStepNonClippedInSeconds() * 1000.0f);
FramesPerSecond = FramesPerSecondCounter / FrameSamples;
+#endif
if ( FrameSamples > 30 )
{