From b066f725d44a16d1010cbe8192a81145221249dd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Jan 2020 23:27:59 +0100 Subject: [PATCH] - clear the matrix list after rendering the 2D content. --- source/glbackend/glbackend.cpp | 2 +- source/glbackend/hw_draw2d.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/glbackend/glbackend.cpp b/source/glbackend/glbackend.cpp index f9891e7e8..dbe5e2851 100644 --- a/source/glbackend/glbackend.cpp +++ b/source/glbackend/glbackend.cpp @@ -56,7 +56,7 @@ static int blendstyles[] = { GL_ZERO, GL_ONE, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALP static int renderops[] = { GL_FUNC_ADD, GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT }; int depthf[] = { GL_ALWAYS, GL_LESS, GL_EQUAL, GL_LEQUAL }; -static TArray matrixArray; +TArray matrixArray; FileReader GetResource(const char* fn) { diff --git a/source/glbackend/hw_draw2d.cpp b/source/glbackend/hw_draw2d.cpp index ac16511f2..bde5359aa 100644 --- a/source/glbackend/hw_draw2d.cpp +++ b/source/glbackend/hw_draw2d.cpp @@ -43,6 +43,8 @@ #include "flatvertices.h" extern int16_t numshades; +extern TArray matrixArray; + //=========================================================================== // // Vertex buffer for 2D drawer @@ -227,6 +229,7 @@ void GLInstance::Draw2D(F2DDrawer *drawer) EnableBlend(true); EnableMultisampling(true); SetIdentityMatrix(Matrix_Projection); + matrixArray.Resize(1); }