mirror of
https://github.com/GTAmodding/re3.git
synced 2025-01-17 23:16:35 +00:00
Merge remote-tracking branch 'GitHub/miami' into lcs
This commit is contained in:
commit
e671fe682d
10 changed files with 131 additions and 61 deletions
|
@ -442,6 +442,9 @@ cAudioManager::IsAudioInitialised() const
|
||||||
void
|
void
|
||||||
cAudioManager::ServiceSoundEffects()
|
cAudioManager::ServiceSoundEffects()
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if(CTimer::GetLogicalFramesPassed() != 0)
|
||||||
|
#endif
|
||||||
m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0;
|
m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0;
|
||||||
if (m_nUserPause && !m_nPreviousUserPause) {
|
if (m_nUserPause && !m_nPreviousUserPause) {
|
||||||
for (int32 i = 0; i < NUM_CHANNELS; i++)
|
for (int32 i = 0; i < NUM_CHANNELS; i++)
|
||||||
|
@ -795,9 +798,9 @@ cAudioManager::AddReleasingSounds()
|
||||||
}
|
}
|
||||||
if (!toProcess[i]) {
|
if (!toProcess[i]) {
|
||||||
if (sample.m_nCounter <= 255 || !sample.m_nLoopsRemaining) {
|
if (sample.m_nCounter <= 255 || !sample.m_nLoopsRemaining) {
|
||||||
if (!sample.m_nReleasingVolumeDivider)
|
if (sample.m_nReleasingVolumeDivider == 0)
|
||||||
continue;
|
continue;
|
||||||
if (!sample.m_nLoopCount) {
|
if (sample.m_nLoopCount == 0) {
|
||||||
if (sample.m_nVolumeChange == -1) {
|
if (sample.m_nVolumeChange == -1) {
|
||||||
sample.m_nVolumeChange = sample.m_nVolume / sample.m_nReleasingVolumeDivider;
|
sample.m_nVolumeChange = sample.m_nVolume / sample.m_nReleasingVolumeDivider;
|
||||||
if (sample.m_nVolumeChange <= 0)
|
if (sample.m_nVolumeChange <= 0)
|
||||||
|
@ -809,6 +812,9 @@ cAudioManager::AddReleasingSounds()
|
||||||
}
|
}
|
||||||
sample.m_nVolume -= sample.m_nVolumeChange;
|
sample.m_nVolume -= sample.m_nVolumeChange;
|
||||||
}
|
}
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if(CTimer::GetLogicalFramesPassed() != 0)
|
||||||
|
#endif
|
||||||
--sample.m_nReleasingVolumeDivider;
|
--sample.m_nReleasingVolumeDivider;
|
||||||
if (m_bFifthFrameFlag) {
|
if (m_bFifthFrameFlag) {
|
||||||
if (sample.m_nReleasingVolumeModificator < 20)
|
if (sample.m_nReleasingVolumeModificator < 20)
|
||||||
|
|
|
@ -1317,7 +1317,11 @@ cMusicManager::DisplayRadioStationName()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (cDisplay == 0) return;
|
if (cDisplay == 0) return;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
cDisplay -= CTimer::GetLogicalFramesPassed();
|
||||||
|
#else
|
||||||
cDisplay--;
|
cDisplay--;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
CFont::SetJustifyOff();
|
CFont::SetJustifyOff();
|
||||||
|
|
|
@ -137,7 +137,11 @@ cAudioManager::ServicePoliceRadio()
|
||||||
if (!crimeReport) {
|
if (!crimeReport) {
|
||||||
if (wantedLevel != 0) {
|
if (wantedLevel != 0) {
|
||||||
if (nLastSeen != 0)
|
if (nLastSeen != 0)
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
nLastSeen -= CTimer::GetLogicalFramesPassed();
|
||||||
|
#else
|
||||||
--nLastSeen;
|
--nLastSeen;
|
||||||
|
#endif
|
||||||
else {
|
else {
|
||||||
nLastSeen = m_anRandomTable[1] % 1000 + 2000;
|
nLastSeen = m_anRandomTable[1] % 1000 + 2000;
|
||||||
SetupSuspectLastSeenReport();
|
SetupSuspectLastSeenReport();
|
||||||
|
@ -176,7 +180,11 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
|
||||||
}
|
}
|
||||||
if (m_sPoliceRadioQueue.policeChannelTimer == 0) bChannelOpen = FALSE;
|
if (m_sPoliceRadioQueue.policeChannelTimer == 0) bChannelOpen = FALSE;
|
||||||
if (cWait) {
|
if (cWait) {
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
cWait -= CTimer::GetLogicalFramesPassed();
|
||||||
|
#else
|
||||||
--cWait;
|
--cWait;
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (g_nMissionAudioSfx != NO_SAMPLE && !bChannelOpen) {
|
if (g_nMissionAudioSfx != NO_SAMPLE && !bChannelOpen) {
|
||||||
|
|
|
@ -195,7 +195,7 @@ const char* FrontendFilenames[][2] = {
|
||||||
#ifdef XBOX_MESSAGE_SCREEN
|
#ifdef XBOX_MESSAGE_SCREEN
|
||||||
bool CMenuManager::m_bDialogOpen = false;
|
bool CMenuManager::m_bDialogOpen = false;
|
||||||
uint32 CMenuManager::m_nDialogHideTimer = 0;
|
uint32 CMenuManager::m_nDialogHideTimer = 0;
|
||||||
PauseModeTime CMenuManager::m_nDialogHideTimerPauseMode = 0;
|
uint32 CMenuManager::m_nDialogHideTimerPauseMode = 0;
|
||||||
bool CMenuManager::m_bSaveWasSuccessful = false;
|
bool CMenuManager::m_bSaveWasSuccessful = false;
|
||||||
wchar* CMenuManager::m_pDialogText = nil;
|
wchar* CMenuManager::m_pDialogText = nil;
|
||||||
#endif
|
#endif
|
||||||
|
@ -764,7 +764,7 @@ CMenuManager::DisplayHelperText(char *text)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// there was a unused static bool
|
// there was a unused static bool
|
||||||
static PauseModeTime LastFlash = 0;
|
static uint32 LastFlash = 0;
|
||||||
int32 alpha = 255;
|
int32 alpha = 255;
|
||||||
|
|
||||||
CFont::SetRightJustifyOn();
|
CFont::SetRightJustifyOn();
|
||||||
|
@ -1442,19 +1442,21 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
static PauseModeTime lastBlendChange = 0;
|
static uint32 lastBlendChange = 0;
|
||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1945,7 +1947,7 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
|
||||||
CFont::PrintString(nextX, nextY, seperator);
|
CFont::PrintString(nextX, nextY, seperator);
|
||||||
nextX += CFont::GetStringWidth(seperator, true) + bindingMargin;
|
nextX += CFont::GetStringWidth(seperator, true) + bindingMargin;
|
||||||
}
|
}
|
||||||
static PauseModeTime lastWaitingTextFlash = 0;
|
static uint32 lastWaitingTextFlash = 0;
|
||||||
if (CTimer::GetTimeInMillisecondsPauseMode() - lastWaitingTextFlash > 150) {
|
if (CTimer::GetTimeInMillisecondsPauseMode() - lastWaitingTextFlash > 150) {
|
||||||
showWaitingText = !showWaitingText;
|
showWaitingText = !showWaitingText;
|
||||||
lastWaitingTextFlash = CTimer::GetTimeInMillisecondsPauseMode();
|
lastWaitingTextFlash = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
|
@ -2010,7 +2012,7 @@ CMenuManager::DrawControllerScreenExtraText(int yStart, int xStart, int lineHeig
|
||||||
CFont::PrintString(nextX, MENU_Y(yStart), TheText.Get("FEC_IBT"));
|
CFont::PrintString(nextX, MENU_Y(yStart), TheText.Get("FEC_IBT"));
|
||||||
nextX = CFont::GetStringWidth(TheText.Get("FEC_IBT"), true) + spacing + nextX;
|
nextX = CFont::GetStringWidth(TheText.Get("FEC_IBT"), true) + spacing + nextX;
|
||||||
}
|
}
|
||||||
static PauseModeTime lastStateChange = 0;
|
static uint32 lastStateChange = 0;
|
||||||
if (CTimer::GetTimeInMillisecondsPauseMode() - lastStateChange > 150) {
|
if (CTimer::GetTimeInMillisecondsPauseMode() - lastStateChange > 150) {
|
||||||
waitingTextVisible = !waitingTextVisible;
|
waitingTextVisible = !waitingTextVisible;
|
||||||
lastStateChange = CTimer::GetTimeInMillisecondsPauseMode();
|
lastStateChange = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
|
@ -2394,22 +2396,27 @@ CMenuManager::DrawBackground(bool transitionCall)
|
||||||
m_nOptionHighlightTransitionBlend = 0;
|
m_nOptionHighlightTransitionBlend = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PauseModeTime LastFade = 0;
|
static uint32 LastFade = 0;
|
||||||
|
|
||||||
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 += 50;
|
m_nMenuFadeAlpha += 50;
|
||||||
if (m_firstStartCounter < 255) {
|
if (m_firstStartCounter < 255) {
|
||||||
m_firstStartCounter = Min(m_firstStartCounter + 50, 255);
|
m_firstStartCounter = Min(m_firstStartCounter + 50, 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;
|
||||||
|
|
||||||
|
@ -2465,7 +2472,7 @@ CMenuManager::DrawBackground(bool transitionCall)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (m_ShowEmptyBindingError) {
|
if (m_ShowEmptyBindingError) {
|
||||||
static PauseModeTime lastBindingError = CTimer::GetTimeInMillisecondsPauseMode();
|
static uint32 lastBindingError = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
static bool bindingErrorShown = false;
|
static bool bindingErrorShown = false;
|
||||||
if (bindingErrorShown) {
|
if (bindingErrorShown) {
|
||||||
lastBindingError = CTimer::GetTimeInMillisecondsPauseMode();
|
lastBindingError = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
|
@ -3349,7 +3356,7 @@ CMenuManager::PrintStats()
|
||||||
else
|
else
|
||||||
CFont::SetScale(MENU_X(0.37f), MENU_Y(0.75f));
|
CFont::SetScale(MENU_X(0.37f), MENU_Y(0.75f));
|
||||||
|
|
||||||
static PauseModeTime lastCheck = 0;
|
static uint32 lastCheck = 0;
|
||||||
|
|
||||||
if (CTimer::GetTimeInMillisecondsPauseMode() - lastCheck > 40) {
|
if (CTimer::GetTimeInMillisecondsPauseMode() - lastCheck > 40) {
|
||||||
|
|
||||||
|
@ -3490,7 +3497,7 @@ CMenuManager::AdditionalOptionInput(bool &goBack)
|
||||||
switch (m_nCurrScreen) {
|
switch (m_nCurrScreen) {
|
||||||
case MENUPAGE_MAP:
|
case MENUPAGE_MAP:
|
||||||
{
|
{
|
||||||
static PauseModeTime lastMapTick = 0;
|
static uint32 lastMapTick = 0;
|
||||||
|
|
||||||
// FIX: All those macros were hardcoded values originally.
|
// FIX: All those macros were hardcoded values originally.
|
||||||
|
|
||||||
|
@ -3819,7 +3826,7 @@ CMenuManager::ExportStats()
|
||||||
void
|
void
|
||||||
CMenuManager::PrintRadioSelector(void)
|
CMenuManager::PrintRadioSelector(void)
|
||||||
{
|
{
|
||||||
static PauseModeTime lastRadioChange = 0;
|
static uint32 lastRadioChange = 0;
|
||||||
|
|
||||||
CSprite2d::Draw2DPolygon(MENU_X_LEFT_ALIGNED(418.f), MENU_Y(MENURADIO_SELECTOR_START_Y + MENURADIO_SELECTOR_HEIGHT),
|
CSprite2d::Draw2DPolygon(MENU_X_LEFT_ALIGNED(418.f), MENU_Y(MENURADIO_SELECTOR_START_Y + MENURADIO_SELECTOR_HEIGHT),
|
||||||
MENU_X_LEFT_ALIGNED(228.f), MENU_Y(MENURADIO_SELECTOR_START_Y + MENURADIO_SELECTOR_HEIGHT),
|
MENU_X_LEFT_ALIGNED(228.f), MENU_Y(MENURADIO_SELECTOR_START_Y + MENURADIO_SELECTOR_HEIGHT),
|
||||||
|
@ -3942,7 +3949,7 @@ CMenuManager::PrintRadioSelector(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool radioChangeRequested = false;
|
static bool radioChangeRequested = false;
|
||||||
static PauseModeTime lastScrollCheck = 0;
|
static uint32 lastScrollCheck = 0;
|
||||||
if (CTimer::GetTimeInMillisecondsPauseMode() - lastScrollCheck > 17) {
|
if (CTimer::GetTimeInMillisecondsPauseMode() - lastScrollCheck > 17) {
|
||||||
if (m_ScrollRadioBy == 1) {
|
if (m_ScrollRadioBy == 1) {
|
||||||
if (m_LeftMostRadioX > MENU_X_LEFT_ALIGNED(MENURADIO_ICON_FIRST_X - MENURADIO_ICON_SIZE)) {
|
if (m_LeftMostRadioX > MENU_X_LEFT_ALIGNED(MENURADIO_ICON_FIRST_X - MENURADIO_ICON_SIZE)) {
|
||||||
|
@ -4026,7 +4033,7 @@ CMenuManager::ProcessList(bool &optionSelected, bool &goBack)
|
||||||
field_159 = false;
|
field_159 = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PauseModeTime lastTimeClickedScrollButton = 0;
|
static uint32 lastTimeClickedScrollButton = 0;
|
||||||
|
|
||||||
if (CTimer::GetTimeInMillisecondsPauseMode() - lastTimeClickedScrollButton >= 200) {
|
if (CTimer::GetTimeInMillisecondsPauseMode() - lastTimeClickedScrollButton >= 200) {
|
||||||
m_bPressedPgUpOnList = false;
|
m_bPressedPgUpOnList = false;
|
||||||
|
@ -4412,7 +4419,7 @@ CMenuManager::UserInput(void)
|
||||||
|
|
||||||
int curAction = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action;
|
int curAction = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action;
|
||||||
if (CPad::GetPad(0)->GetLeft() || CPad::GetPad(0)->GetPedWalkLeftRight() < 0 || CPad::GetPad(0)->GetDPadLeft()) {
|
if (CPad::GetPad(0)->GetLeft() || CPad::GetPad(0)->GetPedWalkLeftRight() < 0 || CPad::GetPad(0)->GetDPadLeft()) {
|
||||||
static PauseModeTime lastSliderDecrease = 0;
|
static uint32 lastSliderDecrease = 0;
|
||||||
if (CTimer::GetTimeInMillisecondsPauseMode() - lastSliderDecrease > 150) {
|
if (CTimer::GetTimeInMillisecondsPauseMode() - lastSliderDecrease > 150) {
|
||||||
if (curAction == MENUACTION_BRIGHTNESS || curAction == MENUACTION_MUSICVOLUME ||
|
if (curAction == MENUACTION_BRIGHTNESS || curAction == MENUACTION_MUSICVOLUME ||
|
||||||
curAction == MENUACTION_SFXVOLUME || curAction == MENUACTION_RADIO ||
|
curAction == MENUACTION_SFXVOLUME || curAction == MENUACTION_RADIO ||
|
||||||
|
@ -4423,7 +4430,7 @@ CMenuManager::UserInput(void)
|
||||||
lastSliderDecrease = CTimer::GetTimeInMillisecondsPauseMode();
|
lastSliderDecrease = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
}
|
}
|
||||||
} else if (CPad::GetPad(0)->GetRight() || CPad::GetPad(0)->GetPedWalkLeftRight() > 0 || CPad::GetPad(0)->GetDPadRight()) {
|
} else if (CPad::GetPad(0)->GetRight() || CPad::GetPad(0)->GetPedWalkLeftRight() > 0 || CPad::GetPad(0)->GetDPadRight()) {
|
||||||
static PauseModeTime lastSliderIncrease = 0;
|
static uint32 lastSliderIncrease = 0;
|
||||||
if (CTimer::GetTimeInMillisecondsPauseMode() - lastSliderIncrease > 150) {
|
if (CTimer::GetTimeInMillisecondsPauseMode() - lastSliderIncrease > 150) {
|
||||||
if (curAction == MENUACTION_BRIGHTNESS || curAction == MENUACTION_MUSICVOLUME ||
|
if (curAction == MENUACTION_BRIGHTNESS || curAction == MENUACTION_MUSICVOLUME ||
|
||||||
curAction == MENUACTION_SFXVOLUME || curAction == MENUACTION_RADIO ||
|
curAction == MENUACTION_SFXVOLUME || curAction == MENUACTION_RADIO ||
|
||||||
|
@ -5414,7 +5421,7 @@ CMenuManager::ProcessFileActions()
|
||||||
{
|
{
|
||||||
#ifdef XBOX_MESSAGE_SCREEN
|
#ifdef XBOX_MESSAGE_SCREEN
|
||||||
if (m_bDialogOpen && DialogTextCmp("FESZ_WR")) {
|
if (m_bDialogOpen && DialogTextCmp("FESZ_WR")) {
|
||||||
PauseModeTime startTime = CTimer::GetTimeInMillisecondsPauseMode();
|
uint32 startTime = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
int8 SaveSlot = PcSaveHelper.SaveSlot(m_nCurrSaveSlot);
|
int8 SaveSlot = PcSaveHelper.SaveSlot(m_nCurrSaveSlot);
|
||||||
PcSaveHelper.PopulateSlotInfo();
|
PcSaveHelper.PopulateSlotInfo();
|
||||||
|
|
||||||
|
@ -5672,13 +5679,13 @@ CMenuManager::DrawQuitGameScreen(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MUCH_SHORTER_OUTRO_SCREEN
|
#ifndef MUCH_SHORTER_OUTRO_SCREEN
|
||||||
static PauseModeTime lastTickIncrease = 0;
|
static uint32 lastTickIncrease = 0;
|
||||||
if (alpha == 255 && CTimer::GetTimeInMillisecondsPauseMode() - lastTickIncrease > 10) {
|
if (alpha == 255 && CTimer::GetTimeInMillisecondsPauseMode() - lastTickIncrease > 10) {
|
||||||
exitSignalTimer++;
|
exitSignalTimer++;
|
||||||
lastTickIncrease = CTimer::GetTimeInMillisecondsPauseMode();
|
lastTickIncrease = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static PauseModeTime firstTick = CTimer::GetTimeInMillisecondsPauseMode();
|
static uint32 firstTick = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
if (alpha == 255 && CTimer::GetTimeInMillisecondsPauseMode() - firstTick > 750) {
|
if (alpha == 255 && CTimer::GetTimeInMillisecondsPauseMode() - firstTick > 750) {
|
||||||
exitSignalTimer = 150;
|
exitSignalTimer = 150;
|
||||||
}
|
}
|
||||||
|
|
|
@ -735,7 +735,7 @@ public:
|
||||||
|
|
||||||
#ifdef XBOX_MESSAGE_SCREEN
|
#ifdef XBOX_MESSAGE_SCREEN
|
||||||
static uint32 m_nDialogHideTimer;
|
static uint32 m_nDialogHideTimer;
|
||||||
static PauseModeTime m_nDialogHideTimerPauseMode;
|
static uint32 m_nDialogHideTimerPauseMode;
|
||||||
static bool m_bDialogOpen;
|
static bool m_bDialogOpen;
|
||||||
static wchar *m_pDialogText;
|
static wchar *m_pDialogText;
|
||||||
static bool m_bSaveWasSuccessful;
|
static bool m_bSaveWasSuccessful;
|
||||||
|
|
|
@ -1503,7 +1503,7 @@ CRadar::InitFrontEndMap()
|
||||||
void
|
void
|
||||||
CRadar::DrawYouAreHereSprite(float x, float y)
|
CRadar::DrawYouAreHereSprite(float x, float y)
|
||||||
{
|
{
|
||||||
static PauseModeTime lastChange = 0;
|
static uint32 lastChange = 0;
|
||||||
static bool show = true;
|
static bool show = true;
|
||||||
|
|
||||||
if (show) {
|
if (show) {
|
||||||
|
@ -1703,7 +1703,7 @@ void
|
||||||
CRadar::DrawLegend(int32 x, int32 y, int32 sprite)
|
CRadar::DrawLegend(int32 x, int32 y, int32 sprite)
|
||||||
{
|
{
|
||||||
if (sprite < 0) {
|
if (sprite < 0) {
|
||||||
static PauseModeTime lastChange = 0;
|
static uint32 lastChange = 0;
|
||||||
static int8 blipMode = 0;
|
static int8 blipMode = 0;
|
||||||
|
|
||||||
CRGBA color;
|
CRGBA color;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "SpecialFX.h"
|
#include "SpecialFX.h"
|
||||||
|
|
||||||
uint32 CTimer::m_snTimeInMilliseconds;
|
uint32 CTimer::m_snTimeInMilliseconds;
|
||||||
PauseModeTime CTimer::m_snTimeInMillisecondsPauseMode = 1;
|
uint32 CTimer::m_snTimeInMillisecondsPauseMode = 1;
|
||||||
|
|
||||||
uint32 CTimer::m_snTimeInMillisecondsNonClipped;
|
uint32 CTimer::m_snTimeInMillisecondsNonClipped;
|
||||||
uint32 CTimer::m_snPreviousTimeInMilliseconds;
|
uint32 CTimer::m_snPreviousTimeInMilliseconds;
|
||||||
|
@ -17,7 +17,11 @@ float CTimer::ms_fTimeScale;
|
||||||
float CTimer::ms_fTimeStep;
|
float CTimer::ms_fTimeStep;
|
||||||
float CTimer::ms_fTimeStepNonClipped;
|
float CTimer::ms_fTimeStepNonClipped;
|
||||||
bool CTimer::m_UserPause;
|
bool CTimer::m_UserPause;
|
||||||
bool CTimer::m_CodePause;
|
bool CTimer::m_CodePause;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
uint32 CTimer::m_LogicalFrameCounter;
|
||||||
|
uint32 CTimer::m_LogicalFramesPassed;
|
||||||
|
#endif
|
||||||
|
|
||||||
uint32 _nCyclesPerMS = 1;
|
uint32 _nCyclesPerMS = 1;
|
||||||
|
|
||||||
|
@ -35,10 +39,6 @@ RsTimerType suspendPcTimer;
|
||||||
|
|
||||||
uint32 suspendDepth;
|
uint32 suspendDepth;
|
||||||
|
|
||||||
#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
|
||||||
double frameTime;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void CTimer::Initialise(void)
|
void CTimer::Initialise(void)
|
||||||
{
|
{
|
||||||
debug("Initialising CTimer...\n");
|
debug("Initialising CTimer...\n");
|
||||||
|
@ -51,6 +51,10 @@ void CTimer::Initialise(void)
|
||||||
m_snTimeInMillisecondsNonClipped = 0;
|
m_snTimeInMillisecondsNonClipped = 0;
|
||||||
m_snPreviousTimeInMilliseconds = 0;
|
m_snPreviousTimeInMilliseconds = 0;
|
||||||
m_snTimeInMilliseconds = 1;
|
m_snTimeInMilliseconds = 1;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
m_LogicalFrameCounter = 0;
|
||||||
|
m_LogicalFramesPassed = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LARGE_INTEGER perfFreq;
|
LARGE_INTEGER perfFreq;
|
||||||
|
@ -83,7 +87,13 @@ void CTimer::Shutdown(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTimer::Update(void)
|
void CTimer::Update(void)
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
static double frameTimeLogical = 0.0;
|
||||||
|
static double frameTimeFraction = 0.0;
|
||||||
|
static double frameTimeFractionScaled = 0.0;
|
||||||
|
#endif
|
||||||
|
|
||||||
m_snPreviousTimeInMilliseconds = m_snTimeInMilliseconds;
|
m_snPreviousTimeInMilliseconds = m_snTimeInMilliseconds;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -98,22 +108,43 @@ void CTimer::Update(void)
|
||||||
|
|
||||||
float updInCyclesScaled = GetIsPaused() ? updInCycles : updInCycles * ms_fTimeScale;
|
float updInCyclesScaled = GetIsPaused() ? updInCycles : updInCycles * ms_fTimeScale;
|
||||||
|
|
||||||
// We need that real frame time to fix transparent menu bug.
|
double frameTime = updInCyclesScaled / (double)_nCyclesPerMS;
|
||||||
#ifndef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
|
||||||
double
|
#ifdef FIX_BUGS
|
||||||
#endif
|
// count frames as if we're running at 30 fps
|
||||||
frameTime = updInCyclesScaled / (double)_nCyclesPerMS;
|
m_LogicalFramesPassed = 0;
|
||||||
|
frameTimeLogical += ((double)updInCycles / (double)_nCyclesPerMS);
|
||||||
|
while (frameTimeLogical >= 1000.0 / 30.0) {
|
||||||
|
frameTimeLogical -= 1000.0 / 30.0;
|
||||||
|
m_LogicalFramesPassed++;
|
||||||
|
}
|
||||||
|
m_LogicalFrameCounter += m_LogicalFramesPassed;
|
||||||
|
|
||||||
|
frameTimeFraction += (double)updInCycles / (double)_nCyclesPerMS;
|
||||||
|
frameTimeFractionScaled += frameTime;
|
||||||
|
|
||||||
|
m_snTimeInMillisecondsPauseMode += uint32(frameTimeFraction);
|
||||||
|
#else
|
||||||
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
|
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( GetIsPaused() )
|
if ( GetIsPaused() )
|
||||||
ms_fTimeStep = 0.0f;
|
ms_fTimeStep = 0.0f;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
m_snTimeInMilliseconds += uint32(frameTimeFractionScaled);
|
||||||
|
m_snTimeInMillisecondsNonClipped += uint32(frameTimeFractionScaled);
|
||||||
|
#else
|
||||||
m_snTimeInMilliseconds = m_snTimeInMilliseconds + frameTime;
|
m_snTimeInMilliseconds = m_snTimeInMilliseconds + frameTime;
|
||||||
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + frameTime;
|
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + frameTime;
|
||||||
|
#endif
|
||||||
ms_fTimeStep = frameTime / 1000.0f * 50.0f;
|
ms_fTimeStep = frameTime / 1000.0f * 50.0f;
|
||||||
}
|
}
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
frameTimeFraction -= uint32(frameTimeFraction);
|
||||||
|
frameTimeFractionScaled -= uint32(frameTimeFractionScaled);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -122,22 +153,39 @@ void CTimer::Update(void)
|
||||||
|
|
||||||
RsTimerType updInMs = timer - oldPcTimer;
|
RsTimerType updInMs = timer - oldPcTimer;
|
||||||
|
|
||||||
// We need that real frame time to fix transparent menu bug.
|
double frameTime = (double)updInMs * ms_fTimeScale;
|
||||||
#ifndef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
|
||||||
double
|
|
||||||
#endif
|
|
||||||
frameTime = (double)updInMs * ms_fTimeScale;
|
|
||||||
|
|
||||||
oldPcTimer = timer;
|
oldPcTimer = timer;
|
||||||
|
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
// count frames as if we're running at 30 fps
|
||||||
|
m_LogicalFramesPassed = 0;
|
||||||
|
frameTimeLogical += (double)updInMs;
|
||||||
|
while(frameTimeLogical >= 1000.0 / 30.0) {
|
||||||
|
frameTimeLogical -= 1000.0 / 30.0;
|
||||||
|
m_LogicalFramesPassed++;
|
||||||
|
}
|
||||||
|
m_LogicalFrameCounter += m_LogicalFramesPassed;
|
||||||
|
|
||||||
|
frameTimeFraction += (double)updInMs;
|
||||||
|
frameTimeFractionScaled += frameTime;
|
||||||
|
|
||||||
|
m_snTimeInMillisecondsPauseMode += uint32(frameTimeFraction);
|
||||||
|
#else
|
||||||
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
|
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( GetIsPaused() )
|
if ( GetIsPaused() )
|
||||||
ms_fTimeStep = 0.0f;
|
ms_fTimeStep = 0.0f;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
m_snTimeInMilliseconds += uint32(frameTimeFractionScaled);
|
||||||
|
m_snTimeInMillisecondsNonClipped += uint32(frameTimeFractionScaled);
|
||||||
|
#else
|
||||||
m_snTimeInMilliseconds = m_snTimeInMilliseconds + frameTime;
|
m_snTimeInMilliseconds = m_snTimeInMilliseconds + frameTime;
|
||||||
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + frameTime;
|
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + frameTime;
|
||||||
|
#endif
|
||||||
ms_fTimeStep = frameTime / 1000.0f * 50.0f;
|
ms_fTimeStep = frameTime / 1000.0f * 50.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,20 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
|
||||||
#define PauseModeTime double
|
|
||||||
#else
|
|
||||||
#define PauseModeTime uint32
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class CTimer
|
class CTimer
|
||||||
{
|
{
|
||||||
|
|
||||||
static uint32 m_snTimeInMilliseconds;
|
static uint32 m_snTimeInMilliseconds;
|
||||||
static PauseModeTime m_snTimeInMillisecondsPauseMode;
|
static uint32 m_snTimeInMillisecondsPauseMode;
|
||||||
static uint32 m_snTimeInMillisecondsNonClipped;
|
static uint32 m_snTimeInMillisecondsNonClipped;
|
||||||
static uint32 m_snPreviousTimeInMilliseconds;
|
static uint32 m_snPreviousTimeInMilliseconds;
|
||||||
static uint32 m_FrameCounter;
|
static uint32 m_FrameCounter;
|
||||||
static float ms_fTimeScale;
|
static float ms_fTimeScale;
|
||||||
static float ms_fTimeStep;
|
static float ms_fTimeStep;
|
||||||
static float ms_fTimeStepNonClipped;
|
static float ms_fTimeStepNonClipped;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
static uint32 m_LogicalFrameCounter;
|
||||||
|
static uint32 m_LogicalFramesPassed;
|
||||||
|
#endif
|
||||||
public:
|
public:
|
||||||
static bool m_UserPause;
|
static bool m_UserPause;
|
||||||
static bool m_CodePause;
|
static bool m_CodePause;
|
||||||
|
@ -35,7 +33,7 @@ public:
|
||||||
static void SetTimeInMilliseconds(uint32 t) { m_snTimeInMilliseconds = t; }
|
static void SetTimeInMilliseconds(uint32 t) { m_snTimeInMilliseconds = t; }
|
||||||
static uint32 GetTimeInMillisecondsNonClipped(void) { return m_snTimeInMillisecondsNonClipped; }
|
static uint32 GetTimeInMillisecondsNonClipped(void) { return m_snTimeInMillisecondsNonClipped; }
|
||||||
static void SetTimeInMillisecondsNonClipped(uint32 t) { m_snTimeInMillisecondsNonClipped = t; }
|
static void SetTimeInMillisecondsNonClipped(uint32 t) { m_snTimeInMillisecondsNonClipped = t; }
|
||||||
static PauseModeTime GetTimeInMillisecondsPauseMode(void) { return m_snTimeInMillisecondsPauseMode; }
|
static uint32 GetTimeInMillisecondsPauseMode(void) { return m_snTimeInMillisecondsPauseMode; }
|
||||||
static void SetTimeInMillisecondsPauseMode(uint32 t) { m_snTimeInMillisecondsPauseMode = t; }
|
static void SetTimeInMillisecondsPauseMode(uint32 t) { m_snTimeInMillisecondsPauseMode = t; }
|
||||||
static uint32 GetPreviousTimeInMilliseconds(void) { return m_snPreviousTimeInMilliseconds; }
|
static uint32 GetPreviousTimeInMilliseconds(void) { return m_snPreviousTimeInMilliseconds; }
|
||||||
static void SetPreviousTimeInMilliseconds(uint32 t) { m_snPreviousTimeInMilliseconds = t; }
|
static void SetPreviousTimeInMilliseconds(uint32 t) { m_snPreviousTimeInMilliseconds = t; }
|
||||||
|
@ -67,9 +65,7 @@ public:
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
static float GetDefaultTimeStep(void) { return 50.0f / 30.0f; }
|
static float GetDefaultTimeStep(void) { return 50.0f / 30.0f; }
|
||||||
static float GetTimeStepFix(void) { return GetTimeStep() / GetDefaultTimeStep(); }
|
static float GetTimeStepFix(void) { return GetTimeStep() / GetDefaultTimeStep(); }
|
||||||
|
static uint32 GetLogicalFrameCounter(void) { return m_LogicalFrameCounter; }
|
||||||
|
static uint32 GetLogicalFramesPassed(void) { return m_LogicalFramesPassed; }
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
|
||||||
extern double frameTime;
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -250,7 +250,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
|
||||||
|
|
||||||
|
@ -457,7 +456,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
|
||||||
|
|
|
@ -1145,8 +1145,11 @@ DisplayGameDebugText()
|
||||||
#endif // #ifdef DRAW_GAME_VERSION_TEXT
|
#endif // #ifdef DRAW_GAME_VERSION_TEXT
|
||||||
|
|
||||||
FrameSamples++;
|
FrameSamples++;
|
||||||
#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
|
#ifdef FIX_BUGS
|
||||||
FramesPerSecondCounter += frameTime / 1000.f; // convert to seconds
|
// this is inaccurate with over 1000 fps
|
||||||
|
static uint32 PreviousTimeInMillisecondsPauseMode = 0;
|
||||||
|
FramesPerSecondCounter += (CTimer::GetTimeInMillisecondsPauseMode() - PreviousTimeInMillisecondsPauseMode) / 1000.0f; // convert to seconds
|
||||||
|
PreviousTimeInMillisecondsPauseMode = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
FramesPerSecond = FrameSamples / FramesPerSecondCounter;
|
FramesPerSecond = FrameSamples / FramesPerSecondCounter;
|
||||||
#else
|
#else
|
||||||
FramesPerSecondCounter += 1000.0f / CTimer::GetTimeStepNonClippedInMilliseconds();
|
FramesPerSecondCounter += 1000.0f / CTimer::GetTimeStepNonClippedInMilliseconds();
|
||||||
|
|
Loading…
Reference in a new issue