Hi,

> Questions:
> 
> Where would be the best place to initialize the new state volume/mute
> variables?  I presume main.c's init_gamestate() is the place to do it,
> but ideally, there should be a sound_volume setting in the config file,
> (and that stuff should have its own initializer functions) and if
> that's not present, it should default to 0xc.    Yes, the sound
> volume is unititialized until you set it in the game.  :)  (I'll fix
> this as soon as I figure out the config stuffs)

You can do it similarly to the way the gfx subsystem is handled ATM- it's
not perfect, but it works:

First, add something to recognize "sound_volume" in config.l, add it to
the README, and set the default value (also in config.l).

At one point, main() retreives either the default config or the one
matching the current game (actually, this may happen in two separate
points). Later on, it runs game_init_graphics(gamestate) /after/ the
interpreter initialization (the reason for this is that if we're starting
with -d, we first need to initialize the interpreter before we can
identify the game, which we need in order to look up game-specific
parameters, and the graphics subsystem may be specified individually for
each game).
Since you might be encountering similar problems, putting sfx_init() and
game_init_sfx() (or something like that) near to gfx_init() and
game_init_graphics() should work- at that point, you have a config entry
you can access, and you have an initialized game state you can read/write
stuff from/to.

However, main() still isn't perfectly clean. It's much better than the
mess it used to be, but that's not saying much...

llap,
 Christoph


Reply via email to