mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Removed a lot of unnecessary vertex roundings
This commit is contained in:
parent
848d19a80b
commit
8d8649273b
|
@ -583,10 +583,6 @@ void GIFAnimComponent::render(const glm::mat4& parentTrans)
|
||||||
vertices[3] = {{mSize.x, mSize.y}, {1.0f, 1.0f}, mColorShiftEnd};
|
vertices[3] = {{mSize.x, mSize.y}, {1.0f, 1.0f}, mColorShiftEnd};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// Round vertices.
|
|
||||||
for (int i = 0; i < 4; ++i)
|
|
||||||
vertices[i].position = glm::round(vertices[i].position);
|
|
||||||
|
|
||||||
vertices->brightness = mBrightness;
|
vertices->brightness = mBrightness;
|
||||||
vertices->saturation = mSaturation * mThemeSaturation;
|
vertices->saturation = mSaturation * mThemeSaturation;
|
||||||
vertices->opacity = mOpacity * mThemeOpacity;
|
vertices->opacity = mOpacity * mThemeOpacity;
|
||||||
|
|
|
@ -874,11 +874,6 @@ void ImageComponent::updateVertices()
|
||||||
|
|
||||||
updateColors();
|
updateColors();
|
||||||
|
|
||||||
// We round the vertices already here in this component as we may otherwise end up with edge
|
|
||||||
// cases at sizes near 0.5.
|
|
||||||
for (int i {0}; i < 4; ++i)
|
|
||||||
mVertices[i].position = glm::round(mVertices[i].position);
|
|
||||||
|
|
||||||
if (mFlipX) {
|
if (mFlipX) {
|
||||||
for (int i {0}; i < 4; ++i)
|
for (int i {0}; i < 4; ++i)
|
||||||
mVertices[i].texcoord[0] = px - mVertices[i].texcoord[0];
|
mVertices[i].texcoord[0] = px - mVertices[i].texcoord[0];
|
||||||
|
|
|
@ -574,10 +574,6 @@ void LottieAnimComponent::render(const glm::mat4& parentTrans)
|
||||||
vertices[3] = {{mSize.x, mSize.y}, {1.0f, 1.0f}, mColorShiftEnd};
|
vertices[3] = {{mSize.x, mSize.y}, {1.0f, 1.0f}, mColorShiftEnd};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// Round vertices.
|
|
||||||
for (int i {0}; i < 4; ++i)
|
|
||||||
vertices[i].position = glm::round(vertices[i].position);
|
|
||||||
|
|
||||||
vertices->brightness = mBrightness;
|
vertices->brightness = mBrightness;
|
||||||
vertices->saturation = mSaturation * mThemeSaturation;
|
vertices->saturation = mSaturation * mThemeSaturation;
|
||||||
vertices->opacity = mOpacity * mThemeOpacity;
|
vertices->opacity = mOpacity * mThemeOpacity;
|
||||||
|
|
|
@ -129,10 +129,6 @@ void NinePatchComponent::buildVertices()
|
||||||
(*mVertices)[v + 4] = {{imgPos.x + imgSize.x, imgPos.y + imgSize.y}, {texPos.x + texSizeSlice.x, texPos.y + texSizeSlice.y}, 0};
|
(*mVertices)[v + 4] = {{imgPos.x + imgSize.x, imgPos.y + imgSize.y}, {texPos.x + texSizeSlice.x, texPos.y + texSizeSlice.y}, 0};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// Round vertices.
|
|
||||||
for (int i {1}; i < 5; ++i)
|
|
||||||
(*mVertices)[v + i].position = glm::round((*mVertices)[v + i].position);
|
|
||||||
|
|
||||||
// Make duplicates of first and last vertex so this can be rendered as a triangle strip.
|
// Make duplicates of first and last vertex so this can be rendered as a triangle strip.
|
||||||
(*mVertices)[v + 0] = (*mVertices)[v + 1];
|
(*mVertices)[v + 0] = (*mVertices)[v + 1];
|
||||||
(*mVertices)[v + 5] = (*mVertices)[v + 4];
|
(*mVertices)[v + 5] = (*mVertices)[v + 4];
|
||||||
|
|
|
@ -199,10 +199,6 @@ void VideoFFmpegComponent::render(const glm::mat4& parentTrans)
|
||||||
vertices[2].color = mColorGradientHorizontal ? mColorShiftEnd : mColorShift;
|
vertices[2].color = mColorGradientHorizontal ? mColorShiftEnd : mColorShift;
|
||||||
vertices[3].color = mColorShiftEnd;
|
vertices[3].color = mColorShiftEnd;
|
||||||
|
|
||||||
// Round vertices.
|
|
||||||
for (int i {0}; i < 4; ++i)
|
|
||||||
vertices[i].position = glm::round(vertices[i].position);
|
|
||||||
|
|
||||||
if (mFadeIn < 1.0f || mThemeOpacity < 1.0f)
|
if (mFadeIn < 1.0f || mThemeOpacity < 1.0f)
|
||||||
vertices->opacity = mOpacity * mThemeOpacity;
|
vertices->opacity = mOpacity * mThemeOpacity;
|
||||||
|
|
||||||
|
|
|
@ -486,10 +486,6 @@ void Renderer::drawRect(const float x,
|
||||||
vertices[3] = {{x + wL, y + hL}, {0.0f, 0.0f}, colorEnd};
|
vertices[3] = {{x + wL, y + hL}, {0.0f, 0.0f}, colorEnd};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// Round vertices.
|
|
||||||
for (int i {0}; i < 4; ++i)
|
|
||||||
vertices[i].position = glm::round(vertices[i].position);
|
|
||||||
|
|
||||||
vertices->opacity = opacity;
|
vertices->opacity = opacity;
|
||||||
vertices->dimming = dimming;
|
vertices->dimming = dimming;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue