From ba250cc496b2e617823ff8111ef463b6adea27f4 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Mon, 11 Dec 2023 14:46:50 -0500 Subject: replace handles with union struct --- editor/editor.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'editor') diff --git a/editor/editor.cpp b/editor/editor.cpp index 9b79155..4ef9b26 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -186,8 +186,7 @@ void PkeEditor_Tick(double delta) { BtDynamicsWorld->rayTest(rayOrigin, rayDestination, rayResult); if (rayResult.hasHit()) { - EntityHandle_T hoveredEntity_T{reinterpret_cast(rayResult.m_collisionObject->getUserPointer())}; - hoveredEntity = EntityHandle{hoveredEntity_T}; + hoveredEntity.hash = reinterpret_cast(rayResult.m_collisionObject->getUserPointer()); } } @@ -248,7 +247,7 @@ void PkeEditor_Tick(double delta) { BtDynamicsWorld->addRigidBody(compInst.bt.rigidBody); compInst.bt.rigidBody->getBroadphaseProxy()->m_collisionFilterGroup = static_cast(et.bt.startingCollisionLayer); compInst.bt.rigidBody->getBroadphaseProxy()->m_collisionFilterMask = static_cast(et.bt.startingCollisionMask); - compInst.bt.rigidBody->setUserPointer(reinterpret_cast(compInst.entHandle)); + compInst.bt.rigidBody->setUserPointer(reinterpret_cast(compInst.entHandle.hash)); } PkeInputEventHolder holder = PkeInput_Query(dbgCtrl_CameraButtonMask); @@ -479,13 +478,13 @@ void RecordImGuiEntityList() { selectedEntity = entity->handle; ImGui::EndDisabled(); ImGui::TableSetColumnIndex(1); - ImGui::Text("0x%016lX", static_cast(entity->handle)); + ImGui::Text("0x%016lX", entity->handle.hash); ImGui::TableSetColumnIndex(2); - ImGui::Text("0x%016lX", static_cast(entity->parentHandle)); + ImGui::Text("0x%016lX", entity->parentHandle.hash); ImGui::TableSetColumnIndex(3); - ImGui::Text("0x%016lX", static_cast(entity->grBindsHandle)); + ImGui::Text("0x%016lX", entity->grBindsHandle.hash); ImGui::TableSetColumnIndex(4); - ImGui::Text("0x%016lX", static_cast(entity->instanceHandle)); + ImGui::Text("0x%016lX", entity->instanceHandle.hash); ImGui::TableSetColumnIndex(5); ImGui::Text("%u", entity->isMarkedForRemoval); ImGui::TableSetColumnIndex(6); @@ -551,7 +550,7 @@ void RecordImGuiCameras() { } ImGui::EndDisabled(); ImGui::TableSetColumnIndex(1); - ImGui::Text("0x%016lX", static_cast(cam.handle)); + ImGui::Text("0x%016lX", cam.handle.hash); ImGui::TableSetColumnIndex(2); ImGui::Text("%4.2f,%4.2f,%4.2f", cam.pos[0], cam.pos[1], cam.pos[2]); ImGui::TableSetColumnIndex(3); -- cgit v1.2.3