added input.x_dir and input.y_dir to gsa

This commit is contained in:
DaniTheSkunk 2023-01-22 11:34:32 +00:00
parent a67fd544a6
commit e1998aa111
3 changed files with 7 additions and 7 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}