Game code start
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "input/input.h"
|
||||
#include "input/inputbindmap.h"
|
||||
|
||||
inputbuttondata_t INPUT_BUTTON_DATA[] = {
|
||||
#ifdef DUSK_INPUT_GAMEPAD
|
||||
@@ -499,49 +500,13 @@ inputbuttondata_t INPUT_BUTTON_DATA[] = {
|
||||
};
|
||||
|
||||
errorret_t inputInitLinux(void) {
|
||||
#define X(buttonName, buttonAction) \
|
||||
inputBind(inputButtonGetByName(buttonName), buttonAction);
|
||||
|
||||
#ifdef DUSK_INPUT_KEYBOARD
|
||||
X("w", INPUT_ACTION_UP);
|
||||
X("s", INPUT_ACTION_DOWN);
|
||||
X("a", INPUT_ACTION_LEFT);
|
||||
X("d", INPUT_ACTION_RIGHT);
|
||||
X("left", INPUT_ACTION_LEFT);
|
||||
X("right", INPUT_ACTION_RIGHT);
|
||||
X("up", INPUT_ACTION_UP);
|
||||
X("down", INPUT_ACTION_DOWN);
|
||||
X("enter", INPUT_ACTION_ACCEPT);
|
||||
X("e", INPUT_ACTION_ACCEPT);
|
||||
X("space", INPUT_ACTION_ACCEPT);
|
||||
X("tab", INPUT_ACTION_CANCEL);
|
||||
X("q", INPUT_ACTION_CANCEL);
|
||||
X("escape", INPUT_ACTION_RAGEQUIT);
|
||||
X("enter", INPUT_ACTION_PAUSE);
|
||||
X("`", INPUT_ACTION_CONSOLE);
|
||||
#endif
|
||||
|
||||
#ifdef DUSK_INPUT_GAMEPAD
|
||||
X("gamepad_up", INPUT_ACTION_UP);
|
||||
X("gamepad_down", INPUT_ACTION_DOWN);
|
||||
X("gamepad_left", INPUT_ACTION_LEFT);
|
||||
X("gamepad_right", INPUT_ACTION_RIGHT);
|
||||
X("gamepad_a", INPUT_ACTION_ACCEPT);
|
||||
X("gamepad_b", INPUT_ACTION_CANCEL);
|
||||
X("gamepad_back", INPUT_ACTION_RAGEQUIT);
|
||||
X("gamepad_start", INPUT_ACTION_PAUSE);
|
||||
X("gamepad_lstick_up", INPUT_ACTION_UP);
|
||||
X("gamepad_lstick_down", INPUT_ACTION_DOWN);
|
||||
X("gamepad_lstick_left", INPUT_ACTION_LEFT);
|
||||
X("gamepad_lstick_right", INPUT_ACTION_RIGHT);
|
||||
#endif
|
||||
|
||||
#ifdef DUSK_INPUT_POINTER
|
||||
X("mouse_x", INPUT_ACTION_POINTERX);
|
||||
X("mouse_y", INPUT_ACTION_POINTERY);
|
||||
#endif
|
||||
|
||||
#undef X
|
||||
for(
|
||||
const inputbindmapentry_t *entry = INPUT_BIND_MAP;
|
||||
entry->buttonName != NULL;
|
||||
entry++
|
||||
) {
|
||||
inputBind(inputButtonGetByName(entry->buttonName), entry->bind);
|
||||
}
|
||||
|
||||
errorOk();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user