diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-11 14:46:50 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-11 18:56:57 -0500 |
| commit | ba250cc496b2e617823ff8111ef463b6adea27f4 (patch) | |
| tree | dc926851da01b970aca827d6c6ca84b87a7432fa /editor | |
| parent | 8047197b62894cb1f7bb6a6871870e4b91fde992 (diff) | |
replace handles with union struct
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/editor.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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<EntityHandle_T>(rayResult.m_collisionObject->getUserPointer())}; - hoveredEntity = EntityHandle{hoveredEntity_T}; + hoveredEntity.hash = reinterpret_cast<uint64_t>(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<PhysicsCollision_T>(et.bt.startingCollisionLayer); compInst.bt.rigidBody->getBroadphaseProxy()->m_collisionFilterMask = static_cast<PhysicsCollision_T>(et.bt.startingCollisionMask); - compInst.bt.rigidBody->setUserPointer(reinterpret_cast<void *>(compInst.entHandle)); + compInst.bt.rigidBody->setUserPointer(reinterpret_cast<void *>(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<EntityHandle_T>(entity->handle)); + ImGui::Text("0x%016lX", entity->handle.hash); ImGui::TableSetColumnIndex(2); - ImGui::Text("0x%016lX", static_cast<EntityHandle_T>(entity->parentHandle)); + ImGui::Text("0x%016lX", entity->parentHandle.hash); ImGui::TableSetColumnIndex(3); - ImGui::Text("0x%016lX", static_cast<GrBindsHandle_T>(entity->grBindsHandle)); + ImGui::Text("0x%016lX", entity->grBindsHandle.hash); ImGui::TableSetColumnIndex(4); - ImGui::Text("0x%016lX", static_cast<InstanceHandle_T>(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<CameraHandle_T>(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); |
