From 7d285a5731407f4e316ed22161785f2c30924ea2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 22 Dec 2004 04:07:42 +0000 Subject: [PATCH] add QuantizeUp --- stepmania/src/RageUtil.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 1165105994..a0e601e5be 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -166,6 +166,12 @@ inline float ftruncf( const float f, const float fTruncInterval ) return int( (f)/fTruncInterval ) * fTruncInterval; } +/* Return i rounded up to the nearest multiple of iInterval. */ +inline int QuantizeUp( int i, int iInterval ) +{ + return int( (i+iInterval-1)/iInterval ) * iInterval; +} + // Move val toward other_val by to_move. void fapproach( float& val, float other_val, float to_move );