fix regression in libretro core loading and streamline open advanced libretro ui

This commit is contained in:
zeromus 2015-11-17 01:50:38 -06:00
parent 1e878f700c
commit 59048264cd
3 changed files with 7 additions and 5 deletions

View File

@ -1185,7 +1185,7 @@ namespace BizHawk.Client.EmuHawk
ThrottleMessage();
}
public void RunLibretroCoreChooser()
public bool RunLibretroCoreChooser()
{
var ofd = new OpenFileDialog();
@ -1203,9 +1203,11 @@ namespace BizHawk.Client.EmuHawk
ofd.Filter = "Libretro Cores (*.dll)|*.dll";
if (ofd.ShowDialog() == DialogResult.Cancel)
return;
return false;
Global.Config.LibretroCore = ofd.FileName;
return true;
}
private void setLibretroCoreToolStripMenuItem_Click(object sender, EventArgs e)

View File

@ -51,8 +51,8 @@ namespace BizHawk.Client.EmuHawk
private void btnSetLibretroCore_Click(object sender, EventArgs e)
{
mainForm.RunLibretroCoreChooser();
RefreshLibretroCore(false);
if(mainForm.RunLibretroCoreChooser())
RefreshLibretroCore(false);
}
LibRetroEmulator.RetroDescription CurrentDescription;

View File

@ -21,7 +21,7 @@ namespace BizHawk.Common
var envpath = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process);
try
{
string envpath_new = Path.GetDirectoryName(path) + ";" + envpath;
string envpath_new = Path.GetDirectoryName(dllPath) + ";" + envpath;
Environment.SetEnvironmentVariable("PATH", envpath_new, EnvironmentVariableTarget.Process);
_hModule = LoadLibrary(path); //consider using LoadLibraryEx instead of shenanigans?
var newfname = TempFileCleaner.RenameTempFilenameForDelete(path);