From e3103fff022cbf32060fbb7fa2f8daced23cf925 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 25 Jan 2022 19:00:52 +0100 Subject: [PATCH] - fixed sky tiling. --- source/core/psky.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/core/psky.cpp b/source/core/psky.cpp index cf88220a6..e9a71c271 100644 --- a/source/core/psky.cpp +++ b/source/core/psky.cpp @@ -101,9 +101,9 @@ SkyDefinition getSky(int tilenum) int w = tileWidth(tilenum); if (result.lognumtiles == 0 || w >= 256) { - int bits = sizeToBits(w); - result.lognumtiles = 11 - bits; - if ((1 << bits) < w) result.lognumtiles--; // round down if not a power of two + if (w < 512) result.lognumtiles = 2; + else if (w < 1024) result.lognumtiles = 1; + else result.lognumtiles = 0; } }