mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-03-04 09:11:27 +01:00
utils: add Sign function
This commit is contained in:
parent
7b93ced844
commit
c2f6aa73cd
2 changed files with 5 additions and 0 deletions
|
@ -162,6 +162,10 @@ SYMBOL_EXPORT double Lerp(double left, double right, double pos) {
|
||||||
return left + (right - left) * pos;
|
return left + (right - left) * pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SYMBOL_EXPORT double Sign(double val) {
|
||||||
|
return val / fabs(val);
|
||||||
|
}
|
||||||
|
|
||||||
/* linear filtering code written by SiegeLord */
|
/* linear filtering code written by SiegeLord */
|
||||||
SYMBOL_EXPORT ALLEGRO_COLOR InterpolateColor(ALLEGRO_COLOR c1, ALLEGRO_COLOR c2, float frac) {
|
SYMBOL_EXPORT ALLEGRO_COLOR InterpolateColor(ALLEGRO_COLOR c1, ALLEGRO_COLOR c2, float frac) {
|
||||||
return al_map_rgba_f(c1.r + frac * (c2.r - c1.r),
|
return al_map_rgba_f(c1.r + frac * (c2.r - c1.r),
|
||||||
|
|
|
@ -61,6 +61,7 @@ double VectorLength(double x, double y, double z);
|
||||||
double Wrap(double left, double right, double val);
|
double Wrap(double left, double right, double val);
|
||||||
double Clamp(double left, double right, double val);
|
double Clamp(double left, double right, double val);
|
||||||
double Lerp(double left, double right, double pos);
|
double Lerp(double left, double right, double pos);
|
||||||
|
double Sign(double val);
|
||||||
|
|
||||||
ALLEGRO_COLOR InterpolateColor(ALLEGRO_COLOR c1, ALLEGRO_COLOR c2, float frac);
|
ALLEGRO_COLOR InterpolateColor(ALLEGRO_COLOR c1, ALLEGRO_COLOR c2, float frac);
|
||||||
void ScaleBitmap(ALLEGRO_BITMAP* source, int width, int height);
|
void ScaleBitmap(ALLEGRO_BITMAP* source, int width, int height);
|
||||||
|
|
Loading…
Add table
Reference in a new issue