From 7208823396762ae9659ec03addabe696fa93256b Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Sun, 19 May 2013 00:30:20 +1200 Subject: Added config for enabling Balance Board. Fixed other structures that still assumed 4 of everything. --- Source/Core/InputCommon/Src/InputConfig.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Source/Core/InputCommon') diff --git a/Source/Core/InputCommon/Src/InputConfig.cpp b/Source/Core/InputCommon/Src/InputConfig.cpp index 65529b0a3f..e1af00f41d 100644 --- a/Source/Core/InputCommon/Src/InputConfig.cpp +++ b/Source/Core/InputCommon/Src/InputConfig.cpp @@ -3,7 +3,8 @@ // Refer to the license.txt file included. #include "InputConfig.h" -#include "../../Core/Src/ConfigManager.h" +#include "../Src/ConfigManager.h" +#include "../Src/HW/Wiimote.h" InputPlugin::~InputPlugin() { @@ -18,9 +19,9 @@ bool InputPlugin::LoadConfig(bool isGC) { IniFile inifile; IniFile game_ini; - bool useProfile[4] = {false, false, false, false}; - std::string num[4] = {"1", "2", "3", "4"}; - std::string profile[4]; + bool useProfile[MAX_BBMOTES] = {false, false, false, false, false}; + std::string num[MAX_BBMOTES] = {"1", "2", "3", "4", "BB"}; + std::string profile[MAX_BBMOTES]; std::string path; if (SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID() != "00000000") -- cgit v1.2.3 From 065d772696fd66720574fadbcbf4ce8190ff5d20 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Sun, 19 May 2013 14:45:24 +1200 Subject: Windows should have support for Balance Board now. Needs to be tested. --- Source/Core/InputCommon/Src/InputConfig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/InputCommon') diff --git a/Source/Core/InputCommon/Src/InputConfig.cpp b/Source/Core/InputCommon/Src/InputConfig.cpp index e1af00f41d..96fc6205db 100644 --- a/Source/Core/InputCommon/Src/InputConfig.cpp +++ b/Source/Core/InputCommon/Src/InputConfig.cpp @@ -3,8 +3,8 @@ // Refer to the license.txt file included. #include "InputConfig.h" -#include "../Src/ConfigManager.h" -#include "../Src/HW/Wiimote.h" +#include "../../Core/Src/ConfigManager.h" +#include "../../Core/Src/HW/Wiimote.h" InputPlugin::~InputPlugin() { -- cgit v1.2.3 From b6e1127c8a14aac8c6f5c322809274977abdb2ae Mon Sep 17 00:00:00 2001 From: John Peterson Date: Thu, 10 Nov 2011 09:27:33 +0100 Subject: Adding stick radius setting because that makes it easier to adjust it Adding visual aid for the hardware range because that makes it easier to adjust the radius relative to it --- Source/Core/InputCommon/Src/ControllerEmu.cpp | 1 + Source/Core/InputCommon/Src/ControllerEmu.h | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'Source/Core/InputCommon') diff --git a/Source/Core/InputCommon/Src/ControllerEmu.cpp b/Source/Core/InputCommon/Src/ControllerEmu.cpp index b7eee1a143..328fcb8c2f 100644 --- a/Source/Core/InputCommon/Src/ControllerEmu.cpp +++ b/Source/Core/InputCommon/Src/ControllerEmu.cpp @@ -226,6 +226,7 @@ ControllerEmu::AnalogStick::AnalogStick(const char* const _name) : ControlGroup( controls.push_back(new Input(_trans("Modifier"))); + settings.push_back(new Setting(_trans("Radius"), 0.7f, 0, 100)); settings.push_back(new Setting(_trans("Dead Zone"), 0, 0, 50)); settings.push_back(new Setting(_trans("Square Stick"), 0)); diff --git a/Source/Core/InputCommon/Src/ControllerEmu.h b/Source/Core/InputCommon/Src/ControllerEmu.h index 33057434cd..cf87f2562e 100644 --- a/Source/Core/InputCommon/Src/ControllerEmu.h +++ b/Source/Core/InputCommon/Src/ControllerEmu.h @@ -35,6 +35,13 @@ enum GROUP_TYPE_SLIDER, }; +enum +{ + SETTING_RADIUS, + SETTING_DEADZONE, + SETTING_SQUARE, +}; + const char * const named_directions[] = { "Up", @@ -126,8 +133,9 @@ public: ControlState yy = controls[0]->control_ref->State() - controls[1]->control_ref->State(); ControlState xx = controls[3]->control_ref->State() - controls[2]->control_ref->State(); - ControlState deadzone = settings[0]->value; - ControlState square = settings[1]->value; + ControlState radius = settings[SETTING_RADIUS]->value; + ControlState deadzone = settings[SETTING_DEADZONE]->value; + ControlState square = settings[SETTING_SQUARE]->value; ControlState m = controls[4]->control_ref->State(); // modifier code @@ -138,11 +146,11 @@ public: } // deadzone / square stick code - if (deadzone || square) + if (radius != 1 || deadzone || square) { // this section might be all wrong, but its working good enough, I think - ControlState ang = atan2(yy, xx); + ControlState ang = atan2(yy, xx); ControlState ang_sin = sin(ang); ControlState ang_cos = cos(ang); @@ -163,6 +171,9 @@ public: ControlState amt = dist / stick_full; dist -= ((square_full - 1) * amt * square); + // radius + dist *= radius; + yy = std::max(-1.0f, std::min(1.0f, ang_sin * dist)); xx = std::max(-1.0f, std::min(1.0f, ang_cos * dist)); } -- cgit v1.2.3 From 8efdbcda9e70eba8f3d3208b580fd0c5d9a9cccb Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 11 Jun 2013 08:23:32 -0500 Subject: [Android] Fix drawn buttons causing rendering issues. --- Source/Core/InputCommon/Src/Android/ButtonManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Source/Core/InputCommon') diff --git a/Source/Core/InputCommon/Src/Android/ButtonManager.cpp b/Source/Core/InputCommon/Src/Android/ButtonManager.cpp index 947f7b0081..9ae996732d 100644 --- a/Source/Core/InputCommon/Src/Android/ButtonManager.cpp +++ b/Source/Core/InputCommon/Src/Android/ButtonManager.cpp @@ -37,9 +37,6 @@ namespace ButtonManager void Init() { - glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - // Initialize our buttons m_buttons.push_back(new Button("ButtonA.png", BUTTON_A, m_coords[0])); m_buttons.push_back(new Button("ButtonB.png", BUTTON_B, m_coords[1])); @@ -83,8 +80,13 @@ namespace ButtonManager void DrawButtons() { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + for(auto it = m_buttons.begin(); it != m_buttons.end(); ++it) DrawButton((*it)->GetTexture(), (*it)->GetCoords()); + + glDisable(GL_BLEND); } } -- cgit v1.2.3