From d3457f76109b9d879562a37f3c2e54d205af08af Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Mon, 30 Jun 2025 21:41:00 +0200 Subject: [PATCH] fix: la musica de la intro no sonaba perque el logo feia fade de la musica pero no la parava i Audio no posa en martxa una musica si ja hi ha alguna sonant --- source/director.cpp | 2 +- source/sections/logo.cpp | 2 +- source/sections/title.cpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/director.cpp b/source/director.cpp index d588f8d..6bf2df6 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -49,7 +49,7 @@ Director::Director(int argc, const char *argv[]) Section::name = Section::Name::GAME; Section::options = Section::Options::GAME_PLAY_1P; #elif DEBUG - Section::name = Section::Name::TITLE; + Section::name = Section::Name::LOGO; Section::options = Section::Options::GAME_PLAY_1P; #else // NORMAL GAME Section::name = Section::Name::LOGO; diff --git a/source/sections/logo.cpp b/source/sections/logo.cpp index 885737d..f514653 100644 --- a/source/sections/logo.cpp +++ b/source/sections/logo.cpp @@ -62,6 +62,7 @@ Logo::~Logo() jail_texture_->setColor(255, 255, 255); since_texture_->setColor(255, 255, 255); Audio::get()->stopAllSounds(); + Audio::get()->stopMusic(); } // Comprueba el manejador de eventos @@ -183,7 +184,6 @@ void Logo::render() // Bucle para el logo del juego void Logo::run() { - Audio::get()->fadeOutMusic(300); while (Section::name == Section::Name::LOGO) { checkInput(); diff --git a/source/sections/title.cpp b/source/sections/title.cpp index 361e1e6..e6068e8 100644 --- a/source/sections/title.cpp +++ b/source/sections/title.cpp @@ -62,6 +62,10 @@ Title::~Title() { Resource::get()->getTexture("smb2.gif")->setPalette(0); Audio::get()->stopAllSounds(); + if (Section::name == Section::Name::LOGO) + { + Audio::get()->fadeOutMusic(300); + } } // Actualiza las variables del objeto