Rendering player and tiles now works.
This commit is contained in:
10
src/math/GameMath.cpp
Normal file
10
src/math/GameMath.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Math.cpp
|
||||
*
|
||||
* Created on: Nov 26, 2016
|
||||
* Author: tibi
|
||||
*/
|
||||
|
||||
#include <math/GameMath.h>
|
||||
|
||||
|
25
src/math/GameMath.h
Normal file
25
src/math/GameMath.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Math.h
|
||||
*
|
||||
* Created on: Nov 26, 2016
|
||||
* Author: tibi
|
||||
*/
|
||||
|
||||
#ifndef MATH_GAMEMATH_H_
|
||||
#define MATH_GAMEMATH_H_
|
||||
|
||||
template<typename TVal, typename TMin, typename TMax>
|
||||
TVal clamp (TVal value, TMin min, TMax max)
|
||||
{
|
||||
if (value < min)
|
||||
return min;
|
||||
|
||||
if (value > max)
|
||||
return max;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* MATH_GAMEMATH_H_ */
|
Reference in New Issue
Block a user