aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-04 07:03:13 -0400
committerPaul Gilbert2016-07-10 16:38:18 -0400
commit4963c9f50b53cbd663c18387d8606ad4623cca34 (patch)
tree48e9bed889ba74ba5754ca29521d50e854a3380a /engines/titanic/support
parent9ca8e2a9285708d03cd64fbfe7f28c97edb145b2 (diff)
downloadscummvm-rg350-4963c9f50b53cbd663c18387d8606ad4623cca34.tar.gz
scummvm-rg350-4963c9f50b53cbd663c18387d8606ad4623cca34.tar.bz2
scummvm-rg350-4963c9f50b53cbd663c18387d8606ad4623cca34.zip
TITANIC: Implement CMovieEvent & CMovieRangeInfo
Diffstat (limited to 'engines/titanic/support')
-rw-r--r--engines/titanic/support/movie.cpp2
-rw-r--r--engines/titanic/support/movie.h4
-rw-r--r--engines/titanic/support/movie_event.cpp61
-rw-r--r--engines/titanic/support/movie_event.h58
-rw-r--r--engines/titanic/support/movie_range_info.cpp67
-rw-r--r--engines/titanic/support/movie_range_info.h64
-rw-r--r--engines/titanic/support/video_surface.cpp6
-rw-r--r--engines/titanic/support/video_surface.h4
8 files changed, 263 insertions, 3 deletions
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 3ae2636404..1c94cab250 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -91,7 +91,7 @@ void OSMovie::proc11() {
warning("TODO: OSMovie::proc11");
}
-void OSMovie::proc12() {
+void OSMovie::proc12(const CString &name, int flags, CGameObject *obj) {
warning("TODO: OSMovie::proc12");
}
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 644f582d64..20de84afa5 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -61,7 +61,7 @@ public:
virtual void proc10() = 0;
virtual void proc11() = 0;
- virtual void proc12() = 0;
+ virtual void proc12(const CString &name, int flags, CGameObject *obj) = 0;
/**
* Stops the movie
@@ -119,7 +119,7 @@ public:
virtual void proc10();
virtual void proc11();
- virtual void proc12();
+ virtual void proc12(const CString &name, int flags, CGameObject *obj);
/**
* Stops the movie
diff --git a/engines/titanic/support/movie_event.cpp b/engines/titanic/support/movie_event.cpp
new file mode 100644
index 0000000000..b3e788e6fc
--- /dev/null
+++ b/engines/titanic/support/movie_event.cpp
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/movie_event.h"
+
+namespace Titanic {
+
+CMovieEvent::CMovieEvent() : ListItem(), _fieldC(0), _field10(0),
+ _field14(0), _field1C(0) {
+}
+
+CMovieEvent::CMovieEvent(const CMovieEvent *src) {
+ _fieldC = src->_fieldC;
+ _field10 = src->_field10;
+ _field14 = src->_field14;
+ _field18 = src->_field18;
+ _field1C = src->_field1C;
+}
+
+void CMovieEvent::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);
+
+ ListItem::save(file, indent);
+}
+
+void CMovieEvent::load(SimpleFile *file) {
+ int val = file->readNumber();
+ if (!val) {
+ _fieldC = file->readNumber();
+ _field10 = file->readNumber();
+ _field14 = file->readNumber();
+ _field1C = file->readNumber();
+ }
+
+ ListItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/movie_event.h b/engines/titanic/support/movie_event.h
new file mode 100644
index 0000000000..5c62220919
--- /dev/null
+++ b/engines/titanic/support/movie_event.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_EVENT_H
+#define TITANIC_MOVIE_EVENT_H
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CMovieEvent : public ListItem {
+public:
+ int _fieldC;
+ int _field10;
+ int _field14;
+ int _field18;
+ int _field1C;
+public:
+ CMovieEvent();
+ CMovieEvent(const CMovieEvent *src);
+ virtual ~CMovieEvent() {}
+
+ /**
+ * Save the data for the class to file
+ */
+ virtual void save(SimpleFile *file, int indent) const;
+
+ /**
+ * Load the data for the class from file
+ */
+ virtual void load(SimpleFile *file);
+};
+
+class CMovieEventList : public List<CMovieEvent> {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_EVENT_H */
diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp
new file mode 100644
index 0000000000..6242673c10
--- /dev/null
+++ b/engines/titanic/support/movie_range_info.cpp
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/movie_range_info.h"
+
+namespace Titanic {
+
+CMovieRangeInfo::CMovieRangeInfo() : ListItem(), _fieldC(0),
+ _field10(0), _field14(0), _field18(0), _field1C(0) {
+}
+
+CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
+ _fieldC = src->_fieldC;
+ _field10 = src->_field10;
+ _field14 = src->_field14;
+ _field18 = src->_field18;
+ _field1C = src->_field1C;
+
+ // Duplicate the events list
+ for (CMovieEventList::const_iterator i = _events.begin();
+ i != _events.end(); ++i) {
+ _events.push_back(new CMovieEvent(*i));
+ }
+}
+
+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);
+ _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();
+ _events.load(file);
+ }
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h
new file mode 100644
index 0000000000..e751e303db
--- /dev/null
+++ b/engines/titanic/support/movie_range_info.h
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_RANGE_INFO_H
+#define TITANIC_MOVIE_RANGE_INFO_H
+
+#include "video/video_decoder.h"
+#include "titanic/core/list.h"
+#include "titanic/core/resource_key.h"
+#include "titanic/support/movie_event.h"
+
+namespace Titanic {
+
+class CMovieRangeInfo : public ListItem {
+public:
+ int _fieldC;
+ int _field10;
+ int _field14;
+ int _field18;
+ int _field1C;
+ CMovieEventList _events;
+public:
+ CMovieRangeInfo();
+ CMovieRangeInfo(const CMovieRangeInfo *src);
+ virtual ~CMovieRangeInfo() {}
+
+ /**
+ * Save the data for the class to file
+ */
+ virtual void save(SimpleFile *file, int indent) const;
+
+ /**
+ * Load the data for the class from file
+ */
+ virtual void load(SimpleFile *file);
+
+ /**
+ * Adds an event to the events list
+ */
+ void add(CMovieEvent *movieEvent) { _events.push_back(movieEvent); }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_RANGE_INFO_H */
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index e6b2fa7958..813138da4a 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -402,6 +402,12 @@ void OSVideoSurface::playMovie(uint startFrame, uint endFrame, int v3, bool v4)
}
}
+void OSVideoSurface::proc35(const CString &name, int flags, CGameObject *owner) {
+ if (loadIfReady() && _movie) {
+ _movie->proc12(name, flags, owner);
+ }
+}
+
void OSVideoSurface::stopMovie() {
if (_movie)
_movie->stop();
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 7521a53b4b..aee28be730 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -166,6 +166,8 @@ public:
*/
virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4) = 0;
+ virtual void proc35(const CString &name, int flags, CGameObject *owner) = 0;
+
/**
* Stops any movie currently attached to the surface
*/
@@ -329,6 +331,8 @@ public:
*/
virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4);
+ virtual void proc35(const CString &name, int flags, CGameObject *owner);
+
/**
* Stops any movie currently attached to the surface
*/