Made Submodules initialized when used
Former-commit-id: 203a4a3b07e18301ce003129bb6af22e0478d07a
This commit is contained in:
parent
8c6c58c677
commit
b30d325ca5
|
|
@ -70,6 +70,9 @@ namespace
|
|||
|
||||
NzString NzHardwareInfo::GetProcessorBrandString()
|
||||
{
|
||||
if (!Initialize())
|
||||
NazaraError("Failed to initialize HardwareInfo");
|
||||
|
||||
return s_brandString;
|
||||
}
|
||||
|
||||
|
|
@ -82,11 +85,17 @@ unsigned int NzHardwareInfo::GetProcessorCount()
|
|||
|
||||
nzProcessorVendor NzHardwareInfo::GetProcessorVendor()
|
||||
{
|
||||
if (!Initialize())
|
||||
NazaraError("Failed to initialize HardwareInfo");
|
||||
|
||||
return s_vendorEnum;
|
||||
}
|
||||
|
||||
NzString NzHardwareInfo::GetProcessorVendorName()
|
||||
{
|
||||
if (!Initialize())
|
||||
NazaraError("Failed to initialize HardwareInfo");
|
||||
|
||||
return vendorNames[s_vendorEnum+1];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,14 @@ bool NzTaskScheduler::Initialize()
|
|||
|
||||
void NzTaskScheduler::Run()
|
||||
{
|
||||
NzTaskSchedulerImpl::Run(&s_pendingWorks[0], s_pendingWorks.size());
|
||||
s_pendingWorks.clear();
|
||||
if (!Initialize())
|
||||
NazaraError("Failed to initialize TaskScheduler");
|
||||
|
||||
if (!s_pendingWorks.empty())
|
||||
{
|
||||
NzTaskSchedulerImpl::Run(&s_pendingWorks[0], s_pendingWorks.size());
|
||||
s_pendingWorks.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void NzTaskScheduler::SetWorkerCount(unsigned int workerCount)
|
||||
|
|
@ -59,18 +65,16 @@ void NzTaskScheduler::Uninitialize()
|
|||
|
||||
void NzTaskScheduler::WaitForTasks()
|
||||
{
|
||||
if (!Initialize())
|
||||
NazaraError("Failed to initialize TaskScheduler");
|
||||
|
||||
NzTaskSchedulerImpl::WaitForTasks();
|
||||
}
|
||||
|
||||
void NzTaskScheduler::AddTaskFunctor(NzFunctor* taskFunctor)
|
||||
{
|
||||
#ifdef NAZARA_CORE_SAFE
|
||||
if (!NzTaskSchedulerImpl::IsInitialized())
|
||||
{
|
||||
NazaraError("Task scheduler is not initialized");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (!Initialize())
|
||||
NazaraError("Failed to initialize TaskScheduler");
|
||||
|
||||
s_pendingWorks.push_back(taskFunctor);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,12 @@ namespace
|
|||
|
||||
void NzDebugDrawer::Draw(const NzBoundingVolumef& volume)
|
||||
{
|
||||
if (!Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialize Debug Drawer");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!volume.IsFinite())
|
||||
return;
|
||||
|
||||
|
|
@ -53,7 +59,7 @@ void NzDebugDrawer::Draw(const NzBoxi& box)
|
|||
|
||||
void NzDebugDrawer::Draw(const NzBoxf& box)
|
||||
{
|
||||
if (!s_initialized && !Initialize())
|
||||
if (!Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialize Debug Drawer");
|
||||
return;
|
||||
|
|
@ -144,7 +150,7 @@ void NzDebugDrawer::Draw(const NzBoxui& box)
|
|||
|
||||
void NzDebugDrawer::Draw(const NzFrustumf& frustum)
|
||||
{
|
||||
if (!s_initialized && !Initialize())
|
||||
if (!Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialize Debug Drawer");
|
||||
return;
|
||||
|
|
@ -226,7 +232,7 @@ void NzDebugDrawer::Draw(const NzFrustumf& frustum)
|
|||
|
||||
void NzDebugDrawer::Draw(const NzOrientedBoxf& orientedBox)
|
||||
{
|
||||
if (!s_initialized && !Initialize())
|
||||
if (!Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialize Debug Drawer");
|
||||
return;
|
||||
|
|
@ -308,7 +314,7 @@ void NzDebugDrawer::Draw(const NzOrientedBoxf& orientedBox)
|
|||
|
||||
void NzDebugDrawer::Draw(const NzSkeleton* skeleton)
|
||||
{
|
||||
if (!s_initialized && !Initialize())
|
||||
if (!Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialize Debug Drawer");
|
||||
return;
|
||||
|
|
@ -359,7 +365,7 @@ void NzDebugDrawer::Draw(const NzSkeleton* skeleton)
|
|||
|
||||
void NzDebugDrawer::DrawBinormals(const NzStaticMesh* subMesh)
|
||||
{
|
||||
if (!s_initialized && !Initialize())
|
||||
if (!Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialize Debug Drawer");
|
||||
return;
|
||||
|
|
@ -406,7 +412,7 @@ void NzDebugDrawer::DrawBinormals(const NzStaticMesh* subMesh)
|
|||
|
||||
void NzDebugDrawer::DrawCone(const NzVector3f& origin, const NzQuaternionf& rotation, float angle, float length)
|
||||
{
|
||||
if (!s_initialized && !Initialize())
|
||||
if (!Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialize Debug Drawer");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue