aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-06-29 19:29:32 -0400
committerPaul Gilbert2016-07-15 19:25:53 -0400
commita82bcd3ce7ef0ae604af45fdb56668fca47e7137 (patch)
tree158b0e5ad0c83092e79da37643321bea1dab37fd /engines/titanic
parentce0be01e317996c0454a85dd9a24b896e13ddc8e (diff)
downloadscummvm-rg350-a82bcd3ce7ef0ae604af45fdb56668fca47e7137.tar.gz
scummvm-rg350-a82bcd3ce7ef0ae604af45fdb56668fca47e7137.tar.bz2
scummvm-rg350-a82bcd3ce7ef0ae604af45fdb56668fca47e7137.zip
TITANIC: Added CMovieRangeInfo methods
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/core/game_object.cpp4
-rw-r--r--engines/titanic/core/game_object.h10
-rw-r--r--engines/titanic/support/movie_range_info.cpp67
-rw-r--r--engines/titanic/support/movie_range_info.h16
4 files changed, 63 insertions, 34 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 2a2c6cf772..af866ddac4 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1197,12 +1197,12 @@ void CGameObject::setMovie14(int v) {
_surface->_movie->_field14 = v;
}
-void CGameObject::movie38(int v1, int v2) {
+void CGameObject::surface38(int v1, int v2) {
if (_surface)
_surface->proc38(v1, v2);
}
-void CGameObject::movie38(int v1) {
+void CGameObject::surface38(int v1) {
if (_surface)
_surface->proc38(-1, v1);
}
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 553367378c..98d6d6099e 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -387,10 +387,6 @@ protected:
void setMovie14(int v);
- void movie38(int v1, int v2);
-
- void movie38(int v1);
-
void fn10(int v1, int v2, int v3);
/**
@@ -848,6 +844,12 @@ public:
* Gets a dial region for a given NPC
*/
int talkGetDIalRegion(const CString &name, int dialNum);
+
+ /*--- CVideoSurface Methods ---*/
+
+ void surface38(int v1, int v2);
+
+ void surface38(int v1);
};
} // End of namespace Titanic
diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp
index ff246fbe7b..ab34082540 100644
--- a/engines/titanic/support/movie_range_info.cpp
+++ b/engines/titanic/support/movie_range_info.cpp
@@ -21,19 +21,22 @@
*/
#include "titanic/support/movie_range_info.h"
+#include "titanic/support/movie_clip.h"
+#include "titanic/core/game_object.h"
namespace Titanic {
-CMovieRangeInfo::CMovieRangeInfo() : ListItem(), _fieldC(0),
- _field10(0), _field14(0), _field18(0), _field1C(0) {
+CMovieRangeInfo::CMovieRangeInfo() : ListItem(), _startFrame(0), _endFrame(0) {
+}
+
+CMovieRangeInfo::~CMovieRangeInfo() {
+ _events.destroyContents();
}
CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
- _fieldC = src->_fieldC;
- _field10 = src->_field10;
- _field14 = src->_field14;
- _field18 = src->_field18;
- _field1C = src->_field1C;
+ _movieName = src->_movieName;
+ _startFrame = src->_startFrame;
+ _endFrame = src->_endFrame;
// Duplicate the events list
for (CMovieEventList::const_iterator i = _events.begin();
@@ -44,38 +47,60 @@ CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
void CMovieRangeInfo::save(SimpleFile *file, int indent) const {
file->writeNumberLine(0, indent);
- file->writeNumberLine(_fieldC, indent + 1);
- file->writeNumberLine(_field10, indent + 1);
- file->writeNumberLine(_field14, indent + 1);
- file->writeNumberLine(_field1C, indent + 1);
- file->writeNumberLine(_field18, indent + 1);
+ file->writeQuotedLine(_movieName, indent + 1);
+ file->writeNumberLine(_endFrame, indent + 1);
+ file->writeNumberLine(_startFrame, indent + 1);
_events.save(file, indent + 1);
}
void CMovieRangeInfo::load(SimpleFile *file) {
int val = file->readNumber();
if (!val) {
- _fieldC = file->readNumber();
- _field10 = file->readNumber();
- _field14 = file->readNumber();
- _field1C = file->readNumber();
- _field18 = file->readNumber();
+ _movieName = file->readString();
+ _endFrame = file->readNumber();
+ _startFrame = file->readNumber();
_events.load(file);
}
}
+void CMovieRangeInfo::get1(CMovieEventList &list) {
+ for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
+ CMovieEvent *movieEvent = *i;
+ if (movieEvent->_fieldC == 1)
+ list.push_back(new CMovieEvent(movieEvent));
+ }
+}
+
+void CMovieRangeInfo::get2(CMovieEventList &list, int val) {
+ for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
+ CMovieEvent *movieEvent = *i;
+ if (movieEvent->_fieldC == 2 && movieEvent->_field1C == val)
+ list.push_back(new CMovieEvent(movieEvent));
+ }
+}
+
void CMovieRangeInfo::process(CGameObject *owner) {
-/*
int flags = 0;
if (_endFrame)
flags |= CLIPFLAG_HAS_END_FRAME;
if (_startFrame)
flags |= CLIPFLAG_HAS_START_FRAME;
+
+ for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
+ CMovieEvent *movieEvent = *i;
+ if (!movieEvent->_fieldC) {
+ flags |= CLIPFLAG_PLAY;
+ break;
+ }
+ }
- warning("TODO: CMovieClip::process");
+ owner->checkPlayMovie(_movieName, flags);
- owner->checkPlayMovie(_name, flags);
- */
+ for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
+ CMovieEvent *movieEvent = *i;
+ if (!movieEvent->_fieldC)
+ owner->surface38(movieEvent->_field1C);
+ }
}
} // End of namespace Titanic
diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h
index 2c7d86f3c5..3f077c717e 100644
--- a/engines/titanic/support/movie_range_info.h
+++ b/engines/titanic/support/movie_range_info.h
@@ -34,16 +34,14 @@ class CGameObject;
class CMovieRangeInfo : public ListItem {
public:
- int _fieldC;
- int _field10;
- int _field14;
- int _field18;
- int _field1C;
+ CString _movieName;
+ uint _startFrame;
+ uint _endFrame;
CMovieEventList _events;
public:
CMovieRangeInfo();
CMovieRangeInfo(const CMovieRangeInfo *src);
- virtual ~CMovieRangeInfo() {}
+ virtual ~CMovieRangeInfo();
/**
* Save the data for the class to file
@@ -58,7 +56,11 @@ public:
/**
* Adds an event to the events list
*/
- void add(CMovieEvent *movieEvent) { _events.push_back(movieEvent); }
+ void addEvent(CMovieEvent *movieEvent) { _events.push_back(movieEvent); }
+
+ void get1(CMovieEventList &list);
+
+ void get2(CMovieEventList &list, int val);
void process(CGameObject *owner);
};