-/* $Id: main.c,v 1.3 2014/06/21 17:16:32 mmondor Exp $ */
+/* $Id: main.c,v 1.4 2014/06/21 18:24:41 mmondor Exp $ */
/*
* Copyright (c) 2006, Matthew Mondor
static void axis_angle_update(void);
static void handle_uevent(SDL_Event *);
-static void send_event(int, ...);
+static void send_event(int, int);
static SDL_Surface *bmp_load_key(void *, size_t);
static int surface_blit_angle(SDL_Surface *, int, int, int);
switch (ev->jbutton.button) {
case 0:
- send_event(UE_TORP);
+ send_event(UE_TORP, -1);
break;
case 1:
- send_event(UE_PHASER);
+ send_event(UE_PHASER, -1);
break;
case 2:
send_event(UE_DIRECTION, joy_angle);
break;
case 3:
- send_event(UE_PLASMA);
+ send_event(UE_PLASMA, -1);
break;
case 4:
- send_event(UE_SHIELD);
+ send_event(UE_SHIELD, -1);
break;
case 5:
- send_event(UE_CLOAK);
+ send_event(UE_CLOAK, -1);
break;
case 6:
- send_event(UE_THRUST_ACC);
+ send_event(UE_THRUST_ACC, -1);
break;
case 7:
- send_event(UE_THRUST_DEC);
+ send_event(UE_THRUST_DEC, -1);
break;
}
send_event(UE_DIRECTION, joy_angle);
break;
case SDLK_z:
- send_event(UE_THRUST_ACC);
+ send_event(UE_THRUST_ACC, -1);
break;
case SDLK_a:
- send_event(UE_THRUST_DEC);
+ send_event(UE_THRUST_DEC, -1);
break;
/* Weapons */
case SDLK_SPACE:
- send_event(UE_TORP);
+ send_event(UE_TORP, -1);
break;
case SDLK_f:
- send_event(UE_PHASER);
+ send_event(UE_PHASER, -1);
break;
case SDLK_g:
- send_event(UE_PLASMA);
+ send_event(UE_PLASMA, -1);
break;
/* Toggles */
case SDLK_s:
- send_event(UE_SHIELD);
+ send_event(UE_SHIELD, -1);
break;
case SDLK_w:
- send_event(UE_CLOAK);
+ send_event(UE_CLOAK, -1);
break;
default:
break;
}
static void
-send_event(int type, ...)
+send_event(int type, int arg1)
{
int ch, err = 0;
switch (type) {
case UE_DIRECTION:
- err = cpacket_direction_send(((int *)&type)[1]);
+ err = cpacket_direction_send(arg1);
break;
case UE_TORP:
if ((ch = Mix_PlayChannel(-1, snd_torp, 0)) != -1)