From 5e30c0c668b4d57316254ceb413b1e2a3f64af4a Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Thu, 15 Mar 2012 02:26:12 +0000 Subject: [PATCH] No "min" and "max" in stdlib :( --- src/graphics.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index cf5a76037..bacc234e9 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2988,12 +2988,12 @@ void create_decoration(int x, int y, int r, int g, int b, int click, int tool) } if (num == 0) return; - ta = min(255,(int)((float)ta/num+.5)); - tr = min(255,(int)((float)tr/num+.5)); - tg = min(255,(int)((float)tg/num+.5)); - tb = min(255,(int)((float)tb/num+.5)); + ta = fminf(255,(int)((float)ta/num+.5)); + tr = fminf(255,(int)((float)tr/num+.5)); + tg = fminf(255,(int)((float)tg/num+.5)); + tb = fminf(255,(int)((float)tb/num+.5)); if (!parts[rp>>8].dcolour) - ta = max(0,ta-3); + ta = fmaxf(0,ta-3); parts[rp>>8].dcolour = ((ta<<24)|(tr<<16)|(tg<<8)|tb); } }