summaryrefslogtreecommitdiff
path: root/src/common/math_util.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-05-22 19:40:57 -0400
committerbunnei <bunneidev@gmail.com>2015-05-22 19:40:57 -0400
commit7b94b312d39037e9a90c981b49743965c0d1a743 (patch)
treef922946de22f54bf0c0aaaff01371f5ca7a2fc57 /src/common/math_util.h
parenteca2b71fa8a6c4c104695b866952e4295dc6466f (diff)
parent62668688e1055dbfcbff824acfd9c9f970fc2c09 (diff)
Merge pull request #789 from tfarley/opengl-renderer
OpenGL Hardware Renderer
Diffstat (limited to 'src/common/math_util.h')
-rw-r--r--src/common/math_util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/math_util.h b/src/common/math_util.h
index 0b1400b41..4b0910741 100644
--- a/src/common/math_util.h
+++ b/src/common/math_util.h
@@ -11,6 +11,10 @@
namespace MathUtil
{
+inline bool IntervalsIntersect(unsigned start0, unsigned length0, unsigned start1, unsigned length1) {
+ return (std::max(start0, start1) <= std::min(start0 + length0, start1 + length1));
+}
+
template<typename T>
inline T Clamp(const T val, const T& min, const T& max)
{