[airstrike] Re: Level changing and tags

Ulf Ekström uekstrom at gmail.com
Wed May 11 17:08:49 EDT 2005


On 5/11/05, Eero Tamminen <eero.tamminen at netsonic.fi> wrote:
> Hi,
> 
> On Wednesday 11 May 2005 23:23, Erik Auerswald wrote:
> > Hi,
> >
> > > Btw. Now whenever I switch to another level, it says
> > > "there is no joystick 0". Couldn't/shouldn't this checking be done at
> > > the game startup?
> >
> > I changed the verbosity of the joystick code a bit, with the current
> > code messages of the kind "there is no joystick 0" can be disabled by
> > writing a configuration file (share/defaults.conf) containing at least
> >
> > player1_control {
> >   joy_no -1
> > }
> > player2_control {
> >   joy_no -1
> > }
> 
> Can the keyboard bindings be set from here too? :-)

Yes, they can. The problem (I think) is that the keys are given by
integers that can be different for different SDL versions and
platforms (please correct me if I'm wrong). If your start the game,
hit F1 to go to the console and write "resource", you will see the
section user {..}. This is the current settings on your specific
computer, what SDLK_SPACE etc resolves to. The idea is that everything
in the "user" section is saved (to ~/.airstrike or similar) when the
users wants. The values should also be editable in-game like we had
before.

Ulf

> It would also good to have a commented default config so that people
> know more easily how to change the defaults.

They should not change it manually (at least they should not have to).
There should be an in-game menu system to do it.

> I looked into joystick.c and noticed minor stylistic issue.  In the rest of
> the Airstrike code the function definitions are written so that the block
> delimiter '{' is on a separate line from the function name & args.
> 
> (My own "sin" in this is following linux kernel coding styles i.e. I have
> different indenting value than Ulf + I use braces always.  I've coded too
> many years that way.)

I don't mind this at all, but I won't respect it when I edit something
:-). I don't use
braces for single line blocks, because I like to see as much of a
function as possible. Of course with your brace style you save even
more lines.. The only rule I have is to always
balance chained blocks, like so

if (a)
{
b();
c();
}
else
{
d();
}

and never

if (a)
{
b();
c();
}
else
d();
 

Ulf



More information about the airstrike mailing list