diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/core/game_object.cpp | 5 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 5 | ||||
-rw-r--r-- | engines/titanic/game_location.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/movie.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/movie.h | 7 | ||||
-rw-r--r-- | engines/titanic/video_surface.cpp | 11 | ||||
-rw-r--r-- | engines/titanic/video_surface.h | 15 |
7 files changed, 36 insertions, 13 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index e4ad4ccaea..810e4396cb 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -125,8 +125,9 @@ void CGameObject::load(SimpleFile *file) { CNamedItem::load(file); } -void CGameObject::fn2() { - error("TODO"); +void CGameObject::stopMovie() { + if (_surface) + _surface->stopMovie(); } bool CGameObject::checkPoint(const Point &pt, int v0, int v1) { diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 66aa9c400c..9d24f8eac1 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -115,7 +115,10 @@ public: */ virtual void draw(CScreenManager *screenManager); - void fn2(); + /** + * Stops any movie currently playing for the object + */ + void stopMovie(); bool checkPoint(const Point &pt, int v0, int v1); }; diff --git a/engines/titanic/game_location.cpp b/engines/titanic/game_location.cpp index 23c2ae2598..3a1d0c9e48 100644 --- a/engines/titanic/game_location.cpp +++ b/engines/titanic/game_location.cpp @@ -52,11 +52,11 @@ void CGameLocation::load(SimpleFile *file) { void CGameLocation::setView(CViewItem *view) { if (_view) { - for (CTreeItem *treeItem = view; treeItem; + for (CTreeItem *treeItem = _view; treeItem; treeItem = treeItem->scan(_view)) { CGameObject *obj = dynamic_cast<CGameObject *>(treeItem); if (obj) - obj->fn2(); + obj->stopMovie(); } } diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp index d7a54d316d..04d57239e1 100644 --- a/engines/titanic/movie.cpp +++ b/engines/titanic/movie.cpp @@ -48,7 +48,7 @@ void OSMovie::proc12() { warning("TODO: OSMovie::proc12"); } -void OSMovie::proc13() { +void OSMovie::stop() { warning("TODO: OSMovie::proc13"); } diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h index 5285508e78..7752fd8cc3 100644 --- a/engines/titanic/movie.h +++ b/engines/titanic/movie.h @@ -26,10 +26,11 @@ #include "video/avi_decoder.h" #include "titanic/core/list.h" #include "titanic/core/resource_key.h" -#include "titanic/video_surface.h" namespace Titanic { +class CVideoSurface; + class CMovie : public ListItem { public: virtual void proc8() = 0; @@ -37,7 +38,7 @@ public: virtual void proc10() = 0; virtual void proc11() = 0; virtual void proc12() = 0; - virtual void proc13() = 0; + virtual void stop() = 0; virtual void proc14() = 0; virtual void proc15() = 0; virtual void proc16() = 0; @@ -60,7 +61,7 @@ public: virtual void proc10(); virtual void proc11(); virtual void proc12(); - virtual void proc13(); + virtual void stop(); virtual void proc14(); virtual void proc15(); virtual void proc16(); diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp index 5cab6d1511..864eb6ba29 100644 --- a/engines/titanic/video_surface.cpp +++ b/engines/titanic/video_surface.cpp @@ -29,7 +29,7 @@ namespace Titanic { int CVideoSurface::_videoSurfaceCounter = 0; CVideoSurface::CVideoSurface(CScreenManager *screenManager) : - _screenManager(screenManager), _rawSurface(nullptr), _field34(nullptr), + _screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr), _pendingLoad(false), _blitStyleFlag(false), _blitFlag(false), _field40(nullptr), _field44(4), _field48(0), _field50(1) { _videoSurfaceNum = _videoSurfaceCounter++; @@ -299,6 +299,11 @@ void OSVideoSurface::shiftColors() { unlock(); } +void OSVideoSurface::stopMovie() { + if (_movie) + _movie->stop(); +} + bool OSVideoSurface::loadIfReady() { _videoSurfaceNum = _videoSurfaceCounter; @@ -318,8 +323,8 @@ int OSVideoSurface::freeSurface() { return 0; int surfaceSize = _ddSurface->getSize(); - delete _field34; - _field34 = nullptr; + delete _movie; + _movie = nullptr; delete _ddSurface; _ddSurface = nullptr; diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h index c6ecf1a5df..dd150abdad 100644 --- a/engines/titanic/video_surface.h +++ b/engines/titanic/video_surface.h @@ -27,6 +27,7 @@ #include "common/array.h" #include "titanic/font.h" #include "titanic/direct_draw.h" +#include "titanic/movie.h" #include "titanic/rect.h" #include "titanic/core/list.h" #include "titanic/core/resource_key.h" @@ -56,7 +57,7 @@ protected: CResourceKey _resourceKey; DirectDrawSurface *_ddSurface; Graphics::ManagedSurface *_rawSurface; - void *_field34; + CMovie *_movie; bool _pendingLoad; void *_field40; int _field44; @@ -139,6 +140,11 @@ public: virtual void shiftColors() = 0; /** + * Stops any movie currently attached to the surface + */ + virtual void stopMovie() = 0; + + /** * Loads the surface's resource if there's one pending */ virtual bool loadIfReady() = 0; @@ -153,6 +159,8 @@ public: */ virtual int freeSurface() { return 0; } + + /** * Blit from another surface */ @@ -236,6 +244,11 @@ public: virtual void shiftColors(); /** + * Stops any movie currently attached to the surface + */ + virtual void stopMovie(); + + /** * Loads the surface's resource if there's one pending */ virtual bool loadIfReady(); |