added input.x_dir and input.y_dir to gsa
This commit is contained in:
parent
a67fd544a6
commit
e1998aa111
|
@ -24,11 +24,6 @@ void init() {
|
|||
}
|
||||
|
||||
void tick() {
|
||||
i32 x, y;
|
||||
|
||||
x = input.down.dpad_left - input.down.dpad_right;
|
||||
y = input.down.dpad_up - input.down.dpad_down;
|
||||
|
||||
maps[0].scrollx -= x;
|
||||
maps[0].scrolly -= y;
|
||||
maps[0].scrollx -= input.x_dir;
|
||||
maps[0].scrolly -= input.y_dir;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ struct _gsa_input_set {
|
|||
|
||||
struct gsa_input {
|
||||
struct _gsa_input_set down, pressed;
|
||||
i32 x_dir;
|
||||
i32 y_dir;
|
||||
};
|
||||
|
||||
extern struct gsa_input input;
|
||||
|
|
|
@ -55,4 +55,7 @@ void _gsa_input_tick() {
|
|||
sw_gamepads[gamepad].button_down[SW_GAMEPAD_BUTTON_BACK];
|
||||
input.down.start =
|
||||
sw_gamepads[gamepad].button_down[SW_GAMEPAD_BUTTON_START];
|
||||
|
||||
input.x_dir = input.down.dpad_left - input.down.dpad_right;
|
||||
input.y_dir = input.down.dpad_up - input.down.dpad_down;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue