From 9ce72dcf7951086030e582bf28674eb37488be3a Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 8 Apr 2024 22:17:26 +0800 Subject: [PATCH] [saco] Implement `CAudio::StopRadio()` * Implement `CAudio::sub_100A21D0()` --- saco/game/audio.cpp | 25 +++++++++++++++++++++++++ saco/game/audio.h | 21 ++++++++++++++------- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/saco/game/audio.cpp b/saco/game/audio.cpp index f1cd01e..50e948b 100644 --- a/saco/game/audio.cpp +++ b/saco/game/audio.cpp @@ -3,6 +3,20 @@ //----------------------------------------------------------- +void CAudio::sub_100A21D0() +{ + if(field_0 && field_0 == 1) + { + if(ScriptCommand(&is_wav_loaded, 1)) + { + ScriptCommand(&play_wav, 1); + field_0 = 2; + } + } +} + +//----------------------------------------------------------- + int CAudio::GetRadioStation() { int iRadioStation = 0; @@ -30,6 +44,17 @@ void CAudio::StartRadio(int iStation) //----------------------------------------------------------- +void CAudio::StopRadio() +{ + _asm push 0 + _asm push 0 + _asm mov ecx, 0xB6BC90 + _asm mov edx, 0x506F70 + _asm call edx +} + +//----------------------------------------------------------- + float CAudio::GetRadioVolume() { return *(float*)0xB5FCC8; diff --git a/saco/game/audio.h b/saco/game/audio.h index 7882215..9232e74 100644 --- a/saco/game/audio.h +++ b/saco/game/audio.h @@ -1,22 +1,29 @@ #pragma once -class CAudio // size: 5 -{ -public: - int field_0; - char field_4; +//----------------------------------------------------------- +class CAudio +{ +private: + int field_0; + bool field_4; + +public: CAudio() { field_0 = 0; - field_4 = 0; - }; + field_4 = false; + } + void sub_100A21D0(); int GetRadioStation(); void StartRadio(int iStation); + void StopRadio(); float GetRadioVolume(); void StopOutdoorAmbienceTrack(); void SetOutdoorAmbienceTrack(int iTrack); void PlaySound(int iSound, float fX, float fY, float fZ); bool IsOutdoorAmbienceTrackDisabled(); }; + +//-----------------------------------------------------------