Use plat_setenv and strcasecmp where the stick dead zone code called Windows-only functions

_putenv_s in cfg_probe.c and _stricmp in the menu's key binding row stopped the Linux runtime library from compiling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-01 18:15:41 +03:00
1 parent 2125ad6eea
commit 2af42ccf0d
2 files changed
+9 -9

No files matched your search

+8 -8
View File
@@ -273,19 +273,19 @@ int probe_cfg(void) {
"pad stick: a square gate's corner stays on the unit circle");
input_pad_stick(0, 32767 / 2 + 1, 0.2f, st);
CHECK(abs(st[1] - 32767 * 3 / 8) <= 3, "pad stick: half deflection past a 20% zone is (0.5 - 0.2) / 0.8 of full");
_putenv_s("TOTK_STICK_DEADZONE", "12");
_putenv_s("TOTK_LSTICK_DEADZONE", "");
_putenv_s("TOTK_RSTICK_DEADZONE", "");
plat_setenv("TOTK_STICK_DEADZONE", "12");
plat_setenv("TOTK_LSTICK_DEADZONE", NULL);
plat_setenv("TOTK_RSTICK_DEADZONE", NULL);
CHECK(fabsf(input_pad_deadzone(0) - 0.12f) < 1e-6f && fabsf(input_pad_deadzone(1) - 0.12f) < 1e-6f,
"pad dead zone: both sticks follow stick_deadzone while lstick/rstick are unset");
_putenv_s("TOTK_RSTICK_DEADZONE", "20");
plat_setenv("TOTK_RSTICK_DEADZONE", "20");
CHECK(fabsf(input_pad_deadzone(0) - 0.12f) < 1e-6f && fabsf(input_pad_deadzone(1) - 0.20f) < 1e-6f,
"pad dead zone: rstick_deadzone sets the right stick alone");
_putenv_s("TOTK_LSTICK_DEADZONE", "80");
plat_setenv("TOTK_LSTICK_DEADZONE", "80");
CHECK(fabsf(input_pad_deadzone(0) - 0.5f) < 1e-6f, "pad dead zone: clamped to 50%");
_putenv_s("TOTK_STICK_DEADZONE", "");
_putenv_s("TOTK_LSTICK_DEADZONE", "");
_putenv_s("TOTK_RSTICK_DEADZONE", "");
plat_setenv("TOTK_STICK_DEADZONE", NULL);
plat_setenv("TOTK_LSTICK_DEADZONE", NULL);
plat_setenv("TOTK_RSTICK_DEADZONE", NULL);
CHECK(input_stick_percent(32767, 0) > 99.99 && input_stick_percent(32767, 0) < 100.01 &&
input_stick_percent(0, 0) == 0 && fabs(input_stick_percent(3000, -4000) - 5000 * 100.0 / 32767) < 1e-9,
"stick percent: an axis's end is 100%, the centre 0%, round in between");
+1 -1
View File
@@ -740,7 +740,7 @@ static void row_walk_key(void) {
InputMap m;
input_map_snapshot(&m);
for (int k = KEY_A; k < KEY_COUNT && !n; k++) {
if (!input_key_name(k) || _stricmp(input_key_name(k), cur)) continue;
if (!input_key_name(k) || strcasecmp(input_key_name(k), cur)) continue;
int a = key_action(&m, k);
if (a >= 0 && input_action_name(a)) snprintf(note, sizeof note, menu_text(UI_MENU_WALK_KEY_TAKEN), input_action_name(a)), n = note;
}