mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-08-08 23:30:06 +00:00
Huge Game.cpp refactor and various other things
Started working on a tiny input/ActionMapper refactor, then everything fell apart and i ended up doing this. I'm sorry. Pretty much untested because input mapping is broken right now, will fix that next.
This commit is contained in:
parent
e2e7753226
commit
9414be864a
45 changed files with 4540 additions and 6812 deletions
|
@ -40,7 +40,19 @@ struct ActionData
|
|||
ButtonList buttonList;
|
||||
};
|
||||
|
||||
#define ACTION_EVENT = -1
|
||||
enum ActionButtonType
|
||||
{
|
||||
// must start at > 512 (SDL scancodes end there)
|
||||
MOUSE_BUTTON_LEFT = 999,
|
||||
MOUSE_BUTTON_RIGHT = 1000,
|
||||
MOUSE_BUTTON_MIDDLE = 1001,
|
||||
|
||||
JOY_BUTTON_0 = 2000,
|
||||
JOY_BUTTON_END = JOY_BUTTON_0 + MAX_JOYSTICK_BTN, // one past end
|
||||
|
||||
JOY_AXIS_0 = 3000,
|
||||
JOY_AXIS_END = JOY_AXIS_0 + MAX_JOYSTICK_AXIS,
|
||||
};
|
||||
|
||||
class ActionMapper
|
||||
{
|
||||
|
@ -57,7 +69,7 @@ public:
|
|||
void removeAllActions();
|
||||
|
||||
bool isActing(int actionID);
|
||||
virtual void action(int actionID, int state){}
|
||||
virtual void action(int actionID, int state, int source) = 0;
|
||||
|
||||
|
||||
void clearActions();
|
||||
|
@ -74,17 +86,6 @@ public:
|
|||
|
||||
bool cleared;
|
||||
|
||||
|
||||
|
||||
enum {
|
||||
MOUSE_BUTTON_LEFT = 999,
|
||||
MOUSE_BUTTON_RIGHT = 1000,
|
||||
MOUSE_BUTTON_MIDDLE = 1001,
|
||||
|
||||
JOY1_BUTTON_0 = 2000,
|
||||
JOY1_BUTTON_END = JOY1_BUTTON_0 + MAX_JOYSTICK_BTN, // one past end
|
||||
};
|
||||
|
||||
virtual void enableInput();
|
||||
virtual void disableInput();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue