mirror of
https://github.com/izzy2lost/Ghostship.git
synced 2026-06-19 01:17:03 -07:00
Moved master volume as a final pass before passing it to the driver
This commit is contained in:
@@ -1496,11 +1496,6 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, f32 pan, u8 reverb
|
||||
velocity = 0;
|
||||
}
|
||||
|
||||
|
||||
float master_vol = CVarGetInteger("gSettings.Volume.Master", 100) / 100.0f;
|
||||
volLeft *= master_vol;
|
||||
volRight *= master_vol;
|
||||
|
||||
#ifdef VERSION_JP
|
||||
note->targetVolLeft = (u16)(velocity * volLeft) & ~0x80FF; // 0x7F00, but that doesn't match
|
||||
note->targetVolRight = (u16)(velocity * volRight) & ~0x80FF;
|
||||
|
||||
@@ -400,6 +400,12 @@ void GameEngine::HandleAudioThread() {
|
||||
create_next_audio_buffer(audio_buffer + i * (num_audio_samples * 2), num_audio_samples);
|
||||
}
|
||||
|
||||
float master_vol = CVarGetInteger("gSettings.Volume.Master", 100) / 100.0f;
|
||||
|
||||
for (u32 i = 0; i < SAMPLES_PER_FRAME; i++) {
|
||||
audio_buffer[i] = static_cast<s16>(audio_buffer[i] * master_vol);
|
||||
}
|
||||
|
||||
AudioPlayerPlayFrame((u8*)audio_buffer, 2 * num_audio_samples * 4);
|
||||
|
||||
audio.processing = false;
|
||||
|
||||
Reference in New Issue
Block a user