From ec5840f8409e782d113989c20bbcdade90a37889 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 28 May 2024 20:02:54 +0200 Subject: [PATCH] scale sprite draw distance with mapobjscale --- src/hardware/hw_main.c | 8 ++++---- src/r_things.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 99f8797c2..63423fc8e 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4796,12 +4796,12 @@ void HWR_AddSprites(sector_t *sec) { // Use the smaller setting if (cv_drawdist.value) - limit_dist = min(current_bsp_culling_distance, cv_drawdist.value << FRACBITS); + limit_dist = min(current_bsp_culling_distance, (fixed_t)(cv_drawdist.value) * mapobjectscale); else limit_dist = current_bsp_culling_distance; } else - limit_dist = cv_drawdist.value << FRACBITS; + limit_dist = (fixed_t)(cv_drawdist.value) * mapobjectscale; // Handle all things in sector. // If a limit exists, handle things a tiny bit different. @@ -4904,9 +4904,9 @@ static void HWR_AddPrecipitationSprites(void) precipmobj_t *th; if (current_bsp_culling_distance) - drawdist = min(current_bsp_culling_distance, cv_drawdist_precip.value * mapobjectscale); + drawdist = min(current_bsp_culling_distance, (fixed_t)(cv_drawdist_precip.value) * mapobjectscale); else - drawdist = cv_drawdist_precip.value * mapobjectscale; + drawdist = (fixed_t)(cv_drawdist_precip.value) * mapobjectscale; // No to infinite precipitation draw distance. if (drawdist == 0) diff --git a/src/r_things.c b/src/r_things.c index e7bf64011..a12b133fa 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1950,7 +1950,7 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel) // Handle all things in sector. // If a limit exists, handle things a tiny bit different. - if ((limit_dist = (fixed_t)(/*(maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : */cv_drawdist.value) << FRACBITS)) + if ((limit_dist = (fixed_t)(cv_drawdist.value) * mapobjectscale)) { for (thing = sec->thinglist; thing; thing = thing->snext) { @@ -2042,7 +2042,7 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel) // void R_AddPrecipitationSprites(void) { - const fixed_t drawdist = cv_drawdist_precip.value * mapobjectscale; + const fixed_t drawdist = (fixed_t)(cv_drawdist_precip.value) * mapobjectscale; INT32 xl, xh, yl, yh, bx, by; precipmobj_t *th, *next;