aboutsummaryrefslogtreecommitdiff
path: root/source/30-game/World.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/30-game/World.cpp')
-rw-r--r--source/30-game/World.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/source/30-game/World.cpp b/source/30-game/World.cpp
index 5d3a8c5..83b9a10 100644
--- a/source/30-game/World.cpp
+++ b/source/30-game/World.cpp
@@ -22,11 +22,6 @@ void CallGameObjectRecursive(GameObject* start, TFunction&& func) {
func(obj);
}
}
-
-struct DrawCall {
- GLuint vao;
- GLuint vbo;
-};
} // namespace ProjectBrussel_UNITY_ID
GameWorld::GameWorld()
@@ -46,21 +41,31 @@ const GameObject& GameWorld::GetRoot() const {
};
void GameWorld::Awaken() {
- if (mAwakened) return;
+ using namespace ProjectBrussel_UNITY_ID;
+
+ if (mAwakened) {
+ return;
+ }
- ProjectBrussel_UNITY_ID::CallGameObjectRecursive(mRoot, [](GameObject* obj) { obj->Awaken(); });
+ CallGameObjectRecursive(mRoot, [](GameObject* obj) { obj->Awaken(); });
mAwakened = true;
}
void GameWorld::Resleep() {
- if (!mAwakened) return;
+ using namespace ProjectBrussel_UNITY_ID;
+
+ if (!mAwakened) {
+ return;
+ }
- ProjectBrussel_UNITY_ID::CallGameObjectRecursive(mRoot, [](GameObject* obj) { obj->Resleep(); });
+ CallGameObjectRecursive(mRoot, [](GameObject* obj) { obj->Resleep(); });
mAwakened = false;
}
void GameWorld::Update() {
- ProjectBrussel_UNITY_ID::CallGameObjectRecursive(mRoot, [this](GameObject* obj) {
+ using namespace ProjectBrussel_UNITY_ID;
+
+ CallGameObjectRecursive(mRoot, [this](GameObject* obj) {
obj->Update();
});
}