use IGameInfo instead of GameInfo in various palces

This commit is contained in:
adelikat 2020-06-12 11:56:05 -05:00
parent 066e282b39
commit 5ef2a4d7e6
6 changed files with 15 additions and 12 deletions

View File

@ -29,11 +29,11 @@ namespace BizHawk.Client.Common
public string DllPath() => PathUtils.DllDirectoryPath;
// Poop
public string GetRetroSaveRAMDirectory(GameInfo game)
public string GetRetroSaveRAMDirectory(IGameInfo game)
=> _pathEntries.RetroSaveRamAbsolutePath(game);
// Poop
public string GetRetroSystemPath(GameInfo game)
public string GetRetroSystemPath(IGameInfo game)
=> _pathEntries.RetroSystemAbsolutePath(game);
private void FirmwareWarn(string sysID, string firmwareID, bool required, string msg = null)

View File

@ -222,7 +222,7 @@ namespace BizHawk.Client.Common
return collection.AbsolutePathFor(path.Path, systemId);
}
public static string SaveRamAbsolutePath(this PathEntryCollection collection, GameInfo game, IMovie movie)
public static string SaveRamAbsolutePath(this PathEntryCollection collection, IGameInfo game, IMovie movie)
{
var name = game.FilesystemSafeName();
if (movie.IsActive())
@ -237,7 +237,7 @@ namespace BizHawk.Client.Common
}
// Shenanigans
public static string RetroSaveRamAbsolutePath(this PathEntryCollection collection, GameInfo game)
public static string RetroSaveRamAbsolutePath(this PathEntryCollection collection, IGameInfo game)
{
var name = game.FilesystemSafeName();
name = Path.GetDirectoryName(name);
@ -255,7 +255,7 @@ namespace BizHawk.Client.Common
}
// Shenanigans
public static string RetroSystemAbsolutePath(this PathEntryCollection collection, GameInfo game)
public static string RetroSystemAbsolutePath(this PathEntryCollection collection, IGameInfo game)
{
var name = game.FilesystemSafeName();
name = Path.GetDirectoryName(name);
@ -270,7 +270,7 @@ namespace BizHawk.Client.Common
return Path.Combine(collection.AbsolutePathFor(pathEntry.Path, game.System), name);
}
public static string AutoSaveRamAbsolutePath(this PathEntryCollection collection, GameInfo game, IMovie movie)
public static string AutoSaveRamAbsolutePath(this PathEntryCollection collection, IGameInfo game, IMovie movie)
{
var path = collection.SaveRamAbsolutePath(game, movie);
return path.Insert(path.Length - 8, ".AutoSaveRAM");

View File

@ -319,7 +319,7 @@ namespace BizHawk.Client.EmuHawk
private void OpenAdvancedMenuItem_Click(object sender, EventArgs e)
{
using var oac = new OpenAdvancedChooser(this, Config);
using var oac = new OpenAdvancedChooser(this, Config, Game);
if (oac.ShowHawkDialog() == DialogResult.Cancel)
{
return;

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Windows.Forms;
using BizHawk.Emulation.Cores.Libretro;
using BizHawk.Client.Common;
using BizHawk.Emulation.Common;
// these match strings from OpenAdvance. should we make them constants in there?
namespace BizHawk.Client.EmuHawk
@ -24,15 +25,17 @@ namespace BizHawk.Client.EmuHawk
{
private readonly MainForm _mainForm;
private readonly Config _config;
private readonly IGameInfo _game;
public AdvancedRomLoaderType Result;
public string SuggestedExtensionFilter;
private RetroDescription _currentDescription;
public OpenAdvancedChooser(MainForm mainForm, Config config)
public OpenAdvancedChooser(MainForm mainForm, Config config, IGameInfo game)
{
_mainForm = mainForm;
_config = config;
_game = game;
InitializeComponent();
@ -70,7 +73,7 @@ namespace BizHawk.Client.EmuHawk
try
{
var coreComm = _mainForm.CreateCoreComm();
using var retro = new LibretroCore(coreComm, GlobalWin.Game, core);
using var retro = new LibretroCore(coreComm, _game, core);
btnLibretroLaunchGame.Enabled = true;
if (retro.Description.SupportsNoGame)
btnLibretroLaunchNoGame.Enabled = true;

View File

@ -13,12 +13,12 @@
/// <summary>
/// produces a path that contains saveram... because libretro cores need it
/// </summary>
string GetRetroSaveRAMDirectory(GameInfo game);
string GetRetroSaveRAMDirectory(IGameInfo game);
/// <summary>
/// produces a path for use as a libretro system path (different for each core)
/// </summary>
string GetRetroSystemPath(GameInfo game);
string GetRetroSystemPath(IGameInfo game);
/// <summary>
/// Get a firmware as a byte array

View File

@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Libretro
private LibretroApi api;
// TODO: codepath just for introspection (lighter weight; no speex, no controls, etc.)
public LibretroCore(CoreComm nextComm, GameInfo game, string corePath)
public LibretroCore(CoreComm nextComm, IGameInfo game, string corePath)
{
ServiceProvider = new BasicServiceProvider(this);
_SyncSettings = new SyncSettings();