Created
August 15, 2016 13:53
-
-
Save florczakraf/76bd4adb3df3e13caedf7d1d1338164b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getCjFPS(fps) | |
| { | |
| delta = 15; | |
| for (i = 0; i < level.cj_fps.size; i++) | |
| { | |
| cj_fps = int(level.cj_fps[i]); | |
| if (isValueCloseToDesired(fps, cj_fps, delta)) | |
| return cj_fps; | |
| } | |
| return fps; | |
| } | |
| isValueCloseToDesired(value, desired, delta) | |
| { | |
| return abs(desired - value) <= delta; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment