diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 817936594..130c125d8 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -491,11 +491,9 @@ static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg) if (seg != NULL && P_ApplyLightOffsetFine(lightnum, seg->frontsector)) { - if (cv_glfakecontrast.value == 2) // Smooth setting - finallight += seg->hwLightOffset; - else - finallight += seg->lightOffset * 8; + INT16 offset = (cv_glfakecontrast.value == 2) ? seg->hwLightOffset : ((INT16)seg->lightOffset * 8); + finallight += offset; finallight = CLAMP(finallight, 0 , 255); } @@ -511,11 +509,9 @@ static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t if (slope != NULL && sector != NULL && P_ApplyLightOffsetFine(lightnum, sector)) { - if (cv_glfakecontrast.value == 2) // Smooth setting - finallight += (fof ? -slope->hwLightOffset : slope->hwLightOffset); - else - finallight += (fof ? -slope->lightOffset * 8 : slope->lightOffset * 8); + INT16 offset = (cv_glfakecontrast.value == 2) ? slope->hwLightOffset : (INT16)slope->lightOffset; + finallight += (fof ? -offset : offset); finallight = CLAMP(finallight, 0 , 255); } diff --git a/src/s_sound.c b/src/s_sound.c index abd5afbd9..cc8e3b2a2 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -423,10 +423,7 @@ static INT32 S_ScaleVolumeWithSplitscreen(INT32 volume) root = FixedSqrt((splitscreen + 1) * (FRACUNIT/3)); - return FixedDiv( - volume * FRACUNIT, - root - ) / FRACUNIT; + return FixedDiv(volume * FRACUNIT, root) / FRACUNIT; } void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)