MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / UpdateCL

Method UpdateCL

ogsr_engine/xrGame/ai/monsters/controller/controller.cpp:376–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374static const float TEXTURE_SIZE_PERCENT = 2.f;
375
376void CController::UpdateCL()
377{
378 inherited::UpdateCL();
379
380 if (m_sndShockEffector)
381 {
382 m_sndShockEffector->Update();
383
384 if (!m_sndShockEffector->InWork())
385 xr_delete(m_sndShockEffector);
386 }
387
388 if (active_control_fx)
389 {
390 u32 time_to_show = 150;
391 float percent = float((Device.dwTimeGlobal - time_control_hit_started)) / float(time_to_show);
392 float percent2 = 1 - (percent - TEXTURE_SIZE_PERCENT) / 2;
393
394 if (percent < TEXTURE_SIZE_PERCENT)
395 {
396 HUD().GetUI()->UIGame()->RemoveCustomStatic("controller_fx2");
397 SDrawStaticStruct* s = HUD().GetUI()->UIGame()->AddCustomStatic("controller_fx", true);
398
399 float x1 = Device.dwWidth / 2 - ((Device.dwWidth / 2) * percent);
400 float y1 = Device.dwHeight / 2 - ((Device.dwHeight / 2) * percent);
401 float x2 = Device.dwWidth / 2 + ((Device.dwWidth / 2) * percent);
402 float y2 = Device.dwHeight / 2 + ((Device.dwHeight / 2) * percent);
403
404 s->wnd()->SetWndRect(x1, y1, x2 - x1, y2 - y1);
405 }
406 else if (percent2 > 0)
407 {
408 HUD().GetUI()->UIGame()->RemoveCustomStatic("controller_fx");
409 SDrawStaticStruct* s = HUD().GetUI()->UIGame()->AddCustomStatic("controller_fx2", true);
410
411 float x1 = Device.dwWidth / 2 - ((Device.dwWidth / 2) * percent2);
412 float y1 = Device.dwHeight / 2 - ((Device.dwHeight / 2) * percent2);
413 float x2 = Device.dwWidth / 2 + ((Device.dwWidth / 2) * percent2);
414 float y2 = Device.dwHeight / 2 + ((Device.dwHeight / 2) * percent2);
415
416 s->wnd()->SetWndRect(x1, y1, x2 - x1, y2 - y1);
417 }
418 else
419 {
420 active_control_fx = false;
421 HUD().GetUI()->UIGame()->RemoveCustomStatic("controller_fx");
422 HUD().GetUI()->UIGame()->RemoveCustomStatic("controller_fx2");
423 }
424 }
425}
426
427void CController::shedule_Update(u32 dt)
428{

Callers

nothing calls this directly

Calls 9

xr_deleteFunction · 0.85
InWorkMethod · 0.80
RemoveCustomStaticMethod · 0.80
UIGameMethod · 0.80
GetUIMethod · 0.80
AddCustomStaticMethod · 0.80
UpdateMethod · 0.45
SetWndRectMethod · 0.45
wndMethod · 0.45

Tested by

no test coverage detected