summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon
diff options
context:
space:
mode:
authorNeoBrainX <NeoBrainX@gmail.com>2013-06-17 12:05:47 +0200
committerNeoBrainX <NeoBrainX@gmail.com>2013-06-17 12:05:47 +0200
commitca22872daed7c384db350b2987b21ea92299a9e8 (patch)
tree21414cf12a5eb7a2b3cc4e0b1702aabf4c7c8890 /Source/Core/InputCommon
parentf0ea525d3b4dea15363674c822943ecf38da26b3 (diff)
parent43a4d418896f47ea971ccd83d5630a97f0f0000b (diff)
Merge 'master' into shader-uids-awesome.
Conflicts: Source/Core/VideoCommon/Src/LightingShaderGen.cpp Source/Core/VideoCommon/Src/PixelShaderGen.cpp Source/Core/VideoCommon/Src/PixelShaderGen.h Source/Core/VideoCommon/Src/VertexShaderGen.cpp
Diffstat (limited to 'Source/Core/InputCommon')
-rw-r--r--Source/Core/InputCommon/Src/Android/ButtonManager.cpp8
-rw-r--r--Source/Core/InputCommon/Src/ControllerEmu.cpp1
-rw-r--r--Source/Core/InputCommon/Src/ControllerEmu.h19
-rw-r--r--Source/Core/InputCommon/Src/InputConfig.cpp7
4 files changed, 25 insertions, 10 deletions
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);
}
}
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));
}
diff --git a/Source/Core/InputCommon/Src/InputConfig.cpp b/Source/Core/InputCommon/Src/InputConfig.cpp
index 65529b0a3f..96fc6205db 100644
--- a/Source/Core/InputCommon/Src/InputConfig.cpp
+++ b/Source/Core/InputCommon/Src/InputConfig.cpp
@@ -4,6 +4,7 @@
#include "InputConfig.h"
#include "../../Core/Src/ConfigManager.h"
+#include "../../Core/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")