From 629c8751ae2d851de921a229b3f78a8a8cda7e39 Mon Sep 17 00:00:00 2001 From: Tomas Maly Date: Tue, 29 Oct 2024 13:13:44 +0100 Subject: [PATCH] fix for clang-15 --- sources/libengine/window/window.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/libengine/window/window.cpp b/sources/libengine/window/window.cpp index 5eb01771..a06a4f84 100644 --- a/sources/libengine/window/window.cpp +++ b/sources/libengine/window/window.cpp @@ -335,10 +335,12 @@ namespace cage if (glfwGetMouseButton(w, GLFW_MOUSE_BUTTON_MIDDLE)) e.buttons |= MouseButtonsFlags::Middle; e.relative = impl->getRelative(); + static_assert(sizeof(input::MouseRelativeMove) == sizeof(input::privat::BaseMouse)); + static_assert(sizeof(input::MouseMove) == sizeof(input::privat::BaseMouse)); if (e.relative) - impl->eventsQueue.push(input::MouseRelativeMove(e)); + impl->eventsQueue.push(*(input::MouseRelativeMove *)(&e)); else - impl->eventsQueue.push(input::MouseMove(e)); + impl->eventsQueue.push(*(input::MouseMove *)(&e)); } void windowMouseButtonCallback(GLFWwindow *w, int button, int action, int mods)