mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-11 07:56:15 +01:00
Wiimotes: Actually we have two constants MAX_WIIMOTES and MAX_WIIMOTE_IR_POINTS
This commit is contained in:
parent
02fb9b5cef
commit
f9e8fd535f
|
|
@ -181,7 +181,7 @@ bool wiimote_device::update()
|
|||
m_state.acc_z = (buf[5] << 2) | ((buf[2] >> 6) & 1);
|
||||
|
||||
// Each IR point is 3 bytes in Extended report 0x33.
|
||||
for (usz j = 0; j < MAX_WIIMOTES; j++)
|
||||
for (usz j = 0; j < MAX_WIIMOTE_IR_POINTS; j++)
|
||||
{
|
||||
const u8* ir = &buf[6 + j * 3];
|
||||
m_state.ir[j].x = (ir[0] | ((ir[2] & 0x30) << 4));
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include <array>
|
||||
|
||||
static constexpr usz MAX_WIIMOTES = 4;
|
||||
static constexpr usz MAX_WIIMOTE_IR_POINTS = 4;
|
||||
|
||||
struct wiimote_ir_point
|
||||
{
|
||||
|
|
@ -60,7 +61,7 @@ struct wiimote_state
|
|||
s16 acc_x = 0;
|
||||
s16 acc_y = 0;
|
||||
s16 acc_z = 0;
|
||||
std::array<wiimote_ir_point, MAX_WIIMOTES> ir {};
|
||||
std::array<wiimote_ir_point, MAX_WIIMOTE_IR_POINTS> ir {};
|
||||
bool connected = false;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ void wiimote_settings_dialog::update_state()
|
|||
painter.drawLine(pixmap.width() / 2, 0, pixmap.width() / 2, pixmap.height());
|
||||
painter.drawLine(0, pixmap.height() / 2, pixmap.width(), pixmap.height() / 2);
|
||||
|
||||
static const std::array<QColor, MAX_WIIMOTES> colors = { Qt::red, Qt::green, Qt::blue, Qt::yellow };
|
||||
static const std::array<QColor, MAX_WIIMOTE_IR_POINTS> colors = { Qt::red, Qt::green, Qt::blue, Qt::yellow };
|
||||
|
||||
for (usz i = 0; i < state.ir.size(); ++i)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue