Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed screenshot code so you can take more than one (and won't overwrite previous...
[vor.git]
/
sound.c
diff --git
a/sound.c
b/sound.c
index
16f3d60
..
471808e
100644
(file)
--- a/
sound.c
+++ b/
sound.c
@@
-11,7
+11,7
@@
static Mix_Music *music[NUM_TUNES];
static Mix_Music *music[NUM_TUNES];
-static int music_volume[NUM_TUNES] = {128,128,128};
+static int music_volume[NUM_TUNES] = {88,88,88};
static Mix_Chunk *wav[NUM_SOUNDS];
int audio_rate;
static Mix_Chunk *wav[NUM_SOUNDS];
int audio_rate;
@@
-20,10
+20,7
@@
int audio_channels;
char *add_data_path(char *);
char *wav_file[] = {
char *add_data_path(char *);
char *wav_file[] = {
- "booom.wav",
- "cboom.wav",
- "boom.wav",
- "bzboom.wav"
+ "bang.wav"
};
char *tune_file[] = {
};
char *tune_file[] = {
@@
-77,18
+74,48
@@
int playing=-1;
void
play_tune(int i) {
void
play_tune(int i) {
- if(!opt_sound) return;
- if (playing==i)
- return;
+ if(!opt_sound) {
+ return;
+ }
+ if (playing == i) {
+ return;
+ }
if (playing) {
if (playing) {
- Mix_FadeOutMusic(1500);
+ Mix_FadeOutMusic(2500);
+ }
+ if(i == TUNE_GAMEPLAY) {
+ Mix_FadeInMusic(music[i],-1,2000);
+ Mix_VolumeMusic(music_volume[i]);
}
}
- Mix_FadeInMusic(music[i],-1,2000);
- Mix_VolumeMusic(music_volume[i]);
playing = i;
}
playing = i;
}
+
+int tune_paused=0;
+
+void
+pause_tune() {
+ if(!opt_sound) {
+ return;
+ }
+ if(playing == TUNE_GAMEPLAY && !tune_paused) {
+ Mix_PauseMusic();
+ tune_paused = 1;
+ }
+}
+
+void
+resume_tune() {
+ if(!opt_sound) {
+ return;
+ }
+ if(playing == TUNE_GAMEPLAY && tune_paused) {
+ Mix_ResumeMusic();
+ tune_paused = 0;
+ }
+}
+
/*
*
* The init_sound() routine is called first.
/*
*
* The init_sound() routine is called first.