Fix use of uninitialized variables boundsMin and boundsMax

This commit is contained in:
RaveYard 2023-09-04 02:53:00 +02:00 committed by Christoph Oelckers
parent 3bbfb673cb
commit 194d5fcf87
2 changed files with 2 additions and 3 deletions

View file

@ -79,7 +79,6 @@ struct LevelMeshSurface
//
TArray<FVector3> verts;
TArray<FVector2> uvs;
FVector3 boundsMin, boundsMax;
// Touching light sources
std::vector<LevelMeshLight*> LightList;

View file

@ -102,8 +102,8 @@ void VkLightmap::RenderAtlasImage(size_t pageIndex)
// Paint all surfaces part of the smoothing group into the surface
for (LevelMeshSurface* surface : mesh->SmoothingGroups[targetSurface->smoothingGroupIndex].surfaces)
{
FVector2 minUV = ToUV(surface->boundsMin, targetSurface);
FVector2 maxUV = ToUV(surface->boundsMax, targetSurface);
FVector2 minUV = ToUV(surface->bounds.min, targetSurface);
FVector2 maxUV = ToUV(surface->bounds.max, targetSurface);
if (surface != targetSurface && (maxUV.X < 0.0f || maxUV.Y < 0.0f || minUV.X > 1.0f || minUV.Y > 1.0f))
continue; // Bounding box not visible