diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 45c07f2a4..ed39d2004 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -336,9 +336,10 @@ void Window::render() } if (Settings::getInstance()->getString("MenuOpeningEffect") == "fade-in") { // Fade-in menu. - if (mTopOpacity < 255) + if (mTopOpacity < 255) { mTopOpacity = Math::clamp(mTopOpacity+15, 0, 255); - top->setOpacity(mTopOpacity); + top->setOpacity(mTopOpacity); + } } #endif diff --git a/es-core/src/components/ComponentList.cpp b/es-core/src/components/ComponentList.cpp index 3dd76fa2d..37d118430 100644 --- a/es-core/src/components/ComponentList.cpp +++ b/es-core/src/components/ComponentList.cpp @@ -229,7 +229,6 @@ void ComponentList::render(const Transform4x4f& parentTrans) } } else { - it->component->setOpacity(mOpacity); it->component->render(trans); } } diff --git a/es-core/src/components/NinePatchComponent.cpp b/es-core/src/components/NinePatchComponent.cpp index 5322ab38b..a288e6dc7 100644 --- a/es-core/src/components/NinePatchComponent.cpp +++ b/es-core/src/components/NinePatchComponent.cpp @@ -118,6 +118,12 @@ void NinePatchComponent::render(const Transform4x4f& parentTrans) mVertices[0].shaders = Renderer::SHADER_OPACITY; mVertices[0].opacity = mOpacity / 255.0; } + else if (mVertices[0].shaders & Renderer::SHADER_OPACITY) { + // We have reached full opacity, so disable the opacity shader and set + // the vertex opacity to 1.0. + mVertices[0].shaders ^= Renderer::SHADER_OPACITY; + mVertices[0].opacity = 1.0; + } mTexture->bind(); Renderer::drawTriangleStrips(&mVertices[0], 6*9, trans); }