diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-08 14:22:22 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-08 14:22:22 +1000 |
commit | 8a8a0501590e83cbc598c7491fca0b767094466f (patch) | |
tree | 4fd806e646179fa9a7e4027cc60e19492d003ade /source/rendering/StarWorldCamera.cpp | |
parent | 4458d2e85ed7f9e373af290dbe8063a52d2824b5 (diff) |
2 features: multi-sample anti-aliasing & Lua patches for images
Diffstat (limited to 'source/rendering/StarWorldCamera.cpp')
-rw-r--r-- | source/rendering/StarWorldCamera.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/rendering/StarWorldCamera.cpp b/source/rendering/StarWorldCamera.cpp index 0344bd6..81e599f 100644 --- a/source/rendering/StarWorldCamera.cpp +++ b/source/rendering/StarWorldCamera.cpp @@ -2,12 +2,13 @@ namespace Star { -void WorldCamera::setCenterWorldPosition(Vec2F const& position) { +void WorldCamera::setCenterWorldPosition(Vec2F const& position, bool force) { // Only actually move the world center if a half pixel distance has been // moved in any direction. This is sort of arbitrary, but helps prevent // judder if the camera is at a boundary and floating point inaccuracy is // causing the focus to jitter back and forth across the boundary. - if (fabs(position[0] - m_worldCenter[0]) < 1.0f / (TilePixels * m_pixelRatio * 2) && fabs(position[1] - m_worldCenter[1]) < 1.0f / (TilePixels * m_pixelRatio * 2)) + if (fabs(position[0] - m_worldCenter[0]) < 1.0f / (TilePixels * m_pixelRatio * 2) + && fabs(position[1] - m_worldCenter[1]) < 1.0f / (TilePixels * m_pixelRatio * 2) && !force) return; // First, make sure the camera center position is inside the main x |