diff --git a/common/arch/sdl/joy.cpp b/common/arch/sdl/joy.cpp index 97408d5a9..08b260e63 100644 --- a/common/arch/sdl/joy.cpp +++ b/common/arch/sdl/joy.cpp @@ -339,10 +339,8 @@ void joy_init() #if DXX_MAX_AXES_PER_JOYSTICK joyaxis_text.clear(); #endif -#if DXX_MAX_BUTTONS_PER_JOYSTICK || DXX_MAX_HATS_PER_JOYSTICK || DXX_MAX_AXES_PER_JOYSTICK joybutton_text.clear(); joy_key_map.clear(); -#endif const auto n = check_warn_joy_support_limit(SDL_NumJoysticks(), "joystick", DXX_MAX_JOYSTICKS); cf_assert(n <= DXX_MAX_JOYSTICKS); @@ -374,7 +372,6 @@ void joy_init() const auto n_axes = 0; #endif -#if DXX_MAX_BUTTONS_PER_JOYSTICK || DXX_MAX_HATS_PER_JOYSTICK || DXX_MAX_AXES_PER_JOYSTICK const auto n_buttons = check_warn_joy_support_limit(SDL_JoystickNumButtons(handle), "button", DXX_MAX_BUTTONS_PER_JOYSTICK); const auto n_hats = check_warn_joy_support_limit(SDL_JoystickNumHats(handle), "hat", DXX_MAX_HATS_PER_JOYSTICK); @@ -424,7 +421,6 @@ void joy_init() joy_key_map[joystick_n_buttons] = (e.idx == 1) ? KEY_LEFT : (e.idx == 2) ? KEY_UP : 0; snprintf(&joybutton_text[joystick_n_buttons++][0], sizeof(joybutton_text[0]), "J%u +A%u", i + 1, e.idx); } -#endif #endif num_joysticks++; @@ -444,9 +440,7 @@ void joy_close() #if DXX_MAX_AXES_PER_JOYSTICK joyaxis_text.clear(); #endif -#if DXX_MAX_BUTTONS_PER_JOYSTICK || DXX_MAX_HATS_PER_JOYSTICK || DXX_MAX_AXES_PER_JOYSTICK joybutton_text.clear(); -#endif } const d_event_joystick_axis_value &event_joystick_get_axis(const d_event &event) diff --git a/common/main/kconfig.h b/common/main/kconfig.h index 31028929c..8fdaa62f0 100644 --- a/common/main/kconfig.h +++ b/common/main/kconfig.h @@ -202,12 +202,10 @@ using joyaxis_text_t = joystick_text_t + DXX_JOY_MAX(DXX_JOY_MAX(sizeof("J H ") + number_to_text_length, sizeof("J B") + number_to_text_length), sizeof("J -A") + number_to_text_length)>; #undef DXX_JOY_MAX extern joybutton_text_t joybutton_text; -#endif } #endif diff --git a/similar/main/kconfig.cpp b/similar/main/kconfig.cpp index 054f5a944..aeb2274f6 100644 --- a/similar/main/kconfig.cpp +++ b/similar/main/kconfig.cpp @@ -91,7 +91,7 @@ const std::array fades{{ }}; const std::array invert_text{{"N", "Y"}}; -#if DXX_MAX_BUTTONS_PER_JOYSTICK || DXX_MAX_HATS_PER_JOYSTICK +#if DXX_MAX_JOYSTICKS joybutton_text_t joybutton_text; #endif #if DXX_MAX_AXES_PER_JOYSTICK