update gui

This commit is contained in:
Logan McNaughton committed 2021-06-04 23:23:04 -06:00
1 parent a00bb7e027
commit e8975518bf
8 files changed
+45 -167

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ It supports everything you'd expect from a mupen64plus frontend
(plugin selection, configuration editing, save state management, screenshots, pausing, etc).
You can try this out by downloading [**m64p**](https://m64p.github.io/).
**m64p** is mupen64plus + GLideN64 + this GUI
**m64p** is mupen64plus + ParaLLEl + this GUI
It is [free/libre software](https://www.fsf.org/blogs/rms/20140407-geneva-tedx-talk-free-software-free-society)
under [license GPL](https://www.gnu.org/licenses/gpl)v3.0.
@@ -15,7 +15,7 @@ Enjoy and happy hacking!
## Dependencies
- [Qt](https://www.qt.io/) 5.4
- [Qt](https://www.qt.io/) 5.10
(this comes statically linked with the Windows binary build in m64p, so you don't need to worry about this on Windows)
- [SDL2](https://www.libsdl.org/) ***Your copy of mupen64plus-core (libmupen64plus.so.2) also needs to be linked against SDL2***
- 7za binary must be installed on your system for 7z/zip support
+19 -114
View File
@@ -50,42 +50,6 @@ void MainWindow::updatePlugins()
QStringList current;
QString default_value;
if (!settings->contains("videoPlugin")) {
Filter.replace(0,"mupen64plus-video*");
current = PluginDir.entryList(Filter);
default_value = "mupen64plus-video-GLideN64";
default_value += OSAL_DLL_EXTENSION;
if (current.isEmpty())
settings->setValue("videoPlugin", "dummy");
else if (current.indexOf(default_value) != -1)
settings->setValue("videoPlugin", default_value);
else
settings->setValue("videoPlugin", current.at(0));
}
if (!settings->contains("audioPlugin")) {
Filter.replace(0,"mupen64plus-audio*");
current = PluginDir.entryList(Filter);
default_value = "mupen64plus-audio-sdl2";
default_value += OSAL_DLL_EXTENSION;
if (current.isEmpty())
settings->setValue("audioPlugin", "dummy");
else if (current.indexOf(default_value) != -1)
settings->setValue("audioPlugin", default_value);
else
settings->setValue("audioPlugin", current.at(0));
}
if (!settings->contains("rspPlugin")) {
Filter.replace(0,"mupen64plus-rsp*");
current = PluginDir.entryList(Filter);
default_value = "mupen64plus-rsp-hle";
default_value += OSAL_DLL_EXTENSION;
if (current.isEmpty())
settings->setValue("rspPlugin", "dummy");
else if (current.indexOf(default_value) != -1)
settings->setValue("rspPlugin", default_value);
else
settings->setValue("rspPlugin", current.at(0));
}
if (!settings->contains("inputPlugin")) {
Filter.replace(0,"mupen64plus-input*");
current = PluginDir.entryList(Filter);
@@ -430,8 +394,6 @@ MainWindow::MainWindow(QWidget *parent) :
loadCoreLib();
loadPlugins();
setupLLE();
if (coreLib)
{
m64p_handle coreConfigHandle;
@@ -464,55 +426,6 @@ void MainWindow::updateApp()
#endif
}
void MainWindow::setupLLE()
{
if (!settings->contains("LLE"))
{
settings->setValue("LLE", 0);
}
ui->actionVideo_Settings->setEnabled(!settings->value("LLE").toInt());
ui->actionLLE_Graphics->setChecked(settings->value("LLE").toInt());
if (coreLib)
{
m64p_handle lionConfigHandle;
m64p_error res = (*ConfigOpenSection)("Video-Angrylion-Plus", &lionConfigHandle);
if (res == M64ERR_SUCCESS)
{
int vimode = (*ConfigGetParamInt)(lionConfigHandle, "ViMode");
ui->actionVI_Filter->setChecked(!vimode);
}
}
ui->actionVI_Filter->setEnabled(settings->value("LLE").toInt());
connect(ui->actionLLE_Graphics, &QAction::toggled,
[=]( bool checked ) {
settings->setValue("LLE", checked ? 1 : 0);
ui->actionVI_Filter->setEnabled(checked);
ui->actionVideo_Settings->setEnabled(!checked);
if (coreLib)
{
int response;
(*CoreDoCommand)(M64CMD_CORE_STATE_QUERY, M64CORE_EMU_STATE, &response);
if (response == M64EMU_STOPPED)
resetCore();
}
});
connect(ui->actionVI_Filter, &QAction::toggled,
[=]( bool checked ) {
m64p_handle lionConfigHandle;
m64p_error res = (*ConfigOpenSection)("Video-Angrylion-Plus", &lionConfigHandle);
if (res == M64ERR_SUCCESS)
{
int vimode = checked == true ? 0 : 1;
(*ConfigSetParameter)(lionConfigHandle, "ViMode", M64TYPE_INT, &vimode);
}
});
}
void MainWindow::setupDiscord()
{
QLibrary *discordLib = new QLibrary((QDir(QCoreApplication::applicationDirPath()).filePath("discord_game_sdk")), this);
@@ -1013,14 +926,6 @@ void MainWindow::on_actionView_Log_triggered()
logViewer.show();
}
void MainWindow::on_actionVideo_Settings_triggered()
{
typedef void (*Config_Func)();
Config_Func PluginConfig = (Config_Func) osal_dynlib_getproc(gfxPlugin, "PluginConfig");
if (PluginConfig)
PluginConfig();
}
void MainWindow::on_actionCreate_Room_triggered()
{
CreateRoom *createRoom = new CreateRoom(this);
@@ -1118,7 +1023,7 @@ void MainWindow::loadCoreLib()
ConfigGetUserConfigPath = (ptr_ConfigGetUserConfigPath) osal_dynlib_getproc(coreLib, "ConfigGetUserConfigPath");
ConfigSaveFile = (ptr_ConfigSaveFile) osal_dynlib_getproc(coreLib, "ConfigSaveFile");
ConfigGetParameterHelp = (ptr_ConfigGetParameterHelp) osal_dynlib_getproc(coreLib, "ConfigSaveFile");
ConfigGetParameterHelp = (ptr_ConfigGetParameterHelp) osal_dynlib_getproc(coreLib, "ConfigGetParameterHelp");
ConfigGetParamInt = (ptr_ConfigGetParamInt) osal_dynlib_getproc(coreLib, "ConfigGetParamInt");
ConfigGetParamFloat = (ptr_ConfigGetParamFloat) osal_dynlib_getproc(coreLib, "ConfigGetParamFloat");
ConfigGetParamBool = (ptr_ConfigGetParamBool) osal_dynlib_getproc(coreLib, "ConfigGetParamBool");
@@ -1187,16 +1092,13 @@ void MainWindow::loadPlugins()
QString pluginPath = settings->value("pluginDirPath").toString();
pluginPath.replace("$APP_PATH$", QCoreApplication::applicationDirPath());
QString lle_path;
QString file_path;
QString plugin_path;
if (settings->value("LLE").toInt())
{
lle_path = "mupen64plus-video-angrylion-plus";
lle_path += OSAL_DLL_EXTENSION;
plugin_path = QDir(pluginPath).filePath(lle_path);
}
else
plugin_path = QDir(pluginPath).filePath(settings->value("videoPlugin").toString());
file_path = "mupen64plus-video-parallel";
file_path += OSAL_DLL_EXTENSION;
plugin_path = QDir(pluginPath).filePath(file_path);
res = osal_dynlib_open(&gfxPlugin, plugin_path.toUtf8().constData());
if (res != M64ERR_SUCCESS)
{
@@ -1206,7 +1108,12 @@ void MainWindow::loadPlugins()
}
PluginStartup = (ptr_PluginStartup) osal_dynlib_getproc(gfxPlugin, "PluginStartup");
(*PluginStartup)(coreLib, (char*)"Video", DebugCallback);
res = osal_dynlib_open(&audioPlugin, QDir(pluginPath).filePath(settings->value("audioPlugin").toString()).toUtf8().constData());
file_path = "mupen64plus-audio-sdl2";
file_path += OSAL_DLL_EXTENSION;
plugin_path = QDir(pluginPath).filePath(file_path);
res = osal_dynlib_open(&audioPlugin, plugin_path.toUtf8().constData());
if (res != M64ERR_SUCCESS)
{
msgBox.setText("Failed to load audio plugin");
@@ -1215,6 +1122,7 @@ void MainWindow::loadPlugins()
}
PluginStartup = (ptr_PluginStartup) osal_dynlib_getproc(audioPlugin, "PluginStartup");
(*PluginStartup)(coreLib, (char*)"Audio", DebugCallback);
res = osal_dynlib_open(&inputPlugin, QDir(pluginPath).filePath(settings->value("inputPlugin").toString()).toUtf8().constData());
if (res != M64ERR_SUCCESS)
{
@@ -1228,14 +1136,11 @@ void MainWindow::loadPlugins()
else
(*PluginStartup)(coreLib, (char*)"Input", DebugCallback);
if (settings->value("LLE").toInt())
{
lle_path = "mupen64plus-rsp-parallel";
lle_path += OSAL_DLL_EXTENSION;
plugin_path = QDir(pluginPath).filePath(lle_path);
}
else
plugin_path = QDir(pluginPath).filePath(settings->value("rspPlugin").toString());
file_path = "mupen64plus-rsp-parallel";
file_path += OSAL_DLL_EXTENSION;
plugin_path = QDir(pluginPath).filePath(file_path);
res = osal_dynlib_open(&rspPlugin, plugin_path.toUtf8().constData());
if (res != M64ERR_SUCCESS)
{
-3
View File
@@ -119,8 +119,6 @@ private slots:
void on_actionView_Log_triggered();
void on_actionVideo_Settings_triggered();
void on_actionCreate_Room_triggered();
void on_actionJoin_Room_triggered();
@@ -130,7 +128,6 @@ private slots:
void on_actionOpen_Discord_Channel_triggered();
private:
void setupLLE();
void setupDiscord();
void stopGame();
void updateOpenRecent();
+2 -27
View File
@@ -20,7 +20,7 @@
<x>0</x>
<y>0</y>
<width>640</width>
<height>32</height>
<height>22</height>
</rect>
</property>
<property name="nativeMenuBar">
@@ -47,10 +47,6 @@
<addaction name="actionPlugin_Paths"/>
<addaction name="actionPlugin_Settings"/>
<addaction name="actionController_Configuration"/>
<addaction name="actionVideo_Settings"/>
<addaction name="separator"/>
<addaction name="actionLLE_Graphics"/>
<addaction name="actionVI_Filter"/>
</widget>
<widget class="QMenu" name="menuEmulation">
<property name="title">
@@ -105,7 +101,7 @@
</action>
<action name="actionPlugin_Settings">
<property name="text">
<string>Advanced Settings</string>
<string>Core and Video Settings</string>
</property>
</action>
<action name="actionOpen_Recent">
@@ -183,11 +179,6 @@
<string>View Log</string>
</property>
</action>
<action name="actionVideo_Settings">
<property name="text">
<string>Video Settings</string>
</property>
</action>
<action name="actionCreate_Room">
<property name="text">
<string>Create Room</string>
@@ -208,22 +199,6 @@
<string>Join Discord Channel</string>
</property>
</action>
<action name="actionLLE_Graphics">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>LLE Graphics</string>
</property>
</action>
<action name="actionVI_Filter">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>VI Filter</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
+1 -1
View File
@@ -195,7 +195,7 @@ void CreateRoom::createRoom()
json.insert("game_name", QString(rom_settings.goodname));
json.insert("client_sha", QStringLiteral(GUI_VERSION));
json.insert("netplay_version", NETPLAY_VER);
json.insert("lle", w->getSettings()->value("LLE").toInt() ? "Yes" : "No");
json.insert("lle", "Yes");
json.insert("use_input_delay", useInputDelay->isChecked());
if (useInputDelay->isChecked())
json.insert("input_delay", inputDelay->text().toInt());
-12
View File
@@ -175,18 +175,6 @@ void JoinRoom::joinGame()
msgBox.setText("ROM does not match room ROM");
msgBox.exec();
}
else if (json.value("lle").toString() == "Yes" && w->getSettings()->value("LLE").toInt() != 1)
{
(*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL);
msgBox.setText("You must enable LLE graphics");
msgBox.exec();
}
else if (json.value("lle").toString() == "No" && w->getSettings()->value("LLE").toInt() != 0)
{
(*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL);
msgBox.setText("You must disable LLE graphics");
msgBox.exec();
}
else if (roomRequiresInputDelay && inputDelay->text().isEmpty())
{
(*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL);
+21 -2
View File
@@ -12,8 +12,11 @@
#include "settingclasses.h"
m64p_handle coreConfigHandle;
m64p_handle videoConfigHandle;
QGridLayout *coreLayout;
int coreLayoutRow;
QGridLayout *videoLayout;
int videoRow;
static void paramListCallback(void * context, const char *ParamName, m64p_type ParamType)
{
@@ -24,6 +27,10 @@ static void paramListCallback(void * context, const char *ParamName, m64p_type P
my_layout = coreLayout;
my_row = &coreLayoutRow;
current_handle = coreConfigHandle;
} else if (strcmp((char*)context, "Video") == 0) {
my_layout = videoLayout;
my_row = &videoRow;
current_handle = videoConfigHandle;
}
int l_ParamInt;
bool l_ParamBool;
@@ -90,7 +97,7 @@ void PluginDialog::handleResetButton()
(*CoreDoCommand)(M64CMD_CORE_STATE_QUERY, M64CORE_EMU_STATE, &value);
if (value == M64EMU_STOPPED) {
(*ConfigDeleteSection)("Core");
(*ConfigDeleteSection)("Video-General");
(*ConfigDeleteSection)("Video-Parallel");
(*ConfigSaveFile)();
w->resetCore();
this->close();
@@ -115,7 +122,7 @@ PluginDialog::PluginDialog(QWidget *parent)
tabWidget->setUsesScrollButtons(false);
QWidget *coreSettings = new QWidget(this);
coreLayout = new QGridLayout(this);
coreLayout = new QGridLayout(coreSettings);
coreSettings->setLayout(coreLayout);
res = (*ConfigOpenSection)("Core", &coreConfigHandle);
if (res == M64ERR_SUCCESS)
@@ -126,6 +133,18 @@ PluginDialog::PluginDialog(QWidget *parent)
coreScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
tabWidget->addTab(coreScroll, tr("Core"));
QWidget *videoSettings = new QWidget(this);
videoLayout = new QGridLayout(videoSettings);
videoSettings->setLayout(videoLayout);
res = (*ConfigOpenSection)("Video-Parallel", &videoConfigHandle);
if (res == M64ERR_SUCCESS)
(*ConfigListParameters)(videoConfigHandle, (char*)"Video", paramListCallback);
QScrollArea *videoScroll = new QScrollArea(this);
videoScroll->setWidget(videoSettings);
videoScroll->setMinimumWidth(videoSettings->sizeHint().width() + 20);
videoScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
tabWidget->addTab(videoScroll, tr("ParaLLEl Video"));
QLabel *myLabel = new QLabel("Hover your mouse over the configuration item name for a description.\n", this);
myLabel->setStyleSheet("font-weight: bold");
mainLayout->addWidget(myLabel);
-6
View File
@@ -28,9 +28,6 @@ void SettingsDialog::handlePluginButton()
w->getSettings()->setValue("pluginDirPath", fileName);
w->getSettings()->remove("inputPlugin");
w->getSettings()->remove("videoPlugin");
w->getSettings()->remove("audioPlugin");
w->getSettings()->remove("rspPlugin");
w->updatePlugins();
}
}
@@ -63,9 +60,6 @@ void SettingsDialog::handlePluginEdit()
w->getSettings()->setValue("pluginDirPath", pluginPath->text());
w->getSettings()->remove("inputPlugin");
w->getSettings()->remove("videoPlugin");
w->getSettings()->remove("audioPlugin");
w->getSettings()->remove("rspPlugin");
w->updatePlugins();
}