Fix a typo here. Two values are not swapped correctly, max_inclusive is still equal to itself.

This commit is contained in:
Walzer 2011-11-26 17:07:36 +08:00
parent c74502da94
commit 8edbbd56a9
1 changed files with 95 additions and 98 deletions

View File

@ -69,10 +69,7 @@ CCPoint ccpLerp(const CCPoint& a, const CCPoint& b, float alpha)
float clampf(float value, float min_inclusive, float max_inclusive)
{
if (min_inclusive > max_inclusive) {
float ftmp;
ftmp = min_inclusive;
min_inclusive = max_inclusive;
max_inclusive = min_inclusive;
CC_SWAP(min_inclusive, max_inclusive, float);
}
return value < min_inclusive ? min_inclusive : value < max_inclusive? value : max_inclusive;
}