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;
|
||||
|
||||
static bool Initialize(bool initializeHardwareInfo = true, bool initializeTaskScheduler = true);
|
||||
static bool Initialize(bool initializeHardwareInfo = false, bool initializeTaskScheduler = false);
|
||||
|
||||
static bool IsInitialized();
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
|
||||
bool NzCore::Initialize(bool initializeHardwareInfo, bool initializeTaskScheduler)
|
||||
{
|
||||
if (s_moduleReferenceCounter++ != 0)
|
||||
return true; // Déjà initialisé
|
||||
s_moduleReferenceCounter++;
|
||||
|
||||
// Initialisation du module
|
||||
if (initializeHardwareInfo && !NzHardwareInfo::Initialize())
|
||||
|
|
@ -27,6 +26,10 @@ bool NzCore::Initialize(bool initializeHardwareInfo, bool initializeTaskSchedule
|
|||
return false;
|
||||
}
|
||||
|
||||
// Vérification après l'initialisation des sous-modules
|
||||
if (s_moduleReferenceCounter != 0)
|
||||
return true; // Déjà initialisé
|
||||
|
||||
NazaraNotice("Initialized: Core");
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -364,7 +364,12 @@ bool NzRenderer::HasCapability(nzRendererCap capability)
|
|||
bool NzRenderer::Initialize(bool initializeDebugDrawer)
|
||||
{
|
||||
if (s_moduleReferenceCounter++ != 0)
|
||||
{
|
||||
if (initializeDebugDrawer && !NzDebugDrawer::Initialize())
|
||||
NazaraWarning("Failed to initialize debug drawer"); // Non-critique
|
||||
|
||||
return true; // Déjà initialisé
|
||||
}
|
||||
|
||||
// Initialisation des dépendances
|
||||
if (!NzUtility::Initialize())
|
||||
|
|
|
|||
Loading…
Reference in New Issue