1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-07-31 10:20:27 +02:00

add forced quick load

This commit is contained in:
XProger
2020-01-31 21:11:56 +03:00
parent c6d409f860
commit 7ea08f75b2
2 changed files with 11 additions and 6 deletions

View File

@@ -226,8 +226,9 @@ namespace Game {
if (slot > -1) { if (slot > -1) {
if (forced) { if (forced) {
level->loadGame(slot);
level->loadLevel(saveSlots[slot].getLevelID()); level->loadLevel(saveSlots[slot].getLevelID());
level->loadNextLevel(); level->loadNextLevelData();
} else { } else {
level->loadGame(slot); level->loadGame(slot);
} }

View File

@@ -2051,6 +2051,14 @@ struct Level : IGame {
controller->render(camera->frustum, mesh, type, room.flags.water); controller->render(camera->frustum, mesh, type, room.flags.water);
} }
void loadNextLevelData() {
isEnded = true;
char buf[64];
TR::getGameLevelFile(buf, level.version, nextLevel);
nextLevel = TR::LVL_MAX;
new Stream(buf, loadLevelAsync);
}
void update() { void update() {
if (isEnded) return; if (isEnded) return;
@@ -2121,11 +2129,7 @@ struct Level : IGame {
showStats = false; showStats = false;
return; return;
} }
isEnded = true; loadNextLevelData();
char buf[64];
TR::getGameLevelFile(buf, level.version, nextLevel);
nextLevel = TR::LVL_MAX;
new Stream(buf, loadLevelAsync);
return; return;
} }