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

Method Pause

ogsr_engine/xr_3da/device.cpp:514–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512ENGINE_API BOOL bShowPauseString = TRUE;
513
514void CRenderDevice::Pause(BOOL bOn, BOOL bTimer, BOOL bSound, LPCSTR reason)
515{
516 static int snd_emitters_ = -1;
517
518#ifdef DEBUG
519// Msg("pause [%s] timer=[%s] sound=[%s] reason=%s",bOn?"ON":"OFF", bTimer?"ON":"OFF", bSound?"ON":"OFF", reason);
520#endif // DEBUG
521
522
523 if (bOn)
524 {
525 if (!Paused())
526 bShowPauseString =
527#ifdef DEBUG
528 !xr_strcmp(reason, "li_pause_key_no_clip") ? FALSE :
529#endif // DEBUG
530 TRUE;
531
532 if (bTimer)
533 {
534 g_pauseMngr->Pause(TRUE);
535#ifdef DEBUG
536 if (!xr_strcmp(reason, "li_pause_key_no_clip"))
537 TimerGlobal.Pause(FALSE);
538#endif // DEBUG
539 }
540
541 if (bSound && ::Sound)
542 {
543 snd_emitters_ = ::Sound->pause_emitters(true);
544#ifdef DEBUG
545// Log("snd_emitters_[true]",snd_emitters_);
546#endif // DEBUG
547 }
548 }
549 else
550 {
551 if (bTimer && g_pauseMngr->Paused())
552 {
553 fTimeDelta = EPS_S + EPS_S;
554
555 g_pauseMngr->Pause(FALSE);
556 }
557
558 if (bSound)
559 {
560 if (snd_emitters_ > 0) // avoid crash
561 {
562 snd_emitters_ = ::Sound->pause_emitters(false);
563#ifdef DEBUG
564// Log("snd_emitters_[false]",snd_emitters_);
565#endif // DEBUG
566 }
567 else
568 {
569#ifdef DEBUG
570 Log("Sound->pause_emitters underflow");
571#endif // DEBUG

Callers 15

IR_OnKeyboardPressMethod · 0.45
set_device_pausedFunction · 0.45
ActivateMethod · 0.45
ShowMethod · 0.45
HideMethod · 0.45
ExecuteMethod · 0.45
OnFrameMethod · 0.45
OnEventMethod · 0.45
OnAppActivateMethod · 0.45
OnAppDeactivateMethod · 0.45
OnKeyboardPressMethod · 0.45

Calls 5

PausedFunction · 0.85
LogFunction · 0.85
pause_emittersMethod · 0.80
PausedMethod · 0.80
xr_strcmpFunction · 0.50

Tested by

no test coverage detected