Tornada a posar la musica de Title i el attract mode
This commit is contained in:
@@ -71,6 +71,9 @@ Title::Title()
|
||||
|
||||
// Rellena la textura de fondo con todos los gráficos
|
||||
fillTexture();
|
||||
|
||||
// Inicia la musica
|
||||
playMusic("title.ogg");
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <iostream> // for basic_ostream, cout, basic_ios, ios, endl
|
||||
#include <unordered_map> // for unordered_map
|
||||
#include <string> // for string
|
||||
#include "jail_audio.h"
|
||||
#include "resource.h"
|
||||
|
||||
// Calcula el cuadrado de la distancia entre dos puntos
|
||||
double distanceSquared(int x1, int y1, int x2, int y2)
|
||||
@@ -524,4 +526,14 @@ void printWithDots(const std::string &text1, const std::string &text2, const std
|
||||
bool stringInVector(const std::vector<std::string> &vec, const std::string &str)
|
||||
{
|
||||
return std::find(vec.begin(), vec.end(), str) != vec.end();
|
||||
}
|
||||
|
||||
// Hace sonar la música
|
||||
void playMusic(const std::string &music_path)
|
||||
{
|
||||
// Si la música no está sonando
|
||||
if (JA_GetMusicState() == JA_MUSIC_INVALID || JA_GetMusicState() == JA_MUSIC_STOPPED)
|
||||
{
|
||||
JA_PlayMusic(Resource::get()->getMusic(music_path));
|
||||
}
|
||||
}
|
||||
@@ -126,4 +126,7 @@ std::string getPath(const std::string &full_path);
|
||||
void printWithDots(const std::string &text1, const std::string &text2, const std::string &text3);
|
||||
|
||||
// Comprueba si una vector contiene una cadena
|
||||
bool stringInVector(const std::vector<std::string> &vec, const std::string &str);
|
||||
bool stringInVector(const std::vector<std::string> &vec, const std::string &str);
|
||||
|
||||
// Hace sonar la música
|
||||
void playMusic(const std::string &music_path);
|
||||
Reference in New Issue
Block a user