Fix play_sound function interpreting -65535 as sound 1.
It now correctly treats it as a sound that doesn't exist, and plays nothing.
This commit is contained in:
@@ -61,7 +61,7 @@ void init_snd_tool(){
|
|||||||
atexit(exit_snd_tool);
|
atexit(exit_snd_tool);
|
||||||
}
|
}
|
||||||
|
|
||||||
void play_sound(short which, sf::Time delay) { // if < 0, play asynch
|
void play_sound(snd_num_t which, sf::Time delay) { // if < 0, play asynch
|
||||||
static bool inited = false;
|
static bool inited = false;
|
||||||
if(!inited) {
|
if(!inited) {
|
||||||
inited = true;
|
inited = true;
|
||||||
@@ -104,7 +104,7 @@ void play_sound(short which, sf::Time delay) { // if < 0, play asynch
|
|||||||
sf::sleep(time_in_ticks(sound_delay[-1 * which]));
|
sf::sleep(time_in_ticks(sound_delay[-1 * which]));
|
||||||
}
|
}
|
||||||
|
|
||||||
void one_sound(short which) {
|
void one_sound(snd_num_t which) {
|
||||||
if(which == last_played)
|
if(which == last_played)
|
||||||
return;
|
return;
|
||||||
play_sound(which);
|
play_sound(which);
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
void init_snd_tool();
|
void init_snd_tool();
|
||||||
bool sound_going(snd_num_t which_s);
|
bool sound_going(snd_num_t which_s);
|
||||||
void play_sound(short which, sf::Time delay = sf::Time());
|
void play_sound(snd_num_t which, sf::Time delay = sf::Time());
|
||||||
void one_sound(short which);
|
void one_sound(snd_num_t which);
|
||||||
|
|
||||||
void clear_sound_memory();
|
void clear_sound_memory();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user