Encapsulate `LibretroHost` constructor
This commit is contained in:
parent
ddd14d5274
commit
407c26e9d5
|
@ -73,7 +73,21 @@ namespace BizHawk.Emulation.Cores.Libretro
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks>does not keep a reference to <paramref name="game"/></remarks>
|
||||
public LibretroHost(CoreComm comm, IGameInfo game, string corePath, bool analysis = false)
|
||||
: this(
|
||||
comm,
|
||||
libretroSystemDir: comm.CoreFileProvider.GetRetroSystemPath(game),
|
||||
libretroSaveRAMDir: comm.CoreFileProvider.GetRetroSaveRAMDirectory(game),
|
||||
corePath: corePath,
|
||||
analysis: analysis) {}
|
||||
|
||||
public LibretroHost(
|
||||
CoreComm comm,
|
||||
string libretroSystemDir,
|
||||
string libretroSaveRAMDir,
|
||||
string corePath,
|
||||
bool analysis)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -95,11 +109,13 @@ namespace BizHawk.Emulation.Cores.Libretro
|
|||
throw new InvalidOperationException("Unsupported Libretro API version (or major error in interop)");
|
||||
}
|
||||
|
||||
bridge.LibretroBridge_SetDirectories(cbHandler,
|
||||
comm.CoreFileProvider.GetRetroSystemPath(game),
|
||||
comm.CoreFileProvider.GetRetroSaveRAMDirectory(game),
|
||||
Path.GetDirectoryName(corePath),
|
||||
Path.GetDirectoryName(corePath));
|
||||
var libretroCoreDir = Path.GetDirectoryName(corePath);
|
||||
bridge.LibretroBridge_SetDirectories(
|
||||
cbHandler,
|
||||
systemDirectory: libretroSystemDir,
|
||||
saveDirectory: libretroSaveRAMDir,
|
||||
coreDirectory: libretroCoreDir,
|
||||
coreAssetsDirectory: libretroCoreDir);
|
||||
|
||||
ControllerDefinition = ControllerDef;
|
||||
_notify = comm.Notify;
|
||||
|
|
Loading…
Reference in New Issue