From 5ab94de3181a2391a938cfa7afb76fedf218944a Mon Sep 17 00:00:00 2001 From: Vincent Pelletier Date: Wed, 26 Apr 2017 11:16:25 +0000 Subject: [PATCH] TINYGL: Avoid unneeded calls in writePixel. --- graphics/tinygl/zbuffer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graphics/tinygl/zbuffer.h b/graphics/tinygl/zbuffer.h index 12a79193c8b..e6c4eb9981e 100644 --- a/graphics/tinygl/zbuffer.h +++ b/graphics/tinygl/zbuffer.h @@ -191,15 +191,15 @@ struct FrameBuffer { template FORCEINLINE void writePixel(int pixel, int value, unsigned int z) { - byte rSrc, gSrc, bSrc, aSrc; - this->pbuf.getFormat().colorToARGB(value, aSrc, rSrc, gSrc, bSrc); - if (kBlendingEnabled == false) { this->pbuf.setPixelAt(pixel, value); if (kDepthWrite) { _zbuf[pixel] = z; } } else { + byte rSrc, gSrc, bSrc, aSrc; + this->pbuf.getFormat().colorToARGB(value, aSrc, rSrc, gSrc, bSrc); + writePixel(pixel, aSrc, rSrc, gSrc, bSrc, z); } }