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

Method OnFrame

ogsr_engine/xrGame/GamePersistent.cpp:518–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516extern bool RESET_SECTORS_HACK;
517
518void CGamePersistent::OnFrame()
519{
520 if (g_tutorial2)
521 {
522 g_tutorial2->Destroy();
523 xr_delete(g_tutorial2);
524 }
525
526 if (g_tutorial && !g_tutorial->IsActive())
527 {
528 xr_delete(g_tutorial);
529 }
530
531#ifdef DEBUG
532 ++m_frame_counter;
533#endif
534 if (!m_intro_event.empty() && !load_screen_renderer.b_registered)
535 m_intro_event();
536
537 if (Device.dwPrecacheFrame == 0 && load_screen_renderer.b_registered && !GameAutopaused)
538 {
539 if (psActorFlags.test(AF_KEYPRESS_ON_START))
540 {
541 Device.Pause(TRUE, TRUE, TRUE, "AUTOPAUSE_START");
542 pApp->LoadForceFinish();
543 LoadTitle("st_press_any_key");
544 GameAutopaused = true;
545 }
546 else
547 {
548 load_screen_renderer.stop();
549 }
550
551 RESET_SECTORS_HACK = true;
552
553 Discord.Update(CStringTable().translate(Level().name()).c_str(), Level().name().c_str());
554 }
555
556 if (!m_pMainMenu->IsActive())
557 m_pMainMenu->DestroyInternal(false);
558
559 if (!g_pGameLevel)
560 return;
561 if (!g_pGameLevel->bReady)
562 return;
563
564 if (Device.Paused())
565 {
566#ifndef MASTER_GOLD
567 if (Level().CurrentViewEntity())
568 {
569 if (!g_actor || (g_actor->ID() != Level().CurrentViewEntity()->ID()))
570 {
571 CCustomMonster* custom_monster = smart_cast<CCustomMonster*>(Level().CurrentViewEntity());
572 if (custom_monster) // can be spectator in multiplayer
573 custom_monster->UpdateCamera();
574 }
575 else

Callers

nothing calls this directly

Calls 15

xr_deleteFunction · 0.85
CStringTableClass · 0.85
ActorFunction · 0.85
OnFrameFunction · 0.85
xr_strdupFunction · 0.85
_TrimFunction · 0.85
u64Enum · 0.85
LoadForceFinishMethod · 0.80
DestroyInternalMethod · 0.80
PausedMethod · 0.80
HolderMethod · 0.80
cam_ActiveMethod · 0.80

Tested by

no test coverage detected