mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-13 14:30:27 +02:00
Handle args on Windows in NativeInit() too.
Now it's like everyone else, plus it works again. Bonus. Fixes #1134.
This commit is contained in:
1 parent
8cecdbe1dc
commit
d8cb2cdffb
3 files changed
+4
-49
No files matched your search
+1
-46
@@ -58,9 +58,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
{
|
||||
Common::EnableCrashingOnCrashes();
|
||||
|
||||
const char *fileToStart = NULL;
|
||||
const char *fileToLog = NULL;
|
||||
const char *stateToLoad = NULL;
|
||||
bool hideLog = true;
|
||||
|
||||
#ifdef _DEBUG
|
||||
@@ -71,6 +68,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
VFSRegister("", new DirectoryAssetReader("assets/"));
|
||||
VFSRegister("", new DirectoryAssetReader(""));
|
||||
|
||||
// The rest is handled in NativeInit().
|
||||
for (int i = 1; i < __argc; ++i)
|
||||
{
|
||||
if (__argv[i][0] == '\0')
|
||||
@@ -80,14 +78,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
{
|
||||
switch (__argv[i][1])
|
||||
{
|
||||
case 'j':
|
||||
g_Config.bJit = true;
|
||||
g_Config.bSaveSettings = false;
|
||||
break;
|
||||
case 'i':
|
||||
g_Config.bJit = false;
|
||||
g_Config.bSaveSettings = false;
|
||||
break;
|
||||
case 'l':
|
||||
hideLog = false;
|
||||
break;
|
||||
@@ -95,32 +85,8 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
g_Config.bAutoRun = false;
|
||||
g_Config.bSaveSettings = false;
|
||||
break;
|
||||
case '-':
|
||||
if (!strcmp(__argv[i], "--log") && i < __argc - 1)
|
||||
fileToLog = __argv[++i];
|
||||
if (!strncmp(__argv[i], "--log=", strlen("--log=")) && strlen(__argv[i]) > strlen("--log="))
|
||||
fileToLog = __argv[i] + strlen("--log=");
|
||||
if (!strcmp(__argv[i], "--state") && i < __argc - 1)
|
||||
stateToLoad = __argv[++i];
|
||||
if (!strncmp(__argv[i], "--state=", strlen("--state=")) && strlen(__argv[i]) > strlen("--state="))
|
||||
stateToLoad = __argv[i] + strlen("--state=");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (fileToStart == NULL)
|
||||
{
|
||||
fileToStart = __argv[i];
|
||||
if (!File::Exists(fileToStart))
|
||||
{
|
||||
fprintf(stderr, "File not found: %s\n", fileToStart);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Can only boot one file");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
//Windows, API init stuff
|
||||
@@ -152,16 +118,8 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
MainWindow::UpdateMenus();
|
||||
|
||||
LogManager::Init();
|
||||
if (fileToLog != NULL)
|
||||
LogManager::GetInstance()->ChangeFileLog(fileToLog);
|
||||
LogManager::GetInstance()->GetConsoleListener()->Open(hideLog, 150, 120, "PPSSPP Debug Console");
|
||||
LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, LogTypes::LERROR);
|
||||
if (fileToStart != NULL)
|
||||
{
|
||||
MainWindow::SetPlaying(fileToStart);
|
||||
MainWindow::Update();
|
||||
MainWindow::UpdateMenus();
|
||||
}
|
||||
|
||||
// Emu thread is always running!
|
||||
EmuThread_Start();
|
||||
@@ -172,9 +130,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
if (!hideLog)
|
||||
SetForegroundWindow(hwndMain);
|
||||
|
||||
if (fileToStart != NULL && stateToLoad != NULL)
|
||||
SaveState::Load(stateToLoad);
|
||||
|
||||
//so.. we're at the message pump of the GUI thread
|
||||
MSG msg;
|
||||
while (GetMessage(&msg, NULL, 0, 0)) //while no quit
|
||||
|
||||
Reference in new issue
Block a user