From 9fff6e8a0b1c82689919967bc9dcaacc5910e8eb Mon Sep 17 00:00:00 2001 From: Timur Gagiev Date: Wed, 14 Mar 2018 13:51:26 +0300 Subject: [PATCH 1/3] Update main.cpp #15 fix joyInit call before os timer initialization --- src/platform/nix/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/platform/nix/main.cpp b/src/platform/nix/main.cpp index be7889f..925e54b 100644 --- a/src/platform/nix/main.cpp +++ b/src/platform/nix/main.cpp @@ -401,12 +401,11 @@ int main(int argc, char **argv) { Atom WM_DELETE_WINDOW = XInternAtom(dpy, "WM_DELETE_WINDOW", 0); XSetWMProtocols(dpy, wnd, &WM_DELETE_WINDOW, 1); - joyInit(); - timeval t; gettimeofday(&t, NULL); startTime = t.tv_sec; + joyInit(); sndInit(); Game::init(argc > 1 ? argv[1] : NULL); From abdece890ea6ff2103dce72a525fcc1a4bbf1906 Mon Sep 17 00:00:00 2001 From: Pablo Date: Sun, 25 Mar 2018 15:42:39 -0300 Subject: [PATCH 2/3] Use kernel axis mapping to get the right axis numbers --- src/platform/nix/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/nix/main.cpp b/src/platform/nix/main.cpp index 925e54b..a43ed15 100644 --- a/src/platform/nix/main.cpp +++ b/src/platform/nix/main.cpp @@ -112,6 +112,7 @@ struct JoyDevice { float oL, oR; // last applied value int time; // time when we can send effect update ff_effect fx; // effect structure + uint8_t axismap[ABS_CNT]; // axis mapping } joyDevice[INPUT_JOY_COUNT]; bool osJoyReady(int index) { @@ -141,6 +142,7 @@ void joyInit() { int8 axes, buttons; ioctl(joy.fd, JSIOCGAXES, &axes); ioctl(joy.fd, JSIOCGBUTTONS, &buttons); + ioctl(joy.fd, JSIOCGAXMAP, joy.axismap); if (axes < 4 || buttons < 11) { // is it really a gamepad? close(joy.fd); @@ -275,7 +277,7 @@ void joyUpdate() { // axes if (event.type & JS_EVENT_AXIS) { - switch (event.number) { + switch (joy.axismap[event.number]) { // Left stick case ABS_X : joy.L.x = joyAxisValue(event.value); break; case ABS_Y : joy.L.y = joyAxisValue(event.value); break; From 90565afef2b0b8dad6a667894fe9fce08e6d3541 Mon Sep 17 00:00:00 2001 From: Timur Gagiev Date: Sun, 25 Mar 2018 23:46:34 +0300 Subject: [PATCH 3/3] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index ca18ea9..6a3c900 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ inspired by OpenTomb project http://opentomb.github.io/ * [Tomb Raider Forums thread](http://www.tombraiderforums.com/showthread.php?t=216618) ## Roadmap -- RELEASE alpha-3 - enemies - save game crystals - PSP port