Use a faster way to find the closest light probe

Fix light probe not being applied to psprite
This commit is contained in:
Magnus Norddahl 2021-10-14 05:43:35 +02:00
commit 764a08752f
8 changed files with 103 additions and 28 deletions

View file

@ -641,6 +641,14 @@ void HWDrawInfo::PreparePlayerSprites(sector_t * viewsector, area_t in_area)
{
hw_GetDynModelLight(playermo, lightdata);
hudsprite.lightindex = screen->mLights->UploadLights(lightdata);
LightProbe* probe = FindLightProbe(playermo->Level, playermo->X(), playermo->Y(), playermo->Center());
if (probe)
{
hudsprite.dynrgb[0] = probe->Red;
hudsprite.dynrgb[1] = probe->Green;
hudsprite.dynrgb[2] = probe->Blue;
}
}
}