aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2022-11-14 18:29:44 +0100
committerRSDuck <RSDuck@users.noreply.github.com>2022-11-14 18:29:44 +0100
commit3111431a3f4afa0205437e3a4f6d72b2b2a20dea (patch)
tree5bae95b65bf64b0a91c4a5bb72d118dea0322a60 /src/frontend/qt_sdl
parent5488e0bf3dec842a7ef742deeba73adb04a8414f (diff)
fix #1556
Diffstat (limited to 'src/frontend/qt_sdl')
-rw-r--r--src/frontend/qt_sdl/main.cpp30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp
index 5074bab..7275693 100644
--- a/src/frontend/qt_sdl/main.cpp
+++ b/src/frontend/qt_sdl/main.cpp
@@ -3413,38 +3413,10 @@ int main(int argc, char** argv)
int CALLBACK WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int cmdshow)
{
- int argc = 0;
- wchar_t** argv_w = CommandLineToArgvW(GetCommandLineW(), &argc);
- char nullarg[] = {'\0'};
-
- char** argv = new char*[argc];
- for (int i = 0; i < argc; i++)
- {
- if (!argv_w) { argv[i] = nullarg; continue; }
- int len = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, NULL, 0, NULL, NULL);
- if (len < 1) { argv[i] = nullarg; continue; }
- argv[i] = new char[len];
- int res = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, argv[i], len, NULL, NULL);
- if (res != len) { delete[] argv[i]; argv[i] = nullarg; }
- }
-
- if (argv_w) LocalFree(argv_w);
-
- //if (AttachConsole(ATTACH_PARENT_PROCESS))
- /*if (AllocConsole())
- {
- freopen("CONOUT$", "w", stdout);
- freopen("CONOUT$", "w", stderr);
- printf("\n");
- }*/
-
- int ret = main(argc, argv);
+ int ret = main(__argc, __argv);
printf("\n\n>");
- for (int i = 0; i < argc; i++) if (argv[i] != nullarg) delete[] argv[i];
- delete[] argv;
-
return ret;
}