diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-02-02 20:37:46 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-02-02 20:37:46 +0000 |
| commit | 601a366b8c665f760463259552fedd7be43e5754 (patch) | |
| tree | f9d315a3bc89b502a2d7cb5508c8c5a470ab01c5 /src/sound.c | |
| parent | 6d4e1eae16b84918009625a866104ec26a234277 (diff) | |
- zvuky v hre
- hudba/zvuky sa daju zapnut/vypnut
- tuxovia nemozu ist v arene do nekonecna
- oprava chyby, ak bol zaskrknuty iba samopal, hra sa zasekla
- do widgetu textfiled sa neda pisat donekonecna
- tux ovladany pomocou keyboard_left stiriela a meni zbran
- tuxovia nemozu prechadzat cez seba
git-svn-id: http://opensvn.csie.org/tuxanci_ng@2 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/sound.c')
| -rw-r--r-- | src/sound.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/sound.c b/src/sound.c index 45cb225..2e7ef4b 100644 --- a/src/sound.c +++ b/src/sound.c @@ -14,6 +14,7 @@ static list_t *listSound; static bool_t isSoundInit = FALSE; +static bool_t isSoundActive = TRUE; bool_t isSoundInicialized() { @@ -22,10 +23,14 @@ bool_t isSoundInicialized() void initSound() { - assert( isAudioInicialized() ); + if( isAudioInicialized() == FALSE ) + { + isSoundInit = FALSE; + } listSound = newList(); isSoundInit = TRUE; + isSoundActive = TRUE; printf("init sound..\n"); } @@ -35,6 +40,7 @@ static Mix_Chunk* loadMixSound(char *file) Mix_Chunk *new; char str[STR_PATH_SIZE]; + printf("load sound %s..\n", file); sprintf(str, PATH_SOUND "%s", file); new = Mix_LoadWAV(str); @@ -85,6 +91,12 @@ void playSound(char *name, int group) int i; sound_t *this; + if( isSoundInit == FALSE || + isSoundActive == FALSE ) + { + return; + } + for( i = 0 ; i < listSound->count ; i++ ) { this = (sound_t *)listSound->list[i]; @@ -97,8 +109,18 @@ void playSound(char *name, int group) } } +void setSoundActive(bool_t n) +{ + isSoundActive = n; +} + void quitSound() { + if( isSoundInit == FALSE ) + { + return; + } + destroyListItem(listSound, destroySound); isSoundInit = FALSE; printf("quit sound..\n"); |