diff --git a/src/gl/renderer/gl_renderer.cpp b/src/gl/renderer/gl_renderer.cpp index 5d2ef73bd..46313df80 100644 --- a/src/gl/renderer/gl_renderer.cpp +++ b/src/gl/renderer/gl_renderer.cpp @@ -542,20 +542,28 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer) GLRenderer->ScreenToWindowX(cmd.mScissor[3] - cmd.mScissor[1])); } else glDisable(GL_SCISSOR_TEST); - gl_RenderState.SetObjectColor(cmd.mColor1); - gl_RenderState.SetObjectColor2(cmd.mColor2); - if (cmd.mFlags & F2DDrawer::DTF_IngameLighting) + // Legacy mode cannot replicate the more complex effects + if (gl.legacyMode) { - gl_RenderState.SetFixedColormap(CM_INGAME2D); - } - else if (cmd.mFlags & F2DDrawer::DTF_SpecialColormap) - { - gl_RenderState.SetFixedColormap(CM_SPECIAL2D); + gl_RenderState.SetFixedColormap(CM_DEFAULT); } else { - gl_RenderState.SetFixedColormap(CM_PLAIN2D); + gl_RenderState.SetObjectColor(cmd.mColor1); + gl_RenderState.SetObjectColor2(cmd.mColor2); + if (cmd.mFlags & F2DDrawer::DTF_IngameLighting) + { + gl_RenderState.SetFixedColormap(CM_INGAME2D); + } + else if (cmd.mFlags & F2DDrawer::DTF_SpecialColormap) + { + gl_RenderState.SetFixedColormap(CM_SPECIAL2D); + } + else + { + gl_RenderState.SetFixedColormap(CM_PLAIN2D); + } } gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f); diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index 66c3a7df2..efb2cbf5b 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -482,6 +482,5 @@ void OpenGLFrameBuffer::ScaleCoordsFromWindow(int16_t &x, int16_t &y) void OpenGLFrameBuffer::Draw2D() { - //if (gl.legacyMode) Draw2DLegacy(); if (GLRenderer != nullptr) GLRenderer->Draw2D(&m2DDrawer); } diff --git a/src/v_2ddrawer.cpp b/src/v_2ddrawer.cpp index 02db68277..85a16b215 100644 --- a/src/v_2ddrawer.cpp +++ b/src/v_2ddrawer.cpp @@ -323,7 +323,7 @@ void F2DDrawer::AddTexture(FTexture *img, DrawParms &parms) ptr->Set(x, y + h, 0, u1, v2, vertexcolor); ptr++; ptr->Set(x + w, y, 0, u2, v1, vertexcolor); ptr++; ptr->Set(x + w, y + h, 0, u2, v2, vertexcolor); ptr++; - AddIndices(6, dg.mVertIndex, 0, 1, 2, 1, 3, 2); + AddIndices(dg.mVertIndex, 6, 0, 1, 2, 1, 3, 2); AddCommand(&dg); } @@ -433,7 +433,7 @@ void F2DDrawer::AddFlatFill(int left, int top, int right, int bottom, FTexture * ptr->Set(left, bottom, 0, fU1, fV2, 0xffffffff); ptr++; ptr->Set(right, top, 0, fU2, fV1, 0xffffffff); ptr++; ptr->Set(right, bottom, 0, fU2, fV2, 0xffffffff); ptr++; - AddIndices(6, dg.mVertIndex, 0, 1, 2, 1, 3, 2); + AddIndices(dg.mVertIndex, 6, 0, 1, 2, 1, 3, 2); AddCommand(&dg); } @@ -457,7 +457,7 @@ void F2DDrawer::AddColorOnlyQuad(int x1, int y1, int w, int h, PalEntry color) 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++; - AddIndices(6, dg.mVertIndex, 0, 1, 2, 1, 3, 2); + AddIndices(dg.mVertIndex, 6, 0, 1, 2, 1, 3, 2); AddCommand(&dg); }