mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
Clang-format
This commit is contained in:
parent
c1f49fb6dd
commit
35d17ed179
@ -18,8 +18,6 @@
|
||||
// Custom message handler to ignore Qt logs
|
||||
void customMessageHandler(QtMsgType, const QMessageLogContext&, const QString&) {}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
#ifdef _WIN32
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
@ -37,7 +35,8 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
// Map of argument strings to lambda functions
|
||||
std::unordered_map<std::string, std::function<void(int&)>> arg_map = {
|
||||
{"-h", [&](int&) {
|
||||
{"-h",
|
||||
[&](int&) {
|
||||
std::cout << "Usage: emulator [options]\n"
|
||||
"Options:\n"
|
||||
" No arguments: Opens the GUI.\n"
|
||||
@ -52,7 +51,8 @@ int main(int argc, char* argv[]) {
|
||||
{"-s", [&](int&) { show_gui = true; }},
|
||||
{"--show-gui", [&](int& i) { arg_map["-s"](i); }},
|
||||
|
||||
{"-g", [&](int& i) {
|
||||
{"-g",
|
||||
[&](int& i) {
|
||||
if (i + 1 < argc) {
|
||||
gamePath = argv[++i];
|
||||
has_game_argument = true;
|
||||
@ -63,7 +63,8 @@ int main(int argc, char* argv[]) {
|
||||
}},
|
||||
{"--game", [&](int& i) { arg_map["-g"](i); }},
|
||||
|
||||
{"-p", [&](int& i) {
|
||||
{"-p",
|
||||
[&](int& i) {
|
||||
if (i + 1 < argc) {
|
||||
MemoryPatcher::patchFile = argv[++i];
|
||||
} else {
|
||||
@ -76,12 +77,12 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
// Parse command-line arguments using the map
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
std::string curArg = argv[i];
|
||||
auto it = arg_map.find(curArg);
|
||||
std::string cur_arg = argv[i];
|
||||
auto it = arg_map.find(cur_arg);
|
||||
if (it != arg_map.end()) {
|
||||
it->second(i); // Call the associated lambda function
|
||||
} else {
|
||||
std::cerr << "Unknown argument: " << curArg << "\n";
|
||||
std::cerr << "Unknown argument: " << cur_arg << "\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -131,7 +132,6 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Show the main window and run the Qt application
|
||||
m_main_window->show();
|
||||
return a.exec();
|
||||
|
Loading…
Reference in New Issue
Block a user