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

Method OnRender

ogsr_engine/xrGame/Level.cpp:432–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430extern void render_reshade_effects();
431
432void CLevel::OnRender()
433{
434 inherited::OnRender();
435
436 Render->Calculate();
437 Render->Render();
438
439 Game().OnRender();
440
441 //отрисовать трассы пуль
442 // Device.Statistic->TEST1.Begin();
443 BulletManager().Render();
444 // Device.Statistic->TEST1.End();
445
446 if (use_reshade)
447 render_reshade_effects();
448
449 auto pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame());
450 auto pActor = smart_cast<CActor*>(Level().CurrentEntity());
451 CPda* Pda = pActor ? pActor->GetPDA() : nullptr;
452 const bool need_pda_render = Pda && Pda->Is3DPDA() && psActorFlags.test(AF_3D_PDA) && pGameSP->PdaMenu->IsShown();
453
454 if (need_pda_render)
455 {
456 Render->AfterWorldRender();
457
458 pGameSP->PdaMenu->Draw();
459
460 const CUIDialogWnd* receiver = pGameSP->MainInputReceiver();
461 const bool is_top = receiver == pGameSP->PdaMenu;
462
463 if (is_top || !receiver)
464 {
465 if (g_btnHint)
466 g_btnHint->OnRender();
467 GetUICursor()->OnRender();
468 }
469
470 draw_wnds_rects();
471
472 Fvector2 cursor_pos = GetUICursor()->GetCursorPosition();
473 Fvector2 cursor_pos_dif{cursor_pos};
474 cursor_pos_dif.sub(pGameSP->PdaMenu->last_cursor_pos);
475 pGameSP->PdaMenu->last_cursor_pos.set(cursor_pos);
476 pGameSP->PdaMenu->MouseMovement(cursor_pos_dif.x, cursor_pos_dif.y);
477
478 Render->AfterUIRender();
479 }
480
481 HUD().RenderUI();
482
483 if (g_btnHint)
484 g_btnHint->OnRender();
485
486 draw_wnds_rects();
487
488#ifndef DEBUG
489

Callers 5

draw_objectsMethod · 0.45
RenderMethod · 0.45
RenderUIMethod · 0.45
dbg_DrawMethod · 0.45
RenderMethod · 0.45

Calls 15

OnRenderFunction · 0.85
render_reshade_effectsFunction · 0.85
GetUICursorFunction · 0.85
draw_wnds_rectsFunction · 0.85
UIGameMethod · 0.80
GetUIMethod · 0.80
GetPDAMethod · 0.80
Is3DPDAMethod · 0.80
IsShownMethod · 0.80
AfterWorldRenderMethod · 0.80
GetCursorPositionMethod · 0.80
MouseMovementMethod · 0.80

Tested by

no test coverage detected