From b35b0c598d183e2ba73c73ad82a03f833556dc27 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sat, 23 Jan 2021 03:09:15 +0200 Subject: [PATCH] Enable GTA_BRIDGE --- src/audio/AudioLogic.cpp | 5 +++-- src/control/Bridge.cpp | 20 ++++++++++++++++++++ src/control/Bridge.h | 1 + src/core/config.h | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index c2050f59..a06df0d0 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -9311,7 +9311,8 @@ cAudioManager::ProcessBridge() void cAudioManager::ProcessBridgeWarning() { - if (CStats::CommercialPassed && m_sQueueSample.m_fDistance < 450.f) { + // TODO: LCS +/* if (CStats::CommercialPassed && m_sQueueSample.m_fDistance < 450.f) { m_sQueueSample.m_nVolume = ComputeVolume(100, 450.f, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume != 0) { m_sQueueSample.m_nCounter = 0; @@ -9332,7 +9333,7 @@ cAudioManager::ProcessBridgeWarning() m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); } - } + }*/ } void diff --git a/src/control/Bridge.cpp b/src/control/Bridge.cpp index 1e63cf30..e7c76a9c 100644 --- a/src/control/Bridge.cpp +++ b/src/control/Bridge.cpp @@ -161,3 +161,23 @@ bool CBridge::ThisIsABridgeObjectMovingUp(int index) return false; #endif } + +void CBridge::ForceBridgeState(uint8 state) +{ +#ifdef GTA_BRIDGE + State = state; + switch (state) + { + case STATE_BRIDGE_LOCKED: + case STATE_LIFT_PART_MOVING_DOWN: + case STATE_LIFT_PART_ABOUT_TO_MOVE_UP: + ThePaths.SetLinksBridgeLights(-330.0f, -230.0f, -700.0f, -588.0f, true); + break; + case STATE_BRIDGE_ALWAYS_UNLOCKED: + ThePaths.SetLinksBridgeLights(-330.0f, -230.0f, -700.0f, -588.0f, false); + break; + default: + break; + } +#endif +} \ No newline at end of file diff --git a/src/control/Bridge.h b/src/control/Bridge.h index dd781a9a..e639d4c1 100644 --- a/src/control/Bridge.h +++ b/src/control/Bridge.h @@ -26,4 +26,5 @@ public: static bool ShouldLightsBeFlashing(); static void FindBridgeEntities(); static bool ThisIsABridgeObjectMovingUp(int); + static void ForceBridgeState(uint8 state); }; diff --git a/src/core/config.h b/src/core/config.h index 07773543..2685c687 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -198,7 +198,7 @@ enum Config { //#define ANIM_COMPRESSION // only keep most recently used anims uncompressed #define GTA_TRAIN -//#define GTA_BRIDGE +#define GTA_BRIDGE #if defined GTA_PS2 # define GTA_PS2_STUFF