diff options
Diffstat (limited to 'engines/titanic/game_manager.cpp')
-rw-r--r-- | engines/titanic/game_manager.cpp | 36 |
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); } |