- // insures the float to int cast is done once.
- int iupdate_sum = (int)update_Sum;
-
- // TODO the main run loop needs to be tested and pruned
- if (iupdate_sum > 0)
- {
- // Calculate a time step that spreads the updates out as much as
- // possible used because really quick updates are nearly wasted
-
- //float time_step = ((float)diff) / iupdate_sum / 1000;
- //float time_step = 1000 / (100000 / rUpdate) / iupdate_sum;
- //float time_step = 1000 / ups / iupdate_sum;
- float time_step = 10;
-
- // run the updates
- for (int i = 0; i < iupdate_sum; i++)
- {
- handleInput();
- update(time_step);
- }
-
- // remove the updates that were run from the sum
- update_Sum -= iupdate_sum;
- last_Block_Update = tickCountMicro();
- }