From 5bdfb7ffc13e7b746267dd03e416463a98687835 Mon Sep 17 00:00:00 2001 From: spherallic Date: Sat, 9 Apr 2022 16:42:54 +0200 Subject: [PATCH] Fix semibright/fulldark frame flags for models --- src/hardware/hw_md2.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index e765656ca..a003163db 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1306,7 +1306,11 @@ boolean HWR_DrawModel(gl_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 - if (!R_ThingIsFullBright(spr->mobj)) + if (R_ThingIsFullDark(spr->mobj)) + lightlevel = 0; + else if (R_ThingIsSemiBright(spr->mobj)) + lightlevel = 128 + (*sector->lightlist[light].lightlevel>>1); + else if (!R_ThingIsFullBright(spr->mobj)) lightlevel = *sector->lightlist[light].lightlevel > 255 ? 255 : *sector->lightlist[light].lightlevel; if (*sector->lightlist[light].extra_colormap) @@ -1314,7 +1318,11 @@ boolean HWR_DrawModel(gl_vissprite_t *spr) } else { - if (!R_ThingIsFullBright(spr->mobj)) + if (R_ThingIsFullDark(spr->mobj)) + lightlevel = 0; + else if (R_ThingIsSemiBright(spr->mobj)) + lightlevel = 128 + (sector->lightlevel>>1); + else if (!R_ThingIsFullBright(spr->mobj)) lightlevel = sector->lightlevel > 255 ? 255 : sector->lightlevel; if (sector->extra_colormap)