From fa6ba8409482a0283c613301f02ddbf41d9dd092 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 29 Mar 2018 00:38:31 +0200 Subject: [PATCH] - fixed untextured vertex order and removed some test code. --- src/gl/renderer/gl_renderer.cpp | 5 +++-- src/gl/renderer/gl_renderstate.cpp | 1 - src/v_2ddrawer.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gl/renderer/gl_renderer.cpp b/src/gl/renderer/gl_renderer.cpp index b9632e9b8..49918376e 100644 --- a/src/gl/renderer/gl_renderer.cpp +++ b/src/gl/renderer/gl_renderer.cpp @@ -479,7 +479,7 @@ public: glVertexAttribPointer(VATTR_COLOR, 4, GL_UNSIGNED_BYTE, true, sizeof(F2DDrawer::TwoDVertex), &TDiO->color0); glEnableVertexAttribArray(VATTR_VERTEX); glEnableVertexAttribArray(VATTR_TEXCOORD); - //glEnableVertexAttribArray(VATTR_COLOR); + glEnableVertexAttribArray(VATTR_COLOR); glDisableVertexAttribArray(VATTR_VERTEX2); glDisableVertexAttribArray(VATTR_NORMAL); } @@ -504,7 +504,6 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer) { // Change from BGRA to RGBA std::swap(v.color0.r, v.color0.b); - v.color0 = 0xffffffff; } auto vb = new F2DVertexBuffer; vb->UploadData(&vertices[0], vertices.Size(), &indices[0], indices.Size()); @@ -604,5 +603,7 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer) glDisable(GL_SCISSOR_TEST); gl_RenderState.SetVertexBuffer(nullptr); gl_RenderState.EnableTexture(true); + gl_RenderState.SetTextureMode(TM_MODULATE); + gl_RenderState.ResetColor(); delete vb; } \ No newline at end of file diff --git a/src/gl/renderer/gl_renderstate.cpp b/src/gl/renderer/gl_renderstate.cpp index ed4d79658..d579a8aa2 100644 --- a/src/gl/renderer/gl_renderstate.cpp +++ b/src/gl/renderer/gl_renderstate.cpp @@ -243,7 +243,6 @@ bool FRenderState::ApplyShader() } else if (mColormapState == CM_SPECIAL2D) { - activeShader->muFixedColormap.Set(2); activeShader->muFixedColormap.Set(1); float startr = mObjectColor.r / 255; float startg = mObjectColor.g / 255; diff --git a/src/v_2ddrawer.cpp b/src/v_2ddrawer.cpp index 85a16b215..f7cd2c167 100644 --- a/src/v_2ddrawer.cpp +++ b/src/v_2ddrawer.cpp @@ -455,8 +455,8 @@ void F2DDrawer::AddColorOnlyQuad(int x1, int y1, int w, int h, PalEntry color) auto ptr = &mVertices[dg.mVertIndex]; ptr->Set(x1, y1, 0, 0, 0, color); ptr++; ptr->Set(x1, y1 + h, 0, 0, 0, color); ptr++; - ptr->Set(x1 + w, y1 + h, 0, 0, 0, color); ptr++; ptr->Set(x1 + w, y1, 0, 0, 0, color); ptr++; + ptr->Set(x1 + w, y1 + h, 0, 0, 0, color); ptr++; AddIndices(dg.mVertIndex, 6, 0, 1, 2, 1, 3, 2); AddCommand(&dg); }