From 3376184a763062bf16f610a2553a5f95530d2bb4 Mon Sep 17 00:00:00 2001 From: esuo1198 <54134.es@gmail.com> Date: Sat, 27 Apr 2024 12:20:16 +0900 Subject: [PATCH] Change config name --- README.md | 2 +- dist/config.toml | 2 +- src/bnusio.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5d9da5c..8c26440 100644 --- a/README.md +++ b/README.md @@ -87,5 +87,5 @@ wait_period = 4 [controller] # use analog input -analog = false +analog_input = false ``` diff --git a/dist/config.toml b/dist/config.toml index 5160894..761bc88 100644 --- a/dist/config.toml +++ b/dist/config.toml @@ -41,4 +41,4 @@ image_path = "" wait_period = 4 [controller] -analog = false \ No newline at end of file +analog_input = false diff --git a/src/bnusio.cpp b/src/bnusio.cpp index 7c895dc..9e34e2d 100644 --- a/src/bnusio.cpp +++ b/src/bnusio.cpp @@ -106,7 +106,7 @@ u16 buttonWaitPeriodP2 = 0; std::queue buttonQueueP1; std::queue buttonQueueP2; -bool useTaikoController; +bool analogInput; SDLAxis analogBindings[] = { SDL_AXIS_LEFT_LEFT, SDL_AXIS_LEFT_RIGHT, SDL_AXIS_LEFT_DOWN, SDL_AXIS_LEFT_UP, // P1: LB, LR, RR, RB SDL_AXIS_RIGHT_LEFT, SDL_AXIS_RIGHT_RIGHT, SDL_AXIS_RIGHT_DOWN, SDL_AXIS_RIGHT_UP, // P2: LB, LR, RR, RB @@ -115,7 +115,7 @@ SDLAxis analogBindings[] = { u16 bnusio_GetAnalogIn (u8 which) { u16 analogValue; - if (useTaikoController) { + if (analogInput) { analogValue = (u16)(32768 * ControllerAxisIsDown (analogBindings[which])); if (analogValue > 100) return analogValue; return 0; @@ -320,10 +320,10 @@ Init () { toml_table_t *config = config_ptr.get (); auto drum = openConfigSection (config, "drum"); if (drum) drumWaitPeriod = readConfigInt (drum, "wait_period", drumWaitPeriod); - auto taikoController = openConfigSection (config, "controller"); - if (taikoController) { - useTaikoController = readConfigBool (taikoController, "analog", useTaikoController); - if (useTaikoController) printf ("Using analog input mode. All the keyboard drum inputs have been disabled.\n"); + auto controller = openConfigSection (config, "controller"); + if (controller) { + analogInput = readConfigBool (controller, "analog_input", analogInput); + if (analogInput) printf ("Using analog input mode. All the keyboard drum inputs have been disabled.\n"); } auto card = openConfigSection (config, "card_reader"); if (card) {