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

Method BeginLevelChange

Sources/Jazz2/LevelHandler.cpp:1108–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1106 }
1107
1108 void LevelHandler::BeginLevelChange(Actors::ActorBase* initiator, ExitType exitType, StringView nextLevel)
1109 {
1110 if (_nextLevelType != ExitType::None) {
1111 return;
1112 }
1113
1114 _nextLevelName = nextLevel;
1115 _nextLevelType = exitType;
1116
1117 if ((exitType & ExitType::FastTransition) == ExitType::FastTransition) {
1118 ExitType exitTypeMasked = (exitType & ExitType::TypeMask);
1119 if (exitTypeMasked == ExitType::Warp || exitTypeMasked == ExitType::Bonus || exitTypeMasked == ExitType::Boss) {
1120 _nextLevelTime = 70.0f;
1121 } else {
1122 _nextLevelTime = 0.0f;
1123 }
1124 } else {
1125 _nextLevelTime = 360.0f;
1126
1127 if (_hud != nullptr) {
1128 _hud->BeginFadeOut(_nextLevelTime - 40.0f);
1129 }
1130
1131#if defined(WITH_AUDIO)
1132 if (_sugarRushMusic != nullptr) {
1133 _sugarRushMusic->stop();
1134 _sugarRushMusic = nullptr;
1135 }
1136 if (_music != nullptr) {
1137 _music->stop();
1138 _music = nullptr;
1139 }
1140#endif
1141 }
1142
1143 for (auto player : _players) {
1144 player->OnLevelChanging(initiator, exitType);
1145 }
1146 }
1147
1148 void LevelHandler::SendPacket(const Actors::ActorBase* self, ArrayView<const std::uint8_t> data)
1149 {

Callers

nothing calls this directly

Calls 3

BeginFadeOutMethod · 0.80
stopMethod · 0.45
OnLevelChangingMethod · 0.45

Tested by

no test coverage detected