diff options
author | Paul Gilbert | 2016-03-13 15:30:12 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-03-13 15:30:12 -0400 |
commit | 819b773491b728ab0be933ffdcfc333e20d582d3 (patch) | |
tree | a86fae67694035ccae76ced14777cb7b668e7eec | |
parent | c92bf22f0331fbdbc7e440b43ae1973b679befb3 (diff) | |
download | scummvm-rg350-819b773491b728ab0be933ffdcfc333e20d582d3.tar.gz scummvm-rg350-819b773491b728ab0be933ffdcfc333e20d582d3.tar.bz2 scummvm-rg350-819b773491b728ab0be933ffdcfc333e20d582d3.zip |
TITANIC: Add message generation at end of applicationStarting
-rw-r--r-- | engines/titanic/core/saveable_object.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/game_manager.cpp | 5 | ||||
-rw-r--r-- | engines/titanic/game_manager.h | 7 | ||||
-rw-r--r-- | engines/titanic/main_game_window.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/messages/messages.h | 12 | ||||
-rw-r--r-- | engines/titanic/titanic.h | 3 |
6 files changed, 46 insertions, 5 deletions
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp index 449eb9a5fb..3144e60c97 100644 --- a/engines/titanic/core/saveable_object.cpp +++ b/engines/titanic/core/saveable_object.cpp @@ -779,6 +779,9 @@ DEFFN(CDropobjectMsg) DEFFN(CDropZoneGotObjectMsg) DEFFN(CDropZoneLostObjectMsg) DEFFN(CEditControlMsg) +DEFFN(CEnterNodeMsg); +DEFFN(CEnterRoomMsg); +DEFFN(CEnterViewMsg); DEFFN(CEjectCylinderMsg) DEFFN(CErasePhonographCylinderMsg) DEFFN(CFreshenCookieMsg) @@ -1345,6 +1348,9 @@ void CSaveableObject::initClassList() { ADDFN(CDropZoneGotObjectMsg, CMessage); ADDFN(CDropZoneLostObjectMsg, CMessage); ADDFN(CEditControlMsg, CMessage); + ADDFN(CEnterNodeMsg, CMessage); + ADDFN(CEnterRoomMsg, CMessage); + ADDFN(CEnterViewMsg, CMessage); ADDFN(CEjectCylinderMsg, CMessage); ADDFN(CErasePhonographCylinderMsg, CMessage); ADDFN(CFreshenCookieMsg, CMessage); diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp index 53e7b34409..0495d08dbd 100644 --- a/engines/titanic/game_manager.cpp +++ b/engines/titanic/game_manager.cpp @@ -20,6 +20,7 @@ * */ +#include "titanic/titanic.h" #include "titanic/game_manager.h" #include "titanic/game_view.h" #include "titanic/screen_manager.h" @@ -84,4 +85,8 @@ void CGameManager::postLoad(CProjectItem *project) { _sound.postLoad(); } +void CGameManager::initBounds() { + _bounds = Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); +} + } // End of namespace Titanic diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h index 394bb6777a..a9bdaaa71f 100644 --- a/engines/titanic/game_manager.h +++ b/engines/titanic/game_manager.h @@ -53,7 +53,6 @@ public: class CGameManager { private: CGameView *_gameView; - CGameState _gameState; CSound _sound; CInputHandler _inputHandler; CInputTranslator _inputTranslator; @@ -72,6 +71,7 @@ private: uint _tickCount2; public: CProjectItem *_project; + CGameState _gameState; public: CGameManager(CProjectItem *project, CGameView *gameView); ~CGameManager(); @@ -97,6 +97,11 @@ public: * Unlock the input handler */ void unlockInputHandler() { _inputHandler.decLockCount(); } + + /** + * Set default screen bounds + */ + void initBounds(); }; } // End of namespace Titanic diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 18f8dca984..01996e6b13 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -24,6 +24,7 @@ #include "titanic/main_game_window.h" #include "titanic/game_manager.h" #include "titanic/game_view.h" +#include "titanic/messages/messages.h" namespace Titanic { @@ -65,7 +66,22 @@ void CMainGameWindow::applicationStarting() { // Load either a new game or selected existing save _project->loadGame(saveSlot); - // TODO: Cursor/image and message generation + // TODO: Cursor/image + + // Generate starting messages + CViewItem *view = _gameManager->_gameState._gameLocation.getView(); + CEnterViewMsg enterViewMsg(view); + enterViewMsg.execute(view, nullptr, MSGFLAG_SCAN); + + CNodeItem *node = view->findNode(); + CEnterNodeMsg enterNodeMsg(node); + enterNodeMsg.execute(node, nullptr, MSGFLAG_SCAN); + + CRoomItem *room = view->findRoom(); + CEnterRoomMsg enterRoomMsg(room); + enterRoomMsg.execute(room, nullptr, MSGFLAG_SCAN); + + _gameManager->initBounds(); } int CMainGameWindow::loadGame() { diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h index 80ce590b87..5331881b85 100644 --- a/engines/titanic/messages/messages.h +++ b/engines/titanic/messages/messages.h @@ -25,6 +25,9 @@ #include "titanic/core/saveable_object.h" #include "titanic/core/game_object.h" +#include "titanic/core/node_item.h" +#include "titanic/core/room_item.h" +#include "titanic/core/view_item.h" namespace Titanic { @@ -241,8 +244,9 @@ MESSAGE1(CDropobjectMsg, int, value, 0); MESSAGE1(CDropZoneGotObjectMsg, int, value, 0); MESSAGE1(CDropZoneLostObjectMsg, int, value, 0); MESSAGE1(CEjectCylinderMsg, int, value, 0); -MESSAGE0(CEnterNodeMsg); -MESSAGE0(CEnterViewMsg); +MESSAGE1(CEnterNodeMsg, CNodeItem *, node, nullptr); +MESSAGE1(CEnterRoomMsg, CRoomItem *, room, nullptr); +MESSAGE1(CEnterViewMsg, CViewItem *, view, nullptr); MESSAGE0(CErasePhonographCylinderMsg); MESSAGE2(CFreshenCookieMsg, int, value1, 0, int, value2, 0); MESSAGE1(CGetChevClassBits, int, value, 0); @@ -259,7 +263,9 @@ MESSAGE0(CInitializeAnimMsg); MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0); MESSAGE1(CIsParrotPresentMsg, int, value, 0); MESSAGE1(CKeyCharMsg, int, value, 32); -MESSAGE0(CLeaveViewMsg); +MESSAGE1(CLeaveNodeMsg, CNodeItem *, node, nullptr); +MESSAGE1(CLeaveRoomMsg, CRoomItem *, room, nullptr); +MESSAGE1(CLeaveViewMsg, CViewItem *, view, nullptr); MESSAGE2(CLemonFallsFromTreeMsg, int, value1, 0, int, value2, 0); MESSAGE1(CLoadSuccessMsg, int, ticks, 0); MESSAGE1(CLockPhonographMsg, int, value, 0); diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h index 3a95e86b54..978f9b3d4f 100644 --- a/engines/titanic/titanic.h +++ b/engines/titanic/titanic.h @@ -50,6 +50,9 @@ enum TitanicDebugChannels { #define TITANIC_SAVEGAME_VERSION 1 +#define SCREEN_WIDTH 640 +#define SCREEN_HEIGHT 480 + #define ERROR_BASIC 1 #define ERROR_INTERMEDIATE 2 #define ERROR_DETAILED 3 |