/[pcsx2_0.9.7]/branch/r3113_0.9.7_beta/tools/GSDumpGUI/Core/Program.cs
ViewVC logotype

Contents of /branch/r3113_0.9.7_beta/tools/GSDumpGUI/Core/Program.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (show annotations) (download)
Tue Sep 7 03:29:01 2010 UTC (10 years, 9 months ago) by william
File size: 2537 byte(s)
branching from upstream revision (http://pcsx2.googlecode.com/svn/trunk
): r3113 to
https://svn.netsolutions.dnsalias.com/websvn/ps2/pcsx2/pcsx2_0.9.7/branch/r3113_0.9.7_beta
1 using System;
2 using System.Collections.Generic;
3 using System.Windows.Forms;
4 using Specialized = System.Collections.Specialized;
5 using Reflection = System.Reflection;
6 using System.Runtime.InteropServices;
7 using System.Threading;
8 using System.Diagnostics;
9 using GSDumpGUI.Properties;
10
11 namespace GSDumpGUI
12 {
13 static class Program
14 {
15 static public GSDumpGUI frmMain;
16
17 static private Boolean ChangeIcon;
18
19 [STAThread]
20 static void Main(String[] args)
21 {
22 if (args.Length == 4)
23 {
24 Thread thd = new Thread(new ThreadStart(delegate
25 {
26 while (true)
27 {
28 if (ChangeIcon)
29 {
30 IntPtr pt = Process.GetCurrentProcess().MainWindowHandle;
31 if (pt.ToInt64() != 0)
32 {
33 NativeMethods.SetClassLong(pt, -14, Resources.AppIcon.Handle.ToInt64());
34 ChangeIcon = false;
35 }
36 }
37 Int32 tmp = NativeMethods.GetAsyncKeyState(0x1b) & 0xf;
38 if (tmp != 0)
39 Process.GetCurrentProcess().Kill();
40 Thread.Sleep(16);
41 }
42 }));
43 thd.IsBackground = true;
44 thd.Start();
45
46 // Retrieve parameters
47 String DLLPath = args[0];
48 String DumpPath = args[1];
49 String Operation = args[2];
50 Int32 Renderer = Convert.ToInt32(args[3]);
51
52 GSDXWrapper wrap = new GSDXWrapper();
53 wrap.Load(DLLPath);
54 if (Operation == "GSReplay")
55 {
56 ChangeIcon = true;
57 if (Renderer != -1)
58 wrap.GSReplayDump(Renderer + " " + DumpPath);
59 else
60 wrap.GSReplayDump(DumpPath);
61 }
62 else
63 wrap.GSConfig();
64 wrap.Unload();
65 }
66 else
67 {
68 Application.EnableVisualStyles();
69 Application.SetCompatibleTextRenderingDefault(false);
70 frmMain = new GSDumpGUI();
71 Application.Run(frmMain);
72 }
73 }
74 }
75 }

  ViewVC Help
Powered by ViewVC 1.1.22