Move gamedb init before single-instance check

This commit is contained in:
YoshiRulz 2024-10-24 04:27:30 +10:00
parent 09a39a5630
commit 9ce3771e85
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 25 additions and 9 deletions

View File

@ -26,7 +26,6 @@ using BizHawk.Client.Common;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Common.Base_Implementations;
using BizHawk.Emulation.Cores;
using BizHawk.Emulation.Cores.Arcades.MAME;
using BizHawk.Emulation.Cores.Computers.AppleII;
using BizHawk.Emulation.Cores.Computers.Commodore64;
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
@ -407,14 +406,6 @@ namespace BizHawk.Client.EmuHawk
}
}
//do this threaded stuff early so it has plenty of time to run in background
Database.InitializeDatabase(
bundledRoot: Path.Combine(PathUtils.ExeDirectoryPath, "gamedb"),
userRoot: Path.Combine(PathUtils.DataDirectoryPath, "gamedb"),
silent: true);
BootGodDb.Initialize(Path.Combine(PathUtils.ExeDirectoryPath, "gamedb"));
MAMEMachineDB.Initialize(Path.Combine(PathUtils.ExeDirectoryPath, "gamedb"));
_argParser = cliFlags;
_getConfigPath = getConfigPath;
GL = gl;

View File

@ -11,6 +11,7 @@ using BizHawk.Common;
using BizHawk.Common.PathExtensions;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk.CustomControls;
using BizHawk.Emulation.Cores;
namespace BizHawk.Client.EmuHawk
{
@ -314,6 +315,7 @@ namespace BizHawk.Client.EmuHawk
var exitCode = 0;
try
{
GameDBHelper.BackgroundInitAll();
MainForm mf = new(
cliFlags,
workingGL,

View File

@ -0,0 +1,23 @@
using System.IO;
using BizHawk.Common.PathExtensions;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Arcades.MAME;
using BizHawk.Emulation.Cores.Nintendo.NES;
namespace BizHawk.Emulation.Cores
{
public static class GameDBHelper
{
public static void BackgroundInitAll()
{
var bundledGamedbPath = Path.Combine(PathUtils.ExeDirectoryPath, "gamedb");
Database.InitializeDatabase(
bundledRoot: bundledGamedbPath,
userRoot: Path.Combine(PathUtils.DataDirectoryPath, "gamedb"),
silent: true);
BootGodDb.Initialize(bundledGamedbPath);
MAMEMachineDB.Initialize(bundledGamedbPath);
}
}
}