From a8ef8b85fab0b810d89c8c0153fd6318d5a457a2 Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:25:15 +0100 Subject: [PATCH] only increase fadeout sample counter on odd samples --- src/Cafe/HW/Latte/Core/LatteShaderCache.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp index 209ba9d13..febe62fb4 100644 --- a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp +++ b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp @@ -190,12 +190,13 @@ class BootSoundPlayer void ApplyFadeOutEffect(std::span samples, uint64 fadeOutDuration) { - for(auto& i : samples) + for(size_t i = 0; i < samples.size(); i++) { float decibel = (float)m_fadeOutSample / fadeOutDuration * -100.0f; float volumeFactor = pow(10,decibel/20); - i *= volumeFactor; - m_fadeOutSample++; + samples[i] *= volumeFactor; + if(i % 2 == 1) + m_fadeOutSample++; } }