- fixed untextured vertex order and removed some test code.

This commit is contained in:
Christoph Oelckers 2018-03-29 00:38:31 +02:00
parent a253b15334
commit fa6ba84094
3 changed files with 4 additions and 4 deletions

View File

@ -479,7 +479,7 @@ public:
glVertexAttribPointer(VATTR_COLOR, 4, GL_UNSIGNED_BYTE, true, sizeof(F2DDrawer::TwoDVertex), &TDiO->color0); glVertexAttribPointer(VATTR_COLOR, 4, GL_UNSIGNED_BYTE, true, sizeof(F2DDrawer::TwoDVertex), &TDiO->color0);
glEnableVertexAttribArray(VATTR_VERTEX); glEnableVertexAttribArray(VATTR_VERTEX);
glEnableVertexAttribArray(VATTR_TEXCOORD); glEnableVertexAttribArray(VATTR_TEXCOORD);
//glEnableVertexAttribArray(VATTR_COLOR); glEnableVertexAttribArray(VATTR_COLOR);
glDisableVertexAttribArray(VATTR_VERTEX2); glDisableVertexAttribArray(VATTR_VERTEX2);
glDisableVertexAttribArray(VATTR_NORMAL); glDisableVertexAttribArray(VATTR_NORMAL);
} }
@ -504,7 +504,6 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer)
{ {
// Change from BGRA to RGBA // Change from BGRA to RGBA
std::swap(v.color0.r, v.color0.b); std::swap(v.color0.r, v.color0.b);
v.color0 = 0xffffffff;
} }
auto vb = new F2DVertexBuffer; auto vb = new F2DVertexBuffer;
vb->UploadData(&vertices[0], vertices.Size(), &indices[0], indices.Size()); vb->UploadData(&vertices[0], vertices.Size(), &indices[0], indices.Size());
@ -604,5 +603,7 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer)
glDisable(GL_SCISSOR_TEST); glDisable(GL_SCISSOR_TEST);
gl_RenderState.SetVertexBuffer(nullptr); gl_RenderState.SetVertexBuffer(nullptr);
gl_RenderState.EnableTexture(true); gl_RenderState.EnableTexture(true);
gl_RenderState.SetTextureMode(TM_MODULATE);
gl_RenderState.ResetColor();
delete vb; delete vb;
} }

View File

@ -243,7 +243,6 @@ bool FRenderState::ApplyShader()
} }
else if (mColormapState == CM_SPECIAL2D) else if (mColormapState == CM_SPECIAL2D)
{ {
activeShader->muFixedColormap.Set(2);
activeShader->muFixedColormap.Set(1); activeShader->muFixedColormap.Set(1);
float startr = mObjectColor.r / 255; float startr = mObjectColor.r / 255;
float startg = mObjectColor.g / 255; float startg = mObjectColor.g / 255;

View File

@ -455,8 +455,8 @@ void F2DDrawer::AddColorOnlyQuad(int x1, int y1, int w, int h, PalEntry color)
auto ptr = &mVertices[dg.mVertIndex]; auto ptr = &mVertices[dg.mVertIndex];
ptr->Set(x1, y1, 0, 0, 0, color); ptr++; ptr->Set(x1, y1, 0, 0, 0, color); ptr++;
ptr->Set(x1, y1 + h, 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, 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); AddIndices(dg.mVertIndex, 6, 0, 1, 2, 1, 3, 2);
AddCommand(&dg); AddCommand(&dg);
} }