2010-03-01 16:47:58 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using Specialized = System.Collections.Specialized;
|
|
|
|
|
using Reflection = System.Reflection;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Diagnostics;
|
2010-03-04 14:54:20 +00:00
|
|
|
|
using GSDumpGUI.Properties;
|
2010-12-19 10:48:09 +00:00
|
|
|
|
using System.IO;
|
2010-03-01 16:47:58 +00:00
|
|
|
|
|
|
|
|
|
namespace GSDumpGUI
|
|
|
|
|
{
|
|
|
|
|
static class Program
|
|
|
|
|
{
|
|
|
|
|
static public GSDumpGUI frmMain;
|
|
|
|
|
|
2010-03-04 14:54:20 +00:00
|
|
|
|
static private Boolean ChangeIcon;
|
|
|
|
|
|
2010-03-01 16:47:58 +00:00
|
|
|
|
[STAThread]
|
|
|
|
|
static void Main(String[] args)
|
|
|
|
|
{
|
2010-03-04 13:47:36 +00:00
|
|
|
|
if (args.Length == 4)
|
2010-03-01 16:47:58 +00:00
|
|
|
|
{
|
|
|
|
|
Thread thd = new Thread(new ThreadStart(delegate
|
|
|
|
|
{
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
2010-03-04 14:54:20 +00:00
|
|
|
|
if (ChangeIcon)
|
|
|
|
|
{
|
|
|
|
|
IntPtr pt = Process.GetCurrentProcess().MainWindowHandle;
|
|
|
|
|
if (pt.ToInt64() != 0)
|
|
|
|
|
{
|
|
|
|
|
NativeMethods.SetClassLong(pt, -14, Resources.AppIcon.Handle.ToInt64());
|
|
|
|
|
ChangeIcon = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-03-01 16:47:58 +00:00
|
|
|
|
Int32 tmp = NativeMethods.GetAsyncKeyState(0x1b) & 0xf;
|
|
|
|
|
if (tmp != 0)
|
|
|
|
|
Process.GetCurrentProcess().Kill();
|
|
|
|
|
Thread.Sleep(16);
|
|
|
|
|
}
|
|
|
|
|
}));
|
|
|
|
|
thd.IsBackground = true;
|
|
|
|
|
thd.Start();
|
|
|
|
|
|
|
|
|
|
// Retrieve parameters
|
|
|
|
|
String DLLPath = args[0];
|
|
|
|
|
String DumpPath = args[1];
|
|
|
|
|
String Operation = args[2];
|
2010-03-04 13:47:36 +00:00
|
|
|
|
Int32 Renderer = Convert.ToInt32(args[3]);
|
2010-03-01 16:47:58 +00:00
|
|
|
|
|
2010-03-04 14:54:20 +00:00
|
|
|
|
GSDXWrapper wrap = new GSDXWrapper();
|
|
|
|
|
wrap.Load(DLLPath);
|
2010-12-19 10:48:09 +00:00
|
|
|
|
Directory.SetCurrentDirectory(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\" + Path.GetFileName(DLLPath) + "\\"));
|
2010-03-04 14:54:20 +00:00
|
|
|
|
if (Operation == "GSReplay")
|
2010-03-01 16:47:58 +00:00
|
|
|
|
{
|
2010-03-04 14:54:20 +00:00
|
|
|
|
ChangeIcon = true;
|
|
|
|
|
if (Renderer != -1)
|
|
|
|
|
wrap.GSReplayDump(Renderer + " " + DumpPath);
|
|
|
|
|
else
|
|
|
|
|
wrap.GSReplayDump(DumpPath);
|
2010-03-01 16:47:58 +00:00
|
|
|
|
}
|
2010-03-04 14:54:20 +00:00
|
|
|
|
else
|
|
|
|
|
wrap.GSConfig();
|
|
|
|
|
wrap.Unload();
|
2010-03-01 16:47:58 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
|
frmMain = new GSDumpGUI();
|
|
|
|
|
Application.Run(frmMain);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|