From 05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2 Mon Sep 17 00:00:00 2001 From: tfarley Date: Mon, 18 May 2015 21:21:33 -0700 Subject: OpenGL renderer --- src/common/math_util.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/common') diff --git a/src/common/math_util.h b/src/common/math_util.h index 0b1400b4..4b091074 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 inline T Clamp(const T val, const T& min, const T& max) { -- cgit v1.2.3