From da6bc22d3505a30446f9be7f58ea53096b31a685 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 24 Oct 2016 21:30:34 +0000 Subject: [PATCH] Polymost: Clear wsprinfo[] upon map load. This should address some remaining instances of wall-ornamented sprite z-fighting. git-svn-id: https://svn.eduke32.com/eduke32@5910 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/polymost.h | 2 ++ polymer/eduke32/build/src/engine.c | 5 +++++ polymer/eduke32/build/src/polymost.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/polymer/eduke32/build/include/polymost.h b/polymer/eduke32/build/include/polymost.h index 88cac7960..67f46c3b0 100644 --- a/polymer/eduke32/build/include/polymost.h +++ b/polymer/eduke32/build/include/polymost.h @@ -28,6 +28,8 @@ struct glfiltermodes { #define NUMGLFILTERMODES 6 extern struct glfiltermodes glfiltermodes[NUMGLFILTERMODES]; +extern void Polymost_prepare_loadboard(void); + //void phex(char v, char *s); void uploadtexture(int32_t doalloc, vec2_t siz, int32_t texfmt, coltype *pic, vec2_t tsiz, int32_t dameth); void polymost_drawsprite(int32_t snum); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index cde65d8a5..039d00f97 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -8937,6 +8937,11 @@ static void prepare_loadboard(int32_t fil, vec3_t *dapos, int16_t *daang, int16_ Bmemset(spritechanged, 0, sizeof(spritechanged)); Bmemset(wallchanged, 0, sizeof(wallchanged)); +#ifdef USE_OPENGL + if (getrendermode() == REND_POLYMOST) + Polymost_prepare_loadboard(); +#endif + if (!have_maptext()) { kread(fil,&dapos->x,4); dapos->x = B_LITTLE32(dapos->x); diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 9f7f09cb2..0501d7dc7 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -4278,6 +4278,11 @@ typedef struct wallspriteinfo_t wsprinfo[MAXSPRITES]; +void Polymost_prepare_loadboard(void) +{ + Bmemset(wsprinfo, 0, sizeof(wsprinfo)); +} + static inline int32_t polymost_findwall(uspritetype const * const tspr, vec2_t const * const tsiz, int32_t * rd) { int32_t dist = 4, closest = -1;