From 709a049ab695a53e78c0293fd86f61badfc755fd Mon Sep 17 00:00:00 2001 From: Zerocker Date: Sat, 30 May 2020 20:38:05 +0900 Subject: [PATCH] Added rumble strength option --- include/text_options_strings.h.in | 2 ++ src/game/options_menu.c | 2 ++ src/pc/configfile.c | 2 ++ src/pc/configfile.h | 1 + 4 files changed, 7 insertions(+) diff --git a/include/text_options_strings.h.in b/include/text_options_strings.h.in index 575b23f9..c391f407 100644 --- a/include/text_options_strings.h.in +++ b/include/text_options_strings.h.in @@ -67,6 +67,7 @@ #define TEXT_BIND_LEFT _("STICK LEFT") #define TEXT_BIND_RIGHT _("STICK RIGHT") #define TEXT_OPT_DEADZONE _("STICK DEADZONE") +#define TEXT_OPT_RUMBLE _("RUMBLE STRENGTH") #define TEXT_OPT_CHEAT1 _("ENABLE CHEATS") #define TEXT_OPT_CHEAT2 _("MOONJUMP (PRESS L)") @@ -128,6 +129,7 @@ #define TEXT_BIND_LEFT _("Stick Left") #define TEXT_BIND_RIGHT _("Stick Right") #define TEXT_OPT_DEADZONE _("Stick Deadzone") +#define TEXT_OPT_RUMBLE _("Rumble Strength") #define TEXT_OPT_CHEAT1 _("Enable cheats") #define TEXT_OPT_CHEAT2 _("Moonjump (Press L)") diff --git a/src/game/options_menu.c b/src/game/options_menu.c index 73952748..4dc0be98 100644 --- a/src/game/options_menu.c +++ b/src/game/options_menu.c @@ -120,6 +120,7 @@ static const u8 bindStr[][32] = { { TEXT_BIND_LEFT }, { TEXT_BIND_RIGHT }, { TEXT_OPT_DEADZONE }, + { TEXT_OPT_RUMBLE } }; static const u8 *filterChoices[] = { @@ -241,6 +242,7 @@ static struct Option optsControls[] = { // max deadzone is 31000; this is less than the max range of ~32768, but this // way, the player can't accidentally lock themselves out of using the stick DEF_OPT_SCROLL( bindStr[16], &configStickDeadzone, 0, 100, 1 ), + DEF_OPT_SCROLL( bindStr[17], &configRumbleStrength, 0, 100, 1) }; static struct Option optsVideo[] = { diff --git a/src/pc/configfile.c b/src/pc/configfile.c index 9c9038a4..528ef1da 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -67,6 +67,7 @@ unsigned int configKeyStickDown[MAX_BINDS] = { 0x001F, VK_INVALID, VK_INVALID unsigned int configKeyStickLeft[MAX_BINDS] = { 0x001E, VK_INVALID, VK_INVALID }; unsigned int configKeyStickRight[MAX_BINDS] = { 0x0020, VK_INVALID, VK_INVALID }; unsigned int configStickDeadzone = 16; // 16*DEADZONE_STEP=4960 (the original default deadzone) +unsigned int configRumbleStrength = 50; #ifdef EXTERNAL_TEXTURES bool configPrecacheRes = false; #endif @@ -109,6 +110,7 @@ static const struct ConfigOption options[] = { {.name = "key_stickleft", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStickLeft}, {.name = "key_stickright", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStickRight}, {.name = "stick_deadzone", .type = CONFIG_TYPE_UINT, .uintValue = &configStickDeadzone}, + {.name = "rumble_strength", .type = CONFIG_TYPE_UINT, .uintValue = &configRumbleStrength}, #ifdef EXTERNAL_TEXTURES {.name = "precache", .type = CONFIG_TYPE_BOOL, .boolValue = &configPrecacheRes}, #endif diff --git a/src/pc/configfile.h b/src/pc/configfile.h index d6087612..6dce17fb 100644 --- a/src/pc/configfile.h +++ b/src/pc/configfile.h @@ -36,6 +36,7 @@ extern unsigned int configKeyStickDown[]; extern unsigned int configKeyStickLeft[]; extern unsigned int configKeyStickRight[]; extern unsigned int configStickDeadzone; +extern unsigned int configRumbleStrength; #ifdef EXTERNAL_TEXTURES extern bool configPrecacheRes; #endif