aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game_view.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-16 19:05:16 -0400
committerPaul Gilbert2016-03-16 19:05:16 -0400
commit8ec499c177d88e11930b8550c47c352d65dc603a (patch)
tree8c66770c49673985aa7ad27b77e8922df670b53d /engines/titanic/game_view.cpp
parenteaead0c6aee10f1fdd347a723bd9b816f80abff6 (diff)
downloadscummvm-rg350-8ec499c177d88e11930b8550c47c352d65dc603a.tar.gz
scummvm-rg350-8ec499c177d88e11930b8550c47c352d65dc603a.tar.bz2
scummvm-rg350-8ec499c177d88e11930b8550c47c352d65dc603a.zip
TITANIC: Implementing setActiveView, surface clearing
Diffstat (limited to 'engines/titanic/game_view.cpp')
-rw-r--r--engines/titanic/game_view.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index a2905d148c..315b2a8909 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -23,11 +23,11 @@
#include "titanic/game_view.h"
#include "titanic/game_manager.h"
#include "titanic/main_game_window.h"
+#include "titanic/screen_manager.h"
namespace Titanic {
-CGameView::CGameView() : _gameManager(nullptr), _fieldC(nullptr),
- _field8(0) {
+CGameView::CGameView() : _gameManager(nullptr), _surface(nullptr) {
}
void CGameView::setGameManager(CGameManager *gameManager) {
@@ -35,10 +35,8 @@ void CGameView::setGameManager(CGameManager *gameManager) {
}
void CGameView::postLoad() {
- if (_fieldC)
- warning("TODO");
-
- _fieldC = nullptr;
+ delete _surface;
+ _surface = nullptr;
}
void CGameView::deleteView(int roomNumber, int nodeNumber, int viewNumber) {
@@ -48,7 +46,14 @@ void CGameView::deleteView(int roomNumber, int nodeNumber, int viewNumber) {
}
void CGameView::createSurface(const CResourceKey &key) {
-
+ // Reset any current view surface
+ _gameManager->initBounds();
+ delete _surface;
+ _surface = nullptr;
+
+ // Create a fresh surface
+ CScreenManager::setCurrent();
+ _surface = CScreenManager::_currentScreenManagerPtr->createSurface(key);
}
/*------------------------------------------------------------------------*/