From b5ac86c4f074e03c5d367531ba5e3419e955ba52 Mon Sep 17 00:00:00 2001 From: zico Date: Sat, 29 Aug 2015 15:46:03 +0200 Subject: [PATCH] Slightly modified keyboard pitch and heading sensitivity so highest setting matches the original game running at ~60 FPS --- similar/main/kconfig.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/similar/main/kconfig.cpp b/similar/main/kconfig.cpp index ca7e8a3c1..b3c72acff 100644 --- a/similar/main/kconfig.cpp +++ b/similar/main/kconfig.cpp @@ -1430,7 +1430,7 @@ static void input_button_matched(const kc_item& item, int down) } template class F> -static void adjust_ramped_keyboard_field(float& keydown_time, ubyte& state, fix& time, const int& sensitivity, const int& speed_factor, const int& speed_divisor = 1) +static void adjust_ramped_keyboard_field(float& keydown_time, ubyte& state, fix& time, const float& sensitivity, const int& speed_factor, const int& speed_divisor = 1) #define adjust_ramped_keyboard_field(F, M, ...) \ (adjust_ramped_keyboard_field(Controls.down_time.M, Controls.state.M, __VA_ARGS__)) { @@ -1674,8 +1674,8 @@ void kconfig_read_controls(const d_event &event, int automap_flag) if ( !Controls.state.slide_on ) { // From keyboard... - adjust_ramped_keyboard_field(plus, key_pitch_forward, Controls.pitch_time, PlayerCfg.KeyboardSens[1], speed_factor, 2); - adjust_ramped_keyboard_field(minus, key_pitch_backward, Controls.pitch_time, PlayerCfg.KeyboardSens[1], speed_factor, 2); + adjust_ramped_keyboard_field(plus, key_pitch_forward, Controls.pitch_time, (PlayerCfg.KeyboardSens[1]==16?15.5:PlayerCfg.KeyboardSens[1]), speed_factor, 2); + adjust_ramped_keyboard_field(minus, key_pitch_backward, Controls.pitch_time, (PlayerCfg.KeyboardSens[1]==16?15.5:PlayerCfg.KeyboardSens[1]), speed_factor, 2); // From joystick... adjust_axis_field(Controls.pitch_time, Controls.joy_axis, kcm_joystick[13].value, kcm_joystick[14].value, PlayerCfg.JoystickSens[1]); // From mouse... @@ -1710,8 +1710,8 @@ void kconfig_read_controls(const d_event &event, int automap_flag) if (!Controls.state.slide_on && !Controls.state.bank_on) { // From keyboard... - adjust_ramped_keyboard_field(plus, key_heading_right, Controls.heading_time, PlayerCfg.KeyboardSens[0], speed_factor); - adjust_ramped_keyboard_field(minus, key_heading_left, Controls.heading_time, PlayerCfg.KeyboardSens[0], speed_factor); + adjust_ramped_keyboard_field(plus, key_heading_right, Controls.heading_time, (PlayerCfg.KeyboardSens[0]==16?15.5:PlayerCfg.KeyboardSens[0]), speed_factor); + adjust_ramped_keyboard_field(minus, key_heading_left, Controls.heading_time, (PlayerCfg.KeyboardSens[0]==16?15.5:PlayerCfg.KeyboardSens[0]), speed_factor); // From joystick... adjust_axis_field(Controls.heading_time, Controls.joy_axis, kcm_joystick[15].value, !kcm_joystick[16].value, PlayerCfg.JoystickSens[0]); // From mouse...