# HG changeset patch # User Matti Hamalainen # Date 1425047102 -7200 # Node ID 43594ac98f91b88d1f90735fa5760343a84e24cf # Parent 76e8dcfeb808790292c74d01eb567989cbf2fc40 Move dmClamp*() functions back to dmlib.h diff -r 76e8dcfeb808 -r 43594ac98f91 src/dmcurves.h --- a/src/dmcurves.h Fri Feb 27 16:24:42 2015 +0200 +++ b/src/dmcurves.h Fri Feb 27 16:25:02 2015 +0200 @@ -29,18 +29,6 @@ DMFloat dmCatmullRom(const DMFloat t, const DMFloat p0, const DMFloat p1, const DMFloat p2, const DMFloat p3); -static inline DMFloat dmClamp10(const DMFloat a) -{ - return (a < 0.0f ? 0.0f : (a > 1.0f ? 1.0f : a)); -} - - -static inline int dmClamp(const int v, const int min, const int max) -{ - return (v < min ? min : (v > max ? max : v)); -} - - static inline DMFloat dmLerpSCurve(DMLerpContext *ctx, const DMFloat step) { const DMFloat n = step / ctx->nsteps; diff -r 76e8dcfeb808 -r 43594ac98f91 src/dmlib.h --- a/src/dmlib.h Fri Feb 27 16:24:42 2015 +0200 +++ b/src/dmlib.h Fri Feb 27 16:25:02 2015 +0200 @@ -206,6 +206,18 @@ } +static inline DMFloat dmClamp10(const DMFloat a) +{ + return (a < 0.0f ? 0.0f : (a > 1.0f ? 1.0f : a)); +} + + +static inline int dmClamp(const int v, const int min, const int max) +{ + return (v < min ? min : (v > max ? max : v)); +} + + /* Arbitrary line drawing */ #ifdef DM_GFX_LINES