1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-03-18 18:19:39 +01:00

add quick save and restore the game state for GCW0

This commit is contained in:
XProger 2020-01-31 23:03:05 +03:00
parent 780b3e96a6
commit d02c1d9274
3 changed files with 15 additions and 7 deletions

View File

@ -225,12 +225,16 @@ namespace Game {
}
if (slot > -1) {
level->loadGame(slot);
if (forced) {
level->loadGame(slot);
level->loadLevel(saveSlots[slot].getLevelID());
level->loadNextLevelData();
} else {
level->loadGame(slot);
if (nextLevel) {
startLevel(nextLevel);
nextLevel = NULL;
inventory->titleTimer = 0.0f;
}
}
}
}

View File

@ -1,3 +1,3 @@
set -e
/opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-g++ -o OpenLara -D__GCW0__ -std=c++11 -O3 -s -g0 -mips32r2 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-invalid-source-encoding main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -L/opt/vc/lib/ -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev
/opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-g++ -o OpenLara -D__GCW0__ -std=c++11 -Os -s -g0 -mips32r2 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-invalid-source-encoding main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I/opt/vc/include -I../../ -L/opt/vc/lib/ -lGLESv2 -lEGL -lm -lrt -lpthread -lasound -ludev
/opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-strip ../../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note

View File

@ -246,7 +246,10 @@ JoyKey codeToJoyKey(int code) {
case KEY_KPDOT : return jkR;
case KEY_PAGEUP : return jkLT;
case KEY_PAGEDOWN : return jkRT;
case KEY_POWER : Core::quit();
case KEY_POWER : {
Game::quickSave();
Core::quit();
}
}
return jkNone;
}
@ -376,12 +379,10 @@ int main(int argc, char **argv) {
strcpy(contentDir, home);
strcat(contentDir, "/.openlara/");
LOG("content dir: %s\n", contentDir);
struct stat st = {0};
if (stat(contentDir, &st) == -1) {
LOG("no data directory found, please copy the original game content into /home/.openlara/\n");
LOG("no data directory found, please copy the original game content into %s\n", contentDir);
return -1;
}
@ -400,6 +401,9 @@ int main(int argc, char **argv) {
startTime = t.tv_sec;
Game::init();
Game::quickLoad(true);
inputInit();
sndInit();