Add error detections when the surfaces sizes do not match

This commit is contained in:
RaveYard 2023-09-14 20:56:09 +02:00 committed by Christoph Oelckers
parent 439c47d399
commit 3943123ef6

View file

@ -3160,6 +3160,17 @@ void MapLoader::LoadLightmap(MapData* map)
continue;
}
if (realSurface.texWidth != surface.width || realSurface.texHeight != surface.height)
{
errors = true;
if (developer >= 1)
{
Printf("Surface size mismatch: Attempting to remap %dx%d to %dx%d pixel area.\n", surface.width, surface.height, realSurface.texWidth, realSurface.texHeight);
}
realSurface.needsUpdate = true;
continue;
}
if (developer >= 5)
{
Printf("Mapping lightmap surface pixels[%u] (count: %u) -> ((x:%d, y:%d), (x2:%d, y2:%d), page:%d) area: %u\n",