From 0f02f6efd455329fdcdd4737801b3c1e6cc536d3 Mon Sep 17 00:00:00 2001 From: Dusan Durech Date: Wed, 24 Jun 2009 17:05:12 +0200 Subject: better code for control tux --- src/client/control.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/client/control.h (limited to 'src/client/control.h') diff --git a/src/client/control.h b/src/client/control.h new file mode 100644 index 0000000..f36c9b5 --- /dev/null +++ b/src/client/control.h @@ -0,0 +1,28 @@ +#ifndef CONTROL_H + +#define CONTROL_H + +#define CONTROL_NONE -1 +#define CONTROL_UP 0 +#define CONTROL_RIGHT 1 +#define CONTROL_LEFT 2 +#define CONTROL_DOWN 3 +#define CONTROL_SHOT 4 +#define CONTROL_SWITCH 5 + +#define CONTROL_KEY_COUNT_ROUTE 4 +#define CONTROL_KEY_COUNT 6 + +typedef struct control_struct +{ + SDLKey key[CONTROL_KEY_COUNT]; + int count[CONTROL_KEY_COUNT]; +} control_t; + +extern control_t* control_new(SDLKey arg_up, SDLKey arg_right, SDLKey arg_left, SDLKey arg_down, + SDLKey arg_shot, SDLKey arg_switch); +extern int control_get_key_route(control_t *my_control); +extern int control_get_key_action(control_t *my_control); +extern void control_destroy(control_t *my_control); + +#endif -- cgit v1.2.3