aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game_manager.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-19 08:08:01 -0400
committerPaul Gilbert2016-03-19 08:08:01 -0400
commit2665e0e08f0f1c8e70738dad793de20176e0d9c4 (patch)
treedde10074c2fbd35297b50a1a5d30d754dea5b124 /engines/titanic/game_manager.cpp
parent3a42c8ca449248dfc67a98f3bedd65c237d06fa0 (diff)
downloadscummvm-rg350-2665e0e08f0f1c8e70738dad793de20176e0d9c4.tar.gz
scummvm-rg350-2665e0e08f0f1c8e70738dad793de20176e0d9c4.tar.bz2
scummvm-rg350-2665e0e08f0f1c8e70738dad793de20176e0d9c4.zip
TITANIC: Added various preSave and postSave methods
Diffstat (limited to 'engines/titanic/game_manager.cpp')
-rw-r--r--engines/titanic/game_manager.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index b181edcaeb..1d34650552 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -27,7 +27,6 @@
#include "titanic/core/project_item.h"
#include "titanic/messages/messages.h"
-
namespace Titanic {
void CGameManagerList::postLoad(uint ticks, CProjectItem *project) {
@@ -35,12 +34,30 @@ void CGameManagerList::postLoad(uint ticks, CProjectItem *project) {
(*i)->postLoad(ticks, project);
}
+void CGameManagerList::preSave() {
+ for (iterator i = begin(); i != end(); ++i)
+ (*i)->preSave();
+}
+
+void CGameManagerList::postSave() {
+ for (iterator i = begin(); i != end(); ++i)
+ (*i)->postSave();
+}
+
/*------------------------------------------------------------------------*/
void CGameManagerListItem::postLoad(uint ticks, CProjectItem *project) {
warning("TODO");
}
+void CGameManagerListItem::preSave() {
+ warning("TODO: CGameManagerListItem::preSave");
+}
+
+void CGameManagerListItem::postSave() {
+ warning("TODO: CGameManagerListItem::postSave");
+}
+
/*------------------------------------------------------------------------*/
CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
@@ -97,6 +114,23 @@ void CGameManager::postLoad(CProjectItem *project) {
_sound.postLoad();
}
+void CGameManager::preSave(CProjectItem *project) {
+ // Generate a message that a save is being done
+ updateDiskTicksCount();
+ CPreSaveMsg msg(_lastDiskTicksCount);
+ msg.execute(project, nullptr, MSGFLAG_SCAN);
+
+ // Notify sub-objects of the save
+ _list.preSave();
+ _trueTalkManager.preSave();
+ _sound.preSave();
+}
+
+void CGameManager::postSave() {
+ _list.postSave();
+ _trueTalkManager.postSave();
+}
+
void CGameManager::initBounds() {
_bounds = Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
}