diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-03-14 21:17:05 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-03-14 21:17:05 +1100 |
commit | 8164e5ae6fa33c9ec2a14f107585a7cbe7fbf813 (patch) | |
tree | 07506664de68caa581dd55b8d65b6ee22887373f /source/rendering/StarWorldCamera.hpp | |
parent | 353406780181feffaa4836d387db4f7337ce6cce (diff) |
Game window respects Windows theme setting
Diffstat (limited to 'source/rendering/StarWorldCamera.hpp')
-rw-r--r-- | source/rendering/StarWorldCamera.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/rendering/StarWorldCamera.hpp b/source/rendering/StarWorldCamera.hpp index d83a31a..e022560 100644 --- a/source/rendering/StarWorldCamera.hpp +++ b/source/rendering/StarWorldCamera.hpp @@ -88,15 +88,15 @@ inline Vec2F WorldCamera::centerWorldPosition() const { inline Vec2F WorldCamera::worldToScreen(Vec2F const& worldCoord) const { Vec2F wrappedCoord = m_worldGeometry.nearestTo(Vec2F(m_worldCenter), worldCoord); return Vec2F( - (wrappedCoord[0] - m_worldCenter[0]) * (TilePixels * m_pixelRatio) + m_screenSize[0] / 2.0, - (wrappedCoord[1] - m_worldCenter[1]) * (TilePixels * m_pixelRatio) + m_screenSize[1] / 2.0 + (wrappedCoord[0] - m_worldCenter[0]) * (TilePixels * m_pixelRatio) + (float)m_screenSize[0] / 2.0, + (wrappedCoord[1] - m_worldCenter[1]) * (TilePixels * m_pixelRatio) + (float)m_screenSize[1] / 2.0 ); } inline Vec2F WorldCamera::screenToWorld(Vec2F const& screen) const { return Vec2F( - (screen[0] - m_screenSize[0] / 2.0) / (TilePixels * m_pixelRatio) + m_worldCenter[0], - (screen[1] - m_screenSize[1] / 2.0) / (TilePixels * m_pixelRatio) + m_worldCenter[1] + (screen[0] - (float)m_screenSize[0] / 2.0) / (TilePixels * m_pixelRatio) + m_worldCenter[0], + (screen[1] - (float)m_screenSize[1] / 2.0) / (TilePixels * m_pixelRatio) + m_worldCenter[1] ); } |