MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / OnBeginFrame

Method OnBeginFrame

Sources/Jazz2/LevelHandler.cpp:519–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517 }
518
519 void LevelHandler::OnBeginFrame()
520 {
521 ZoneScopedC(0x4876AF);
522
523 float timeMult = theApplication().GetTimeMult();
524
525 if (_pauseMenu == nullptr) {
526 UpdatePressedActions();
527
528 bool isGamepad;
529 if (PlayerActionHit(nullptr, PlayerAction::Menu)) {
530 if (_console->IsVisible()) {
531 HideConsole();
532 } else if (_nextLevelType == ExitType::None) {
533 PauseGame();
534 }
535 } else if (PlayerActionHit(nullptr, PlayerAction::Console, true, isGamepad)) {
536 if (_console->IsVisible()) {
537 if (isGamepad) {
538 HideConsole();
539 }
540 } else {
541 ShowConsole();
542 }
543 }
544#if defined(DEATH_DEBUG)
545 if (IsCheatingAllowed() && PlayerActionPressed(nullptr, PlayerAction::ChangeWeapon) && PlayerActionHit(0, PlayerAction::Jump)) {
546 _cheatsUsed = true;
547 BeginLevelChange(nullptr, ExitType::Warp | ExitType::FastTransition);
548 }
549#endif
550 }
551
552#if defined(WITH_AUDIO)
553 // Destroy stopped players and resume music after Sugar Rush
554 if (_sugarRushMusic != nullptr && _sugarRushMusic->isStopped()) {
555 _sugarRushMusic = nullptr;
556 if (_music != nullptr) {
557 _music->play();
558 }
559 }
560
561 auto it = _playingSounds.begin();
562 while (it != _playingSounds.end()) {
563 if ((*it)->isStopped()) {
564 it = _playingSounds.eraseUnordered(it);
565 continue;
566 }
567 ++it;
568 }
569#endif
570
571 if (!IsPausable() || _pauseMenu == nullptr) {
572 if (_nextLevelType != ExitType::None) {
573 _nextLevelTime -= timeMult;
574 ProcessQueuedNextLevel();
575 }
576

Callers

nothing calls this directly

Calls 9

isStoppedMethod · 0.80
eraseUnorderedMethod · 0.80
GetHealthMethod · 0.80
OnLevelUpdateMethod · 0.80
GetTimeMultMethod · 0.45
IsVisibleMethod · 0.45
playMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected