diff --git a/SHADE_Engine/SHADE_Engine.vcxproj b/SHADE_Engine/SHADE_Engine.vcxproj
index 1831bff6..d84f3c05 100644
--- a/SHADE_Engine/SHADE_Engine.vcxproj
+++ b/SHADE_Engine/SHADE_Engine.vcxproj
@@ -114,6 +114,8 @@
+
+
@@ -200,6 +202,8 @@
+
+
diff --git a/SHADE_Engine/SHADE_Engine.vcxproj.filters b/SHADE_Engine/SHADE_Engine.vcxproj.filters
index 70a5b407..8fc412c5 100644
--- a/SHADE_Engine/SHADE_Engine.vcxproj.filters
+++ b/SHADE_Engine/SHADE_Engine.vcxproj.filters
@@ -386,6 +386,8 @@
Tools
+
+
@@ -587,5 +589,7 @@
Tools
+
+
\ No newline at end of file
diff --git a/SHADE_Engine/src/ECS_Base/Managers/SHSystemManager.cpp b/SHADE_Engine/src/ECS_Base/Managers/SHSystemManager.cpp
index 5b861161..acf7cba3 100644
--- a/SHADE_Engine/src/ECS_Base/Managers/SHSystemManager.cpp
+++ b/SHADE_Engine/src/ECS_Base/Managers/SHSystemManager.cpp
@@ -14,10 +14,14 @@
#include "SHSystemManager.h"
#include
+#include
+#include
+#include
+
namespace SHADE
{
SHSystemManager::SystemContainer SHSystemManager::systemContainer;
-
+ SHSystemManager::SystemRoutineContainer SHSystemManager::systemRoutineContainer;
void SHSystemManager::Init() noexcept
{
@@ -30,11 +34,36 @@ namespace SHADE
}
}
+ void SHSystemManager::RunRoutines(bool editorPause) noexcept
+ {
+ for (auto& routine : systemRoutineContainer)
+ {
+ if (editorPause == true)
+ {
+ if (routine.get()->IsRunInEditorPause)
+ {
+ std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();
+ routine.get()->Execute(0.0);
+ std::chrono::high_resolution_clock::time_point end = std::chrono::high_resolution_clock::now();
+ routine.get()->stats.executionTime = std::chrono::duration(end - start).count();
+ }
+ }
+ else
+ {
+ std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();
+ routine.get()->Execute(0.0);
+ std::chrono::high_resolution_clock::time_point end = std::chrono::high_resolution_clock::now();
+ routine.get()->stats.executionTime = std::chrono::duration(end - start).count();
+ }
+ }
+ }
+
+
void SHSystemManager::Exit() noexcept
{
- for (auto& system : systemContainer)
+ for (SystemContainer::reverse_iterator it = systemContainer.rbegin(); it != systemContainer.rend(); ++it)
{
- system.second->Exit();
+ (*it).second->Exit();
//delete system.second;
}
diff --git a/SHADE_Engine/src/ECS_Base/Managers/SHSystemManager.h b/SHADE_Engine/src/ECS_Base/Managers/SHSystemManager.h
index 7d4e8c27..616a8db3 100644
--- a/SHADE_Engine/src/ECS_Base/Managers/SHSystemManager.h
+++ b/SHADE_Engine/src/ECS_Base/Managers/SHSystemManager.h
@@ -13,30 +13,29 @@
#pragma once
-#include
+#include