Remove utils.c
This commit is contained in:
parent
72a1d17fe4
commit
2e9edbd99a
41
utils.c
41
utils.c
@ -1,41 +0,0 @@
|
||||
#include "utils.h"
|
||||
|
||||
//Signum function
|
||||
#ifdef WIN32
|
||||
_inline int sign(float i)
|
||||
#else
|
||||
inline int sign(float i)
|
||||
#endif
|
||||
{
|
||||
if (i<0)
|
||||
return -1;
|
||||
if (i>0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
_inline unsigned clamp_flt(float f, float min, float max)
|
||||
#else
|
||||
inline unsigned clamp_flt(float f, float min, float max)
|
||||
#endif
|
||||
{
|
||||
if(f<min)
|
||||
return 0;
|
||||
if(f>max)
|
||||
return 255;
|
||||
return (int)(255.0f*(f-min)/(max-min));
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
_inline float restrict_flt(float f, float min, float max)
|
||||
#else
|
||||
inline float restrict_flt(float f, float min, float max)
|
||||
#endif
|
||||
{
|
||||
if(f<min)
|
||||
return min;
|
||||
if(f>max)
|
||||
return max;
|
||||
return f;
|
||||
}
|
23
utils.h
23
utils.h
@ -1,23 +0,0 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
//Signum function
|
||||
#ifdef WIN32
|
||||
_inline int sign(float i);
|
||||
#else
|
||||
inline int sign(float i);
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
_inline unsigned clamp_flt(float f, float min, float max);
|
||||
#else
|
||||
inline unsigned clamp_flt(float f, float min, float max);
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
_inline float restrict_flt(float f, float min, float max);
|
||||
#else
|
||||
inline float restrict_flt(float f, float min, float max);
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user