Changed module initialisation behavior
Former-commit-id: f3901c7785ab89b113afd961d7a51b609db2e314
This commit is contained in:
parent
861c1b6a38
commit
00d636fb1c
|
|
@ -16,7 +16,7 @@ class NAZARA_API NzCore
|
||||||
NzCore() = delete;
|
NzCore() = delete;
|
||||||
~NzCore() = delete;
|
~NzCore() = delete;
|
||||||
|
|
||||||
static bool Initialize(bool initializeHardwareInfo = true, bool initializeTaskScheduler = true);
|
static bool Initialize(bool initializeHardwareInfo = false, bool initializeTaskScheduler = false);
|
||||||
|
|
||||||
static bool IsInitialized();
|
static bool IsInitialized();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,7 @@
|
||||||
|
|
||||||
bool NzCore::Initialize(bool initializeHardwareInfo, bool initializeTaskScheduler)
|
bool NzCore::Initialize(bool initializeHardwareInfo, bool initializeTaskScheduler)
|
||||||
{
|
{
|
||||||
if (s_moduleReferenceCounter++ != 0)
|
s_moduleReferenceCounter++;
|
||||||
return true; // Déjà initialisé
|
|
||||||
|
|
||||||
// Initialisation du module
|
// Initialisation du module
|
||||||
if (initializeHardwareInfo && !NzHardwareInfo::Initialize())
|
if (initializeHardwareInfo && !NzHardwareInfo::Initialize())
|
||||||
|
|
@ -27,6 +26,10 @@ bool NzCore::Initialize(bool initializeHardwareInfo, bool initializeTaskSchedule
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Vérification après l'initialisation des sous-modules
|
||||||
|
if (s_moduleReferenceCounter != 0)
|
||||||
|
return true; // Déjà initialisé
|
||||||
|
|
||||||
NazaraNotice("Initialized: Core");
|
NazaraNotice("Initialized: Core");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -364,7 +364,12 @@ bool NzRenderer::HasCapability(nzRendererCap capability)
|
||||||
bool NzRenderer::Initialize(bool initializeDebugDrawer)
|
bool NzRenderer::Initialize(bool initializeDebugDrawer)
|
||||||
{
|
{
|
||||||
if (s_moduleReferenceCounter++ != 0)
|
if (s_moduleReferenceCounter++ != 0)
|
||||||
|
{
|
||||||
|
if (initializeDebugDrawer && !NzDebugDrawer::Initialize())
|
||||||
|
NazaraWarning("Failed to initialize debug drawer"); // Non-critique
|
||||||
|
|
||||||
return true; // Déjà initialisé
|
return true; // Déjà initialisé
|
||||||
|
}
|
||||||
|
|
||||||
// Initialisation des dépendances
|
// Initialisation des dépendances
|
||||||
if (!NzUtility::Initialize())
|
if (!NzUtility::Initialize())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue