mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-01 22:13:03 +02:00
Update to v077r04 release.
byuu says: Changelog: - setGeometry is called after append(layout) now. This fixes the window sizing on Qt. - removed enum Style {} code, as it's no longer necessary. - removed Filter, Shader path selection code from the file load dialog, since that is menu-driven now. - improved the file load dialog to remember last selected file when mode doesn't change (had to split a switch statement into two switches.) - added Hotkeys port onto input settings window, allowing one to dynamically see and remap GUI shortcuts - added power cycle / reset shortcuts Still very minimal with the hotkeys, so I packed them all into one group for now. A few more I'd like to add, but I don't want to get ridiculous like with the Qt GUI.
This commit is contained in:
@@ -102,6 +102,10 @@ Widget::Widget(pWidget &p) : state(*new State), p(p) { p.constructor(); }
|
|||||||
void Button::setText(const string &text) { state.text = text; return p.setText(text); }
|
void Button::setText(const string &text) { state.text = text; return p.setText(text); }
|
||||||
Button::Button() : state(*new State), base_from_member<pButton&>(*new pButton(*this)), Widget(base_from_member<pButton&>::value), p(base_from_member<pButton&>::value) { p.constructor(); }
|
Button::Button() : state(*new State), base_from_member<pButton&>(*new pButton(*this)), Widget(base_from_member<pButton&>::value), p(base_from_member<pButton&>::value) { p.constructor(); }
|
||||||
|
|
||||||
|
uint32_t* Canvas::buffer() { return p.buffer(); }
|
||||||
|
void Canvas::update() { return p.update(); }
|
||||||
|
Canvas::Canvas() : base_from_member<pCanvas&>(*new pCanvas(*this)), Widget(base_from_member<pCanvas&>::value), p(base_from_member<pCanvas&>::value) { p.constructor(); }
|
||||||
|
|
||||||
bool CheckBox::checked() { return p.checked(); }
|
bool CheckBox::checked() { return p.checked(); }
|
||||||
void CheckBox::setChecked(bool checked) { state.checked = checked; return p.setChecked(checked); }
|
void CheckBox::setChecked(bool checked) { state.checked = checked; return p.setChecked(checked); }
|
||||||
void CheckBox::setText(const string &text) { state.text = text; return p.setText(text); }
|
void CheckBox::setText(const string &text) { state.text = text; return p.setText(text); }
|
||||||
|
@@ -16,6 +16,7 @@ struct pRadioItem;
|
|||||||
struct pLayout;
|
struct pLayout;
|
||||||
struct pWidget;
|
struct pWidget;
|
||||||
struct pButton;
|
struct pButton;
|
||||||
|
struct pCanvas;
|
||||||
struct pCheckBox;
|
struct pCheckBox;
|
||||||
struct pComboBox;
|
struct pComboBox;
|
||||||
struct pHexEdit;
|
struct pHexEdit;
|
||||||
@@ -235,6 +236,14 @@ struct Button : private nall::base_from_member<pButton&>, Widget {
|
|||||||
pButton &p;
|
pButton &p;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Canvas : private nall::base_from_member<pCanvas&>, Widget {
|
||||||
|
uint32_t* buffer();
|
||||||
|
void update();
|
||||||
|
|
||||||
|
Canvas();
|
||||||
|
pCanvas &p;
|
||||||
|
};
|
||||||
|
|
||||||
struct CheckBox : private nall::base_from_member<pCheckBox&>, Widget {
|
struct CheckBox : private nall::base_from_member<pCheckBox&>, Widget {
|
||||||
nall::function<void ()> onTick;
|
nall::function<void ()> onTick;
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "widget/widget.cpp"
|
#include "widget/widget.cpp"
|
||||||
#include "widget/button.cpp"
|
#include "widget/button.cpp"
|
||||||
|
#include "widget/canvas.cpp"
|
||||||
#include "widget/check-box.cpp"
|
#include "widget/check-box.cpp"
|
||||||
#include "widget/combo-box.cpp"
|
#include "widget/combo-box.cpp"
|
||||||
#include "widget/hex-edit.cpp"
|
#include "widget/hex-edit.cpp"
|
||||||
|
@@ -173,7 +173,7 @@ struct pWidget : public pObject {
|
|||||||
void setEnabled(bool enabled);
|
void setEnabled(bool enabled);
|
||||||
virtual void setFocused();
|
virtual void setFocused();
|
||||||
virtual void setFont(Font &font);
|
virtual void setFont(Font &font);
|
||||||
void setGeometry(const Geometry &geometry);
|
virtual void setGeometry(const Geometry &geometry);
|
||||||
void setVisible(bool visible);
|
void setVisible(bool visible);
|
||||||
|
|
||||||
pWidget(Widget &widget) : widget(widget) {}
|
pWidget(Widget &widget) : widget(widget) {}
|
||||||
@@ -190,6 +190,20 @@ struct pButton : public pWidget {
|
|||||||
void constructor();
|
void constructor();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct pCanvas : public pWidget {
|
||||||
|
Canvas &canvas;
|
||||||
|
uint32_t *bufferRGB;
|
||||||
|
uint32_t *bufferBGR;
|
||||||
|
|
||||||
|
uint32_t* buffer();
|
||||||
|
void setGeometry(const Geometry &geometry);
|
||||||
|
void update();
|
||||||
|
|
||||||
|
pCanvas(Canvas &canvas) : pWidget(canvas), canvas(canvas) {}
|
||||||
|
void constructor();
|
||||||
|
void redraw();
|
||||||
|
};
|
||||||
|
|
||||||
struct pCheckBox : public pWidget {
|
struct pCheckBox : public pWidget {
|
||||||
CheckBox &checkBox;
|
CheckBox &checkBox;
|
||||||
|
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "widget/widget.cpp"
|
#include "widget/widget.cpp"
|
||||||
#include "widget/button.cpp"
|
#include "widget/button.cpp"
|
||||||
|
#include "widget/canvas.cpp"
|
||||||
#include "widget/check-box.cpp"
|
#include "widget/check-box.cpp"
|
||||||
#include "widget/combo-box.cpp"
|
#include "widget/combo-box.cpp"
|
||||||
#include "widget/hex-edit.cpp"
|
#include "widget/hex-edit.cpp"
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Meta object code from reading C++ file 'qt.moc.hpp'
|
** Meta object code from reading C++ file 'qt.moc.hpp'
|
||||||
**
|
**
|
||||||
** Created: Wed Mar 23 03:03:27 2011
|
** Created: Wed Mar 23 16:17:23 2011
|
||||||
** by: The Qt Meta Object Compiler version 62 (Qt 4.7.0)
|
** by: The Qt Meta Object Compiler version 62 (Qt 4.7.0)
|
||||||
**
|
**
|
||||||
** WARNING! All changes made in this file will be lost!
|
** WARNING! All changes made in this file will be lost!
|
||||||
@@ -311,6 +311,57 @@ int pButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
|||||||
}
|
}
|
||||||
return _id;
|
return _id;
|
||||||
}
|
}
|
||||||
|
static const uint qt_meta_data_pCanvas[] = {
|
||||||
|
|
||||||
|
// content:
|
||||||
|
5, // revision
|
||||||
|
0, // classname
|
||||||
|
0, 0, // classinfo
|
||||||
|
0, 0, // methods
|
||||||
|
0, 0, // properties
|
||||||
|
0, 0, // enums/sets
|
||||||
|
0, 0, // constructors
|
||||||
|
0, // flags
|
||||||
|
0, // signalCount
|
||||||
|
|
||||||
|
0 // eod
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char qt_meta_stringdata_pCanvas[] = {
|
||||||
|
"pCanvas\0"
|
||||||
|
};
|
||||||
|
|
||||||
|
const QMetaObject pCanvas::staticMetaObject = {
|
||||||
|
{ &QObject::staticMetaObject, qt_meta_stringdata_pCanvas,
|
||||||
|
qt_meta_data_pCanvas, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef Q_NO_DATA_RELOCATION
|
||||||
|
const QMetaObject &pCanvas::getStaticMetaObject() { return staticMetaObject; }
|
||||||
|
#endif //Q_NO_DATA_RELOCATION
|
||||||
|
|
||||||
|
const QMetaObject *pCanvas::metaObject() const
|
||||||
|
{
|
||||||
|
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *pCanvas::qt_metacast(const char *_clname)
|
||||||
|
{
|
||||||
|
if (!_clname) return 0;
|
||||||
|
if (!strcmp(_clname, qt_meta_stringdata_pCanvas))
|
||||||
|
return static_cast<void*>(const_cast< pCanvas*>(this));
|
||||||
|
if (!strcmp(_clname, "pWidget"))
|
||||||
|
return static_cast< pWidget*>(const_cast< pCanvas*>(this));
|
||||||
|
return QObject::qt_metacast(_clname);
|
||||||
|
}
|
||||||
|
|
||||||
|
int pCanvas::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||||
|
{
|
||||||
|
_id = QObject::qt_metacall(_c, _id, _a);
|
||||||
|
if (_id < 0)
|
||||||
|
return _id;
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
static const uint qt_meta_data_pCheckBox[] = {
|
static const uint qt_meta_data_pCheckBox[] = {
|
||||||
|
|
||||||
// content:
|
// content:
|
||||||
|
@@ -200,7 +200,7 @@ struct pWidget : public pObject {
|
|||||||
void setEnabled(bool enabled);
|
void setEnabled(bool enabled);
|
||||||
void setFocused();
|
void setFocused();
|
||||||
void setFont(Font &font);
|
void setFont(Font &font);
|
||||||
void setGeometry(const Geometry &geometry);
|
virtual void setGeometry(const Geometry &geometry);
|
||||||
void setVisible(bool visible);
|
void setVisible(bool visible);
|
||||||
|
|
||||||
pWidget(Widget &widget) : widget(widget) {}
|
pWidget(Widget &widget) : widget(widget) {}
|
||||||
@@ -224,6 +224,28 @@ public slots:
|
|||||||
void onTick();
|
void onTick();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct pCanvas : public QObject, public pWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
Canvas &canvas;
|
||||||
|
QImage *qtImage;
|
||||||
|
struct QtCanvas : public QWidget {
|
||||||
|
pCanvas &self;
|
||||||
|
void paintEvent(QPaintEvent*);
|
||||||
|
QtCanvas(pCanvas &self);
|
||||||
|
} *qtCanvas;
|
||||||
|
|
||||||
|
uint32_t* buffer();
|
||||||
|
void setGeometry(const Geometry &geometry);
|
||||||
|
void update();
|
||||||
|
|
||||||
|
pCanvas(Canvas &canvas) : pWidget(canvas), canvas(canvas) {}
|
||||||
|
void constructor();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
};
|
||||||
|
|
||||||
struct pCheckBox : public QObject, public pWidget {
|
struct pCheckBox : public QObject, public pWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "widget/widget.cpp"
|
#include "widget/widget.cpp"
|
||||||
#include "widget/button.cpp"
|
#include "widget/button.cpp"
|
||||||
|
#include "widget/canvas.cpp"
|
||||||
#include "widget/check-box.cpp"
|
#include "widget/check-box.cpp"
|
||||||
#include "widget/combo-box.cpp"
|
#include "widget/combo-box.cpp"
|
||||||
#include "widget/hex-edit.cpp"
|
#include "widget/hex-edit.cpp"
|
||||||
@@ -183,6 +184,18 @@ void pOS::initialize() {
|
|||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
RegisterClass(&wc);
|
RegisterClass(&wc);
|
||||||
|
|
||||||
|
wc.cbClsExtra = 0;
|
||||||
|
wc.cbWndExtra = 0;
|
||||||
|
wc.hbrBackground = CreateSolidBrush(RGB(0, 0, 0));
|
||||||
|
wc.hCursor = LoadCursor(0, IDC_ARROW);
|
||||||
|
wc.hIcon = LoadIcon(0, IDI_APPLICATION);
|
||||||
|
wc.hInstance = GetModuleHandle(0);
|
||||||
|
wc.lpfnWndProc = Canvas_windowProc;
|
||||||
|
wc.lpszClassName = L"phoenix_canvas";
|
||||||
|
wc.lpszMenuName = 0;
|
||||||
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
|
RegisterClass(&wc);
|
||||||
|
|
||||||
wc.cbClsExtra = 0;
|
wc.cbClsExtra = 0;
|
||||||
wc.cbWndExtra = 0;
|
wc.cbWndExtra = 0;
|
||||||
wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
|
wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
|
||||||
|
@@ -182,6 +182,19 @@ struct pButton : public pWidget {
|
|||||||
void setParent(Window &parent);
|
void setParent(Window &parent);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct pCanvas : public pWidget {
|
||||||
|
Canvas &canvas;
|
||||||
|
uint32_t *bufferRGB;
|
||||||
|
|
||||||
|
uint32_t* buffer();
|
||||||
|
void setGeometry(const Geometry &geometry);
|
||||||
|
void update();
|
||||||
|
|
||||||
|
pCanvas(Canvas &canvas) : pWidget(canvas), canvas(canvas) {}
|
||||||
|
void constructor();
|
||||||
|
void setParent(Window &parent);
|
||||||
|
};
|
||||||
|
|
||||||
struct pCheckBox : public pWidget {
|
struct pCheckBox : public pWidget {
|
||||||
CheckBox &checkBox;
|
CheckBox &checkBox;
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
namespace SNES {
|
namespace SNES {
|
||||||
namespace Info {
|
namespace Info {
|
||||||
static const char Name[] = "bsnes";
|
static const char Name[] = "bsnes";
|
||||||
static const char Version[] = "077.03";
|
static const char Version[] = "077.04";
|
||||||
static const unsigned SerializerVersion = 19;
|
static const unsigned SerializerVersion = 19;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -55,23 +55,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern Application application;
|
extern Application application;
|
||||||
|
|
||||||
struct Style {
|
|
||||||
enum : unsigned {
|
|
||||||
#if defined(PLATFORM_WIN)
|
|
||||||
ButtonHeight = 25,
|
|
||||||
CheckBoxHeight = 15,
|
|
||||||
ComboBoxHeight = 22,
|
|
||||||
LabelHeight = 15,
|
|
||||||
SliderHeight = 25,
|
|
||||||
LineEditHeight = 22,
|
|
||||||
#else
|
|
||||||
ButtonHeight = 25,
|
|
||||||
CheckBoxHeight = 15,
|
|
||||||
ComboBoxHeight = 22,
|
|
||||||
LabelHeight = 15,
|
|
||||||
SliderHeight = 22,
|
|
||||||
LineEditHeight = 22,
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
@@ -23,9 +23,8 @@ void Console::create() {
|
|||||||
controlLayout.append(spacer, 120, ~0 );
|
controlLayout.append(spacer, 120, ~0 );
|
||||||
controlLayout.append(clearConsole, 120, 0 );
|
controlLayout.append(clearConsole, 120, 0 );
|
||||||
layout.append(controlLayout );
|
layout.append(controlLayout );
|
||||||
|
|
||||||
setGeometry({ 0, 0, layout.minimumGeometry().width + 585, 350 });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, layout.minimumGeometry().width + 585, 350 });
|
||||||
|
|
||||||
onClose = []() {
|
onClose = []() {
|
||||||
debugger.showConsole.setChecked(false);
|
debugger.showConsole.setChecked(false);
|
||||||
|
@@ -18,9 +18,8 @@ void CPUDebugger::create() {
|
|||||||
controlLayout.append(proceed, 80, 0 );
|
controlLayout.append(proceed, 80, 0 );
|
||||||
controlLayout.append(spacer, 80, ~0 );
|
controlLayout.append(spacer, 80, ~0 );
|
||||||
layout.append(controlLayout );
|
layout.append(controlLayout );
|
||||||
|
|
||||||
setGeometry({ 0, 0, layout.minimumGeometry().width + 300, 220 });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, layout.minimumGeometry().width + 300, 220 });
|
||||||
|
|
||||||
onClose = []() {
|
onClose = []() {
|
||||||
debugger.showCPUDebugger.setChecked(false);
|
debugger.showCPUDebugger.setChecked(false);
|
||||||
|
@@ -35,9 +35,8 @@ void Debugger::create() {
|
|||||||
layout.append(showSMPDebugger, ~0, 0);
|
layout.append(showSMPDebugger, ~0, 0);
|
||||||
layout.append(showBreakpointEditor, ~0, 0);
|
layout.append(showBreakpointEditor, ~0, 0);
|
||||||
layout.append(showMemoryEditor, ~0, 0);
|
layout.append(showMemoryEditor, ~0, 0);
|
||||||
|
|
||||||
setGeometry({ 0, 0, layout.minimumGeometry().width, layout.minimumGeometry().height });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, layout.minimumGeometry().width, layout.minimumGeometry().height });
|
||||||
|
|
||||||
//windows shown by default
|
//windows shown by default
|
||||||
showConsole.setChecked();
|
showConsole.setChecked();
|
||||||
|
@@ -18,9 +18,8 @@ void SMPDebugger::create() {
|
|||||||
controlLayout.append(proceed, 80, 0 );
|
controlLayout.append(proceed, 80, 0 );
|
||||||
controlLayout.append(spacer, 80, ~0 );
|
controlLayout.append(spacer, 80, ~0 );
|
||||||
layout.append(controlLayout );
|
layout.append(controlLayout );
|
||||||
|
|
||||||
setGeometry({ 0, 0, layout.minimumGeometry().width + 300, 220 });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, layout.minimumGeometry().width + 300, 220 });
|
||||||
|
|
||||||
onClose = []() {
|
onClose = []() {
|
||||||
debugger.showSMPDebugger.setChecked(false);
|
debugger.showSMPDebugger.setChecked(false);
|
||||||
|
@@ -26,11 +26,11 @@ void BreakpointEditor::create() {
|
|||||||
breakpointLayout[n].append(valueBox[n], 30, 0, 5);
|
breakpointLayout[n].append(valueBox[n], 30, 0, 5);
|
||||||
breakpointLayout[n].append(typeBox[n], 0, 0, 5);
|
breakpointLayout[n].append(typeBox[n], 0, 0, 5);
|
||||||
breakpointLayout[n].append(sourceBox[n], 0, 0 );
|
breakpointLayout[n].append(sourceBox[n], 0, 0 );
|
||||||
layout.append(breakpointLayout[n], 5);
|
layout.append(breakpointLayout[n], n < Breakpoints - 1 ? 5 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
setGeometry({ 0, 0, layout.minimumGeometry().width, layout.minimumGeometry().height });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, layout.minimumGeometry().width, layout.minimumGeometry().height });
|
||||||
|
|
||||||
onClose = []() {
|
onClose = []() {
|
||||||
debugger.showBreakpointEditor.setChecked(false);
|
debugger.showBreakpointEditor.setChecked(false);
|
||||||
|
@@ -21,9 +21,8 @@ void MemoryEditor::create() {
|
|||||||
controlLayout.append(refreshButton, 80, 0 );
|
controlLayout.append(refreshButton, 80, 0 );
|
||||||
controlLayout.append(spacer, 80, ~0 );
|
controlLayout.append(spacer, 80, ~0 );
|
||||||
layout.append(controlLayout );
|
layout.append(controlLayout );
|
||||||
|
|
||||||
setGeometry({ 0, 0, layout.minimumGeometry().width + 475, 230 });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, layout.minimumGeometry().width + 475, 230 });
|
||||||
|
|
||||||
onClose = []() {
|
onClose = []() {
|
||||||
debugger.showMemoryEditor.setChecked(false);
|
debugger.showMemoryEditor.setChecked(false);
|
||||||
|
@@ -12,9 +12,8 @@ void FileBrowser::create() {
|
|||||||
pathLayout.append(upButton, 25, 25 );
|
pathLayout.append(upButton, 25, 25 );
|
||||||
layout.append(pathLayout, 5);
|
layout.append(pathLayout, 5);
|
||||||
layout.append(contentsBox, ~0, ~0 );
|
layout.append(contentsBox, ~0, ~0 );
|
||||||
|
|
||||||
setGeometry({ 0, 0, 640, layout.minimumGeometry().height + 400 });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, 640, layout.minimumGeometry().height + 400 });
|
||||||
|
|
||||||
pathBox.onActivate = []() {
|
pathBox.onActivate = []() {
|
||||||
string path = fileBrowser.pathBox.text();
|
string path = fileBrowser.pathBox.text();
|
||||||
@@ -31,11 +30,20 @@ void FileBrowser::create() {
|
|||||||
void FileBrowser::fileOpen(FileBrowser::Mode requestedMode, function<void (string)> requestedCallback) {
|
void FileBrowser::fileOpen(FileBrowser::Mode requestedMode, function<void (string)> requestedCallback) {
|
||||||
callback = requestedCallback;
|
callback = requestedCallback;
|
||||||
|
|
||||||
//if(mode == requestedMode && folder == config.path.current) {
|
switch(requestedMode) {
|
||||||
// setVisible();
|
case Mode::Cartridge: folderPath = "sfc"; break;
|
||||||
// contentsBox.setFocused();
|
case Mode::Satellaview: folderPath = "bs"; break;
|
||||||
// return;
|
case Mode::SufamiTurbo: folderPath = "st"; break;
|
||||||
//}
|
case Mode::GameBoy: folderPath = "gb"; break;
|
||||||
|
}
|
||||||
|
string activePath = path.load(folderPath);
|
||||||
|
|
||||||
|
//if path has not changed, do not reload list; this will preserve previously selected file
|
||||||
|
if(mode == requestedMode && folder == activePath) {
|
||||||
|
setVisible();
|
||||||
|
contentsBox.setFocused();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
filters.reset();
|
filters.reset();
|
||||||
@@ -43,45 +51,32 @@ void FileBrowser::fileOpen(FileBrowser::Mode requestedMode, function<void (strin
|
|||||||
switch(mode = requestedMode) {
|
switch(mode = requestedMode) {
|
||||||
case Mode::Cartridge: {
|
case Mode::Cartridge: {
|
||||||
setTitle("Load Cartridge");
|
setTitle("Load Cartridge");
|
||||||
folderPath = "sfc";
|
|
||||||
filters.append(".sfc");
|
filters.append(".sfc");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Mode::Satellaview: {
|
case Mode::Satellaview: {
|
||||||
setTitle("Load Satellaview Cartridge");
|
setTitle("Load Satellaview Cartridge");
|
||||||
folderPath = "bs";
|
|
||||||
filters.append(".bs");
|
filters.append(".bs");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Mode::SufamiTurbo: {
|
case Mode::SufamiTurbo: {
|
||||||
setTitle("Load Sufami Turbo Cartridge");
|
setTitle("Load Sufami Turbo Cartridge");
|
||||||
folderPath = "st";
|
|
||||||
filters.append(".st");
|
filters.append(".st");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Mode::GameBoy: {
|
case Mode::GameBoy: {
|
||||||
setTitle("Load Game Boy Cartridge");
|
setTitle("Load Game Boy Cartridge");
|
||||||
folderPath = "gb";
|
|
||||||
filters.append(".gb");
|
filters.append(".gb");
|
||||||
filters.append(".gbc");
|
filters.append(".gbc");
|
||||||
filters.append(".sgb");
|
filters.append(".sgb");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Mode::Filter: {
|
|
||||||
setTitle("Load Video Filter");
|
|
||||||
folderPath = "filter";
|
|
||||||
filters.append(".filter");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Mode::Shader: {
|
|
||||||
setTitle("Load Pixel Shader");
|
|
||||||
folderPath = "shader";
|
|
||||||
filters.append(".shader");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setFolder(path.load(folderPath));
|
setFolder(activePath);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
contentsBox.setFocused();
|
contentsBox.setFocused();
|
||||||
}
|
}
|
||||||
@@ -94,6 +89,7 @@ void FileBrowser::setFolder(const string &pathname) {
|
|||||||
folder.transform("\\", "/");
|
folder.transform("\\", "/");
|
||||||
pathBox.setText(folder);
|
pathBox.setText(folder);
|
||||||
lstring contentsList = directory::contents(folder);
|
lstring contentsList = directory::contents(folder);
|
||||||
|
|
||||||
foreach(item, contentsList) {
|
foreach(item, contentsList) {
|
||||||
if(strend(item, "/")) {
|
if(strend(item, "/")) {
|
||||||
contents.append(item);
|
contents.append(item);
|
||||||
@@ -104,6 +100,7 @@ void FileBrowser::setFolder(const string &pathname) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(item, contents) contentsBox.append(item);
|
foreach(item, contents) contentsBox.append(item);
|
||||||
contentsBox.setSelection(0);
|
contentsBox.setSelection(0);
|
||||||
contentsBox.setFocused();
|
contentsBox.setFocused();
|
||||||
|
@@ -6,7 +6,7 @@ struct FileBrowser : TopLevelWindow {
|
|||||||
Button upButton;
|
Button upButton;
|
||||||
ListView contentsBox;
|
ListView contentsBox;
|
||||||
|
|
||||||
enum class Mode : unsigned { Cartridge, Satellaview, SufamiTurbo, GameBoy, Filter, Shader } mode;
|
enum class Mode : unsigned { Cartridge, Satellaview, SufamiTurbo, GameBoy } mode;
|
||||||
void fileOpen(Mode mode, function<void (string)> callback);
|
void fileOpen(Mode mode, function<void (string)> callback);
|
||||||
void create();
|
void create();
|
||||||
|
|
||||||
|
@@ -22,9 +22,8 @@ void SingleSlotLoader::create() {
|
|||||||
controlLayout.append(spacer, ~0, 0 );
|
controlLayout.append(spacer, ~0, 0 );
|
||||||
controlLayout.append(okButton, 80, 0 );
|
controlLayout.append(okButton, 80, 0 );
|
||||||
layout.append(controlLayout);
|
layout.append(controlLayout);
|
||||||
|
|
||||||
setGeometry({ 0, 0, 480, layout.minimumGeometry().height });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, 480, layout.minimumGeometry().height });
|
||||||
|
|
||||||
baseBrowse.onTick = []() {
|
baseBrowse.onTick = []() {
|
||||||
fileBrowser.fileOpen(FileBrowser::Mode::Cartridge, [](string filename) {
|
fileBrowser.fileOpen(FileBrowser::Mode::Cartridge, [](string filename) {
|
||||||
@@ -120,9 +119,8 @@ void DoubleSlotLoader::create() {
|
|||||||
controlLayout.append(spacer, ~0, 0 );
|
controlLayout.append(spacer, ~0, 0 );
|
||||||
controlLayout.append(okButton, 80, 0 );
|
controlLayout.append(okButton, 80, 0 );
|
||||||
layout.append(controlLayout);
|
layout.append(controlLayout);
|
||||||
|
|
||||||
setGeometry({ 0, 0, 480, layout.minimumGeometry().height });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, 480, layout.minimumGeometry().height });
|
||||||
|
|
||||||
baseBrowse.onTick = []() {
|
baseBrowse.onTick = []() {
|
||||||
fileBrowser.fileOpen(FileBrowser::Mode::Cartridge, [](string filename) {
|
fileBrowser.fileOpen(FileBrowser::Mode::Cartridge, [](string filename) {
|
||||||
|
@@ -9,31 +9,31 @@ void InputMapper::poll_hotkeys(unsigned scancode, int16_t value) {
|
|||||||
if(mainWindow.focused() == false) return;
|
if(mainWindow.focused() == false) return;
|
||||||
|
|
||||||
//save states
|
//save states
|
||||||
if(scancode == keyboard(0)[Keyboard::F5]) {
|
if(scancode == hotkeysGeneral.stateSave.scancode) {
|
||||||
utility.saveState(activeSlot);
|
utility.saveState(activeSlot);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(scancode == keyboard(0)[Keyboard::F7]) {
|
if(scancode == hotkeysGeneral.stateLoad.scancode) {
|
||||||
utility.loadState(activeSlot);
|
utility.loadState(activeSlot);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(scancode == keyboard(0)[Keyboard::F6]) {
|
if(scancode == hotkeysGeneral.stateDecrement.scancode) {
|
||||||
activeSlot = (activeSlot == 1 ? 5 : activeSlot - 1);
|
activeSlot = (activeSlot == 1 ? 5 : activeSlot - 1);
|
||||||
utility.showMessage({ "Slot ", activeSlot, " selected" });
|
utility.showMessage({ "Slot ", activeSlot, " selected" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if(scancode == keyboard(0)[Keyboard::F8]) {
|
if(scancode == hotkeysGeneral.stateIncrement.scancode) {
|
||||||
activeSlot = (activeSlot == 5 ? 1 : activeSlot + 1);
|
activeSlot = (activeSlot == 5 ? 1 : activeSlot + 1);
|
||||||
utility.showMessage({ "Slot ", activeSlot, " selected" });
|
utility.showMessage({ "Slot ", activeSlot, " selected" });
|
||||||
}
|
}
|
||||||
|
|
||||||
//fullscreen
|
//fullscreen
|
||||||
if(scancode == keyboard(0)[Keyboard::F11]) {
|
if(scancode == hotkeysGeneral.fullscreenToggle.scancode) {
|
||||||
utility.setFullscreen(!utility.fullscreen);
|
utility.setFullscreen(!utility.fullscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
//mouse capture
|
//mouse capture
|
||||||
if(scancode == keyboard(0)[Keyboard::F12]) {
|
if(scancode == hotkeysGeneral.mouseCaptureToggle.scancode) {
|
||||||
if(input.acquired() == false) {
|
if(input.acquired() == false) {
|
||||||
input.acquire();
|
input.acquire();
|
||||||
} else {
|
} else {
|
||||||
@@ -42,12 +42,12 @@ void InputMapper::poll_hotkeys(unsigned scancode, int16_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//pause
|
//pause
|
||||||
if(scancode == keyboard(0)[Keyboard::P]) {
|
if(scancode == hotkeysGeneral.pauseToggle.scancode) {
|
||||||
application.pause = !application.pause;
|
application.pause = !application.pause;
|
||||||
}
|
}
|
||||||
|
|
||||||
//fast forward
|
//fast forward
|
||||||
if(scancode == keyboard(0)[Keyboard::Tilde]) {
|
if(scancode == hotkeysGeneral.fastForward.scancode) {
|
||||||
videoSync = config.video.synchronize;
|
videoSync = config.video.synchronize;
|
||||||
audioSync = config.audio.synchronize;
|
audioSync = config.audio.synchronize;
|
||||||
video.set(Video::Synchronize, config.video.synchronize = false);
|
video.set(Video::Synchronize, config.video.synchronize = false);
|
||||||
@@ -56,12 +56,22 @@ void InputMapper::poll_hotkeys(unsigned scancode, int16_t value) {
|
|||||||
SNES::ppu.set_frameskip(9);
|
SNES::ppu.set_frameskip(9);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//power cycle
|
||||||
|
if(scancode == hotkeysGeneral.power.scancode) {
|
||||||
|
mainWindow.systemPower.onTick();
|
||||||
|
}
|
||||||
|
|
||||||
|
//reset
|
||||||
|
if(scancode == hotkeysGeneral.reset.scancode) {
|
||||||
|
mainWindow.systemReset.onTick();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//key released
|
//key released
|
||||||
if(mainWindow.focused() == false) return;
|
if(mainWindow.focused() == false) return;
|
||||||
|
|
||||||
//fast forward
|
//fast forward
|
||||||
if(scancode == keyboard(0)[Keyboard::Tilde]) {
|
if(scancode == hotkeysGeneral.fastForward.scancode) {
|
||||||
video.set(Video::Synchronize, config.video.synchronize = videoSync);
|
video.set(Video::Synchronize, config.video.synchronize = videoSync);
|
||||||
audio.set(Audio::Synchronize, config.audio.synchronize = audioSync);
|
audio.set(Audio::Synchronize, config.audio.synchronize = audioSync);
|
||||||
#if defined(PROFILE_COMPATIBILITY) || defined(PROFILE_PERFORMANCE)
|
#if defined(PROFILE_COMPATIBILITY) || defined(PROFILE_PERFORMANCE)
|
||||||
@@ -70,3 +80,46 @@ void InputMapper::poll_hotkeys(unsigned scancode, int16_t value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InputMapper::HotkeysGeneral::create(const char *deviceName, const char *configName) {
|
||||||
|
name = deviceName;
|
||||||
|
|
||||||
|
stateSave.name = "Save State";
|
||||||
|
stateLoad.name = "Load State";
|
||||||
|
stateDecrement.name = "Decrement State";
|
||||||
|
stateIncrement.name = "Increment State";
|
||||||
|
fullscreenToggle.name = "Fullscreen";
|
||||||
|
mouseCaptureToggle.name = "Mouse Capture";
|
||||||
|
pauseToggle.name = "Pause Emulation";
|
||||||
|
fastForward.name = "Fast-Forward";
|
||||||
|
power.name = "Power Cycle";
|
||||||
|
reset.name = "Reset";
|
||||||
|
|
||||||
|
append(&stateSave);
|
||||||
|
append(&stateLoad);
|
||||||
|
append(&stateDecrement);
|
||||||
|
append(&stateIncrement);
|
||||||
|
append(&fullscreenToggle);
|
||||||
|
append(&mouseCaptureToggle);
|
||||||
|
append(&pauseToggle);
|
||||||
|
append(&fastForward);
|
||||||
|
append(&power);
|
||||||
|
append(&reset);
|
||||||
|
|
||||||
|
config.attach(stateSave.mapping = "KB0::F5", string("input.", configName, ".stateSave"));
|
||||||
|
config.attach(stateLoad.mapping = "KB0::F7", string("input.", configName, ".stateLoad"));
|
||||||
|
config.attach(stateDecrement.mapping = "KB0::F6", string("input.", configName, ".stateDecrement"));
|
||||||
|
config.attach(stateIncrement.mapping = "KB0::F8", string("input.", configName, ".stateIncrement"));
|
||||||
|
config.attach(fullscreenToggle.mapping = "KB0::F11", string("input.", configName, ".fullscreenToggle"));
|
||||||
|
config.attach(mouseCaptureToggle.mapping = "KB0::F12", string("input.", configName, ".mouseCaptureToggle"));
|
||||||
|
config.attach(pauseToggle.mapping = "KB0::P", string("input.", configName, ".pauseToggle"));
|
||||||
|
config.attach(fastForward.mapping = "KB0::Tilde", string("input.", configName, ".fastForward"));
|
||||||
|
config.attach(power.mapping = "", string("input.", configName, ".power"));
|
||||||
|
config.attach(reset.mapping = "", string("input.", configName, ".reset"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void InputMapper::create_hotkeys() {
|
||||||
|
hotkeys.name = "Hotkeys";
|
||||||
|
hotkeysGeneral.create("General", "hotkeys.general");
|
||||||
|
hotkeys.append(&hotkeysGeneral);
|
||||||
|
}
|
||||||
|
@@ -227,6 +227,8 @@ void InputMapper::create() {
|
|||||||
port2.append(&port2.superScope);
|
port2.append(&port2.superScope);
|
||||||
port2.append(&port2.justifierA);
|
port2.append(&port2.justifierA);
|
||||||
port2.append(&port2.justifierB);
|
port2.append(&port2.justifierB);
|
||||||
|
|
||||||
|
create_hotkeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputMapper::bind() {
|
void InputMapper::bind() {
|
||||||
@@ -238,6 +240,10 @@ void InputMapper::bind() {
|
|||||||
Controller &controller = *port2[i];
|
Controller &controller = *port2[i];
|
||||||
for(unsigned n = 0; n < controller.size(); n++) controller[n]->bind();
|
for(unsigned n = 0; n < controller.size(); n++) controller[n]->bind();
|
||||||
}
|
}
|
||||||
|
for(unsigned i = 0; i < hotkeys.size(); i++) {
|
||||||
|
Controller &controller = *hotkeys[i];
|
||||||
|
for(unsigned n = 0; n < controller.size(); n++) controller[n]->bind();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputMapper::poll() {
|
void InputMapper::poll() {
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
struct InputMapper {
|
struct InputMapper {
|
||||||
|
int16_t state[2][Scancode::Limit];
|
||||||
|
bool activeState;
|
||||||
|
|
||||||
struct AbstractInput {
|
struct AbstractInput {
|
||||||
enum class Type : unsigned { Button, MouseAxis, MouseButton, HatUp, HatDown, HatLeft, HatRight, AxisLo, AxisHi } type;
|
enum class Type : unsigned { Button, MouseAxis, MouseButton, HatUp, HatDown, HatLeft, HatRight, AxisLo, AxisHi } type;
|
||||||
string name;
|
string name;
|
||||||
@@ -73,13 +76,13 @@ struct InputMapper {
|
|||||||
Justifier justifierB;
|
Justifier justifierB;
|
||||||
} port2;
|
} port2;
|
||||||
|
|
||||||
int16_t state[2][Scancode::Limit];
|
#include "hotkeys.hpp"
|
||||||
bool activeState;
|
|
||||||
|
|
||||||
void create();
|
void create();
|
||||||
void bind();
|
void bind();
|
||||||
void poll();
|
void poll();
|
||||||
int16_t poll(bool port, SNES::Input::Device device, unsigned index, unsigned id);
|
int16_t poll(bool port, SNES::Input::Device device, unsigned index, unsigned id);
|
||||||
|
void create_hotkeys();
|
||||||
void poll_hotkeys(unsigned scancode, int16_t value);
|
void poll_hotkeys(unsigned scancode, int16_t value);
|
||||||
int16_t value(unsigned scancode);
|
int16_t value(unsigned scancode);
|
||||||
};
|
};
|
||||||
|
@@ -33,9 +33,8 @@ void AdvancedSettings::create() {
|
|||||||
focusPolicyLayout.append(focusPolicyIgnore, ~0, 0, 5);
|
focusPolicyLayout.append(focusPolicyIgnore, ~0, 0, 5);
|
||||||
focusPolicyLayout.append(focusPolicyAllow, ~0, 0);
|
focusPolicyLayout.append(focusPolicyAllow, ~0, 0);
|
||||||
layout.append(focusPolicyLayout);
|
layout.append(focusPolicyLayout);
|
||||||
|
|
||||||
setGeometry({ 0, 0, 640, layout.minimumGeometry().height });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, 640, layout.minimumGeometry().height });
|
||||||
|
|
||||||
lstring list;
|
lstring list;
|
||||||
|
|
||||||
|
@@ -18,9 +18,8 @@ void AudioSettings::create() {
|
|||||||
frequencyLayout.append(frequencyValue, 60, 0);
|
frequencyLayout.append(frequencyValue, 60, 0);
|
||||||
frequencyLayout.append(frequencySlider, ~0, 0);
|
frequencyLayout.append(frequencySlider, ~0, 0);
|
||||||
layout.append(frequencyLayout);
|
layout.append(frequencyLayout);
|
||||||
|
|
||||||
setGeometry({ 0, 0, 480, layout.minimumGeometry().height });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, 480, layout.minimumGeometry().height });
|
||||||
|
|
||||||
volumeSlider.onChange = []() {
|
volumeSlider.onChange = []() {
|
||||||
config.audio.volume = audioSettings.volumeSlider.position();
|
config.audio.volume = audioSettings.volumeSlider.position();
|
||||||
|
@@ -13,6 +13,7 @@ void InputSettings::create() {
|
|||||||
portLabel.setText("Port:");
|
portLabel.setText("Port:");
|
||||||
portBox.append(inputMapper.port1.name);
|
portBox.append(inputMapper.port1.name);
|
||||||
portBox.append(inputMapper.port2.name);
|
portBox.append(inputMapper.port2.name);
|
||||||
|
portBox.append(inputMapper.hotkeys.name);
|
||||||
deviceLabel.setText("Device:");
|
deviceLabel.setText("Device:");
|
||||||
mappingList.setHeaderText("Name", "Mapping");
|
mappingList.setHeaderText("Name", "Mapping");
|
||||||
mappingList.setHeaderVisible(true);
|
mappingList.setHeaderVisible(true);
|
||||||
@@ -47,10 +48,10 @@ void InputSettings::create() {
|
|||||||
buttonControlLayout.append(mouseRight, 100, 0, 5);
|
buttonControlLayout.append(mouseRight, 100, 0, 5);
|
||||||
buttonLayout.append(buttonControlLayout);
|
buttonLayout.append(buttonControlLayout);
|
||||||
|
|
||||||
setGeometry({ 0, 0, 480, layout.minimumGeometry().height + 250 });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
append(axisLayout);
|
append(axisLayout);
|
||||||
append(buttonLayout);
|
append(buttonLayout);
|
||||||
|
setGeometry({ 0, 0, 480, layout.minimumGeometry().height + 250 });
|
||||||
|
|
||||||
axisLayout.setVisible(false);
|
axisLayout.setVisible(false);
|
||||||
buttonLayout.setVisible(false);
|
buttonLayout.setVisible(false);
|
||||||
@@ -74,9 +75,9 @@ void InputSettings::create() {
|
|||||||
void InputSettings::portChanged() {
|
void InputSettings::portChanged() {
|
||||||
deviceBox.reset();
|
deviceBox.reset();
|
||||||
InputMapper::ControllerPort &port = (
|
InputMapper::ControllerPort &port = (
|
||||||
portBox.selection() == 0
|
portBox.selection() == 0 ? (InputMapper::ControllerPort&)inputMapper.port1 :
|
||||||
? (InputMapper::ControllerPort&)inputMapper.port1
|
portBox.selection() == 1 ? (InputMapper::ControllerPort&)inputMapper.port2 :
|
||||||
: (InputMapper::ControllerPort&)inputMapper.port2
|
/*portBox.selection() == 2*/ (InputMapper::ControllerPort&)inputMapper.hotkeys
|
||||||
);
|
);
|
||||||
|
|
||||||
for(unsigned i = 0; i < port.size(); i++) deviceBox.append(port[i]->name);
|
for(unsigned i = 0; i < port.size(); i++) deviceBox.append(port[i]->name);
|
||||||
@@ -86,9 +87,9 @@ void InputSettings::portChanged() {
|
|||||||
void InputSettings::deviceChanged() {
|
void InputSettings::deviceChanged() {
|
||||||
mappingList.reset();
|
mappingList.reset();
|
||||||
InputMapper::ControllerPort &port = (
|
InputMapper::ControllerPort &port = (
|
||||||
portBox.selection() == 0
|
portBox.selection() == 0 ? (InputMapper::ControllerPort&)inputMapper.port1 :
|
||||||
? (InputMapper::ControllerPort&)inputMapper.port1
|
portBox.selection() == 1 ? (InputMapper::ControllerPort&)inputMapper.port2 :
|
||||||
: (InputMapper::ControllerPort&)inputMapper.port2
|
/*portBox.selection() == 2*/ (InputMapper::ControllerPort&)inputMapper.hotkeys
|
||||||
);
|
);
|
||||||
InputMapper::Controller &controller = (InputMapper::Controller&)*port[deviceBox.selection()];
|
InputMapper::Controller &controller = (InputMapper::Controller&)*port[deviceBox.selection()];
|
||||||
|
|
||||||
@@ -102,9 +103,9 @@ void InputSettings::deviceChanged() {
|
|||||||
|
|
||||||
void InputSettings::mappingChanged() {
|
void InputSettings::mappingChanged() {
|
||||||
InputMapper::ControllerPort &port = (
|
InputMapper::ControllerPort &port = (
|
||||||
portBox.selection() == 0
|
portBox.selection() == 0 ? (InputMapper::ControllerPort&)inputMapper.port1 :
|
||||||
? (InputMapper::ControllerPort&)inputMapper.port1
|
portBox.selection() == 1 ? (InputMapper::ControllerPort&)inputMapper.port2 :
|
||||||
: (InputMapper::ControllerPort&)inputMapper.port2
|
/*portBox.selection() == 2*/ (InputMapper::ControllerPort&)inputMapper.hotkeys
|
||||||
);
|
);
|
||||||
InputMapper::Controller &controller = (InputMapper::Controller&)*port[deviceBox.selection()];
|
InputMapper::Controller &controller = (InputMapper::Controller&)*port[deviceBox.selection()];
|
||||||
|
|
||||||
@@ -119,9 +120,9 @@ void InputSettings::mappingChanged() {
|
|||||||
void InputSettings::assignInput() {
|
void InputSettings::assignInput() {
|
||||||
if(mappingList.selected() == false) return;
|
if(mappingList.selected() == false) return;
|
||||||
InputMapper::ControllerPort &port = (
|
InputMapper::ControllerPort &port = (
|
||||||
portBox.selection() == 0
|
portBox.selection() == 0 ? (InputMapper::ControllerPort&)inputMapper.port1 :
|
||||||
? (InputMapper::ControllerPort&)inputMapper.port1
|
portBox.selection() == 1 ? (InputMapper::ControllerPort&)inputMapper.port2 :
|
||||||
: (InputMapper::ControllerPort&)inputMapper.port2
|
/*portBox.selection() == 2*/ (InputMapper::ControllerPort&)inputMapper.hotkeys
|
||||||
);
|
);
|
||||||
InputMapper::Controller &controller = (InputMapper::Controller&)*port[deviceBox.selection()];
|
InputMapper::Controller &controller = (InputMapper::Controller&)*port[deviceBox.selection()];
|
||||||
|
|
||||||
@@ -143,9 +144,9 @@ void InputSettings::assignInput() {
|
|||||||
void InputSettings::clearInput() {
|
void InputSettings::clearInput() {
|
||||||
if(mappingList.selected() == false) return;
|
if(mappingList.selected() == false) return;
|
||||||
InputMapper::ControllerPort &port = (
|
InputMapper::ControllerPort &port = (
|
||||||
portBox.selection() == 0
|
portBox.selection() == 0 ? (InputMapper::ControllerPort&)inputMapper.port1 :
|
||||||
? (InputMapper::ControllerPort&)inputMapper.port1
|
portBox.selection() == 1 ? (InputMapper::ControllerPort&)inputMapper.port2 :
|
||||||
: (InputMapper::ControllerPort&)inputMapper.port2
|
/*portBox.selection() == 2*/ (InputMapper::ControllerPort&)inputMapper.hotkeys
|
||||||
);
|
);
|
||||||
InputMapper::Controller &controller = (InputMapper::Controller&)*port[deviceBox.selection()];
|
InputMapper::Controller &controller = (InputMapper::Controller&)*port[deviceBox.selection()];
|
||||||
|
|
||||||
|
@@ -40,9 +40,8 @@ void VideoSettings::create() {
|
|||||||
fullscreenLayout.append(fullscreenScale, ~0, 0, 5);
|
fullscreenLayout.append(fullscreenScale, ~0, 0, 5);
|
||||||
fullscreenLayout.append(fullscreenStretch, ~0, 0 );
|
fullscreenLayout.append(fullscreenStretch, ~0, 0 );
|
||||||
layout.append(fullscreenLayout);
|
layout.append(fullscreenLayout);
|
||||||
|
|
||||||
setGeometry({ 0, 0, 480, layout.minimumGeometry().height });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, 480, layout.minimumGeometry().height });
|
||||||
|
|
||||||
brightnessSlider.setPosition(config.video.brightness);
|
brightnessSlider.setPosition(config.video.brightness);
|
||||||
brightnessValue.setText({ config.video.brightness, "%" });
|
brightnessValue.setText({ config.video.brightness, "%" });
|
||||||
|
@@ -15,8 +15,8 @@ void CheatDatabase::create() {
|
|||||||
controlLayout.append(spacerWidget, ~0, 0 );
|
controlLayout.append(spacerWidget, ~0, 0 );
|
||||||
controlLayout.append(okButton, 80, 0 );
|
controlLayout.append(okButton, 80, 0 );
|
||||||
layout.append(controlLayout );
|
layout.append(controlLayout );
|
||||||
setGeometry({ 0, 0, 600, layout.minimumGeometry().height + 350 });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, 600, layout.minimumGeometry().height + 350 });
|
||||||
|
|
||||||
selectAllButton.onTick = [this]() {
|
selectAllButton.onTick = [this]() {
|
||||||
foreach(item, this->listData, n) this->listView.setChecked(n, true);
|
foreach(item, this->listData, n) this->listView.setChecked(n, true);
|
||||||
|
@@ -104,9 +104,8 @@ void CheatEditor::create() {
|
|||||||
controlLayout.append(clearAllButton, 80, 0, 5);
|
controlLayout.append(clearAllButton, 80, 0, 5);
|
||||||
controlLayout.append(clearButton, 80, 0 );
|
controlLayout.append(clearButton, 80, 0 );
|
||||||
layout.append(controlLayout);
|
layout.append(controlLayout);
|
||||||
|
|
||||||
setGeometry({ 0, 0, 480, layout.minimumGeometry().height + 250 });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, 480, layout.minimumGeometry().height + 250 });
|
||||||
|
|
||||||
synchronize();
|
synchronize();
|
||||||
|
|
||||||
|
@@ -21,9 +21,8 @@ void StateManager::create() {
|
|||||||
controlLayout.append(saveButton, 80, 0, 5);
|
controlLayout.append(saveButton, 80, 0, 5);
|
||||||
controlLayout.append(eraseButton, 80, 0 );
|
controlLayout.append(eraseButton, 80, 0 );
|
||||||
layout.append(controlLayout );
|
layout.append(controlLayout );
|
||||||
|
|
||||||
setGeometry({ 0, 0, 480, layout.minimumGeometry().height + 250 });
|
|
||||||
append(layout);
|
append(layout);
|
||||||
|
setGeometry({ 0, 0, 480, layout.minimumGeometry().height + 250 });
|
||||||
|
|
||||||
synchronize();
|
synchronize();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user