Permalink
Browse files

[skip ci] gsdumpgui: Update code to share only one gsdx config for al…

…l dlls.
  • Loading branch information...
lightningterror committed Feb 8, 2019
1 parent dabc99f commit 8c6e4cd28b9f161b0b8e484ee1b3faba842ea526
Showing with 7 additions and 13 deletions.
  1. +1 −1 tools/GSDumpGUI/Core/Program.cs
  2. +6 −12 tools/GSDumpGUI/Forms/frmMain.cs
@@ -98,7 +98,7 @@ static void Main(String[] args)
Int32 Renderer = Convert.ToInt32(args[3]);

wrap.Load(DLLPath);
Directory.SetCurrentDirectory(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\" + Path.GetFileName(DLLPath) + "\\"));
Directory.SetCurrentDirectory(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\"));
if (Operation == "GSReplay")
{
dump = GSDump.LoadDump(DumpPath);
@@ -194,7 +194,7 @@ private void ExecuteFunction(String Function)
txtLog.Text = "";
String GSDXName = lstGSDX.SelectedItem.ToString().Split(new char[] { '|' })[0].TrimEnd();

CreateDirs(GSDXName);
CreateDirs();

// Set the Arguments to pass to the child
String DLLPath = Properties.Settings.Default.GSDXDir + "\\" + GSDXName;
@@ -226,7 +226,7 @@ private void ExecuteFunction(String Function)
}
if (SelectedRenderer != "-1")
{
String GSdxIniPath = AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\" + GSDXName + "\\inis\\gsdx.ini";
String GSdxIniPath = AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\inis\\gsdx.ini";
NativeMethods.WritePrivateProfileString("Settings", "Renderer", SelectedRenderer, GSdxIniPath);
}
if (lstDumps.SelectedItem != null)
@@ -248,26 +248,21 @@ private void ExecuteFunction(String Function)
Processes.Add(p);
}

private static void CreateDirs(String GSDXName)
private static void CreateDirs()
{
// Create and set the config directory.
String Dir = AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\";
if (!Directory.Exists(Dir))
{
Directory.CreateDirectory(Dir);
}
Dir += GSDXName;
if (!Directory.Exists(Dir))
{
Directory.CreateDirectory(Dir);
}
Dir += "\\Inis\\";
if (!Directory.Exists(Dir))
{
Directory.CreateDirectory(Dir);
File.Create(Dir + "\\gsdx.ini").Close();
}
Dir = AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\" + GSDXName;
Dir = AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs";
Directory.SetCurrentDirectory(Dir);
}

@@ -302,9 +297,8 @@ private void cmdOpenIni_Click(object sender, EventArgs e)
// Execute the GSconfigure function
if (lstGSDX.SelectedIndex != -1)
{
String GSDXName = lstGSDX.SelectedItem.ToString().Split(new char[] { '|' })[0];
CreateDirs(GSDXName);
Process.Start(AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\" + GSDXName + "\\inis\\gsdx.ini");
CreateDirs();
Process.Start(AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\inis\\gsdx.ini");
}
else
MessageBox.Show("Select your GSdx first", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);

0 comments on commit 8c6e4cd

Please sign in to comment.