| 512 | ENGINE_API BOOL bShowPauseString = TRUE; |
| 513 | |
| 514 | void 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 |
no test coverage detected