-/* $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
struct scene {
const char *img, *mus;
+ int vol;
};
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);
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;
}
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;
"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",
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++;
}