limit max distance for vissprites to 8192 map units as before

But don't rely on an integer overflow this time.

This increases FPS from 9 to 28 in the opening scene of comatose.wad
This commit is contained in:
Fabian Greffrath 2024-05-07 09:54:49 +02:00
parent 5f3d6a15fb
commit 14ed02e08d

View File

@ -47,6 +47,7 @@
#include "z_zone.h"
#define MINZ (FRACUNIT*4)
#define MAXZ (FRACUNIT*8192)
#define BASEYCENTER 100
typedef struct {
@ -539,7 +540,7 @@ void R_ProjectSprite (mobj_t* thing)
tz = gxt-gyt;
// thing is behind view plane?
if (tz < MINZ)
if (tz < MINZ || tz > MAXZ)
return;
xscale = FixedDiv(projection, tz);