Skip to content

Commit

Permalink
Move ir_max_x and ir_max_y back into the class
Browse files Browse the repository at this point in the history
  • Loading branch information
Pokechu22 committed Jul 28, 2019
1 parent 586eb76 commit 1f50ad2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions Source/Core/DolphinQt/TAS/IRWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class IRWidget : public QWidget
public:
explicit IRWidget(QWidget* parent);

static constexpr u16 ir_max_x = 1023;
static constexpr u16 ir_max_y = 767;

signals:
void ChangedX(u16 x);
void ChangedY(u16 y);
Expand All @@ -33,7 +36,3 @@ public slots:
u16 m_y = 0;
bool m_ignore_movement = false;
};

// Should be part of class but fails to compile on mac os
static const u16 ir_max_x = 1023;
static const u16 ir_max_y = 767;
12 changes: 6 additions & 6 deletions Source/Core/DolphinQt/TAS/WiiTASInputWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ WiiTASInputWindow::WiiTASInputWindow(QWidget* parent, int num) : TASInputWindow(
ir_y_shortcut_key_sequence.toString(QKeySequence::NativeText)));

auto* x_layout = new QHBoxLayout;
m_ir_x_value = CreateSliderValuePair(x_layout, ir_max_x, ir_x_shortcut_key_sequence,
m_ir_x_value = CreateSliderValuePair(x_layout, IRWidget::ir_max_x, ir_x_shortcut_key_sequence,
Qt::Horizontal, m_ir_box, true);

auto* y_layout = new QVBoxLayout;
m_ir_y_value = CreateSliderValuePair(y_layout, ir_max_y, ir_y_shortcut_key_sequence, Qt::Vertical,
m_ir_box, true);
m_ir_y_value = CreateSliderValuePair(y_layout, IRWidget::ir_max_y, ir_y_shortcut_key_sequence,
Qt::Vertical, m_ir_box, true);
m_ir_y_value->setMaximumWidth(60);

auto* visual = new IRWidget(this);
Expand All @@ -66,10 +66,10 @@ WiiTASInputWindow::WiiTASInputWindow(QWidget* parent, int num) : TASInputWindow(
connect(visual, &IRWidget::ChangedX, m_ir_x_value, &QSpinBox::setValue);
connect(visual, &IRWidget::ChangedY, m_ir_y_value, &QSpinBox::setValue);

m_ir_x_value->setValue(static_cast<int>(std::round(ir_max_x / 2.)));
m_ir_y_value->setValue(static_cast<int>(std::round(ir_max_y / 2.)));
m_ir_x_value->setValue(static_cast<int>(std::round(IRWidget::ir_max_x / 2.)));
m_ir_y_value->setValue(static_cast<int>(std::round(IRWidget::ir_max_y / 2.)));

auto* visual_ar = new AspectRatioWidget(visual, ir_max_x, ir_max_y);
auto* visual_ar = new AspectRatioWidget(visual, IRWidget::ir_max_x, IRWidget::ir_max_y);

auto* visual_layout = new QHBoxLayout;
visual_layout->addWidget(visual_ar);
Expand Down

0 comments on commit 1f50ad2

Please sign in to comment.