From 6689bbd9138be38fec7dc16d5702d467a8f473ef Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 8 Apr 2019 06:27:24 +0000 Subject: [PATCH] SW: Hacks to input code just to get it to compile. Patch from Striker. git-svn-id: https://svn.eduke32.com/eduke32@7521 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/mact/include/control.h | 3 +++ source/sw/src/config.cpp | 16 +++++++++++----- source/sw/src/menus.cpp | 12 +++++++++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/source/mact/include/control.h b/source/mact/include/control.h index 558cf8acd..ca85d0730 100644 --- a/source/mact/include/control.h +++ b/source/mact/include/control.h @@ -200,6 +200,9 @@ static inline int CONTROL_KeyIsBound(int const key) void CONTROL_ProcessBinds(void); +#define CONTROL_GetUserInput(...) +#define CONTROL_ClearUserInput(...) + //////////////////// #define CONTROL_NUM_FLAGS 64 diff --git a/source/sw/src/config.cpp b/source/sw/src/config.cpp index df80152b5..62a405f8c 100644 --- a/source/sw/src/config.cpp +++ b/source/sw/src/config.cpp @@ -241,7 +241,7 @@ void CONFIG_SetDefaults(void) MouseAnalogAxes[i] = CONFIG_AnalogNameToNum(mouseanalogdefaults[i]); } - CONTROL_SetMouseSensitivity(gs.MouseSpeed); + CONTROL_MouseSensitivity = float(gs.MouseSpeed); // [JM] Temporary !CHECKME! memset(JoystickButtons, -1, sizeof(JoystickButtons)); memset(JoystickButtonsClicked, -1, sizeof(JoystickButtonsClicked)); @@ -290,8 +290,10 @@ void SetDefaultKeyDefinitions(int style) if (f == -1) continue; k1 = KB_StringToScanCode(keydefaultset[3*i+1]); k2 = KB_StringToScanCode(keydefaultset[3*i+2]); - +// [JM] Needs to be rewritten, I think. !CHECKME! +#if 0 CONTROL_MapKey(i, k1, k2); +#endif KeyboardKeys[f][0] = k1; KeyboardKeys[f][1] = k2; @@ -386,8 +388,11 @@ void CONFIG_ReadKeys(int32_t scripthandle) { if (i == gamefunc_Show_Console) OSD_CaptureKey(KeyboardKeys[i][0]); +#if 0 + // [JM] Needs to be re-done. !CHECKME! else CONTROL_MapKey(i, KeyboardKeys[i][0], KeyboardKeys[i][1]); +#endif } } @@ -457,7 +462,7 @@ void CONFIG_SetupMouse(void) CONTROL_SetAnalogAxisScale(i, MouseAnalogScale[i], controldevice_mouse); } - CONTROL_SetMouseSensitivity(gs.MouseSpeed); + CONTROL_MouseSensitivity = float(gs.MouseSpeed); // [JM] Temporary !CHECKME! } /* @@ -530,8 +535,9 @@ void CONFIG_SetupJoystick(void) CONTROL_MapDigitalAxis(i, JoystickDigitalAxes[i][0], 0, controldevice_joystick); CONTROL_MapDigitalAxis(i, JoystickDigitalAxes[i][1], 1, controldevice_joystick); CONTROL_SetAnalogAxisScale(i, JoystickAnalogScale[i], controldevice_joystick); - CONTROL_SetJoyAxisDead(i, JoystickAnalogDead[i]); - CONTROL_SetJoyAxisSaturate(i, JoystickAnalogSaturate[i]); + //CONTROL_SetJoyAxisDead(i, JoystickAnalogDead[i]); + //CONTROL_SetJoyAxisSaturate(i, JoystickAnalogSaturate[i]); + joySetDeadZone(i, JoystickAnalogDead[i], JoystickAnalogSaturate[i]); // [JM] !CHECKME! } } diff --git a/source/sw/src/menus.cpp b/source/sw/src/menus.cpp index 343f9b09a..897e9e03b 100644 --- a/source/sw/src/menus.cpp +++ b/source/sw/src/menus.cpp @@ -803,9 +803,11 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item) KeyboardKeys[currentkey][currentcol] = KB_GetLastScanCode(); if (currentkey != gamefunc_Show_Console) { +#if 0 // [JM] Re-do this shit !CHECKME! CONTROL_MapKey(currentkey, KeyboardKeys[currentkey][0], KeyboardKeys[currentkey][1]); +#endif } else { @@ -855,9 +857,11 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item) if (currentkey != gamefunc_Show_Console) { KeyboardKeys[currentkey][currentcol] = 0xff; +#if 0 // [JM] Re-do this shit !CHECKME! CONTROL_MapKey(currentkey, KeyboardKeys[currentkey][0], KeyboardKeys[currentkey][1]); +#endif } } else if (KB_KeyPressed(sc_Home)) @@ -3642,7 +3646,7 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) slidersettings[sldr_mouse] = offset; gs.MouseSpeed = offset * (MOUSE_SENS_MAX_VALUE/SLDR_MOUSESENSEMAX); - CONTROL_SetMouseSensitivity(gs.MouseSpeed); + CONTROL_MouseSensitivity = float(gs.MouseSpeed); // [JM] Will need to verify this. !CHECKME! break; case sldr_sndfxvolume: @@ -3992,13 +3996,15 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (item->slider == sldr_joyaxisdead) { JoystickAnalogDead[JoystickAxisPage] = min((offset<<10), 32767); - CONTROL_SetJoyAxisDead(JoystickAxisPage, JoystickAnalogDead[JoystickAxisPage]); + //CONTROL_SetJoyAxisDead(JoystickAxisPage, JoystickAnalogDead[JoystickAxisPage]); } else { JoystickAnalogSaturate[JoystickAxisPage] = min((offset<<10), 32767); - CONTROL_SetJoyAxisSaturate(JoystickAxisPage, JoystickAnalogSaturate[JoystickAxisPage]); + //CONTROL_SetJoyAxisSaturate(JoystickAxisPage, JoystickAnalogSaturate[JoystickAxisPage]); } + + joySetDeadZone(JoystickAxisPage, JoystickAnalogDead[JoystickAxisPage], JoystickAnalogSaturate[JoystickAxisPage]); // [JM] !CHECKME! } sprintf(tmp_text, "%.2f%%", (float)(slidersettings[item->slider]<<10) / 32767.f);