From 70876d3cde319a586c3b9a8c74b97c0325278d21 Mon Sep 17 00:00:00 2001 From: withmorten Date: Sat, 3 Jul 2021 16:43:35 +0200 Subject: fix screenshot name --- src/core/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/main.cpp b/src/core/main.cpp index 74b896c6..e84c6eeb 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -379,7 +379,7 @@ DoRWStuffEndOfFrame(void) } #else if (CPad::GetPad(1)->GetLeftShockJustDown() || CPad::GetPad(0)->GetFJustDown(11)) { - sprintf(s, "screen_0%11lld.png", time(nil)); + sprintf(s, "screen_%011lld.png", time(nil)); RwGrabScreen(Scene.camera, s); } #endif -- cgit v1.2.3 From c5e896c4202e6518a31cf7edb5a4f9c8bfdb2dea Mon Sep 17 00:00:00 2001 From: mssx86 Date: Thu, 1 Jul 2021 20:12:28 +0300 Subject: fix: add missing limits.h includes to enable bulding on musl. --- src/core/CdStreamPosix.cpp | 1 + src/skel/crossplatform.h | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/core/CdStreamPosix.cpp b/src/core/CdStreamPosix.cpp index 30fe06a0..bc9129eb 100644 --- a/src/core/CdStreamPosix.cpp +++ b/src/core/CdStreamPosix.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #ifdef __linux__ #include diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h index 24c3fb4d..a073f854 100644 --- a/src/skel/crossplatform.h +++ b/src/skel/crossplatform.h @@ -1,4 +1,5 @@ #include +#include // This is the common include for platform/renderer specific skeletons(glfw.cpp, win.cpp etc.) and using cross platform things (like Windows directories wrapper, platform specific global arrays etc.) // Functions that's different on glfw and win but have same signature, should be located on platform.h. -- cgit v1.2.3 From e6544a69834f6bf8c8b412d02d19c3b5c29f9178 Mon Sep 17 00:00:00 2001 From: withmorten Date: Wed, 7 Jul 2021 01:59:16 +0200 Subject: fix sampman_null build --- src/audio/sampman_null.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/audio/sampman_null.cpp b/src/audio/sampman_null.cpp index a5ed2889..af4c54ad 100644 --- a/src/audio/sampman_null.cpp +++ b/src/audio/sampman_null.cpp @@ -114,7 +114,7 @@ cSampleManager::SetMusicMasterVolume(uint8 nVolume) } void -cSampleManager::SetMusicMasterVolume(uint8 nVolume) +cSampleManager::SetMP3BoostVolume(uint8 nVolume) { } @@ -231,35 +231,35 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank) void cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume) { - ASSERT( nChannel != CHANNEL2D ); + ASSERT( nChannel < MAXCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); } void cSampleManager::SetChannel3DPosition(uint32 nChannel, float fX, float fY, float fZ) { - ASSERT( nChannel != CHANNEL2D ); + ASSERT( nChannel < MAXCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); } void cSampleManager::SetChannel3DDistances(uint32 nChannel, float fMax, float fMin) { - ASSERT( nChannel != CHANNEL2D ); + ASSERT( nChannel < MAXCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); } void cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume) { - ASSERT( nChannel == CHANNEL2D ); + ASSERT( nChannel >= MAXCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); } void cSampleManager::SetChannelPan(uint32 nChannel, uint32 nPan) { - ASSERT(nChannel == CHANNEL2D); + ASSERT( nChannel >= MAXCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); } -- cgit v1.2.3 From 79c010f08275a7152e920bd0a9e3dbf6493f5b4c Mon Sep 17 00:00:00 2001 From: withmorten Date: Thu, 8 Jul 2021 01:44:55 +0200 Subject: fix macro redefinition warnings on win-glfw build --- src/audio/sampman_miles.cpp | 1 + src/control/Script.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index e8c28dc4..49f2f10f 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1,3 +1,4 @@ +#define WITHWINDOWS #include "common.h" #ifdef AUDIO_MSS diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 4b70a678..1eee1c9e 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -2209,8 +2209,9 @@ int scriptToLoad = 0; const char *scriptfile = "main.scm"; #ifdef _WIN32 -#include +extern "C" __declspec(dllimport) short __stdcall GetAsyncKeyState(int); #endif + int open_script() { // glfwGetKey doesn't work because of CGame::Initialise is blocking -- cgit v1.2.3 From 72f67809059c732588ac29eedf8a10f9156b27b4 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 8 Jul 2021 03:37:14 +0300 Subject: Use CPad functions to check key states in script loader --- src/control/Script.cpp | 15 +++++---------- src/core/Frontend.cpp | 10 +--------- 2 files changed, 6 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 1eee1c9e..76ab9471 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -2208,21 +2208,16 @@ void CRunningScript::Init() int scriptToLoad = 0; const char *scriptfile = "main.scm"; -#ifdef _WIN32 -extern "C" __declspec(dllimport) short __stdcall GetAsyncKeyState(int); -#endif - int open_script() { - // glfwGetKey doesn't work because of CGame::Initialise is blocking -#ifdef _WIN32 - if (GetAsyncKeyState('G') & 0x8000) + // glfwGetKey doesn't work because of CGame::Initialise is blocking + CPad::UpdatePads(); + if (CPad::GetPad(0)->GetChar('G')) scriptToLoad = 0; - if (GetAsyncKeyState('R') & 0x8000) + if (CPad::GetPad(0)->GetChar('R')) scriptToLoad = 1; - if (GetAsyncKeyState('D') & 0x8000) + if (CPad::GetPad(0)->GetChar('D')) scriptToLoad = 2; -#endif switch (scriptToLoad) { case 0: scriptfile = "main.scm"; break; case 1: scriptfile = "freeroam_miami.scm"; break; diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 13db6b98..632a69ab 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -4558,19 +4558,11 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u #ifdef USE_DEBUG_SCRIPT_LOADER if (m_nCurrScreen == MENUPAGE_START_MENU || m_nCurrScreen == MENUPAGE_NEW_GAME || m_nCurrScreen == MENUPAGE_NEW_GAME_RELOAD) { -#ifdef RW_GL3 - if (glfwGetKey(PSGLOBAL(window), GLFW_KEY_R) == GLFW_PRESS) { + if (CPad::GetPad(0)->GetChar('R')) { scriptToLoad = 1; DoSettingsBeforeStartingAGame(); return; } -#elif defined _WIN32 - if (GetAsyncKeyState('R') & 0x8000) { - scriptToLoad = 1; - DoSettingsBeforeStartingAGame(); - return; - } -#endif } #endif -- cgit v1.2.3 From 7a1ff3b2ad0ba3b52849d34e8a904b300f3a18c7 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Fri, 9 Jul 2021 00:02:35 +0300 Subject: Mission audio cleanup + sound pause --- src/audio/AudioLogic.cpp | 60 +++++++++++++++++----------------------------- src/audio/AudioManager.cpp | 10 +++++++- src/audio/AudioSamples.h | 2 +- 3 files changed, 32 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 31036adc..8ec4f06a 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -9447,7 +9447,7 @@ const MissionAudioData MissionAudioNameSfxAssoc[] = { {"lanamu1", SFX_SFX_LANAMU1}, {"lanamu2", SFX_SFX_LANAMU2}, {"airhrnl", SFX_SFX_AIRHORN_LEFT}, - {"airhrnr", SFX_SFX_AIRHORN_RIGH}, + {"airhrnr", SFX_SFX_AIRHORN_RIGHT}, {"sniper", SFX_SFX_SNIPER_SHOT_1}, {"snipsh", SFX_SFX_SNIPER_SHOT_2}, {"bloroof", SFX_SFX_BLOW_ROOF}, @@ -11293,9 +11293,8 @@ cAudioManager::PreloadMissionAudio(uint8 slot, Const char *name) m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_NOT_LOADED; m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_STOPPED; m_sMissionAudio.m_bIsPlaying[slot] = FALSE; - //m_sMissionAudio.m_nMissionAudioCounter[slot] = m_nTimeSpent * SampleManager.GetStreamedFileLength(missionAudioSfx) / 1000; m_sMissionAudio.m_nMissionAudioCounter[slot] = m_nTimeSpent * SampleManager.GetSampleLength(missionAudioSfx) / SampleManager.GetSampleBaseFrequency(missionAudioSfx); - m_sMissionAudio.m_nMissionAudioCounter[slot] *= 4; + m_sMissionAudio.m_nMissionAudioCounter[slot] = 11 * m_sMissionAudio.m_nMissionAudioCounter[slot] / 10; m_sMissionAudio.m_bIsPlayed[slot] = FALSE; m_sMissionAudio.m_bPredefinedProperties[slot] = TRUE; g_bMissionAudioLoadFailed[slot] = FALSE; @@ -11379,7 +11378,6 @@ cAudioManager::ClearMissionAudio(uint8 slot) m_sMissionAudio.m_bPredefinedProperties[slot] = TRUE; m_sMissionAudio.m_nMissionAudioCounter[slot] = 0; m_sMissionAudio.m_bIsMobile[slot] = FALSE; - //SampleManager.StopStreamedFile(slot + 1); SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1); } } @@ -11401,7 +11399,7 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot) switch (m_sMissionAudio.m_nLoadingStatus[slot]) { case LOADING_STATUS_NOT_LOADED: - //SampleManager.PreloadStreamedFile(m_sMissionAudio.m_nSampleIndex[slot], slot + 1); + // TODO: LoadMissionAudio SampleManager.LoadPedComment(m_sMissionAudio.m_nSampleIndex[slot]); SampleManager.InitialiseChannel(slot + CHANNEL_MISSION_AUDIO_1, m_sMissionAudio.m_nSampleIndex[slot], SFX_BANK_PED_COMMENTS); SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot])); @@ -11414,8 +11412,8 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot) if (g_bMissionAudioLoadFailed[slot]) { if (m_bTimerJustReset) { ClearMissionAudio(slot); + SampleManager.StopChannel(CHANNEL_POLICE_RADIO); SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1); - //SampleManager.StopStreamedFile(slot + 1); nFramesForPretendPlaying[slot] = 0; nCheckPlayingDelay[slot] = 0; nFramesUntilFailedLoad[slot] = 0; @@ -11434,18 +11432,20 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot) if (MissionScriptAudioUsesPoliceChannel(m_sMissionAudio.m_nSampleIndex[slot])) { SetMissionScriptPoliceAudio(m_sMissionAudio.m_nSampleIndex[slot]); } else { + SampleManager.InitialiseChannel(slot + CHANNEL_MISSION_AUDIO_1, m_sMissionAudio.m_nSampleIndex[slot], SFX_BANK_PED_COMMENTS); if(m_nUserPause) - // SampleManager.PauseStream(TRUE, slot + 1); - SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1); + SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, 0); + else + SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot])); if (m_sMissionAudio.m_bPredefinedProperties[slot]) { - //if (m_sMissionAudio.m_nSampleIndex[slot] == STREAMED_SOUND_MISSION_CAMERAL) - // SampleManager.SetStreamedVolumeAndPan(80, 0, TRUE, slot + 1); - //else if (m_sMissionAudio.m_nSampleIndex[slot] == STREAMED_SOUND_MISSION_CAMERAR) - // SampleManager.SetStreamedVolumeAndPan(80, 127, TRUE, slot + 1); - //else - SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63); SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, 127); - //SampleManager.SetStreamedVolumeAndPan(80, 63, 1, slot + 1); + SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63); + if (m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_CAMERA_LEFT || m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_AIRHORN_LEFT) + SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 0); + else if (m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_CAMERA_RIGHT || m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_AIRHORN_RIGHT) + SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 127); + else + SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63); } else { distSquared = GetDistanceSquared(m_sMissionAudio.m_vecPos[slot]); if (distSquared >= SQR(80.0f)) { @@ -11460,22 +11460,18 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot) TranslateEntity(&m_sMissionAudio.m_vecPos[slot], &vec); pan = ComputePan(80.f, &vec); } - SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, pan); SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol); - //SampleManager.SetStreamedVolumeAndPan(emittingVol, pan, 1, slot + 1); + SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, pan); } - //SampleManager.StartPreloadedStreamedFile(slot + 1); SampleManager.StartChannel(slot + CHANNEL_MISSION_AUDIO_1); } m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_PLAYING; nCheckPlayingDelay[slot] = 30; - //if (m_sMissionAudio.m_nSampleIndex[slot] >= STREAMED_SOUND_MISSION_MOB_01A && m_sMissionAudio.m_nSampleIndex[slot] <= STREAMED_SOUND_MISSION_MOB_99A) - // m_sMissionAudio.m_bIsMobile[slot] = TRUE; break; case PLAY_STATUS_PLAYING: if (m_bTimerJustReset) { ClearMissionAudio(slot); - //SampleManager.StopStreamedFile(slot + 1); + SampleManager.StopChannel(CHANNEL_POLICE_RADIO); SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1); break; } @@ -11484,25 +11480,20 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot) if (nCheckPlayingDelay[slot]) { --nCheckPlayingDelay[slot]; } else if ((g_bMissionAudioLoadFailed[slot] && m_sMissionAudio.m_nMissionAudioCounter[slot]-- == 0) || GetMissionScriptPoliceAudioPlayingStatus() == PLAY_STATUS_FINISHED) { + debug("FINISHED PLAYINGXXXXXXXXXXXXX"); m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_FINISHED; - //if (m_sMissionAudio.m_nSampleIndex[slot] >= STREAMED_SOUND_MISSION_MOB_01A && m_sMissionAudio.m_nSampleIndex[slot] <= STREAMED_SOUND_MISSION_MOB_99A) - // m_sMissionAudio.m_bIsMobile[slot] = FALSE; m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE; - //SampleManager.StopStreamedFile(slot + 1); - SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1); + SampleManager.StopChannel(CHANNEL_POLICE_RADIO); m_sMissionAudio.m_nMissionAudioCounter[slot] = 0; } } } else if (m_sMissionAudio.m_bIsPlaying[slot]) { - //if (SampleManager.IsStreamPlaying(slot + 1) || m_nUserPause || m_nPreviousUserPause) { if(SampleManager.GetChannelUsedFlag(slot + CHANNEL_MISSION_AUDIO_1) || m_nUserPause || m_nPreviousUserPause) { if(m_nUserPause) - //SampleManager.PauseStream(TRUE, slot + 1); - SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1); + SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, 0); else { - //SampleManager.PauseStream(FALSE, slot + 1); - //SampleManager.StartChannel(slot + CHANNEL_MISSION_AUDIO_1); + SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot])); if (!m_sMissionAudio.m_bPredefinedProperties[slot]) { distSquared = GetDistanceSquared(m_sMissionAudio.m_vecPos[slot]); if (distSquared >= SQR(80.0f)) { @@ -11517,19 +11508,13 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot) TranslateEntity(&m_sMissionAudio.m_vecPos[slot], &vec); pan = ComputePan(80.f, &vec); } - SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, pan); SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol); - //SampleManager.SetStreamedVolumeAndPan(emittingVol, pan, 1, slot + 1); + SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, pan); } } - //} else if (m_sMissionAudio.m_nSampleIndex[slot] == STREAMED_SOUND_MISSION_ROK2_01) { - // m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_STOPPED; } else { m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_FINISHED; - //if (m_sMissionAudio.m_nSampleIndex[slot] >= STREAMED_SOUND_MISSION_MOB_01A && m_sMissionAudio.m_nSampleIndex[slot] <= STREAMED_SOUND_MISSION_MOB_99A) - // m_sMissionAudio.m_bIsMobile[slot] = FALSE; m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE; - //SampleManager.StopStreamedFile(slot + 1); SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1); m_sMissionAudio.m_nMissionAudioCounter[slot] = 0; } @@ -11537,7 +11522,6 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot) if (m_nUserPause) break; if (nCheckPlayingDelay[slot]--) { - //if (!SampleManager.IsStreamPlaying(slot + 1)) if (!SampleManager.GetChannelUsedFlag(slot + CHANNEL_MISSION_AUDIO_1)) break; nCheckPlayingDelay[slot] = 0; diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 4ecdff25..f8fc5ff1 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -447,9 +447,17 @@ cAudioManager::ServiceSoundEffects() #endif m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0; if (m_nUserPause && !m_nPreviousUserPause) { - for (int32 i = 0; i < NUM_CHANNELS; i++) + for (int32 i = 0; i < NUM_CHANNELS_GENERIC; i++) SampleManager.StopChannel(i); + SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, 0); + SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_1, 0); + SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_2, 0); + + // ps2 code just stops the sound here for some reason + //SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_1); + //SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_2); + ClearRequestedQueue(); if (m_nActiveSampleQueue) { m_nActiveSampleQueue = 0; diff --git a/src/audio/AudioSamples.h b/src/audio/AudioSamples.h index 15840dd3..41c2e3d4 100644 --- a/src/audio/AudioSamples.h +++ b/src/audio/AudioSamples.h @@ -4017,7 +4017,7 @@ enum eSfxSample SFX_SCUM_WOM_GUN_THREATENED_2, SFX_SCUM_WOM_SHOCKED_1, SFX_SFX_AIRHORN_LEFT, - SFX_SFX_AIRHORN_RIGH, + SFX_SFX_AIRHORN_RIGHT, SFX_SFX_ANG1_AA, SFX_SFX_ANG1_AB, SFX_SFX_ANG1_AC, -- cgit v1.2.3 From 0b269571d78487733d786d677e5f831d1781ef95 Mon Sep 17 00:00:00 2001 From: withmorten Date: Fri, 9 Jul 2021 18:05:26 +0200 Subject: add librw defines to vanilla defines undefs --- src/core/config.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/core/config.h b/src/core/config.h index ff44eef1..2a3b8e6d 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -464,6 +464,11 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually #undef DISABLE_LOADING_SCREEN #undef DISABLE_VSYNC_ON_TEXTURE_CONVERSION +#undef EXTENDED_COLOURFILTER +#undef EXTENDED_PIPELINES +#undef SCREEN_DROPLETS +#undef NEW_RENDERER + #undef FIX_SPRITES #define PC_WATER -- cgit v1.2.3 From ffe199290bc2540d33d438c40f67157bdb0cb0a1 Mon Sep 17 00:00:00 2001 From: withmorten Date: Fri, 9 Jul 2021 18:51:27 +0200 Subject: fix jittery cars at 15fps --- src/vehicles/Vehicle.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index a41e0fa0..932f4fbc 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -812,11 +812,12 @@ CVehicle::ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelCon if(contactSpeedRight != 0.0f){ // exert opposing force right = -contactSpeedRight/wheelsOnGround; -#ifdef FIX_BUGS + // BUG? // contactSpeedRight is independent of framerate but right has timestep as a factor // so we probably have to fix this - right *= CTimer::GetTimeStepFix(); -#endif + // fixing this causes jittery cars at 15fps, and causes the car to move backwards slowly at 18fps + // at 19fps, the effects are gone ... + //right *= CTimer::GetTimeStepFix(); if(wheelStatus == WHEEL_STATUS_BURST){ float fwdspeed = Min(contactSpeedFwd, fBurstSpeedMax); -- cgit v1.2.3 From 4981fe30916249887c126c9a9bbb6a0c0ba2b0b2 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sat, 10 Jul 2021 02:06:35 +0300 Subject: Remove redundant SampleManager.InitialiseChannel call --- src/audio/AudioLogic.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 8ec4f06a..2d8cebc2 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -11401,7 +11401,6 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot) case LOADING_STATUS_NOT_LOADED: // TODO: LoadMissionAudio SampleManager.LoadPedComment(m_sMissionAudio.m_nSampleIndex[slot]); - SampleManager.InitialiseChannel(slot + CHANNEL_MISSION_AUDIO_1, m_sMissionAudio.m_nSampleIndex[slot], SFX_BANK_PED_COMMENTS); SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot])); m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_LOADED; nFramesUntilFailedLoad[slot] = 0; -- cgit v1.2.3