| 1602 | } |
| 1603 | |
| 1604 | void LevelHandler::PrepareNextLevelInitialization(LevelInitialization& levelInit) |
| 1605 | { |
| 1606 | StringView realNextLevel; |
| 1607 | if (!_nextLevelName.empty()) { |
| 1608 | realNextLevel = _nextLevelName; |
| 1609 | } else { |
| 1610 | realNextLevel = ((_nextLevelType & ExitType::TypeMask) == ExitType::Bonus ? _defaultSecretLevel : _defaultNextLevel); |
| 1611 | } |
| 1612 | |
| 1613 | auto p = _levelName.partition('/'); |
| 1614 | if (!realNextLevel.empty()) { |
| 1615 | if (realNextLevel.contains('/')) { |
| 1616 | levelInit.LevelName = realNextLevel; |
| 1617 | } else { |
| 1618 | levelInit.LevelName = p[0] + '/' + realNextLevel; |
| 1619 | } |
| 1620 | } |
| 1621 | |
| 1622 | levelInit.Difficulty = _difficulty; |
| 1623 | levelInit.IsReforged = _isReforged; |
| 1624 | levelInit.CheatsUsed = _cheatsUsed; |
| 1625 | levelInit.LastExitType = _nextLevelType; |
| 1626 | levelInit.LastEpisodeName = p[0]; |
| 1627 | levelInit.ElapsedMilliseconds = _elapsedMillisecondsBegin + (std::uint64_t)(_elapsedFrames * FrameTimer::SecondsPerFrame * 1000.0f); |
| 1628 | |
| 1629 | std::int32_t playerCount = (std::int32_t)std::min(_players.size(), arraySize(levelInit.PlayerCarryOvers)); |
| 1630 | for (std::int32_t i = 0; i < playerCount; i++) { |
| 1631 | levelInit.PlayerCarryOvers[i] = _players[i]->PrepareLevelCarryOver(); |
| 1632 | } |
| 1633 | } |
| 1634 | |
| 1635 | Recti LevelHandler::GetPlayerViewportBounds(std::int32_t w, std::int32_t h, std::int32_t index) |
| 1636 | { |