diff options
author | Paul Gilbert | 2016-04-06 19:42:45 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-04-06 19:42:45 -0400 |
commit | ac59f58c8a65e9e27a696da4536693c7d6ec6bc9 (patch) | |
tree | 0eaba9c5715badd673d7fc5967b9642849b4fc60 /engines | |
parent | 71a278791a25d039c39a818f27d1106db1fa0e6e (diff) | |
download | scummvm-rg350-ac59f58c8a65e9e27a696da4536693c7d6ec6bc9.tar.gz scummvm-rg350-ac59f58c8a65e9e27a696da4536693c7d6ec6bc9.tar.bz2 scummvm-rg350-ac59f58c8a65e9e27a696da4536693c7d6ec6bc9.zip |
TITANIC: Implement CBackground message handlers
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/core/background.cpp | 14 | ||||
-rw-r--r-- | engines/titanic/core/game_object.cpp | 14 | ||||
-rw-r--r-- | engines/titanic/support/movie.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/support/movie.h | 4 | ||||
-rw-r--r-- | engines/titanic/support/video_surface.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/support/video_surface.h | 2 |
6 files changed, 35 insertions, 7 deletions
diff --git a/engines/titanic/core/background.cpp b/engines/titanic/core/background.cpp index ea3bdb01a8..cb8e26450f 100644 --- a/engines/titanic/core/background.cpp +++ b/engines/titanic/core/background.cpp @@ -50,15 +50,23 @@ void CBackground::load(SimpleFile *file) { } bool CBackground::handleMessage(CStatusChangeMsg &msg) { - error("TODO: CBackground::handleMessage"); + setVisible(true); + if (_fieldDC) { + fn1(_fieldBC, _fieldC0, 16); + } else { + fn1(_fieldBC, _fieldC0, 0); + } + return true; } bool CBackground::handleMessage(CSetFrameMsg &msg) { - error("TODO: CBackground::handleMessage"); + loadFrame(msg._frameNumber); + return true; } bool CBackground::handleMessage(CVisibleMsg &msg) { - error("TODO: CBackground::handleMessage"); + setVisible(msg._visible); + return true; } } // End of namespace Titanic diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index c855fd9030..d2b1c29ed7 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -330,7 +330,19 @@ void CGameObject::petFn3(CTreeItem *item) { } void CGameObject::fn1(int val1, int val2, int val3) { - warning("TODO: CGameObject::fn1"); + _frameNumber = -1; + if (!_surface) { + if (!_resource.empty()) + loadResource(_resource); + _resource.clear(); + } + + if (_surface) { + _surface->proc34(val1, val2, val3, val3 != 0); + + if (val3 & 0x10) + getGameManager()->_gameState.addMovie(_surface->_movie); + } } void CGameObject::changeStatus(int newStatus) { diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp index 25909183dd..846dc09d5c 100644 --- a/engines/titanic/support/movie.cpp +++ b/engines/titanic/support/movie.cpp @@ -59,7 +59,7 @@ void OSMovie::proc8(int v1, CVideoSurface *surface) { warning("TODO: OSMovie::proc8"); } -void OSMovie::proc9() { +void OSMovie::proc9(int v1, int v2, int v3, bool v4) { warning("TODO: OSMovie::proc9"); } diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h index e84e283597..b5ae70de13 100644 --- a/engines/titanic/support/movie.h +++ b/engines/titanic/support/movie.h @@ -40,7 +40,7 @@ public: virtual ~CMovie() {} virtual void proc8(int v1, CVideoSurface *surface) = 0; - virtual void proc9() = 0; + virtual void proc9(int v1, int v2, int v3, bool v4) = 0; virtual void proc10() = 0; virtual void proc11() = 0; virtual void proc12() = 0; @@ -68,7 +68,7 @@ public: virtual ~OSMovie(); virtual void proc8(int v1, CVideoSurface *surface); - virtual void proc9(); + virtual void proc9(int v1, int v2, int v3, bool v4); virtual void proc10(); virtual void proc11(); virtual void proc12(); diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp index a1b26386b3..1a0d48bebe 100644 --- a/engines/titanic/support/video_surface.cpp +++ b/engines/titanic/support/video_surface.cpp @@ -368,6 +368,12 @@ void OSVideoSurface::proc32(int v1, CVideoSurface *surface) { _movie->proc8(v1, surface); } +void OSVideoSurface::proc34(int v1, int v2, int v3, bool v4) { + if (loadIfReady() && _movie) { + _movie->proc9(v1, v2, v3, v4); + } +} + void OSVideoSurface::stopMovie() { if (_movie) _movie->stop(); diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h index e1ddde8013..767306cae6 100644 --- a/engines/titanic/support/video_surface.h +++ b/engines/titanic/support/video_surface.h @@ -153,6 +153,7 @@ public: virtual void shiftColors() = 0; virtual void proc32(int v1, CVideoSurface *surface) = 0; + virtual void proc34(int v1, int v2, int v3, bool v4) = 0; /** * Stops any movie currently attached to the surface @@ -299,6 +300,7 @@ public: virtual void shiftColors(); virtual void proc32(int v1, CVideoSurface *surface); + virtual void proc34(int v1, int v2, int v3, bool v4); /** * Stops any movie currently attached to the surface |