diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index f5a2646c7..91161d276 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -320,7 +320,7 @@ typedef struct s_prwall { typedef struct s_prsprite { _prplane plane; - uint32_t trackedrev; + uint32_t hash; } _prsprite; typedef struct s_prmirror { @@ -371,7 +371,7 @@ extern _prsprite *prsprites[MAXSPRITES]; static inline void polymer_invalidatesprite(int32_t i) { if (prsprites[i]) - prsprites[i]->trackedrev = UINT32_MAX; + prsprites[i]->hash = 0xDEADBEEF; } extern GLuint prartmaps[MAXTILES]; diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 03e53124b..c636aa6b3 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -3868,7 +3868,7 @@ void polymer_updatesprite(int32_t snum) s->plane.buffer = (_prvert *)Xcalloc(4, sizeof(_prvert)); // XXX s->plane.vertcount = 4; s->plane.mapvbo_vertoffset = -1; - s->trackedrev = UINT32_MAX; + s->hash = 0xDEADBEEF; } if ((tspr->cstat & 48) && (pr_vbos > 0) && !s->plane.vbo) @@ -3886,16 +3886,12 @@ void polymer_updatesprite(int32_t snum) if (tspr->cstat & 48 && searchit != 2) { -#ifndef UNTRACKED_STRUCTS - uint32_t const changed = spritechanged[tspr->owner]; -#else uint32_t const changed = XXH32((uint8_t *) tspr, offsetof(spritetype, owner), 0xDEADBEEF); -#endif - if (changed == s->trackedrev && tspr->picnum == curpicnum) + if (changed == s->hash) return; - s->trackedrev = changed; + s->hash = changed; } polymer_getbuildmaterial(&s->plane.material, curpicnum, tspr->pal, tspr->shade, @@ -3915,7 +3911,7 @@ void polymer_updatesprite(int32_t snum) if (searchit == 2) { polymer_drawsearchplane(&s->plane, NULL, 0x03, (GLubyte *) &tspr->owner); - s->trackedrev = UINT32_MAX; + s->hash = 0xDEADBEEF; } curpicnum = tspr->picnum;