summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
authorRachel Bryk <RachelBryk@gmail.com>2014-11-09 15:02:18 -0500
committerRachel Bryk <RachelBryk@gmail.com>2014-11-11 14:14:22 -0500
commite9cb629723bb0fabbad130c2a63b3cdbaaf8ba6a (patch)
treee63ba5755800e9ab82a6314ba8e9f368cbd23a67 /Source/Core/InputCommon/ControllerInterface
parent71d8165a8649cde73663b1534bbdd6094faecf2d (diff)
Fix some double->float conversions.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp6
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp6
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h6
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp4
4 files changed, 11 insertions, 11 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
index ec2973f3d3..e75df76a36 100644
--- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
@@ -31,7 +31,7 @@ using namespace ciface::ExpressionParser;
namespace
{
-const float INPUT_DETECT_THRESHOLD = 0.55f;
+const ControlState INPUT_DETECT_THRESHOLD = 0.55;
}
ControllerInterface g_controller_interface;
@@ -194,7 +194,7 @@ ControlState ControllerInterface::InputReference::State( const ControlState igno
if (parsed_expression)
return parsed_expression->GetValue() * range;
else
- return 0.0f;
+ return 0.0;
}
//
@@ -208,7 +208,7 @@ ControlState ControllerInterface::OutputReference::State(const ControlState stat
{
if (parsed_expression)
parsed_expression->SetValue(state);
- return 0.0f;
+ return 0.0;
}
//
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
index d9728dcbac..05f28c79ae 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
@@ -136,7 +136,7 @@ KeyboardMouse::KeyboardMouse(const LPDIRECTINPUTDEVICE8 kb_device, const LPDIREC
AddInput(new Cursor(!!(i&2), (&m_state_in.cursor.x)[i/2], !!(i&1)));
}
-void GetMousePos(float* const x, float* const y)
+void GetMousePos(ControlState* const x, ControlState* const y)
{
POINT point = { 1, 1 };
GetCursorPos(&point);
@@ -151,8 +151,8 @@ void GetMousePos(float* const x, float* const y)
unsigned int win_height = rect.bottom - rect.top;
// Return the mouse position as a range from -1 to 1
- *x = (float)point.x / (float)win_width * 2 - 1;
- *y = (float)point.y / (float)win_height * 2 - 1;
+ *x = (ControlState)point.x / (ControlState)win_width * 2 - 1;
+ *y = (ControlState)point.y / (ControlState)win_height * 2 - 1;
}
bool KeyboardMouse::UpdateInput()
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
index 8f7ac67452..f4ad99db2d 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
@@ -25,7 +25,7 @@ private:
DIMOUSESTATE2 mouse;
struct
{
- float x, y;
+ ControlState x, y;
} cursor;
};
@@ -68,10 +68,10 @@ private:
public:
std::string GetName() const;
bool IsDetectable() { return false; }
- Cursor(u8 index, const float& axis, const bool positive) : m_index(index), m_axis(axis), m_positive(positive) {}
+ Cursor(u8 index, const ControlState& axis, const bool positive) : m_index(index), m_axis(axis), m_positive(positive) {}
ControlState GetState() const;
private:
- const float& m_axis;
+ const ControlState& m_axis;
const u8 m_index;
const bool m_positive;
};
diff --git a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
index e93b22826d..8c9060e69c 100644
--- a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
@@ -317,7 +317,7 @@ public:
switch (op)
{
case TOK_NOT:
- return 1.0f - value;
+ return 1.0 - value;
default:
assert(false);
return 0;
@@ -329,7 +329,7 @@ public:
switch (op)
{
case TOK_NOT:
- inner->SetValue(1.0f - value);
+ inner->SetValue(1.0 - value);
default:
assert(false);
}