[Super-tux-devel] sound.h and sound.c
Brought to you by:
wkendrick
From: Duong-Khang N. <neo...@us...> - 2003-12-21 12:35:21
|
Hmm, I have just looked at the "sound.h" and "sound.c" today. And I discover that there'r still some of these functions in "gameloop.c": int Mix_PlayingMusic(); void Mix_HaltMusic(); int Mix_PlayMusic(); void Mix_FreeMusic(); void Mix_FreeChunk(); int Mix_OpenAudio(int a, int b, int c, int d); They must not exist anywhere else but in "sound.c" only ! Nobody else should know about the SDL_Mixer exept the sound.c. The following functions (from sound.h) must be used instead of those above. Mix_Chunk * load_sound(char * file); void play_sound(Mix_Chunk * snd); Mix_Music * load_song(char * file); int playing_music(void); int halt_music(void); int play_music(Mix_Music*music, int loops); void free_music(Mix_Music*music); void free_chunk(Mix_Chunk*chunk); int open_audio(int a, int b, int c, int d); Added: Primilary DEBUG_MSG macro Modifed Makefile for supporting the -DDEBUG Changes: playsound() replaced by play_sound(): I tried to keep everything uniform :-D gameloop.c exit immediately if it can not open a level file. Duong-Khang NGUYEN, who comes from C++ and thinks that "encapsulation" is his friend ! (wink at Tobias) |