From 8b3c00dc76c53dcea8aff8194593e02d9f178170 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Sun, 5 Jun 2022 23:40:26 +0200 Subject: [PATCH] fix quad coloring when overridden by parent (eg. entity damage flash) --- BBGE/Quad.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BBGE/Quad.cpp b/BBGE/Quad.cpp index 8c920dd..88def98 100644 --- a/BBGE/Quad.cpp +++ b/BBGE/Quad.cpp @@ -397,6 +397,12 @@ void Quad::onRender(const RenderState& rs) const if (!drawGrid) { + const float red = rs.color.x * this->color.x; + const float green = rs.color.y * this->color.y; + const float blue = rs.color.z * this->color.z; + const float alpha = rs.alpha * this->alpha.x * this->alphaMod; + glColor4f(red, green, blue, alpha); + glBegin(GL_QUADS); { glTexCoord2f(upperLeftTextureCoordinates.x, 1.0f-upperLeftTextureCoordinates.y);