Compare commits
3 Commits
5173edd7f0
...
ad1cceea5f
| Author | SHA1 | Date | |
|---|---|---|---|
| ad1cceea5f | |||
| 70720e7e62 | |||
| 490dc1e5d6 |
BIN
data/THX.GIF
BIN
data/THX.GIF
Binary file not shown.
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
@@ -17,7 +17,7 @@ namespace gamestate
|
|||||||
fondo = draw::loadSurface("menuprin.gif", true);
|
fondo = draw::loadSurface("menuprin.gif", true);
|
||||||
cursor = draw::loadSurface("cursor.gif");
|
cursor = draw::loadSurface("cursor.gif");
|
||||||
|
|
||||||
if (audio::getMusicState() != audio::music_state::MUSIC_PLAYING) {
|
if (audio::getMusicState() != audio::music_state::MUSIC_PLAYING || audio::whichMusic() != "mus3.ogg") {
|
||||||
audio::playMusic(audio::loadMusic("mus3.ogg"));
|
audio::playMusic(audio::loadMusic("mus3.ogg"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace audio
|
|||||||
|
|
||||||
static char *buffer = nullptr;
|
static char *buffer = nullptr;
|
||||||
static Mix_Music *music = nullptr;
|
static Mix_Music *music = nullptr;
|
||||||
|
static std::string music_filename = "";
|
||||||
|
|
||||||
// Inicialitza el sistema de só
|
// Inicialitza el sistema de só
|
||||||
void init()
|
void init()
|
||||||
@@ -47,6 +48,7 @@ namespace audio
|
|||||||
|
|
||||||
if (music==nullptr) return false;
|
if (music==nullptr) return false;
|
||||||
|
|
||||||
|
music_filename = filename;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +101,12 @@ namespace audio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obté el nom de l'arxiu de música actual
|
||||||
|
std::string whichMusic()
|
||||||
|
{
|
||||||
|
return music_filename;
|
||||||
|
}
|
||||||
|
|
||||||
// Carrega un só des d'un arxiu WAV
|
// Carrega un só des d'un arxiu WAV
|
||||||
const sound *loadSound(const std::string filename)
|
const sound *loadSound(const std::string filename)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ namespace audio
|
|||||||
/// @return estat actual de la música (MUSIC_INVALID, MUSIC_PLAYING, MUSIC_PAUSED o MUSIC_STOPPED)
|
/// @return estat actual de la música (MUSIC_INVALID, MUSIC_PLAYING, MUSIC_PAUSED o MUSIC_STOPPED)
|
||||||
const music_state getMusicState();
|
const music_state getMusicState();
|
||||||
|
|
||||||
|
/// @brief Obté el nom de l'arxiu de música actual
|
||||||
|
/// @return el nom de l'arxiu
|
||||||
|
std::string whichMusic();
|
||||||
|
|
||||||
/// @brief Carrega un só des d'un arxiu WAV
|
/// @brief Carrega un só des d'un arxiu WAV
|
||||||
/// @param filename nom de l'arxiu
|
/// @param filename nom de l'arxiu
|
||||||
/// @return un punter al só
|
/// @return un punter al só
|
||||||
|
|||||||
Reference in New Issue
Block a user