X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Finput.h;fp=src%2Finput.h;h=a969d8e178189b14d5d60404501a61d3fd6cb12b;hb=974e63caa567fb56d5fa08ead1ffd7282fb910fd;hp=0000000000000000000000000000000000000000;hpb=ed53cdd30c05b7b3f8d0ba6ef2b0668f37d90119;p=deeprace diff --git a/src/input.h b/src/input.h new file mode 100644 index 0000000..a969d8e --- /dev/null +++ b/src/input.h @@ -0,0 +1,37 @@ +#ifndef INPUT_H_ +#define INPUT_H_ + +/* game input actions */ +enum { + INP_FWD, + INP_BACK, + INP_LEFT, + INP_RIGHT, + INP_FIRE, + INP_LROLL, + INP_RROLL, + + MAX_INPUTS +}; + +#define INP_FWD_BIT (1 << INP_FWD) +#define INP_BACK_BIT (1 << INP_BACK) +#define INP_LEFT_BIT (1 << INP_LEFT) +#define INP_RIGHT_BIT (1 << INP_RIGHT) +#define INP_FIRE_BIT (1 << INP_FIRE) +#define INP_LROLL_BIT (1 << INP_LROLL) +#define INP_RROLL_BIT (1 << INP_RROLL) + +#define INP_MOVE_BITS \ + (INP_FWD_BIT | INP_BACK_BIT | INP_LEFT_BIT | INP_RIGHT_BIT) + +struct input_map { + int inp, key, mbn; +}; +extern struct input_map inpmap[MAX_INPUTS]; + +extern unsigned int inpstate; + +void init_input(void); + +#endif /* INPUT_H_ */