| 269 | } |
| 270 | |
| 271 | bool Time::OnBeginUpdate(double time) |
| 272 | { |
| 273 | #if !USE_EDITOR |
| 274 | // Pause game if window lost focus (based on game settings) |
| 275 | bool gamePausedUnfocsed = !Engine::HasFocus && UnfocusedPause; |
| 276 | if (gamePausedUnfocsed != _gamePausedUnfocsed) |
| 277 | { |
| 278 | _gamePausedUnfocsed = gamePausedUnfocsed; |
| 279 | if (!gamePausedUnfocsed) |
| 280 | { |
| 281 | // Reset ticking |
| 282 | const double time = Platform::GetTimeSeconds(); |
| 283 | Update.OnReset(UpdateFPS, time); |
| 284 | Physics.OnReset(PhysicsFPS, time); |
| 285 | Draw.OnReset(DrawFPS, time); |
| 286 | } |
| 287 | } |
| 288 | #endif |
| 289 | |
| 290 | if (Update.OnTickBegin(time, GetFps(UpdateFPS), MaxUpdateDeltaTime)) |
| 291 | { |
| 292 | Current = &Update; |
| 293 | return true; |
| 294 | } |
| 295 | return false; |
| 296 | } |
| 297 | |
| 298 | bool Time::OnBeginPhysics(double time) |
| 299 | { |
nothing calls this directly
no test coverage detected