| 376 | void CCustomMonster::update_sound_player() { sound().update(client_update_fdelta()); } |
| 377 | |
| 378 | void CCustomMonster::UpdateCL() |
| 379 | { |
| 380 | START_PROFILE("CustomMonster/client_update") |
| 381 | m_client_update_delta = Device.dwTimeGlobal - m_last_client_update_time; |
| 382 | m_last_client_update_time = Device.dwTimeGlobal; |
| 383 | |
| 384 | START_PROFILE("CustomMonster/client_update/inherited") |
| 385 | inherited::UpdateCL(); |
| 386 | STOP_PROFILE |
| 387 | |
| 388 | CScriptEntity::process_sound_callbacks(); |
| 389 | |
| 390 | /* //. hack just to skip 'CalculateBones' |
| 391 | if (sound().need_bone_data()) { |
| 392 | // we do this because we know here would be virtual function call |
| 393 | IKinematics *kinematics = smart_cast<IKinematics*>(Visual()); |
| 394 | VERIFY (kinematics); |
| 395 | kinematics->CalculateBones (); |
| 396 | } |
| 397 | */ |
| 398 | |
| 399 | if (g_mt_config.test(mtSoundPlayer)) |
| 400 | Device.add_to_seq_parallel(fastdelegate::MakeDelegate(this, &CCustomMonster::update_sound_player)); |
| 401 | else |
| 402 | { |
| 403 | START_PROFILE("CustomMonster/client_update/sound_player") |
| 404 | update_sound_player(); |
| 405 | STOP_PROFILE |
| 406 | } |
| 407 | |
| 408 | START_PROFILE("CustomMonster/client_update/network extrapolation") |
| 409 | if (NET.empty()) |
| 410 | { |
| 411 | update_animation_movement_controller(); |
| 412 | return; |
| 413 | } |
| 414 | |
| 415 | m_dwCurrentTime = Device.dwTimeGlobal; |
| 416 | |
| 417 | // distinguish interpolation/extrapolation |
| 418 | u32 dwTime = Level().timeServer() - NET_Latency; |
| 419 | net_update& N = NET.back(); |
| 420 | if ((dwTime > N.dwTimeStamp) || (NET.size() < 2)) |
| 421 | { |
| 422 | // BAD. extrapolation |
| 423 | NET_Last = N; |
| 424 | } |
| 425 | else |
| 426 | { |
| 427 | // OK. interpolation |
| 428 | NET_WasExtrapolating = FALSE; |
| 429 | // Search 2 keyframes for interpolation |
| 430 | int select = -1; |
| 431 | for (u32 id = 0; id < NET.size() - 1; ++id) |
| 432 | { |
| 433 | if ((NET[id].dwTimeStamp <= dwTime) && (dwTime <= NET[id + 1].dwTimeStamp)) |
| 434 | select = id; |
| 435 | } |
nothing calls this directly
no test coverage detected