Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- time0 = getTickCount();
- while (!bGameDone)
- {
- time1 = getTickCount();
- frameTime = 0;
- int numLoops = 0;
- while ((time1 - time0) > TICK_TIME && numLoops < MAX_LOOPS)
- {
- GameTickRun();
- time0 += TICK_TIME;
- frameTime += TICK_TIME;
- numLoops++;
- }
- IndependentTickRun(frameTime);
- // If playing solo and game logic takes way too long, discard
- // pending time.
- if (!bNetworkGame && (time1 - time0) > TICK_TIME)
- time0 = time1 - TICK_TIME;
- if (canRender)
- {
- // Account for numLoops overflow causing percent > 1.
- float percentWithinTick = Min(1.f, float(time1 - time0)/TICK_TIME);
- GameDrawWithInterpolation(percentWithinTick);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement