From 8365d975d3cba63dd2e96187bab785c73112a6ee Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 17 Jun 2020 18:40:56 -0400 Subject: [PATCH] A even more better fix for this --- src/hardware/hw_batching.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_batching.c b/src/hardware/hw_batching.c index a574c7879..67cda0305 100644 --- a/src/hardware/hw_batching.c +++ b/src/hardware/hw_batching.c @@ -215,11 +215,11 @@ void HWR_RenderBatches(void) int polygonReadPos = 0;// position in polygonIndexArray int currentShader; - int nextShader; + int nextShader = 0; GLMipmap_t *currentTexture; - GLMipmap_t *nextTexture; - FBITFIELD currentPolyFlags; - FBITFIELD nextPolyFlags; + GLMipmap_t *nextTexture = NULL; + FBITFIELD currentPolyFlags = 0; + FBITFIELD nextPolyFlags = 0; FSurfaceInfo currentSurfaceInfo; FSurfaceInfo nextSurfaceInfo; @@ -228,6 +228,10 @@ void HWR_RenderBatches(void) if (!currently_batching) I_Error("HWR_RenderBatches called without starting batching"); + nextSurfaceInfo.LightInfo.fade_end = 0; + nextSurfaceInfo.LightInfo.fade_start = 0; + nextSurfaceInfo.LightInfo.light_level = 0; + currently_batching = false;// no longer collecting batches if (!polygonArraySize) {