1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 22:57:45 +00:00

Merge pull request #3 from Minoost/master

Add gitignore and fix UtilMath::clamp
This commit is contained in:
SapphireMordred 2017-08-08 14:05:42 +02:00 committed by GitHub
commit 9267fc7ebf
2 changed files with 13 additions and 3 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
bin
.vs
*.dat *.dat
*.suo *.suo
*.pch *.pch

View file

@ -29,9 +29,17 @@ template
<typename T> <typename T>
T clamp( T val, T minimum, T maximum ) T clamp( T val, T minimum, T maximum )
{ {
// TODO: Lazy hack, do this properly... if (val > maximum)
return maximum; {
// return std::max( std::min( val, maximum ), minimum ); return maximum;
}
if (val < minimum)
{
return minimum;
}
return val;
} }
} }
} }