fix linearsky calculation for large sky texture width (#2160)

This commit is contained in:
Roman Fomin 2025-01-28 08:24:00 +07:00 committed by GitHub
parent 4ebaddec41
commit 344d86d61b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -367,10 +367,7 @@ static void R_InitTextureMapping(void)
xtoviewangle[x] = (i<<ANGLETOFINESHIFT)-ANG90;
// [FG] linear horizontal sky scrolling
int angle = (0.5 - x / (double)viewwidth) * linearskyfactor;
if (angle >= 0)
linearskyangle[x] = angle;
else
linearskyangle[x] = ANG90 + angle;
linearskyangle[x] = (angle >= 0) ? angle : ANGLE_MAX + angle;
}
// Take out the fencepost cases from viewangletox.