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); } }