Skip to content

Commit

Permalink
Release v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
abodelot committed Oct 23, 2019
1 parent 0421629 commit 358bbb5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Core/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define APP_FPS 60

#define APP_AUTHOR "Alexandre Bodelot"
#define APP_VERSION "0.2"
#define APP_VERSION "0.3"
#define APP_URL "https://github.com/abodelot/wallbreaker"

// Paths
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ void Game::quit()
config.set("sound", SoundSystem::isSoundEnabled());
config.set("music", SoundSystem::isMusicEnabled());
config.save(m_appDir + APP_SETTINGS_FILE);

SoundSystem::stopAll();
}


Expand Down
18 changes: 9 additions & 9 deletions src/Core/SoundSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#include "Resources.hpp"


sf::Sound SoundSystem::m_sounds[MAX_SOUNDS];
int SoundSystem::m_last_sound_played = 0;
sf::Music SoundSystem::m_music;
int SoundSystem::m_music_volume = 100;
int SoundSystem::m_sound_volume = 100;
bool SoundSystem::m_enable_music = true;
bool SoundSystem::m_enable_sound = true;
sf::Sound SoundSystem::m_sounds[MAX_SOUNDS];
int SoundSystem::m_last_sound_played = 0;
sf::Music SoundSystem::m_music;
int SoundSystem::m_music_volume = 100;
int SoundSystem::m_sound_volume = 100;
bool SoundSystem::m_enable_music = true;
bool SoundSystem::m_enable_sound = true;

template <class T>
static inline void clamp(T& value, T min, T max)
Expand Down Expand Up @@ -54,7 +54,7 @@ void SoundSystem::pauseMusic()
}


void SoundSystem::playSound(const std::string& sound_name, float pitch)
void SoundSystem::playSound(const std::string& filename, float pitch)
{
if (m_enable_sound)
{
Expand All @@ -67,7 +67,7 @@ void SoundSystem::playSound(const std::string& sound_name, float pitch)
{
sound.stop();
}
sound.setBuffer(Resources::getSoundBuffer(sound_name));
sound.setBuffer(Resources::getSoundBuffer(filename));
sound.setPitch(pitch);
sound.play();
++m_last_sound_played;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/SoundSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SoundSystem
/**
* Play a sound effect
*/
static void playSound(const std::string& sound_name, float pitch = 1.f);
static void playSound(const std::string& filename, float pitch = 1.f);

/**
* Control music volume
Expand Down

0 comments on commit 358bbb5

Please sign in to comment.