Fix sample distance power of two rounding

This commit is contained in:
RaveYard 2023-09-11 00:44:15 +02:00 committed by Christoph Oelckers
parent 5c60c9473f
commit 9595bd3b7a

View file

@ -1118,7 +1118,7 @@ void DoomLevelMesh::BuildSurfaceParams(int lightMapTextureWidth, int lightMapTex
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
++n;
n = (n + 1) >> 1;
surface.sampleDimension = uint16_t(n) ? uint16_t(n) : uint16_t(0xFFFF);
}