speed up masked sprites a bit
thx eternity engine!
This commit is contained in:
1 parent
32504b9e8e
commit
57990100c5
1 file changed
+9
-5
+9
-5
@@ -2810,6 +2810,11 @@ void R_ClipSprites(drawseg_t* dsstart, portal_t* portal)
|
||||
drawseg_t* ds;
|
||||
INT32 i;
|
||||
|
||||
if (visspritecount - clippedvissprites <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// e6y
|
||||
// Reducing of cache misses in the following R_DrawSprite()
|
||||
// Makes sense for scenes with huge amount of drawsegs.
|
||||
@@ -2819,13 +2824,9 @@ void R_ClipSprites(drawseg_t* dsstart, portal_t* portal)
|
||||
drawsegs_xranges[i].count = 0;
|
||||
}
|
||||
|
||||
if (visspritecount - clippedvissprites <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (drawsegs_xrange_size < maxdrawsegs)
|
||||
{
|
||||
// haleyjd: fix reallocation to track 2x size
|
||||
drawsegs_xrange_size = 2 * maxdrawsegs;
|
||||
|
||||
for (i = 0; i < DS_RANGES_COUNT; i++)
|
||||
@@ -2865,6 +2866,9 @@ void R_ClipSprites(drawseg_t* dsstart, portal_t* portal)
|
||||
}
|
||||
}
|
||||
|
||||
// haleyjd: terminate with a nullptr user for faster loop - adds ~3 FPS
|
||||
drawsegs_xranges[0].items[drawsegs_xranges[0].count].user = nullptr;
|
||||
|
||||
for (; clippedvissprites < visspritecount; clippedvissprites++)
|
||||
{
|
||||
vissprite_t *spr = R_GetVisSprite(clippedvissprites);
|
||||
|
||||
Reference in new issue
Block a user