From f878820bbee1e7e4659ca601872674082334fa63 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Tue, 24 Jun 2008 21:15:30 +0000 Subject: Created Global Main Menu Dialog. Made a uniform _quit flag for engines. So far agi, agos, and cine are now using the new _quit flag. svn-id: r32770 --- engines/agi/saveload.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/agi/saveload.cpp') diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index db7bba13e4..5dc2523424 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -91,7 +91,7 @@ int AgiEngine::saveGame(const char *fileName, const char *description) { out->writeSint16BE((int16)_game.lognum); out->writeSint16BE((int16)_game.playerControl); - out->writeSint16BE((int16)_game.quitProgNow); + out->writeSint16BE((int16)_quit); out->writeSint16BE((int16)_game.statusLine); out->writeSint16BE((int16)_game.clockEnabled); out->writeSint16BE((int16)_game.exitAllLogics); @@ -281,7 +281,7 @@ int AgiEngine::loadGame(const char *fileName, bool checkId) { _game.lognum = in->readSint16BE(); _game.playerControl = in->readSint16BE(); - _game.quitProgNow = in->readSint16BE(); + _quit = in->readSint16BE(); _game.statusLine = in->readSint16BE(); _game.clockEnabled = in->readSint16BE(); _game.exitAllLogics = in->readSint16BE(); -- cgit v1.2.3 From 61d25a912ed1a8ca864e7c4dc564624947f3b2fe Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Mon, 7 Jul 2008 23:24:12 +0000 Subject: Agi works with the new GMM implementation svn-id: r32953 --- engines/agi/saveload.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/agi/saveload.cpp') diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 5dc2523424..26d903d52a 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -29,6 +29,7 @@ */ +#include "common/events.h" #include "common/file.h" #include "agi/agi.h" @@ -91,7 +92,7 @@ int AgiEngine::saveGame(const char *fileName, const char *description) { out->writeSint16BE((int16)_game.lognum); out->writeSint16BE((int16)_game.playerControl); - out->writeSint16BE((int16)_quit); + out->writeSint16BE((int16)_eventMan->shouldQuit()); out->writeSint16BE((int16)_game.statusLine); out->writeSint16BE((int16)_game.clockEnabled); out->writeSint16BE((int16)_game.exitAllLogics); @@ -281,7 +282,8 @@ int AgiEngine::loadGame(const char *fileName, bool checkId) { _game.lognum = in->readSint16BE(); _game.playerControl = in->readSint16BE(); - _quit = in->readSint16BE(); + if (in->readSint16BE()) + _eventMan->pushEvent(Common::EVENT_QUIT); _game.statusLine = in->readSint16BE(); _game.clockEnabled = in->readSint16BE(); _game.exitAllLogics = in->readSint16BE(); -- cgit v1.2.3 From e808cdf7a08d641389ecc81063b3b1016c7bc8cf Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Wed, 9 Jul 2008 02:27:05 +0000 Subject: Reimplemented pushEvent() and artificialEventQueue to work with Events instead of EventTypes. Reimplemented Queue as a List instead of Array. Updated AGOS, AGI, CINE, GOB, and KYRA to work with the current implementation of the GMM svn-id: r32971 --- engines/agi/saveload.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/agi/saveload.cpp') diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 26d903d52a..4ea80479dc 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -92,7 +92,7 @@ int AgiEngine::saveGame(const char *fileName, const char *description) { out->writeSint16BE((int16)_game.lognum); out->writeSint16BE((int16)_game.playerControl); - out->writeSint16BE((int16)_eventMan->shouldQuit()); + out->writeSint16BE((int16)quit()); out->writeSint16BE((int16)_game.statusLine); out->writeSint16BE((int16)_game.clockEnabled); out->writeSint16BE((int16)_game.exitAllLogics); @@ -283,7 +283,7 @@ int AgiEngine::loadGame(const char *fileName, bool checkId) { _game.playerControl = in->readSint16BE(); if (in->readSint16BE()) - _eventMan->pushEvent(Common::EVENT_QUIT); + quitGame(); _game.statusLine = in->readSint16BE(); _game.clockEnabled = in->readSint16BE(); _game.exitAllLogics = in->readSint16BE(); -- cgit v1.2.3 From 30b1a62e810cfbe3246ebb9b94aa341ea3be5f7c Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Thu, 10 Jul 2008 05:15:19 +0000 Subject: Removed unnecessary #inlcudes svn-id: r32984 --- engines/agi/saveload.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/agi/saveload.cpp') diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 4ea80479dc..1589611c01 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -29,7 +29,6 @@ */ -#include "common/events.h" #include "common/file.h" #include "agi/agi.h" -- cgit v1.2.3 From c9e0422722eadeabdd0fd0dfe8591f90a3f00e89 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Sun, 10 Aug 2008 22:53:43 +0000 Subject: Added Autosave support for AGI svn-id: r33772 --- engines/agi/saveload.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'engines/agi/saveload.cpp') diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 1589611c01..0b308bb37b 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -214,6 +214,9 @@ int AgiEngine::saveGame(const char *fileName, const char *description) { delete out; debugC(3, kDebugLevelMain | kDebugLevelSavegame, "Closed %s", fileName); + + _lastSaveTime = _system->getMillis(); + return result; } @@ -699,13 +702,18 @@ int AgiEngine::saveGameDialog() { sprintf(fileName, "%s", getSavegameFilename(slot)); - drawWindow(hp, vp, GFX_WIDTH - hp, GFX_HEIGHT - vp); - printText("Select a slot in which you wish to\nsave the game:", - 0, hm + 1, vm + 1, w, MSG_BOX_TEXT, MSG_BOX_COLOUR); - slot = selectSlot(); - if (slot < 0) - return errOK; + do { + drawWindow(hp, vp, GFX_WIDTH - hp, GFX_HEIGHT - vp); + printText("Select a slot in which you wish to\nsave the game:", + 0, hm + 1, vm + 1, w, MSG_BOX_TEXT, MSG_BOX_COLOUR); + slot = selectSlot(); + if (slot == 0) + messageBox("That slot is for Autosave only."); + else if (slot < 0) + return errOK; + } + while (slot == 0); drawWindow(hp, vp + 5 * CHAR_LINES, GFX_WIDTH - hp, GFX_HEIGHT - vp - 9 * CHAR_LINES); -- cgit v1.2.3