Client: add vv_flag VFL_VIDREMOVE, for client-side entities needing deletion on renderer restart.

This commit is contained in:
Marco Cawthorne 2024-11-04 01:12:09 -08:00
parent 70d6302808
commit 5c6f405872
2 changed files with 12 additions and 4 deletions

View file

@ -272,13 +272,20 @@ Entities_ParseLump(void)
void void
Entities_RendererRestarted(void) Entities_RendererRestarted(void)
{ {
int c = 0; int c = 0i;
int f = 0i;
for (entity b = world; (b = findfloat(b, ::isCSQC, TRUE));) { for (entity b = world; (b = findfloat(b, ::isCSQC, TRUE));) {
NSEntity pf = (NSEntity) b; NSEntity pf = (NSEntity) b;
if (pf.vv_flags & VFL_VIDREMOVE) {
pf.Destroy();
f++;
} else {
pf.RendererRestarted(); pf.RendererRestarted();
c++; c++;
} }
}
NSLog("...resource reload called on %i entities", c); NSLog("...resource reload called on %i entities, flushed %i", c, f);
} }

View file

@ -47,3 +47,4 @@
#define VFL_PRIMEDFUSE (1<<11) /**< Entity is not allowed to fire. */ #define VFL_PRIMEDFUSE (1<<11) /**< Entity is not allowed to fire. */
#define VFL_REDRAW (1<<12) /**< Entity is not allowed to fire. */ #define VFL_REDRAW (1<<12) /**< Entity is not allowed to fire. */
#define VFL_FIRING (1<<13) /**< Entity is firing. */ #define VFL_FIRING (1<<13) /**< Entity is firing. */
#define VFL_VIDREMOVE (1<<14) /**< Entity will be flushed upon vid_reload. */