mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
merge doublemelon (#2067)
non-exhaustive (but exhausting) list of changes: * base laid for multiple window support, but will likely require more work to work correctly * encapsulation of frontend state for proper multi-instance support * (JIT still needs a fix for the NDS::Current workaround but we can get there later) * new, more flexible configuration system
This commit is contained in:
@ -20,7 +20,7 @@
|
||||
#define WINDOW_H
|
||||
|
||||
#include "glad/glad.h"
|
||||
#include "FrontendUtil.h"
|
||||
#include "ScreenLayout.h"
|
||||
#include "duckstation/gl/context.h"
|
||||
|
||||
#include <QWidget>
|
||||
@ -34,10 +34,14 @@
|
||||
#include <QCloseEvent>
|
||||
|
||||
#include "Screen.h"
|
||||
#include "Config.h"
|
||||
|
||||
|
||||
class EmuInstance;
|
||||
class EmuThread;
|
||||
|
||||
const int kMaxRecentROMs = 10;
|
||||
|
||||
/*
|
||||
class WindowBase : public QMainWindow
|
||||
{
|
||||
@ -100,26 +104,28 @@ class MainWindow : public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget* parent = nullptr);
|
||||
explicit MainWindow(int id, EmuInstance* inst, QWidget* parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
bool hasOGL;
|
||||
EmuInstance* getEmuInstance() { return emuInstance; }
|
||||
Config::Table& getWindowConfig() { return windowCfg; }
|
||||
|
||||
bool hasOpenGL() { return hasOGL; }
|
||||
GL::Context* getOGLContext();
|
||||
/*void initOpenGL();
|
||||
void initOpenGL();
|
||||
void deinitOpenGL();
|
||||
void drawScreenGL();*/
|
||||
void setGLSwapInterval(int intv);
|
||||
void makeCurrentGL();
|
||||
void drawScreenGL();
|
||||
|
||||
bool preloadROMs(QStringList file, QStringList gbafile, bool boot);
|
||||
QStringList splitArchivePath(const QString& filename, bool useMemberSyntax);
|
||||
|
||||
void onAppStateChanged(Qt::ApplicationState state);
|
||||
|
||||
void osdAddMessage(unsigned int color, const char* fmt, ...);
|
||||
void osdAddMessage(unsigned int color, const char* msg);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
void changeEvent(QEvent* event) override;
|
||||
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void keyReleaseEvent(QKeyEvent* event) override;
|
||||
|
||||
@ -170,6 +176,7 @@ private slots:
|
||||
void onOpenCameraSettings();
|
||||
void onCameraSettingsFinished(int res);
|
||||
void onOpenAudioSettings();
|
||||
void onUpdateAudioVolume(int vol, int dsisync);
|
||||
void onUpdateAudioSettings();
|
||||
void onAudioSettingsFinished(int res);
|
||||
void onOpenMPSettings();
|
||||
@ -182,7 +189,7 @@ private slots:
|
||||
void onPathSettingsFinished(int res);
|
||||
void onOpenInterfaceSettings();
|
||||
void onInterfaceSettingsFinished(int res);
|
||||
void onUpdateMouseTimer();
|
||||
void onUpdateInterfaceSettings();
|
||||
void onChangeSavestateSRAMReloc(bool checked);
|
||||
void onChangeScreenSize();
|
||||
void onChangeScreenRotation(QAction* act);
|
||||
@ -201,6 +208,8 @@ private slots:
|
||||
|
||||
void onEmuStart();
|
||||
void onEmuStop();
|
||||
void onEmuPause(bool pause);
|
||||
void onEmuReset();
|
||||
|
||||
void onUpdateVideoSettings(bool glchange);
|
||||
|
||||
@ -223,10 +232,21 @@ private:
|
||||
|
||||
void createScreenPanel();
|
||||
|
||||
bool pausedManually = false;
|
||||
bool showOSD;
|
||||
|
||||
int oldW, oldH;
|
||||
bool oldMax;
|
||||
bool hasOGL;
|
||||
|
||||
bool pauseOnLostFocus;
|
||||
bool pausedManually;
|
||||
|
||||
int windowID;
|
||||
|
||||
EmuInstance* emuInstance;
|
||||
EmuThread* emuThread;
|
||||
|
||||
Config::Table& globalCfg;
|
||||
Config::Table& localCfg;
|
||||
Config::Table windowCfg;
|
||||
|
||||
public:
|
||||
ScreenPanel* panel;
|
||||
@ -275,14 +295,14 @@ public:
|
||||
QAction* actSavestateSRAMReloc;
|
||||
QAction* actScreenSize[4];
|
||||
QActionGroup* grpScreenRotation;
|
||||
QAction* actScreenRotation[Frontend::screenRot_MAX];
|
||||
QAction* actScreenRotation[screenRot_MAX];
|
||||
QActionGroup* grpScreenGap;
|
||||
QAction* actScreenGap[6];
|
||||
QActionGroup* grpScreenLayout;
|
||||
QAction* actScreenLayout[Frontend::screenLayout_MAX];
|
||||
QAction* actScreenLayout[screenLayout_MAX];
|
||||
QAction* actScreenSwap;
|
||||
QActionGroup* grpScreenSizing;
|
||||
QAction* actScreenSizing[Frontend::screenSizing_MAX];
|
||||
QAction* actScreenSizing[screenSizing_MAX];
|
||||
QAction* actIntegerScaling;
|
||||
QActionGroup* grpScreenAspectTop;
|
||||
QAction** actScreenAspectTop;
|
||||
|
Reference in New Issue
Block a user