[Change] Better handling of player_flags and sunds when exiting the

game.
This commit is contained in:
Allanis 2014-03-14 19:46:44 +00:00
parent c743205286
commit 9278a1851b
3 changed files with 8 additions and 6 deletions

View File

@ -250,6 +250,11 @@ static void menu_small_exit(unsigned int wid, char* str) {
menu_Close(MENU_INFO); menu_Close(MENU_INFO);
} }
/* Stop player sounds because they sometimes hand! */
player_flags = 0;
player_stopSound();
/* Clean up. */
window_destroy(wid); window_destroy(wid);
menu_Close(MENU_SMALL); menu_Close(MENU_SMALL);
menu_main(); menu_main();

View File

@ -199,7 +199,6 @@ static int player_newMake(void);
static void player_newShipMake(char* name); static void player_newShipMake(char* name);
/* Sound. */ /* Sound. */
static void player_initSound(void); static void player_initSound(void);
/*static void player_stopSound(void) */
/* Gui. */ /* Gui. */
static void rect_parse(const xmlNodePtr parent, static void rect_parse(const xmlNodePtr parent,
double* x, double* y, double* w, double* h); double* x, double* y, double* w, double* h);
@ -655,16 +654,13 @@ void player_playSound(int sound, int once) {
sound_playGroup(PLAYER_GUI_CHANNEL, sound, once); sound_playGroup(PLAYER_GUI_CHANNEL, sound, once);
} }
#if 0
/** /**
* @fn static void player_stopSound(void)
*
* @brief Stop playing player sounds. * @brief Stop playing player sounds.
*/ */
static void player_stopSound(void) { void player_stopSound(void) {
sound_stopGroup(PLAYER_GUI_CHANNEL); sound_stopGroup(PLAYER_GUI_CHANNEL);
sound_stopGroup(PLAYER_ENGINE_CHANNEL);
} }
#endif
/** /**
* @fn void player_message(const char* fmt, ...) * @fn void player_message(const char* fmt, ...)

View File

@ -52,6 +52,7 @@ void player_clear(void);
void player_warp(const double x, const double y); void player_warp(const double x, const double y);
const char* player_rating(void); const char* player_rating(void);
void player_playSound(int sound, int once); void player_playSound(int sound, int once);
void player_stopSound(void);
/* Cargo. */ /* Cargo. */
int player_outfitOwned(const char* outfitname); int player_outfitOwned(const char* outfitname);
int player_cargoOwned(const char* commodityname); int player_cargoOwned(const char* commodityname);