comparison src/dmlib.h @ 980:43594ac98f91

Move dmClamp*() functions back to dmlib.h
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 27 Feb 2015 16:25:02 +0200
parents 1b439304ff3c
children 7e54b2d08ce7
comparison
equal deleted inserted replaced
979:76e8dcfeb808 980:43594ac98f91
204 { 204 {
205 return (bpp == 8 ? 0 : (bpp == 32 ? 1 : -1)); 205 return (bpp == 8 ? 0 : (bpp == 32 ? 1 : -1));
206 } 206 }
207 207
208 208
209 static inline DMFloat dmClamp10(const DMFloat a)
210 {
211 return (a < 0.0f ? 0.0f : (a > 1.0f ? 1.0f : a));
212 }
213
214
215 static inline int dmClamp(const int v, const int min, const int max)
216 {
217 return (v < min ? min : (v > max ? max : v));
218 }
219
220
209 /* Arbitrary line drawing 221 /* Arbitrary line drawing
210 */ 222 */
211 #ifdef DM_GFX_LINES 223 #ifdef DM_GFX_LINES
212 #define DM_HEADER 224 #define DM_HEADER
213 #include "dmlinefunc.h" 225 #include "dmlinefunc.h"