Skip to content

Commit

Permalink
Common: Add ability to detect the left analogue intent
Browse files Browse the repository at this point in the history
The player may want to ask us to make the main char walk or run depending on the left analogue stick position
  • Loading branch information
julianxhokaxhiu committed Feb 5, 2023
1 parent b6bf503 commit ef34288
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ bool xinput_connected = false;

bool simulate_OK_button = false;

GamepadAnalogueIntent gamepad_analogue_intent = INTENT_NONE;

uint32_t noop() { return 0; }
uint32_t noop_a1(uint32_t a1) { return 0; }
uint32_t noop_a2(uint32_t a1, uint32_t a2) { return 0; }
Expand Down
15 changes: 11 additions & 4 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,17 @@ enum game_modes

enum AspectRatioMode
{
AR_ORIGINAL = 0,
AR_STRETCH,
AR_WIDESCREEN,
AR_COUNT
AR_ORIGINAL = 0,
AR_STRETCH,
AR_WIDESCREEN,
AR_COUNT
};

enum GamepadAnalogueIntent
{
INTENT_NONE,
INTENT_WALK,
INTENT_RUN
};

// popup lifetime in frames
Expand Down
1 change: 1 addition & 0 deletions src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ extern double speedhack_current;

extern bool xinput_connected;
extern bool simulate_OK_button;
extern GamepadAnalogueIntent gamepad_analogue_intent;

extern char *get_current_field_name();
extern uint32_t noop();
Expand Down

0 comments on commit ef34288

Please sign in to comment.