From: Matthew Mondor Date: Mon, 8 Jan 2007 10:44:20 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: pgsql-branch-merge~38 X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=016ac4dd9152bfb2dfe977efdb4438f2c5e74169;p=mmondor.git *** empty log message *** --- diff --git a/mmsoftware/paradise_adventure/src/main.c b/mmsoftware/paradise_adventure/src/main.c index 248f4dc..368bb54 100644 --- a/mmsoftware/paradise_adventure/src/main.c +++ b/mmsoftware/paradise_adventure/src/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.6 2007/01/08 09:45:38 mmondor Exp $ */ +/* $Id: main.c,v 1.7 2007/01/08 10:44:20 mmondor Exp $ */ /* * Copyright (c) 2006, Matthew Mondor @@ -29,6 +29,7 @@ struct scene { const char *img, *mus; + int vol; }; @@ -38,7 +39,7 @@ struct scene { int main(int, char **); static void screen_draw(void); -static void scene_switch(const char *, const char *); +static void scene_switch(const char *, const char *, int); static void scene_next(void); @@ -59,11 +60,11 @@ static Mix_Music *music = NULL; static char *painting_file = NULL, *music_file = NULL; static const struct scene scenes[] = { - { "gardens_smallbridge", "adventure1" }, - { "forest_entry", "forest"}, - { "dungeon_deadend", "cavern" }, - { "gardens_house", "castle" }, - { "mountains_landscape", "aria_prima" }, + { "gardens_smallbridge", "adventure1", 128 }, + { "forest_entry", "forest", 128 }, + { "dungeon_deadend", "cavern", 128 }, + { "gardens_house", "castle", 128 }, + { "mountains_landscape", "aria_prima", 128 }, { NULL, NULL } }; static int curscene = 0; @@ -177,7 +178,7 @@ screen_draw(void) } static void -scene_switch(const char *img, const char *mus) +scene_switch(const char *img, const char *mus, int vol) { SDL_Surface *s = NULL; Mix_Music *m = NULL; @@ -243,6 +244,7 @@ scene_switch(const char *img, const char *mus) "scene_switch() - Mix_LoadMUS(%s) - %s\n", path, Mix_GetError()); + (void) Mix_VolumeMusic(vol); if (Mix_PlayMusic(music, -1) != 0) (void) fprintf(stderr, "scene_switch() - Mix_PlayMusic() - %s\n", @@ -257,6 +259,7 @@ scene_next(void) if (scenes[curscene].img == NULL) curscene = 0; - scene_switch(scenes[curscene].img, scenes[curscene].mus); + scene_switch(scenes[curscene].img, scenes[curscene].mus, + scenes[curscene].vol); curscene++; }