summaryrefslogtreecommitdiff
path: root/src/egg/audio/eggAudioSystem.cpp
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-09-13 12:45:21 +0200
committerGitHub <noreply@github.com>2025-09-13 12:45:21 +0200
commit3320140f40ae8c198868bb29fe8922ca400f2aa9 (patch)
treed120fcb746d04ed706ad5ec5a4773a0fad3e848b /src/egg/audio/eggAudioSystem.cpp
parenta30123ac3d0f998fdc62027092fa63e256b2e163 (diff)
parent637419b21d16f02a11f3cd4b7b35634dc8f23f19 (diff)
Merge pull request #205 from robojumper/more_snd
continue with d/snd
Diffstat (limited to 'src/egg/audio/eggAudioSystem.cpp')
-rw-r--r--src/egg/audio/eggAudioSystem.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/egg/audio/eggAudioSystem.cpp b/src/egg/audio/eggAudioSystem.cpp
index 8687eb62..844853ab 100644
--- a/src/egg/audio/eggAudioSystem.cpp
+++ b/src/egg/audio/eggAudioSystem.cpp
@@ -8,47 +8,47 @@ namespace EGG {
AudioSystem *AudioSystem::sInstanse;
AudioSystem::AudioSystem() {
- field_0x00 = 1.0f;
- field_0x08 = 0;
- field_0x04 = 0;
+ mSavedMasterVolume = 1.0f;
+ mShutdownStatus = 0;
+ mResetStatus = 0;
sInstanse = this;
}
AudioSystem::~AudioSystem() {}
-void AudioSystem::fn_804B7270(s32 frame) {
- if (field_0x08 == 0 && field_0x04 == 0) {
- field_0x00 = nw4r::snd::SoundSystem::GetMasterVolume();
- nw4r::snd::SoundSystem::SetMasterVolume(0.0f, frame * 16.666667f);
- field_0x04 = 1;
+void AudioSystem::reset(s32 ms) {
+ if (mShutdownStatus == 0 && mResetStatus == 0) {
+ mSavedMasterVolume = nw4r::snd::SoundSystem::GetMasterVolume();
+ nw4r::snd::SoundSystem::SetMasterVolume(0.0f, ms * (1.0f / 60.f * 1000.0f));
+ mResetStatus = 1;
}
}
-void AudioSystem::fn_804B7370() {
- if (field_0x08 == 0) {
- nw4r::snd::SoundSystem::SetMasterVolume(field_0x00, 0);
- field_0x04 = 0;
+void AudioSystem::recoverReset() {
+ if (mShutdownStatus == 0) {
+ nw4r::snd::SoundSystem::SetMasterVolume(mSavedMasterVolume, 0);
+ mResetStatus = 0;
}
}
-void AudioSystem::fn_804B73D0(s32 frame) {
- if (field_0x08 == 0) {
- field_0x08 = 1;
- nw4r::snd::SoundSystem::SetMasterVolume(0.0f, frame * 16.666667f);
+void AudioSystem::shutdown(s32 ms) {
+ if (mShutdownStatus == 0) {
+ mShutdownStatus = 1;
+ nw4r::snd::SoundSystem::SetMasterVolume(0.0f, ms * (1.0f / 60.f * 1000.0f));
}
}
void AudioSystem::calc() {
f32 masterVolume = nw4r::snd::SoundSystem::GetMasterVolume();
- if (field_0x08 == 1 && masterVolume == 0.0f) {
+ if (mShutdownStatus == 1 && masterVolume == 0.0f) {
nw4r::snd::SoundSystem::PrepareReset();
nw4r::snd::SoundSystem::WaitForResetReady();
- field_0x08 = 2;
+ mShutdownStatus = 2;
}
- if (field_0x08 != 2 && field_0x04 == 1 && masterVolume == 0.0f) {
- field_0x04 = 2;
+ if (mShutdownStatus != 2 && mResetStatus == 1 && masterVolume == 0.0f) {
+ mResetStatus = 2;
}
}