treballant en la classe Audio
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#include "global_events.h" // Para check
|
||||
#include "global_inputs.h" // Para check, update
|
||||
#include "input.h" // Para Input, INPUT_ALLOW_REPEAT
|
||||
#include "jail_audio.h" // Para JA_GetMusicState, JA_SetMusicVolume
|
||||
#include "audio.h" // Para JA_GetMusicState, JA_SetMusicVolume
|
||||
#include "lang.h" // Para getText
|
||||
#include "param.h" // Para Param, ParamGame, param
|
||||
#include "player.h" // Para Player, PlayerState
|
||||
@@ -71,7 +71,7 @@ Credits::~Credits()
|
||||
SDL_DestroyTexture(text_texture_);
|
||||
SDL_DestroyTexture(canvas_);
|
||||
resetVolume();
|
||||
JA_StopMusic();
|
||||
Audio::get()->stopMusic();
|
||||
}
|
||||
|
||||
// Bucle principal
|
||||
@@ -438,7 +438,7 @@ void Credits::updateBlackRects()
|
||||
{
|
||||
// Si los rectangulos izquierdo y derecho han llegado al centro
|
||||
setVolume(0);
|
||||
JA_StopMusic();
|
||||
Audio::get()->stopMusic();
|
||||
if (counter_pre_fade_ == 400)
|
||||
{
|
||||
fade_out_->activate();
|
||||
@@ -472,10 +472,7 @@ void Credits::updateAllFades()
|
||||
fade_in_->update();
|
||||
if (fade_in_->hasEnded())
|
||||
{
|
||||
if (JA_GetMusicState() == JA_MUSIC_INVALID || JA_GetMusicState() == JA_MUSIC_STOPPED)
|
||||
{
|
||||
JA_PlayMusic(Resource::get()->getMusic("credits.ogg"));
|
||||
}
|
||||
Audio::get()->playMusic("credits.ogg");
|
||||
}
|
||||
|
||||
fade_out_->update();
|
||||
@@ -489,14 +486,14 @@ void Credits::updateAllFades()
|
||||
void Credits::setVolume(int amount)
|
||||
{
|
||||
options.audio.music.volume = std::clamp(amount, 0, 100);
|
||||
JA_SetMusicVolume(to_JA_volume(options.audio.music.volume));
|
||||
Audio::get()->setMusicVolume(options.audio.music.volume);
|
||||
}
|
||||
|
||||
// Reestablece el nivel de volumen
|
||||
void Credits::resetVolume()
|
||||
{
|
||||
options.audio.music.volume = initial_volume_;
|
||||
JA_SetMusicVolume(to_JA_volume(options.audio.music.volume));
|
||||
Audio::get()->setMusicVolume(options.audio.music.volume);
|
||||
}
|
||||
|
||||
// Cambia el color del fondo
|
||||
|
||||
Reference in New Issue
Block a user