{
Mix_Chunk * snd;
- if (use_sound)
- {
- snd = Mix_LoadWAV(file);
-
- if (snd == NULL)
- st_abort("Can't load", file);
- }
- else
- snd = NULL;
+ snd = Mix_LoadWAV(file);
+ if (snd == NULL)
+ st_abort("Can't load", file);
+
return(snd);
}
{
Mix_Music * sng;
- if (use_sound)
- {
- sng = Mix_LoadMUS(file);
-
- if (sng == NULL)
- st_abort("Can't load", file);
- }
- else
- sng = NULL;
+ sng = Mix_LoadMUS(file);
+ if (sng == NULL)
+ st_abort("Can't load", file);
+
return (sng);
}
void free_chunk(Mix_Chunk *chunk)
{
- if (use_sound) {
- DEBUG_MSG( __PRETTY_FUNCTION__ );
- Mix_FreeChunk( chunk );
+ if (chunk != NULL) {
+ DEBUG_MSG( __PRETTY_FUNCTION__ );
+ Mix_FreeChunk( chunk );
+ chunk = NULL;
}
}
void free_music(Mix_Music *music)
{
- if (use_sound) {
+ if ( music != NULL ) {
DEBUG_MSG(__PRETTY_FUNCTION__);
Mix_FreeMusic( music );
+ music = NULL;
}
}