emuhawk - add --gdi commandline so that you can force the program to boot up that way instead of attempting to use a broken opengl by default

This commit is contained in:
zeromus 2014-12-16 19:22:49 +00:00
parent bb940473bb
commit 26969addb9
1 changed files with 61 additions and 58 deletions

View File

@ -131,6 +131,67 @@ namespace BizHawk.Client.EmuHawk
}
};
// TODO - replace this with some kind of standard dictionary-yielding parser in a separate component
string cmdRom = null;
string cmdLoadState = null;
string cmdMovie = null;
string cmdDumpType = null;
string cmdDumpName = null;
bool startFullscreen = false;
for (int i = 0; i < args.Length; i++)
{
// For some reason sometimes visual studio will pass this to us on the commandline. it makes no sense.
if (args[i] == ">")
{
i++;
var stdout = args[i];
Console.SetOut(new StreamWriter(stdout));
continue;
}
var arg = args[i].ToLower();
if (arg.StartsWith("--load-slot="))
{
cmdLoadState = arg.Substring(arg.IndexOf('=') + 1);
}
else if (arg.StartsWith("--movie="))
{
cmdMovie = arg.Substring(arg.IndexOf('=') + 1);
}
else if (arg.StartsWith("--dump-type="))
{
cmdDumpType = arg.Substring(arg.IndexOf('=') + 1);
}
else if (arg.StartsWith("--dump-name="))
{
cmdDumpName = arg.Substring(arg.IndexOf('=') + 1);
}
else if (arg.StartsWith("--dump-length="))
{
int.TryParse(arg.Substring(arg.IndexOf('=') + 1), out _autoDumpLength);
}
else if (arg.StartsWith("--dump-close"))
{
_autoCloseOnDump = true;
}
else if (arg.StartsWith("--chromeless"))
{
_chromeless = true;
}
else if (arg.StartsWith("--gdi"))
{
Global.Config.DispMethod = Config.EDispMethod.GdiPlus;
}
else if (arg.StartsWith("--fullscreen"))
{
startFullscreen = true;
}
else
{
cmdRom = arg;
}
}
Database.LoadDatabase(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "gamedb.txt"));
//TODO GL - a lot of disorganized wiring-up here
@ -211,13 +272,6 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.Tools = new ToolManager();
RewireSound();
// TODO - replace this with some kind of standard dictionary-yielding parser in a separate component
string cmdRom = null;
string cmdLoadState = null;
string cmdMovie = null;
string cmdDumpType = null;
string cmdDumpName = null;
// Workaround for windows, location is -32000 when minimized, if they close it during this time, that's what gets saved
if (Global.Config.MainWndx == -32000)
{
@ -234,57 +288,6 @@ namespace BizHawk.Client.EmuHawk
Location = new Point(Global.Config.MainWndx, Global.Config.MainWndy);
}
bool startFullscreen = false;
for (int i = 0; i < args.Length; i++)
{
// For some reason sometimes visual studio will pass this to us on the commandline. it makes no sense.
if (args[i] == ">")
{
i++;
var stdout = args[i];
Console.SetOut(new StreamWriter(stdout));
continue;
}
var arg = args[i].ToLower();
if (arg.StartsWith("--load-slot="))
{
cmdLoadState = arg.Substring(arg.IndexOf('=') + 1);
}
else if (arg.StartsWith("--movie="))
{
cmdMovie = arg.Substring(arg.IndexOf('=') + 1);
}
else if (arg.StartsWith("--dump-type="))
{
cmdDumpType = arg.Substring(arg.IndexOf('=') + 1);
}
else if (arg.StartsWith("--dump-name="))
{
cmdDumpName = arg.Substring(arg.IndexOf('=') + 1);
}
else if (arg.StartsWith("--dump-length="))
{
int.TryParse(arg.Substring(arg.IndexOf('=') + 1), out _autoDumpLength);
}
else if (arg.StartsWith("--dump-close"))
{
_autoCloseOnDump = true;
}
else if (arg.StartsWith("--chromeless"))
{
_chromeless = true;
}
else if (arg.StartsWith("--fullscreen"))
{
startFullscreen = true;
}
else
{
cmdRom = arg;
}
}
if (cmdRom != null)
{
// Commandline should always override auto-load