diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/core/game_object.cpp | 9 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 2 | ||||
-rw-r--r-- | engines/titanic/support/movie.cpp | 10 | ||||
-rw-r--r-- | engines/titanic/support/movie.h | 24 | ||||
-rw-r--r-- | engines/titanic/support/video_surface.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/support/video_surface.h | 26 |
6 files changed, 62 insertions, 17 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index feeabdb5dc..cdc2db68df 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -364,7 +364,7 @@ void CGameObject::fn1(int val1, int val2, int val3) { if (movie) movie->_gameObject = this; - _surface->proc34(val1, val2, val3, val3 != 0); + _surface->playMovie(val1, val2, val3, val3 != 0); if (val3 & 0x10) getGameManager()->_gameState.addMovie(_surface->_movie); @@ -380,8 +380,13 @@ void CGameObject::changeStatus(int newStatus) { CVideoSurface *surface = (newStatus & 4) ? _surface : nullptr; if (_surface) { - _surface->proc32(newStatus, surface); + _surface->playMovie(newStatus, surface); + // TODO: Figure out where to do this legitimately + OSMovie *movie = static_cast<OSMovie *>(_surface->_movie); + if (movie) + movie->_gameObject = this; + if (newStatus & 0x10) { getGameManager()->_gameState.addMovie(_surface->_movie); } diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 108650958b..0ea67a132b 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -34,8 +34,10 @@ namespace Titanic { class CVideoSurface; class CMouseDragStartMsg; +class OSMovie; class CGameObject : public CNamedItem { + friend class OSMovie; DECLARE_MESSAGE_MAP public: static void *_v1; diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp index 79e0a7bc9f..7593c74e42 100644 --- a/engines/titanic/support/movie.cpp +++ b/engines/titanic/support/movie.cpp @@ -61,12 +61,13 @@ OSMovie::~OSMovie() { delete _video; } -void OSMovie::proc8(int v1, CVideoSurface *surface) { +void OSMovie::play(int v1, CVideoSurface *surface) { warning("TODO: OSMovie::proc8"); + play(0, 0, 0, 0); } -void OSMovie::proc9(int v1, int v2, int v3, bool v4) { - warning("TODO: OSMovie::proc9"); +void OSMovie::play(int v1, int v2, int v3, bool v4) { + warning("TODO: OSMovie::play properly"); //setFrame(v1); ? _video->start(); g_vm->_activeMovies.push_back(this); @@ -172,6 +173,9 @@ void OSMovie::decodeFrame() { // Unlock the surface videoSurface->unlock(); + + if (_gameObject) + _gameObject->makeDirty(); } } // End of namespace Titanic diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h index 08d2940fe4..b488d26e39 100644 --- a/engines/titanic/support/movie.h +++ b/engines/titanic/support/movie.h @@ -49,8 +49,16 @@ public: CMovie(); virtual ~CMovie(); - virtual void proc8(int v1, CVideoSurface *surface) = 0; - virtual void proc9(int v1, int v2, int v3, bool v4) = 0; + /** + * Plays the movie + */ + virtual void play(int v1, CVideoSurface *surface) = 0; + + /** + * Plays the movie + */ + virtual void play(int v1, int v2, int v3, bool v4) = 0; + virtual void proc10() = 0; virtual void proc11() = 0; virtual void proc12() = 0; @@ -87,8 +95,16 @@ public: OSMovie(const CResourceKey &name, CVideoSurface *surface); virtual ~OSMovie(); - virtual void proc8(int v1, CVideoSurface *surface); - virtual void proc9(int v1, int v2, int v3, bool v4); + /** + * Plays the movie + */ + virtual void play(int v1, CVideoSurface *surface); + + /** + * Plays the movie + */ + virtual void play(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 c7b437e1e7..3fb513c5fc 100644 --- a/engines/titanic/support/video_surface.cpp +++ b/engines/titanic/support/video_surface.cpp @@ -379,14 +379,14 @@ void OSVideoSurface::shiftColors() { // we already convert 16-bit surfaces as soon as they're loaded } -void OSVideoSurface::proc32(int v1, CVideoSurface *surface) { +void OSVideoSurface::playMovie(int newStatus, CVideoSurface *surface) { if (loadIfReady() && _movie) - _movie->proc8(v1, surface); + _movie->play(newStatus, surface); } -void OSVideoSurface::proc34(int v1, int v2, int v3, bool v4) { +void OSVideoSurface::playMovie(int v1, int v2, int v3, bool v4) { if (loadIfReady() && _movie) { - _movie->proc9(v1, v2, v3, v4); + _movie->play(v1, v2, v3, v4); } } diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h index 335215d1df..c4947ca766 100644 --- a/engines/titanic/support/video_surface.h +++ b/engines/titanic/support/video_surface.h @@ -154,8 +154,17 @@ 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; + /** + * Plays a movie, loading it from the specified _resource + * if not already loaded + */ + virtual void playMovie(int newStatus, CVideoSurface *surface) = 0; + + /** + * Plays a movie, loading it from the specified _resource + * if not already loaded + */ + virtual void playMovie(int v1, int v2, int v3, bool v4) = 0; /** * Stops any movie currently attached to the surface @@ -304,8 +313,17 @@ public: */ virtual void shiftColors(); - virtual void proc32(int v1, CVideoSurface *surface); - virtual void proc34(int v1, int v2, int v3, bool v4); + /** + * Plays a movie, loading it from the specified _resource + * if not already loaded + */ + virtual void playMovie(int newStatus, CVideoSurface *surface); + + /** + * Plays a movie, loading it from the specified _resource + * if not already loaded + */ + virtual void playMovie(int v1, int v2, int v3, bool v4); /** * Stops any movie currently attached to the surface |