mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Fix some double->float conversions.
This commit is contained in:
@ -128,7 +128,7 @@ void PadSettingSpin::UpdateGUI()
|
|||||||
|
|
||||||
void PadSettingSpin::UpdateValue()
|
void PadSettingSpin::UpdateValue()
|
||||||
{
|
{
|
||||||
setting->SetValue(float(((wxSpinCtrl*)wxcontrol)->GetValue()) / 100);
|
setting->SetValue(ControlState(((wxSpinCtrl*)wxcontrol)->GetValue()) / 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
ControlDialog::ControlDialog(GamepadPage* const parent, InputConfig& config, ControllerInterface::ControlReference* const ref)
|
ControlDialog::ControlDialog(GamepadPage* const parent, InputConfig& config, ControllerInterface::ControlReference* const ref)
|
||||||
@ -490,7 +490,7 @@ void GamepadPage::ClearControl(wxEvent& event)
|
|||||||
{
|
{
|
||||||
ControlButton* const btn = (ControlButton*)event.GetEventObject();
|
ControlButton* const btn = (ControlButton*)event.GetEventObject();
|
||||||
btn->control_reference->expression.clear();
|
btn->control_reference->expression.clear();
|
||||||
btn->control_reference->range = 1.0f;
|
btn->control_reference->range = 1.0;
|
||||||
|
|
||||||
std::lock_guard<std::recursive_mutex> lk(m_config.controls_lock);
|
std::lock_guard<std::recursive_mutex> lk(m_config.controls_lock);
|
||||||
controller->UpdateReferences(g_controller_interface);
|
controller->UpdateReferences(g_controller_interface);
|
||||||
|
@ -155,12 +155,12 @@ ControllerEmu::AnalogStick::AnalogStick(const char* const _name, ControlState de
|
|||||||
|
|
||||||
ControllerEmu::Buttons::Buttons(const std::string& _name) : ControlGroup(_name, GROUP_TYPE_BUTTONS)
|
ControllerEmu::Buttons::Buttons(const std::string& _name) : ControlGroup(_name, GROUP_TYPE_BUTTONS)
|
||||||
{
|
{
|
||||||
settings.emplace_back(new Setting(_trans("Threshold"), 0.5f));
|
settings.emplace_back(new Setting(_trans("Threshold"), 0.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
ControllerEmu::MixedTriggers::MixedTriggers(const std::string& _name) : ControlGroup(_name, GROUP_TYPE_MIXED_TRIGGERS)
|
ControllerEmu::MixedTriggers::MixedTriggers(const std::string& _name) : ControlGroup(_name, GROUP_TYPE_MIXED_TRIGGERS)
|
||||||
{
|
{
|
||||||
settings.emplace_back(new Setting(_trans("Threshold"), 0.9f));
|
settings.emplace_back(new Setting(_trans("Threshold"), 0.9));
|
||||||
}
|
}
|
||||||
|
|
||||||
ControllerEmu::Triggers::Triggers(const std::string& _name) : ControlGroup(_name, GROUP_TYPE_TRIGGERS)
|
ControllerEmu::Triggers::Triggers(const std::string& _name) : ControlGroup(_name, GROUP_TYPE_TRIGGERS)
|
||||||
@ -203,7 +203,7 @@ ControllerEmu::Tilt::Tilt(const std::string& _name) : ControlGroup(_name, GROUP_
|
|||||||
|
|
||||||
settings.emplace_back(new Setting(_trans("Dead Zone"), 0, 0, 50));
|
settings.emplace_back(new Setting(_trans("Dead Zone"), 0, 0, 50));
|
||||||
settings.emplace_back(new Setting(_trans("Circle Stick"), 0));
|
settings.emplace_back(new Setting(_trans("Circle Stick"), 0));
|
||||||
settings.emplace_back(new Setting(_trans("Angle"), 0.9f, 0, 180));
|
settings.emplace_back(new Setting(_trans("Angle"), 0.9, 0, 180));
|
||||||
}
|
}
|
||||||
|
|
||||||
ControllerEmu::Cursor::Cursor(const std::string& _name)
|
ControllerEmu::Cursor::Cursor(const std::string& _name)
|
||||||
@ -216,9 +216,9 @@ ControllerEmu::Cursor::Cursor(const std::string& _name)
|
|||||||
controls.emplace_back(new Input("Backward"));
|
controls.emplace_back(new Input("Backward"));
|
||||||
controls.emplace_back(new Input(_trans("Hide")));
|
controls.emplace_back(new Input(_trans("Hide")));
|
||||||
|
|
||||||
settings.emplace_back(new Setting(_trans("Center"), 0.5f));
|
settings.emplace_back(new Setting(_trans("Center"), 0.5));
|
||||||
settings.emplace_back(new Setting(_trans("Width"), 0.5f));
|
settings.emplace_back(new Setting(_trans("Width"), 0.5));
|
||||||
settings.emplace_back(new Setting(_trans("Height"), 0.5f));
|
settings.emplace_back(new Setting(_trans("Height"), 0.5));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ using namespace ciface::ExpressionParser;
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const float INPUT_DETECT_THRESHOLD = 0.55f;
|
const ControlState INPUT_DETECT_THRESHOLD = 0.55;
|
||||||
}
|
}
|
||||||
|
|
||||||
ControllerInterface g_controller_interface;
|
ControllerInterface g_controller_interface;
|
||||||
@ -194,7 +194,7 @@ ControlState ControllerInterface::InputReference::State( const ControlState igno
|
|||||||
if (parsed_expression)
|
if (parsed_expression)
|
||||||
return parsed_expression->GetValue() * range;
|
return parsed_expression->GetValue() * range;
|
||||||
else
|
else
|
||||||
return 0.0f;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -208,7 +208,7 @@ ControlState ControllerInterface::OutputReference::State(const ControlState stat
|
|||||||
{
|
{
|
||||||
if (parsed_expression)
|
if (parsed_expression)
|
||||||
parsed_expression->SetValue(state);
|
parsed_expression->SetValue(state);
|
||||||
return 0.0f;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -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)));
|
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 };
|
POINT point = { 1, 1 };
|
||||||
GetCursorPos(&point);
|
GetCursorPos(&point);
|
||||||
@ -151,8 +151,8 @@ void GetMousePos(float* const x, float* const y)
|
|||||||
unsigned int win_height = rect.bottom - rect.top;
|
unsigned int win_height = rect.bottom - rect.top;
|
||||||
|
|
||||||
// Return the mouse position as a range from -1 to 1
|
// Return the mouse position as a range from -1 to 1
|
||||||
*x = (float)point.x / (float)win_width * 2 - 1;
|
*x = (ControlState)point.x / (ControlState)win_width * 2 - 1;
|
||||||
*y = (float)point.y / (float)win_height * 2 - 1;
|
*y = (ControlState)point.y / (ControlState)win_height * 2 - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KeyboardMouse::UpdateInput()
|
bool KeyboardMouse::UpdateInput()
|
||||||
|
@ -25,7 +25,7 @@ private:
|
|||||||
DIMOUSESTATE2 mouse;
|
DIMOUSESTATE2 mouse;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
float x, y;
|
ControlState x, y;
|
||||||
} cursor;
|
} cursor;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -68,10 +68,10 @@ private:
|
|||||||
public:
|
public:
|
||||||
std::string GetName() const;
|
std::string GetName() const;
|
||||||
bool IsDetectable() { return false; }
|
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;
|
ControlState GetState() const;
|
||||||
private:
|
private:
|
||||||
const float& m_axis;
|
const ControlState& m_axis;
|
||||||
const u8 m_index;
|
const u8 m_index;
|
||||||
const bool m_positive;
|
const bool m_positive;
|
||||||
};
|
};
|
||||||
|
@ -317,7 +317,7 @@ public:
|
|||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case TOK_NOT:
|
case TOK_NOT:
|
||||||
return 1.0f - value;
|
return 1.0 - value;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
return 0;
|
return 0;
|
||||||
@ -329,7 +329,7 @@ public:
|
|||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case TOK_NOT:
|
case TOK_NOT:
|
||||||
inner->SetValue(1.0f - value);
|
inner->SetValue(1.0 - value);
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user