mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 04:11:18 +00:00
LightLevelToLum gone
LightLevelToLum unused by everything now, it seemed to be giving wrong values for lightlevels.
This commit is contained in:
parent
103258e364
commit
770c7eeade
2 changed files with 30 additions and 30 deletions
|
@ -716,28 +716,28 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, fixed_t fi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (psector->extra_colormap)
|
if (psector->extra_colormap)
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel),psector->extra_colormap->rgba,psector->extra_colormap->fadergba, false, true);
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel,psector->extra_colormap->rgba,psector->extra_colormap->fadergba, false, true);
|
||||||
else
|
else
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel),NORMALFOG,FADEFOG, false, true);
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel,NORMALFOG,FADEFOG, false, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel),NORMALFOG,FADEFOG, false, true);
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel,NORMALFOG,FADEFOG, false, true);
|
||||||
|
|
||||||
#endif // NOPE
|
#endif // NOPE
|
||||||
|
|
||||||
if (planecolormap)
|
if (planecolormap)
|
||||||
{
|
{
|
||||||
if (fogplane)
|
if (fogplane)
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), planecolormap->rgba, planecolormap->fadergba, true, false);
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, planecolormap->rgba, planecolormap->fadergba, true, false);
|
||||||
else
|
else
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), planecolormap->rgba, planecolormap->fadergba, false, true);
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, planecolormap->rgba, planecolormap->fadergba, false, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fogplane)
|
if (fogplane)
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, true, false);
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, true, false);
|
||||||
else
|
else
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, false, true);
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PolyFlags & PF_Translucent)
|
if (PolyFlags & PF_Translucent)
|
||||||
|
@ -971,11 +971,11 @@ static void HWR_ProjectWall(wallVert3D * wallVerts,
|
||||||
|
|
||||||
if (wallcolormap)
|
if (wallcolormap)
|
||||||
{
|
{
|
||||||
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), wallcolormap->rgba, wallcolormap->fadergba, false, false);
|
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, wallcolormap->rgba, wallcolormap->fadergba, false, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, false, false);
|
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(pSurf, trVerts, 4, blendmode|PF_Modulated|PF_Occlude|PF_Clip);
|
HWD.pfnDrawPolygon(pSurf, trVerts, 4, blendmode|PF_Modulated|PF_Occlude|PF_Clip);
|
||||||
|
@ -3329,7 +3329,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
||||||
if (spr->mobj->frame & FF_TRANSMASK || spr->mobj->flags2 & MF2_SHADOW)
|
if (spr->mobj->frame & FF_TRANSMASK || spr->mobj->flags2 & MF2_SHADOW)
|
||||||
{
|
{
|
||||||
sector_t *sector = spr->mobj->subsector->sector;
|
sector_t *sector = spr->mobj->subsector->sector;
|
||||||
UINT8 lightlevel = LightLevelToLum(sector->lightlevel);
|
UINT8 lightlevel = sector->lightlevel;
|
||||||
extracolormap_t *colormap = sector->extra_colormap;
|
extracolormap_t *colormap = sector->extra_colormap;
|
||||||
|
|
||||||
if (sector->numlights)
|
if (sector->numlights)
|
||||||
|
@ -3337,16 +3337,16 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
||||||
INT32 light = R_GetPlaneLight(sector, spr->mobj->floorz, false);
|
INT32 light = R_GetPlaneLight(sector, spr->mobj->floorz, false);
|
||||||
|
|
||||||
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||||
lightlevel = LightLevelToLum(*sector->lightlist[light].lightlevel);
|
lightlevel = *sector->lightlist[light].lightlevel;
|
||||||
else
|
else
|
||||||
lightlevel = LightLevelToLum(255);
|
lightlevel = 255;
|
||||||
|
|
||||||
if (sector->lightlist[light].extra_colormap)
|
if (sector->lightlist[light].extra_colormap)
|
||||||
colormap = sector->lightlist[light].extra_colormap;
|
colormap = sector->lightlist[light].extra_colormap;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lightlevel = LightLevelToLum(sector->lightlevel);
|
lightlevel = sector->lightlevel;
|
||||||
|
|
||||||
if (sector->extra_colormap)
|
if (sector->extra_colormap)
|
||||||
colormap = sector->extra_colormap;
|
colormap = sector->extra_colormap;
|
||||||
|
@ -3379,7 +3379,7 @@ noshadow:
|
||||||
// colormap test
|
// colormap test
|
||||||
{
|
{
|
||||||
sector_t *sector = spr->mobj->subsector->sector;
|
sector_t *sector = spr->mobj->subsector->sector;
|
||||||
UINT8 lightlevel = LightLevelToLum(sector->lightlevel);
|
UINT8 lightlevel = sector->lightlevel;
|
||||||
extracolormap_t *colormap = sector->extra_colormap;
|
extracolormap_t *colormap = sector->extra_colormap;
|
||||||
|
|
||||||
if (sector->numlights)
|
if (sector->numlights)
|
||||||
|
@ -3389,9 +3389,9 @@ noshadow:
|
||||||
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
|
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
|
||||||
|
|
||||||
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||||
lightlevel = LightLevelToLum(*sector->lightlist[light].lightlevel);
|
lightlevel = *sector->lightlist[light].lightlevel;
|
||||||
else
|
else
|
||||||
lightlevel = LightLevelToLum(255);
|
lightlevel = 255;
|
||||||
|
|
||||||
if (sector->lightlist[light].extra_colormap)
|
if (sector->lightlist[light].extra_colormap)
|
||||||
colormap = sector->lightlist[light].extra_colormap;
|
colormap = sector->lightlist[light].extra_colormap;
|
||||||
|
@ -3399,16 +3399,16 @@ noshadow:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||||
lightlevel = LightLevelToLum(sector->lightlevel);
|
lightlevel = sector->lightlevel;
|
||||||
else
|
else
|
||||||
lightlevel = LightLevelToLum(255);
|
lightlevel = 255;
|
||||||
|
|
||||||
if (sector->extra_colormap)
|
if (sector->extra_colormap)
|
||||||
colormap = sector->extra_colormap;
|
colormap = sector->extra_colormap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spr->mobj->frame & FF_FULLBRIGHT)
|
if (spr->mobj->frame & FF_FULLBRIGHT)
|
||||||
lightlevel = LightLevelToLum(255);
|
lightlevel = 255;
|
||||||
|
|
||||||
if (colormap)
|
if (colormap)
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
|
||||||
|
@ -3908,7 +3908,7 @@ static void HWR_AddSprites(sector_t *sec)
|
||||||
sec->validcount = validcount;
|
sec->validcount = validcount;
|
||||||
|
|
||||||
// sprite lighting
|
// sprite lighting
|
||||||
sectorlight = LightLevelToLum(sec->lightlevel & 0xff);
|
sectorlight = sec->lightlevel & 0xff;
|
||||||
|
|
||||||
// Handle all things in sector.
|
// Handle all things in sector.
|
||||||
// If a limit exists, handle things a tiny bit different.
|
// If a limit exists, handle things a tiny bit different.
|
||||||
|
@ -5182,16 +5182,16 @@ static void HWR_RenderWall(wallVert3D *wallVerts, FSurfaceInfo *pSurf, FBITFIE
|
||||||
if (wallcolormap)
|
if (wallcolormap)
|
||||||
{
|
{
|
||||||
if (fogwall)
|
if (fogwall)
|
||||||
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), wallcolormap->rgba, wallcolormap->fadergba, true, false);
|
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, wallcolormap->rgba, wallcolormap->fadergba, true, false);
|
||||||
else
|
else
|
||||||
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), wallcolormap->rgba, wallcolormap->fadergba, false, false);
|
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, wallcolormap->rgba, wallcolormap->fadergba, false, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fogwall)
|
if (fogwall)
|
||||||
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, true, false);
|
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, true, false);
|
||||||
else
|
else
|
||||||
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, false, false);
|
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
pSurf->FlatColor.s.alpha = alpha; // put the alpha back after lighting
|
pSurf->FlatColor.s.alpha = alpha; // put the alpha back after lighting
|
||||||
|
|
|
@ -1082,7 +1082,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
// colormap test
|
// colormap test
|
||||||
{
|
{
|
||||||
sector_t *sector = spr->mobj->subsector->sector;
|
sector_t *sector = spr->mobj->subsector->sector;
|
||||||
UINT8 lightlevel = LightLevelToLum(sector->lightlevel);
|
UINT8 lightlevel = sector->lightlevel;
|
||||||
extracolormap_t *colormap = sector->extra_colormap;
|
extracolormap_t *colormap = sector->extra_colormap;
|
||||||
|
|
||||||
if (sector->numlights)
|
if (sector->numlights)
|
||||||
|
@ -1092,9 +1092,9 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
|
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
|
||||||
|
|
||||||
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||||
lightlevel = LightLevelToLum(*sector->lightlist[light].lightlevel);
|
lightlevel = *sector->lightlist[light].lightlevel;
|
||||||
else
|
else
|
||||||
lightlevel = LightLevelToLum(255);
|
lightlevel = 255;
|
||||||
|
|
||||||
if (sector->lightlist[light].extra_colormap)
|
if (sector->lightlist[light].extra_colormap)
|
||||||
colormap = sector->lightlist[light].extra_colormap;
|
colormap = sector->lightlist[light].extra_colormap;
|
||||||
|
@ -1102,16 +1102,16 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||||
lightlevel = LightLevelToLum(sector->lightlevel);
|
lightlevel = sector->lightlevel;
|
||||||
else
|
else
|
||||||
lightlevel = LightLevelToLum(255);
|
lightlevel = 255;
|
||||||
|
|
||||||
if (sector->extra_colormap)
|
if (sector->extra_colormap)
|
||||||
colormap = sector->extra_colormap;
|
colormap = sector->extra_colormap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spr->mobj->frame & FF_FULLBRIGHT)
|
if (spr->mobj->frame & FF_FULLBRIGHT)
|
||||||
lightlevel = LightLevelToLum(255);
|
lightlevel = 255;
|
||||||
|
|
||||||
if (colormap)
|
if (colormap)
|
||||||
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
|
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
|
||||||
|
|
Loading…
Reference in a new issue