aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-08 22:56:34 -0500
committerPaul Gilbert2016-03-08 22:56:34 -0500
commit759c0e3b4584d412f12250e0f248bad062581215 (patch)
treedb6f06bacfa399b59e7470c833ac80a8c175c318 /engines
parent71c3129ecff1e5e4e847825eba58d1be9594b1c8 (diff)
downloadscummvm-rg350-759c0e3b4584d412f12250e0f248bad062581215.tar.gz
scummvm-rg350-759c0e3b4584d412f12250e0f248bad062581215.tar.bz2
scummvm-rg350-759c0e3b4584d412f12250e0f248bad062581215.zip
TITANIC: More game manager setup
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/core/project_item.cpp5
-rw-r--r--engines/titanic/core/project_item.h5
-rw-r--r--engines/titanic/game_manager.cpp8
-rw-r--r--engines/titanic/screen_manager.cpp6
-rw-r--r--engines/titanic/screen_manager.h4
5 files changed, 22 insertions, 6 deletions
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index de43b5bb41..18b0c42815 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -128,6 +128,11 @@ CGameManager *CProjectItem::getGameManager() const {
return _gameManager;
}
+void CProjectItem::setGameManager(CGameManager *gameManager) {
+ if (!_gameManager)
+ _gameManager = gameManager;
+}
+
void CProjectItem::resetGameManager() {
_gameManager = nullptr;
}
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 4271559184..f4148b0678 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -122,6 +122,11 @@ public:
virtual CGameManager *getGameManager() const;
/**
+ * Sets the game manager for the project, if not already set
+ */
+ void setGameManager(CGameManager *gameManager);
+
+ /**
* Get a reference to the PET control
*/
CPetControl *getPetControl() const;
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index d8e64543fe..b26c9b3297 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -21,8 +21,9 @@
*/
#include "titanic/game_manager.h"
-#include "titanic/messages/messages.h"
#include "titanic/screen_manager.h"
+#include "titanic/core/project_item.h"
+#include "titanic/messages/messages.h"
namespace Titanic {
@@ -30,9 +31,10 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
_project(project), _gameView(gameView), _trueTalkManager(this),
_inputHandler(this), _inputTranslator(&_inputHandler),
_gameState(this), _sound(this), _musicRoom(this),
- _videoSurface(nullptr), _field30(0), _field34(0), _field48(0),
+ _field30(0), _field34(0), _field48(0),
_field4C(0), _field50(0), _field54(0), _tickCount(0) {
- // TODO
+ _videoSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340);
+ _project->setGameManager(this);
}
void CGameManager::load(SimpleFile *file) {
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 1da9b585d8..145ba432c0 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -124,7 +124,11 @@ void OSScreenManager::proc18() {}
void OSScreenManager::proc19() {}
void OSScreenManager::proc20() {}
void OSScreenManager::proc21() {}
-void OSScreenManager::proc22() {}
+
+CVideoSurface *OSScreenManager::createSurface(int w, int h) {
+ error("TODO");
+}
+
void OSScreenManager::proc23() {}
void OSScreenManager::proc24() {}
void OSScreenManager::proc25() {}
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index d56020afce..914fc85eb7 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -93,7 +93,7 @@ public:
virtual void proc19() = 0;
virtual void proc20() = 0;
virtual void proc21() = 0;
- virtual void proc22() = 0;
+ virtual CVideoSurface *createSurface(int w, int h) = 0;
virtual void proc23() = 0;
virtual void proc24() = 0;
virtual void proc25() = 0;
@@ -142,7 +142,7 @@ public:
virtual void proc19();
virtual void proc20();
virtual void proc21();
- virtual void proc22();
+ virtual CVideoSurface *createSurface(int w, int h);
virtual void proc23();
virtual void proc24();
virtual void proc25();