From a36d79c70189fa4ac8a3b62d457d268276ec2a4f Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Thu, 31 May 2012 17:14:24 +0100 Subject: [PATCH] Check fire colour values are within the range 0-255 Fixes flashing dust --- src/graphics.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/graphics.c b/src/graphics.c index 8992ea839..8b9e02e0c 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2004,6 +2004,15 @@ void render_parts(pixel *vid) else if(colb<0) colb = 0; if(cola>255) cola = 255; else if(cola<0) cola = 0; + + if(firer>255) firer = 255; + else if(firer<0) firer = 0; + if(fireg>255) fireg = 255; + else if(fireg<0) fireg = 0; + if(fireb>255) fireb = 255; + else if(fireb<0) fireb = 0; + if(firea>255) firea = 255; + else if(firea<0) firea = 0; #endif //Pixel rendering