From 3ebc230b287f52d39f605e2cf55c22817e08aa65 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Mon, 6 Apr 2015 03:05:28 -0700 Subject: [PATCH] OpenGL2: Use signed value in case value goes below 0. --- code/renderergl2/tr_extramath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/renderergl2/tr_extramath.c b/code/renderergl2/tr_extramath.c index da9a94d2..bded7570 100644 --- a/code/renderergl2/tr_extramath.c +++ b/code/renderergl2/tr_extramath.c @@ -225,7 +225,7 @@ uint16_t FloatToHalf(float in) f32.f = in; - f16.pack.exponent = CLAMP(f32.pack.exponent - 112, 0, 31); + f16.pack.exponent = CLAMP((int)(f32.pack.exponent) - 112, 0, 31); f16.pack.fraction = f32.pack.fraction >> 13; f16.pack.sign = f32.pack.sign;