treballant en la classe Audio

This commit is contained in:
2025-03-28 23:27:33 +01:00
parent 31a0ad6fd5
commit d2417f48d9
29 changed files with 321 additions and 253 deletions

View File

@@ -9,7 +9,7 @@
#include "fade.h" // Para Fade, FadeMode, FadeType
#include "global_events.h" // Para check
#include "global_inputs.h" // Para check, update
#include "jail_audio.h" // Para JA_GetMusicState, JA_Music_state
#include "audio.h" // Para JA_GetMusicState, JA_Music_state
#include "lang.h" // Para getText
#include "param.h" // Para Param, param, ParamGame, ParamFade
#include "resource.h" // Para Resource
@@ -206,9 +206,6 @@ void Instructions::update()
// Actualiza el contador de ticks
ticks_ = SDL_GetTicks();
// Mantiene la música sonando
updateMusic();
// Actualiza el objeto screen
Screen::get()->update();
@@ -278,6 +275,7 @@ void Instructions::checkInput()
// Bucle para la pantalla de instrucciones
void Instructions::run()
{
Audio::get()->playMusic("title.ogg");
while (section::name == section::Name::INSTRUCTIONS)
{
checkInput();
@@ -344,15 +342,6 @@ void Instructions::renderLines(SDL_Renderer *renderer, SDL_Texture *texture, con
}
}
// Gestiona la musica
void Instructions::updateMusic()
{
if ((JA_GetMusicState() == JA_MUSIC_INVALID) || (JA_GetMusicState() == JA_MUSIC_STOPPED))
{
JA_PlayMusic(Resource::get()->getMusic("title.ogg"));
}
}
// Gestiona la textura con los graficos
void Instructions::updateBackbuffer()
{