aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl/main.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2020-05-19 21:34:24 +0200
committerArisotura <thetotalworm@gmail.com>2020-05-19 21:34:24 +0200
commit9df8d91bdc12ab2e65569e26dc7c57246e384a8f (patch)
treecf3e25e927b4f396a3d421a42b63854dc81988ac /src/frontend/qt_sdl/main.cpp
parent34506ff2bb1be880cf260e0c1b09efede14ac0d8 (diff)
keep the ugliness confined in Platform.cpp
Diffstat (limited to 'src/frontend/qt_sdl/main.cpp')
-rw-r--r--src/frontend/qt_sdl/main.cpp47
1 files changed, 2 insertions, 45 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp
index 8fe776e..a68f933 100644
--- a/src/frontend/qt_sdl/main.cpp
+++ b/src/frontend/qt_sdl/main.cpp
@@ -54,8 +54,6 @@
// TODO: uniform variable spelling
-char* EmuDirectory;
-
bool RunningSomething;
MainWindow* mainWindow;
@@ -865,11 +863,6 @@ void MainWindow::onInputConfigFinished(int res)
}
-// FIXME!!!!
-#if (!defined(__WIN32__) && !defined(UNIX_PORTABLE))
-#include <glib.h>
-#endif
-
int main(int argc, char** argv)
{
srand(time(NULL));
@@ -877,43 +870,7 @@ int main(int argc, char** argv)
printf("melonDS " MELONDS_VERSION "\n");
printf(MELONDS_URL "\n");
-#if defined(__WIN32__) || defined(UNIX_PORTABLE)
- if (argc > 0 && strlen(argv[0]) > 0)
- {
- int len = strlen(argv[0]);
- while (len > 0)
- {
- if (argv[0][len] == '/') break;
- if (argv[0][len] == '\\') break;
- len--;
- }
- if (len > 0)
- {
- EmuDirectory = new char[len+1];
- strncpy(EmuDirectory, argv[0], len);
- EmuDirectory[len] = '\0';
- }
- else
- {
- EmuDirectory = new char[2];
- strcpy(EmuDirectory, ".");
- }
- }
- else
- {
- EmuDirectory = new char[2];
- strcpy(EmuDirectory, ".");
- }
-#else
- const char* confdir = g_get_user_config_dir();
- const char* confname = "/melonDS";
- int cdlen = strlen(confdir);
- int cnlen = strlen(confname);
- EmuDirectory = new char[cdlen + cnlen + 1];
- strncpy(&EmuDirectory[0], confdir, cdlen);
- strncpy(&EmuDirectory[cdlen], confname, cnlen);
- EmuDirectory[cdlen+cnlen] = '\0';
-#endif
+ Platform::Init(argc, argv);
QApplication melon(argc, argv);
@@ -1060,7 +1017,7 @@ int main(int argc, char** argv)
Config::Save();
SDL_Quit();
- delete[] EmuDirectory;
+ Platform::DeInit();
return ret;
}