From 8ea5d533294193a4d220316152cec59580bbf10c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 29 Jun 2016 22:05:06 -0400 Subject: TITANIC: Added CGameObject saving, and movie range info methods --- engines/titanic/support/movie.cpp | 7 ++++--- engines/titanic/support/movie.h | 20 ++++++++++++++++---- engines/titanic/support/movie_clip.cpp | 2 ++ engines/titanic/support/movie_range_info.cpp | 14 ++++++++++---- engines/titanic/support/movie_range_info.h | 4 +++- engines/titanic/support/video_surface.cpp | 8 ++++++-- engines/titanic/support/video_surface.h | 15 +++++++++++++-- 7 files changed, 54 insertions(+), 16 deletions(-) (limited to 'engines/titanic/support') diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp index 27bcb97ae9..361bf6e1fa 100644 --- a/engines/titanic/support/movie.cpp +++ b/engines/titanic/support/movie.cpp @@ -99,7 +99,7 @@ void OSMovie::proc11() { warning("TODO: OSMovie::proc11"); } -void OSMovie::proc12(const CString &name, int flags, CGameObject *obj) { +void OSMovie::proc12(int v1, int v2, int frameNumber, int flags, CGameObject *obj) { warning("TODO: OSMovie::proc12"); } @@ -121,8 +121,9 @@ void OSMovie::proc16() { warning("TODO: OSMovie::proc16"); } -void OSMovie::proc17() { - warning("TODO: OSMovie::proc17"); +const Common::List OSMovie::getMovieRangeInfo() const { + warning("TODO: OSMovie::getMovieRangeInfo"); + return Common::List(); } void OSMovie::proc18() { diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h index da3285547d..2d7bdc9c6d 100644 --- a/engines/titanic/support/movie.h +++ b/engines/titanic/support/movie.h @@ -23,9 +23,11 @@ #ifndef TITANIC_MOVIE_H #define TITANIC_MOVIE_H +#include "common/list.h" #include "video/video_decoder.h" #include "titanic/core/list.h" #include "titanic/core/resource_key.h" +#include "titanic/support/movie_range_info.h" namespace Titanic { @@ -72,7 +74,7 @@ public: virtual void playClip(const Rect &rect, uint startFrame, uint endFrame) = 0; virtual void proc11() = 0; - virtual void proc12(const CString &name, int flags, CGameObject *obj) = 0; + virtual void proc12(int v1, int v2, int frameNumber, int flags, CGameObject *obj) = 0; /** * Stops the movie @@ -82,7 +84,12 @@ public: virtual void proc14() = 0; virtual void setFrame(uint frameNumber) = 0; virtual void proc16() = 0; - virtual void proc17() = 0; + + /** + * Return any movie range info associated with the movie + */ + virtual const Common::List getMovieRangeInfo() const = 0; + virtual void proc18() = 0; /** @@ -139,7 +146,7 @@ public: virtual void playClip(const Rect &rect, uint startFrame, uint endFrame); virtual void proc11(); - virtual void proc12(const CString &name, int flags, CGameObject *obj); + virtual void proc12(int v1, int v2, int frameNumber, int flags, CGameObject *obj); /** * Stops the movie @@ -154,7 +161,12 @@ public: virtual void setFrame(uint frameNumber); virtual void proc16(); - virtual void proc17(); + + /** + * Return any movie range info associated with the movie + */ + virtual const Common::List getMovieRangeInfo() const; + virtual void proc18(); /** diff --git a/engines/titanic/support/movie_clip.cpp b/engines/titanic/support/movie_clip.cpp index 2d3187b000..1f2ef66428 100644 --- a/engines/titanic/support/movie_clip.cpp +++ b/engines/titanic/support/movie_clip.cpp @@ -65,6 +65,8 @@ void CMovieClip::load(SimpleFile *file) { ListItem::load(file); } +/*------------------------------------------------------------------------*/ + CMovieClip *CMovieClipList::findByName(const Common::String &name) const { for (const_iterator i = begin(); i != end(); ++i) { CMovieClip *clip = *i; diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp index d48bab1df6..e6b28ce4e8 100644 --- a/engines/titanic/support/movie_range_info.cpp +++ b/engines/titanic/support/movie_range_info.cpp @@ -34,7 +34,9 @@ CMovieRangeInfo::~CMovieRangeInfo() { } CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() { - _movieName = src->_movieName; + _fieldC = src->_fieldC; + _field10 = src->_field10; + _frameNumber = src->_frameNumber; _startFrame = src->_startFrame; _endFrame = src->_endFrame; @@ -47,7 +49,9 @@ CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() { void CMovieRangeInfo::save(SimpleFile *file, int indent) { file->writeNumberLine(0, indent); - file->writeQuotedLine(_movieName, indent + 1); + file->writeNumberLine(_fieldC, indent + 1); + file->writeNumberLine(_field10, indent + 1); + file->writeNumberLine(_frameNumber, indent + 1); file->writeNumberLine(_endFrame, indent + 1); file->writeNumberLine(_startFrame, indent + 1); _events.save(file, indent + 1); @@ -56,7 +60,9 @@ void CMovieRangeInfo::save(SimpleFile *file, int indent) { void CMovieRangeInfo::load(SimpleFile *file) { int val = file->readNumber(); if (!val) { - _movieName = file->readString(); + _fieldC = file->readNumber(); + _field10 = file->readNumber(); + _frameNumber = file->readNumber(); _endFrame = file->readNumber(); _startFrame = file->readNumber(); _events.load(file); @@ -94,7 +100,7 @@ void CMovieRangeInfo::process(CGameObject *owner) { } } - owner->checkPlayMovie(_movieName, flags); + owner->checkPlayMovie(_fieldC, _field10, _frameNumber, flags); for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) { CMovieEvent *movieEvent = *i; diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h index 2776ac2851..be04975cbf 100644 --- a/engines/titanic/support/movie_range_info.h +++ b/engines/titanic/support/movie_range_info.h @@ -34,7 +34,9 @@ class CGameObject; class CMovieRangeInfo : public ListItem { public: - CString _movieName; + int _fieldC; + int _field10; + int _frameNumber; uint _startFrame; uint _endFrame; CMovieEventList _events; diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp index c1af869e1e..9293b03f02 100644 --- a/engines/titanic/support/video_surface.cpp +++ b/engines/titanic/support/video_surface.cpp @@ -402,9 +402,9 @@ void OSVideoSurface::playMovie(uint startFrame, uint endFrame, int v3, bool v4) } } -void OSVideoSurface::proc35(const CString &name, int flags, CGameObject *owner) { +void OSVideoSurface::proc35(int v1, int v2, int frameNumber, int flags, CGameObject *owner) { if (loadIfReady() && _movie) { - _movie->proc12(name, flags, owner); + _movie->proc12(v1, v2, frameNumber, flags, owner); } } @@ -426,6 +426,10 @@ void OSVideoSurface::proc39(int v1, int v2) { warning("OSVideoSurface::proc39"); } +const Common::List OSVideoSurface::getMovieRangeInfo() const { + return _movie ? _movie->getMovieRangeInfo() : Common::List(); +} + bool OSVideoSurface::loadIfReady() { _videoSurfaceNum = _videoSurfaceCounter; diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h index 2b66b269e7..e5d904f6d6 100644 --- a/engines/titanic/support/video_surface.h +++ b/engines/titanic/support/video_surface.h @@ -28,6 +28,7 @@ #include "titanic/support/font.h" #include "titanic/support/direct_draw.h" #include "titanic/support/movie.h" +#include "titanic/support/movie_range_info.h" #include "titanic/support/rect.h" #include "titanic/core/list.h" #include "titanic/core/resource_key.h" @@ -166,7 +167,7 @@ public: */ virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4) = 0; - virtual void proc35(const CString &name, int flags, CGameObject *owner) = 0; + virtual void proc35(int v1, int v2, int frameNumber, int flags, CGameObject *owner) = 0; /** * Stops any movie currently attached to the surface @@ -182,6 +183,11 @@ public: virtual void proc39(int v1, int v2) = 0; + /** + * Return any movie range info associated with the surface's movie + */ + virtual const Common::List getMovieRangeInfo() const = 0; + /** * Loads the surface's resource if there's one pending */ @@ -335,7 +341,7 @@ public: */ virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4); - virtual void proc35(const CString &name, int flags, CGameObject *owner); + virtual void proc35(int v1, int v2, int frameNumber, int flags, CGameObject *owner); /** * Stops any movie currently attached to the surface @@ -351,6 +357,11 @@ public: virtual void proc39(int v1, int v2); + /** + * Return any movie range info associated with the surface's movie + */ + virtual const Common::List getMovieRangeInfo() const; + /** * Loads the surface's resource if there's one pending */ -- cgit v1.2.3