changeset 1341:f65f25233127

fix: transparent tiles are loaded
author sam <sam@basx.dev>
date Sat, 24 Aug 2024 23:03:19 +0700
parents deefc3573b6e
children 34ae5835bfa8
files semicongine/image.nim
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/image.nim	Sat Aug 24 22:30:08 2024 +0700
+++ b/semicongine/image.nim	Sat Aug 24 23:03:19 2024 +0700
@@ -146,9 +146,9 @@
     tilesY = height div tilesize
   result = ImageArray[T](width: tilesize, height: tilesize)
   var tile = newSeq[T](tilesize * tilesize)
-  var hasNonTransparent = when T is BGRA: false else: true
   for ty in 0 ..< tilesY:
     for tx in 0 ..< tilesY:
+      var hasNonTransparent = when T is BGRA: false else: true
       let baseI = ty * tilesize * width + tx * tilesize
       for y in 0 ..< tilesize:
         for x in 0 ..< tilesize: