| 53 | } |
| 54 | |
| 55 | void updateTime() |
| 56 | { |
| 57 | if (!s_pauseTimeUpdate) |
| 58 | { |
| 59 | s_timeAccum += TFE_System::getDeltaTime() * TIMER_FREQ; |
| 60 | } |
| 61 | |
| 62 | Tick prevTick = s_curTick; |
| 63 | |
| 64 | // Record Replay Ticks |
| 65 | if (TFE_Input::isRecording()) |
| 66 | { |
| 67 | TFE_Input::saveTick(); |
| 68 | } |
| 69 | |
| 70 | // Either Playback Ticks or use the current time. |
| 71 | if (TFE_Input::isDemoPlayback()) |
| 72 | { |
| 73 | TFE_Input::loadTick(); |
| 74 | } |
| 75 | else |
| 76 | { |
| 77 | s_curTick = Tick(s_timeAccum); |
| 78 | |
| 79 | s_curTickFract = 0; |
| 80 | if (TFE_Settings::getGraphicsSettings()->useSmoothDeltaTime) |
| 81 | { |
| 82 | s_curTickFract = fract16(floatToFixed16(s_timeAccum)); |
| 83 | } |
| 84 | } |
| 85 | // Keep the original tick delta for animations. |
| 86 | fixed16_16 dt = div16(intToFixed16(s_curTick - prevTick), FIXED(TICKS_PER_SECOND)); |
| 87 | for (s32 i = 0; i < 13; i++) |
| 88 | { |
| 89 | s_frameTicks[i] += mul16(dt, intToFixed16(i)); |
| 90 | } |
| 91 | } |
| 92 | } // TFE_DarkForces |
no test coverage detected