move early return even earlier

so theres no need to constantly init scale and drawdist
This commit is contained in:
Alug committed 2025-01-01 05:10:52 +01:00
1 parent da3ffafc90
commit e18d973d5e
2 files changed
+11 -5

No files matched your search

+1 -1
View File
@@ -4435,7 +4435,7 @@ static void HWR_AddPrecipitationSprites(void)
fixed_t drawdist;
// save a little time on invisible weather
// save a little time if theres no or invisible weather
if (curWeather == PRECIP_NONE || curWeather == PRECIP_BLANK || curWeather == PRECIP_STORM_NORAIN)
{
return;
+10 -4
View File
@@ -2052,14 +2052,20 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
//
void R_AddPrecipitationSprites(void)
{
fixed_t precipscale = (cv_mobjscaleprecip.value ? mapobjectscale : FRACUNIT);
fixed_t drawdist = ((fixed_t)(cv_drawdist_precip.value) * precipscale);
INT32 xl, xh, yl, yh, bx, by;
precipmobj_t *th, *next;
// save a little time if theres no or invisible weather
if (curWeather == PRECIP_NONE || curWeather == PRECIP_BLANK || curWeather == PRECIP_STORM_NORAIN)
{
return;
}
const fixed_t precipscale = (cv_mobjscaleprecip.value ? mapobjectscale : FRACUNIT);
const fixed_t drawdist = ((fixed_t)(cv_drawdist_precip.value) * precipscale);
// no, no infinite draw distance for precipitation. this option at zero is supposed to turn it off
if (drawdist == 0 || curWeather == PRECIP_NONE || curWeather == PRECIP_BLANK || curWeather == PRECIP_STORM_NORAIN)
if (drawdist == 0)
{
return;
}