summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/graphics/tile-map.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/chickadee/graphics/tile-map.scm b/chickadee/graphics/tile-map.scm
index 1453407..083d61e 100644
--- a/chickadee/graphics/tile-map.scm
+++ b/chickadee/graphics/tile-map.scm
@@ -912,6 +912,15 @@ argument may be used to specify a list of layers to draw, instead."
(vec2-copy! camera *position*)
(vec2-mult! *position* -1.0)
(vec2-add! *position* position)
+ ;; XXX: Round position to nearest pixel to maybe avoid texture
+ ;; artifacts caused by texels not aligning perfectly with the
+ ;; viewport pixels. Of course, if the projection matrix isn't pixel
+ ;; perfect, or if the map is scaled, or if there is rotation, then
+ ;; this issue can happen anyway. Sigh... much to learn about how to
+ ;; improve this.
+ (set-vec2! *position*
+ (round (vec2-x *position*))
+ (round (vec2-y *position*)))
(matrix4-2d-transform! *matrix*
#:origin origin
#:position *position*