From 56f2533754f5fbf3aac32d982835509f6e975323 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 24 Jun 2023 12:38:39 -0500 Subject: [PATCH] [nostalgia/core/studio] Cleanup reinterpret_cast --- .../modules/core/src/studio/tilesheeteditor-imgui.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor-imgui.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor-imgui.cpp index f1db8baa..7dbcaf28 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor-imgui.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor-imgui.cpp @@ -289,9 +289,11 @@ void TileSheetEditorImGui::drawTileSheet(const ox::Vec2 &fbSize) noexcept { glViewport(0, 0, fbSizei.width, fbSizei.height); m_tileSheetEditor.draw(); glBindFramebuffer(GL_FRAMEBUFFER, 0); - const uintptr_t buffId = m_framebuffer.color.id; + ImTextureID buffId{}; + static_assert(sizeof(ImTextureID) >= sizeof(m_framebuffer.color.id)); + memcpy(&buffId, &m_framebuffer.color.id, sizeof(m_framebuffer.color.id)); ImGui::Image( - reinterpret_cast(buffId), + buffId, static_cast(fbSize), ImVec2(0, 1), ImVec2(1, 0));