From 9bdaea10f55d72e0ec6e68a33f638c9c1ec3a389 Mon Sep 17 00:00:00 2001 From: Diren D Bharwani Date: Wed, 23 Nov 2022 16:56:25 +0800 Subject: [PATCH 1/2] Fixed...another..bug...:( --- SHADE_Application/src/Scenes/SBMainScene.cpp | 8 ++++++-- SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp | 8 +++++++- SHADE_Engine/src/Physics/System/SHPhysicsSystem.h | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/SHADE_Application/src/Scenes/SBMainScene.cpp b/SHADE_Application/src/Scenes/SBMainScene.cpp index 521dd275..73926115 100644 --- a/SHADE_Application/src/Scenes/SBMainScene.cpp +++ b/SHADE_Application/src/Scenes/SBMainScene.cpp @@ -44,8 +44,6 @@ namespace Sandbox { sceneName = SHSerialization::DeserializeSceneFromFile(sceneAssetID); - #ifndef SHEDITOR - auto* physicsSystem = SHSystemManager::GetSystem(); if (!physicsSystem) { @@ -53,6 +51,12 @@ namespace Sandbox return; } + #ifdef SHEDITOR + + physicsSystem->ForceBuild(SHSceneManager::GetCurrentSceneGraph()); + + #else + physicsSystem->BuildScene(SHSceneManager::GetCurrentSceneGraph()); #endif diff --git a/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp b/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp index 9eab928d..061b7b26 100644 --- a/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp +++ b/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp @@ -188,6 +188,13 @@ namespace SHADE objectManager.UpdateCommands(); } + void SHPhysicsSystem::ForceBuild(SHSceneGraph& sceneGraph) + { + // HACK: Band-aid fix. To be removed. + objectManager.UpdateCommands(); + } + + void SHPhysicsSystem::ForceUpdate() { if (!worldState.world) @@ -419,7 +426,6 @@ namespace SHADE for (size_t i = 0; i < COLLIDER->GetCollisionShapes().size(); ++i) objectManager.AddCollisionShape(EID, i); } - }; //////////////////////////////// diff --git a/SHADE_Engine/src/Physics/System/SHPhysicsSystem.h b/SHADE_Engine/src/Physics/System/SHPhysicsSystem.h index f7340d31..8d49450d 100644 --- a/SHADE_Engine/src/Physics/System/SHPhysicsSystem.h +++ b/SHADE_Engine/src/Physics/System/SHPhysicsSystem.h @@ -78,9 +78,9 @@ namespace SHADE void Exit () override; void BuildScene (SHSceneGraph& sceneGraph); + void ForceBuild (SHSceneGraph& sceneGraph); void ForceUpdate (); - /** * @brief Casts a ray into the world. * @param ray The ray to cast. From 20a1fdc16ea884b2208f202d217d12a91db89e25 Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Wed, 23 Nov 2022 17:03:57 +0800 Subject: [PATCH 2/2] Fixed Application::Close() not closing but instead minimizing the window --- .../Graphics/MiddleEnd/Interface/SHGraphicsSystemInterface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystemInterface.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystemInterface.cpp index 1ad46e04..4b9a1e67 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystemInterface.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystemInterface.cpp @@ -69,7 +69,8 @@ namespace SHADE if (gfxSystem) { auto WND = gfxSystem->GetWindow(); - return WND->Close(); + if (WND) + WND->Destroy(); } SHLOG_WARNING("[SHGraphicsSystemInterface] Failed to close window.");