diff options
| author | JMC47 <JMC4789@gmail.com> | 2019-04-26 05:50:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-26 05:50:18 -0400 |
| commit | 664376dae15ef187df4e4c8c7c5e241b9a68fb5d (patch) | |
| tree | 0bbfa4617934f632156996a90922e232be1e7651 /Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp | |
| parent | 057fa6c092fb10abb90a0f038d90c97a00731a59 (diff) | |
| parent | ba1b3351184864ed3d5692a461b00edd2f3a21f6 (diff) | |
Merge pull request #7861 from jordan-woyak/mplus-emu
WiimoteEmu: Emulated MotionPlus and improved emulated swing.
Diffstat (limited to 'Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp index ca6bab91ba..2cd768feea 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp @@ -217,7 +217,7 @@ void MappingIndicator::DrawCursor(ControllerEmu::Cursor& cursor) QRectF(-scale, raw_coord.z * scale - INPUT_DOT_RADIUS / 2, scale * 2, INPUT_DOT_RADIUS)); // Adjusted Z (if not hidden): - if (adj_coord.z && adj_coord.x < 10000) + if (adj_coord.IsVisible()) { p.setBrush(GetAdjustedInputColor()); p.drawRect( @@ -250,7 +250,7 @@ void MappingIndicator::DrawCursor(ControllerEmu::Cursor& cursor) p.drawEllipse(QPointF{raw_coord.x, raw_coord.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS); // Adjusted cursor position (if not hidden): - if (adj_coord.x < 10000) + if (adj_coord.IsVisible()) { p.setPen(Qt::NoPen); p.setBrush(GetAdjustedInputColor()); @@ -492,11 +492,19 @@ void MappingIndicator::DrawForce(ControllerEmu::Force& force) QRectF(-scale, raw_coord.z * scale - INPUT_DOT_RADIUS / 2, scale * 2, INPUT_DOT_RADIUS)); // Adjusted Z: - if (adj_coord.y) + const auto curve_point = + std::max(std::abs(m_motion_state.angle.x), std::abs(m_motion_state.angle.z)) / MathUtil::TAU; + if (adj_coord.y || curve_point) { - p.setBrush(GetAdjustedInputColor()); - p.drawRect( - QRectF(-scale, adj_coord.y * -scale - INPUT_DOT_RADIUS / 2, scale * 2, INPUT_DOT_RADIUS)); + // Show off the angle somewhat with a curved line. + QPainterPath path; + path.moveTo(-scale, (adj_coord.y + curve_point) * -scale); + path.quadTo({0, (adj_coord.y - curve_point) * -scale}, + {scale, (adj_coord.y + curve_point) * -scale}); + + p.setBrush(Qt::NoBrush); + p.setPen(QPen(GetAdjustedInputColor(), INPUT_DOT_RADIUS)); + p.drawPath(path); } // Draw "gate" shape. |
