Thread: [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
Attachments:
supertux-soundc-soundh.patch.bz2
|
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) |
From: Tobias <tob...@gm...> - 2003-12-21 13:18:08
|
Hi Duong-Khang, I'll commit your patch very soon. It's already merged. But I want to fix the possible segfault first. Greetz... Tobias Gläßer Am So, den 21.12.2003 schrieb Duong-Khang NGUYEN um 07:36: > 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) > > > -- |
From: Bill K. <nb...@so...> - 2003-12-21 13:37:39
|
On Sun, Dec 21, 2003 at 02:20:26PM -0500, Tobias Gl=E4=DFer wrote: > Hi Duong-Khang, >=20 > I'll commit your patch very soon. It's already merged. > But I want to fix the possible segfault first. Heh - I should read before I respond. Thx Tobias -bill! |
From: Bill K. <nb...@so...> - 2003-12-21 13:37:20
|
On Sun, Dec 21, 2003 at 01:36:46PM +0100, Duong-Khang NGUYEN wrote: > 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": I didn't look at your patch, but it /sounds/ good. (Hahaha ;^) ) Tobias, can you check it and commit? I'm busy trying to get a new Tux Paint out before Christmas. ;) -bill! |
From: Tobias <tob...@gm...> - 2003-12-21 14:28:14
|
It is commited. ;) Thanks for your patch, it was a child's play this time. Greetz... Tobias Gläßer Am So, den 21.12.2003 schrieb Duong-Khang NGUYEN um 07:36: > 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) > > > -- |