Add cursor support
This commit is contained in:
14
game/input.h
14
game/input.h
@@ -17,7 +17,7 @@ typedef enum InputType {
|
||||
|
||||
#define MOUSE_BUTTON_COUNT (MOUSE_BUTTON_BACK + 1)
|
||||
|
||||
#define CLICK_LIMIT 0.2f
|
||||
#define CLICK_LIMIT 0.12f
|
||||
#define BUTTON_COUNT (MOUSE_BUTTON_BACK + 1)
|
||||
|
||||
typedef struct InputMapping {
|
||||
@@ -41,6 +41,11 @@ typedef struct InputState {
|
||||
Vector2 mouse;
|
||||
Vector2 mouseWorld;
|
||||
f32 mouseDownElapsed[BUTTON_COUNT];
|
||||
enum {
|
||||
CURSOR_NONE,
|
||||
CURSOR_COLLECT_WOOD,
|
||||
} cursor;
|
||||
|
||||
// INPUT_BUILDING
|
||||
int building;
|
||||
bool buildingCanPlace;
|
||||
@@ -49,6 +54,11 @@ typedef struct InputState {
|
||||
// SELECTED_UNITS
|
||||
Rectangle pickArea;
|
||||
|
||||
|
||||
// SELECTED_OBJECT
|
||||
// SELECTED_BUILDING
|
||||
|
||||
// Other
|
||||
struct {
|
||||
/* Selected units
|
||||
* 1: Position
|
||||
@@ -58,8 +68,6 @@ typedef struct InputState {
|
||||
ecs_query_t *selected;
|
||||
//ecs_query_t *selectedBuilding;
|
||||
} queries;
|
||||
// SELECTED_OBJECT
|
||||
// SELECTED_BUILDING
|
||||
} InputState;
|
||||
|
||||
static InputMapping inputDefaultMapping() {
|
||||
|
||||
Reference in New Issue
Block a user