# HG changeset patch # User sam # Date 1735710163 -25200 # Node ID a4fd9c31a225769920956f9dbe04f4e571eaedfe # Parent 62ebf735ecfadea915b6a3b75ead35b0e829a86d did: clean up compiler warnings diff -r 62ebf735ecfa -r a4fd9c31a225 semicongine/gltf.nim --- a/semicongine/gltf.nim Fri Dec 27 22:00:46 2024 +0700 +++ b/semicongine/gltf.nim Wed Jan 01 12:42:43 2025 +0700 @@ -236,7 +236,7 @@ ): TMaterial = result = TMaterial() - let pbr = materialNode["pbrMetallicRoughness"] + let pbr {.warning[InheritFromException]: off.} = materialNode["pbrMetallicRoughness"] for name, value in fieldPairs(result): for gltfAttribute, mappedName in fieldPairs(mapping): when gltfAttribute != "" and name == mappedName: diff -r 62ebf735ecfa -r a4fd9c31a225 semicongine/loaders.nim --- a/semicongine/loaders.nim Fri Dec 27 22:00:46 2024 +0700 +++ b/semicongine/loaders.nim Wed Jan 01 12:42:43 2025 +0700 @@ -27,10 +27,6 @@ ): Image[T] {.gcsafe.} = assert path.splitFile().ext.toLowerAscii == ".png", "Unsupported image type: " & path.splitFile().ext.toLowerAscii - when T is Gray: - let pngType = 0.cint - elif T is BGRA: - let pngType = 6.cint let (width, height, data) = loadImageData[T](loadResource_intern(path, package = package).readAll()) @@ -43,10 +39,6 @@ for path in paths: assert path.splitFile().ext.toLowerAscii == ".png", "Unsupported image type: " & path.splitFile().ext.toLowerAscii - when T is Gray: - let pngType = 0.cint - elif T is BGRA: - let pngType = 6.cint let (width, height, data) = loadImageData[T](loadResource_intern(paths[0], package = package).readAll()) @@ -66,18 +58,14 @@ ): ImageArray[T] {.gcsafe.} = assert path.splitFile().ext.toLowerAscii == ".png", "Unsupported image type: " & path.splitFile().ext.toLowerAscii - when T is Gray: - let pngType = 0.cint - elif T is BGRA: - let pngType = 6.cint let (width, height, data) = loadImageData[T](loadResource_intern(path, package = package).readAll()) - let - tilesX = width div tilesize - tilesY = height div tilesize + let tilesY = height div tilesize + result = ImageArray[T](width: tilesize, height: tilesize) var tile = newSeq[T](tilesize * tilesize) + for ty in 0 ..< tilesY: for tx in 0 ..< tilesY: var hasNonTransparent = when T is BGRA: false else: true