normalitzat Audio
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include <iostream> // for char_traits, basic_ostream, operator<<
|
||||
#include <string> // for basic_string
|
||||
|
||||
#include "core/audio/jail_audio.hpp" // for JA_StopMusic
|
||||
#include "core/audio/audio.hpp" // for Audio::update
|
||||
#include "core/input/global_inputs.hpp" // for GlobalInputs::handle
|
||||
#include "core/input/input.h" // for Input, REPEAT_FALSE, inputs_e
|
||||
#include "core/locale/lang.h" // for Lang
|
||||
@@ -71,7 +71,7 @@ Instructions::~Instructions() {
|
||||
void Instructions::update() {
|
||||
// Bombea el stream de música: si no se llama, el buffer se vacía y la
|
||||
// música se corta hasta que volvamos a una escena que sí lo haga.
|
||||
JA_Update();
|
||||
Audio::update();
|
||||
|
||||
// Comprueba las entradas
|
||||
checkInput();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <string> // for basic_string
|
||||
|
||||
#include "core/audio/jail_audio.hpp" // for JA_StopMusic, JA_DeleteMusic, JA_LoadMusic
|
||||
#include "core/audio/audio.hpp" // for Audio::get, Audio::update
|
||||
#include "core/input/global_inputs.hpp" // for GlobalInputs::handle
|
||||
#include "core/input/input.h" // for Input, REPEAT_FALSE, inputs_e
|
||||
#include "core/locale/lang.h" // for Lang
|
||||
@@ -149,7 +149,7 @@ Intro::Intro(SDL_Renderer *renderer, section_t *section) {
|
||||
t->center(GAMECANVAS_CENTER_X);
|
||||
}
|
||||
|
||||
JA_PlayMusic(music, 0);
|
||||
Audio::get()->playMusic(music, 0);
|
||||
}
|
||||
|
||||
// Destructor
|
||||
@@ -177,7 +177,7 @@ void Intro::checkInput() {
|
||||
if (GlobalInputs::handle()) { return; }
|
||||
|
||||
if (Input::get()->checkInput(input_pause, REPEAT_FALSE) || Input::get()->checkInput(input_accept, REPEAT_FALSE) || Input::get()->checkInput(input_fire_left, REPEAT_FALSE) || Input::get()->checkInput(input_fire_center, REPEAT_FALSE) || Input::get()->checkInput(input_fire_right, REPEAT_FALSE)) {
|
||||
JA_StopMusic();
|
||||
Audio::get()->stopMusic();
|
||||
section->name = SECTION_PROG_TITLE;
|
||||
section->subsection = SUBSECTION_TITLE_1;
|
||||
}
|
||||
@@ -307,7 +307,7 @@ void Intro::updateScenes() {
|
||||
if (bitmaps[5]->hasFinished() && texts[8]->hasFinished()) {
|
||||
bitmaps[5]->setEnabled(false);
|
||||
texts[8]->setEnabled(false);
|
||||
JA_StopMusic();
|
||||
Audio::get()->stopMusic();
|
||||
section->name = SECTION_PROG_TITLE;
|
||||
section->subsection = SUBSECTION_TITLE_1;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ void Intro::updateScenes() {
|
||||
|
||||
// Actualiza las variables del objeto
|
||||
void Intro::update() {
|
||||
JA_Update();
|
||||
Audio::update();
|
||||
checkInput();
|
||||
|
||||
if (SDL_GetTicks() - ticks > ticksSpeed) {
|
||||
@@ -365,7 +365,7 @@ void Intro::render() {
|
||||
|
||||
// Bucle principal
|
||||
void Intro::run() {
|
||||
JA_PlayMusic(music, 0);
|
||||
Audio::get()->playMusic(music, 0);
|
||||
|
||||
while (section->name == SECTION_PROG_INTRO) {
|
||||
iterate();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <algorithm> // for min
|
||||
#include <string> // for basic_string
|
||||
|
||||
#include "core/audio/jail_audio.hpp" // for JA_StopMusic
|
||||
#include "core/audio/audio.hpp" // for Audio::get, Audio::update
|
||||
#include "core/input/global_inputs.hpp" // for GlobalInputs::handle
|
||||
#include "core/input/input.h" // for Input, REPEAT_FALSE, inputs_e
|
||||
#include "core/rendering/screen.h" // for Screen
|
||||
@@ -38,7 +38,7 @@ Logo::Logo(SDL_Renderer *renderer, section_t *section) {
|
||||
ticks = 0;
|
||||
ticksSpeed = 15;
|
||||
|
||||
JA_StopMusic();
|
||||
Audio::get()->stopMusic();
|
||||
}
|
||||
|
||||
// Destructor
|
||||
@@ -85,7 +85,7 @@ void Logo::renderFade() {
|
||||
|
||||
// Actualiza las variables del objeto
|
||||
void Logo::update() {
|
||||
JA_Update();
|
||||
Audio::update();
|
||||
checkInput();
|
||||
|
||||
if (SDL_GetTicks() - ticks > ticksSpeed) {
|
||||
@@ -120,7 +120,7 @@ void Logo::render() {
|
||||
|
||||
// Bucle para el logo del juego
|
||||
void Logo::run() {
|
||||
JA_StopMusic();
|
||||
Audio::get()->stopMusic();
|
||||
|
||||
while (section->name == SECTION_PROG_LOGO) {
|
||||
iterate();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <iostream> // for basic_ostream, operator<<, basic_ostrea...
|
||||
#include <string> // for basic_string, operator+, char_traits
|
||||
|
||||
#include "core/audio/jail_audio.hpp" // for JA_StopMusic, JA_GetMusicState, JA_Play...
|
||||
#include "core/audio/audio.hpp" // for Audio
|
||||
#include "core/input/global_inputs.hpp" // for GlobalInputs::handle
|
||||
#include "core/input/input.h" // for Input, INPUT_USE_GAMECONTROLLER, INPUT_...
|
||||
#include "core/locale/lang.h" // for Lang, ba_BA, en_UK, es_ES
|
||||
@@ -212,7 +212,7 @@ void Title::init() {
|
||||
// Actualiza las variables del objeto
|
||||
void Title::update() {
|
||||
// Actualiza el audio
|
||||
JA_Update();
|
||||
Audio::update();
|
||||
|
||||
// Comprueba las entradas
|
||||
checkInput();
|
||||
@@ -243,7 +243,7 @@ void Title::update() {
|
||||
Screen::get()->blit();
|
||||
|
||||
// Reproduce el efecto sonoro
|
||||
JA_PlaySound(crashSound);
|
||||
Audio::get()->playSound(crashSound);
|
||||
}
|
||||
} break;
|
||||
|
||||
@@ -276,8 +276,8 @@ void Title::update() {
|
||||
// Sección 3 - La pantalla de titulo con el menú y la música
|
||||
case SUBSECTION_TITLE_3: {
|
||||
if (counter > 0) { // Reproduce la música
|
||||
if ((JA_GetMusicState() == JA_MUSIC_INVALID) || (JA_GetMusicState() == JA_MUSIC_STOPPED)) {
|
||||
JA_PlayMusic(titleMusic);
|
||||
if (Audio::getRealMusicState() == Audio::MusicState::STOPPED) {
|
||||
Audio::get()->playMusic(titleMusic);
|
||||
}
|
||||
|
||||
dustBitmapR->update();
|
||||
@@ -291,19 +291,19 @@ void Title::update() {
|
||||
case 0: // 1 PLAYER
|
||||
section->name = SECTION_PROG_GAME;
|
||||
section->subsection = SUBSECTION_GAME_PLAY_1P;
|
||||
JA_StopMusic();
|
||||
Audio::get()->stopMusic();
|
||||
break;
|
||||
|
||||
case 1: // 2 PLAYERS
|
||||
section->name = SECTION_PROG_GAME;
|
||||
section->subsection = SUBSECTION_GAME_PLAY_2P;
|
||||
JA_StopMusic();
|
||||
Audio::get()->stopMusic();
|
||||
break;
|
||||
|
||||
case 2: // QUIT
|
||||
#ifndef __EMSCRIPTEN__
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
JA_StopMusic();
|
||||
Audio::get()->stopMusic();
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user