Initial port to Linux (using Allegro).
64-bit fixes. Some changes to aid portability. A few other tweaks.
This commit is contained in:
parent
4b3f77c926
commit
56b455844e
70 changed files with 12702 additions and 282 deletions
30
src/allegro-joystick.c
Normal file
30
src/allegro-joystick.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "allegro-main.h"
|
||||
#include "plat-joystick.h"
|
||||
|
||||
joystick_t joystick_state[2];
|
||||
int joysticks_present;
|
||||
|
||||
void joystick_init()
|
||||
{
|
||||
install_joystick(JOY_TYPE_AUTODETECT);
|
||||
joysticks_present = MIN(num_joysticks, 2);
|
||||
}
|
||||
void joystick_close()
|
||||
{
|
||||
}
|
||||
void joystick_poll()
|
||||
{
|
||||
int c;
|
||||
|
||||
poll_joystick();
|
||||
|
||||
for (c = 0; c < MIN(num_joysticks, 2); c++)
|
||||
{
|
||||
joystick_state[c].x = joy[c].stick[0].axis[0].pos * 256;
|
||||
joystick_state[c].y = joy[c].stick[0].axis[1].pos * 256;
|
||||
joystick_state[c].b[0] = joy[c].button[0].b;
|
||||
joystick_state[c].b[1] = joy[c].button[1].b;
|
||||
joystick_state[c].b[2] = joy[c].button[2].b;
|
||||
joystick_state[c].b[3] = joy[c].button[3].b;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue