diff options
author | bunnei <bunneidev@gmail.com> | 2016-07-15 04:25:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-15 04:25:52 +0200 |
commit | f95d119dde2addd4a83fe8dd5ca6de5139c20336 (patch) | |
tree | 7b47be1c71ca918f6acd2a49350c2b48c0e2550d | |
parent | Merge pull request #1894 from wwylele/set-config-block (diff) | |
parent | Fix boot_filename encode on Windows (diff) | |
download | yuzu-f95d119dde2addd4a83fe8dd5ca6de5139c20336.tar yuzu-f95d119dde2addd4a83fe8dd5ca6de5139c20336.tar.gz yuzu-f95d119dde2addd4a83fe8dd5ca6de5139c20336.tar.bz2 yuzu-f95d119dde2addd4a83fe8dd5ca6de5139c20336.tar.lz yuzu-f95d119dde2addd4a83fe8dd5ca6de5139c20336.tar.xz yuzu-f95d119dde2addd4a83fe8dd5ca6de5139c20336.tar.zst yuzu-f95d119dde2addd4a83fe8dd5ca6de5139c20336.zip |
-rw-r--r-- | src/citra/citra.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index e01216734..128b9a16d 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -17,11 +17,16 @@ #include <getopt.h> #endif +#ifdef _WIN32 +#include <Windows.h> +#endif + #include "common/logging/log.h" #include "common/logging/backend.h" #include "common/logging/filter.h" #include "common/scm_rev.h" #include "common/scope_exit.h" +#include "common/string_util.h" #include "core/settings.h" #include "core/system.h" @@ -55,6 +60,15 @@ int main(int argc, char **argv) { bool use_gdbstub = Settings::values.use_gdbstub; u32 gdb_port = static_cast<u32>(Settings::values.gdbstub_port); char *endarg; +#ifdef _WIN32 + int argc_w; + auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w); + + if (argv_w == nullptr) { + LOG_CRITICAL(Frontend, "Failed to get command line arguments"); + return -1; + } +#endif std::string boot_filename; static struct option long_options[] = { @@ -86,11 +100,19 @@ int main(int argc, char **argv) { return 0; } } else { +#ifdef _WIN32 + boot_filename = Common::UTF16ToUTF8(argv_w[optind]); +#else boot_filename = argv[optind]; +#endif optind++; } } +#ifdef _WIN32 + LocalFree(argv_w); +#endif + Log::Filter log_filter(Log::Level::Debug); Log::SetFilter(&log_filter); |