aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-06-29 13:08:17 -0400
committerPaul Gilbert2016-07-15 19:25:50 -0400
commitce0be01e317996c0454a85dd9a24b896e13ddc8e (patch)
treed1038c4a2f3fe5085359714392d7f842aa0e5ef8 /engines
parent123966554abab05646f666b85a29726b02342661 (diff)
downloadscummvm-rg350-ce0be01e317996c0454a85dd9a24b896e13ddc8e.tar.gz
scummvm-rg350-ce0be01e317996c0454a85dd9a24b896e13ddc8e.tar.bz2
scummvm-rg350-ce0be01e317996c0454a85dd9a24b896e13ddc8e.zip
TITANIC: Cleanup CGameObject list from CMovieClipList to CMovieRangeInfoList
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/core/game_object.cpp22
-rw-r--r--engines/titanic/core/game_object.h14
-rw-r--r--engines/titanic/core/game_object_desc_item.h2
-rw-r--r--engines/titanic/core/link_item.h2
-rw-r--r--engines/titanic/core/room_item.h2
-rw-r--r--engines/titanic/core/saveable_object.cpp2
-rw-r--r--engines/titanic/module.mk2
-rw-r--r--engines/titanic/support/movie_clip.cpp (renamed from engines/titanic/core/movie_clip.cpp)16
-rw-r--r--engines/titanic/support/movie_clip.h (renamed from engines/titanic/core/movie_clip.h)2
-rw-r--r--engines/titanic/support/movie_range_info.cpp14
-rw-r--r--engines/titanic/support/movie_range_info.h7
11 files changed, 47 insertions, 38 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 9e155908d5..2a2c6cf772 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -93,7 +93,7 @@ void CGameObject::load(SimpleFile *file) {
switch (val) {
case 7:
- _clipList2.load(file);
+ _movieRangeInfo.load(file);
_frameNumber = file->readNumber();
// Deliberate fall-through
@@ -102,7 +102,7 @@ void CGameObject::load(SimpleFile *file) {
// Deliberate fall-through
case 5:
- _clipList1.load(file);
+ _movieClips.load(file);
// Deliberate fall-through
case 4:
@@ -179,8 +179,8 @@ void CGameObject::draw(CScreenManager *screenManager) {
_frameNumber = -1;
}
- if (!_clipList2.empty())
- processClipList2();
+ if (!_movieRangeInfo.empty())
+ processMoveRangeInfo();
if (_bounds.intersects(getGameManager()->_bounds)) {
if (_surface) {
@@ -376,11 +376,11 @@ void CGameObject::playMovie(int v1, int v2) {
}
}
-void CGameObject::processClipList2() {
- for (CMovieClipList::iterator i = _clipList2.begin(); i != _clipList2.end(); ++i)
+void CGameObject::processMoveRangeInfo() {
+ for (CMovieRangeInfoList::iterator i = _movieRangeInfo.begin(); i != _movieRangeInfo.end(); ++i)
(*i)->process(this);
- _clipList2.destroyContents();
+ _movieRangeInfo.destroyContents();
}
void CGameObject::makeDirty(const Rect &r) {
@@ -499,7 +499,7 @@ void CGameObject::playMovie(uint startFrame, uint endFrame, uint flags) {
void CGameObject::playClip(const CString &name, uint flags) {
_frameNumber = -1;
- CMovieClip *clip = _clipList1.findByName(name);
+ CMovieClip *clip = _movieClips.findByName(name);
if (clip)
playMovie(clip->_startFrame, clip->_endFrame, flags);
}
@@ -1064,11 +1064,11 @@ void CGameObject::performAction(int actionNum, CViewItem *view) {
}
bool CGameObject::clipExistsByStart(const CString &name, int startFrame) const {
- return _clipList1.existsByStart(name, startFrame);
+ return _movieClips.existsByStart(name, startFrame);
}
bool CGameObject::clipExistsByEnd(const CString &name, int endFrame) const {
- return _clipList1.existsByEnd(name, endFrame);
+ return _movieClips.existsByEnd(name, endFrame);
}
void CGameObject::checkPlayMovie(const CString &name, int flags) {
@@ -1208,7 +1208,7 @@ void CGameObject::movie38(int v1) {
}
int CGameObject::getClipDuration(const CString &name, int frameRate) const {
- CMovieClip *clip = _clipList1.findByName(name);
+ CMovieClip *clip = _movieClips.findByName(name);
return clip ? (clip->_endFrame - clip->_startFrame) * 1000 / frameRate : 0;
}
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index ade8800e5d..553367378c 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -25,9 +25,10 @@
#include "titanic/support/mouse_cursor.h"
#include "titanic/support/credit_text.h"
+#include "titanic/support/movie_range_info.h"
#include "titanic/support/proximity.h"
#include "titanic/support/rect.h"
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
#include "titanic/core/named_item.h"
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_text.h"
@@ -68,7 +69,10 @@ private:
*/
void loadImage(const CString &name, bool pendingFlag = true);
- void processClipList2();
+ /**
+ * Process and remove any registered movie range info
+ */
+ void processMoveRangeInfo();
/**
* Merges one rect into another, and returns true if there was
@@ -84,9 +88,9 @@ protected:
int _field44;
int _field48;
int _field4C;
- CMovieClipList _clipList1;
+ CMovieClipList _movieClips;
int _initialFrame;
- CMovieClipList _clipList2;
+ CMovieRangeInfoList _movieRangeInfo;
int _frameNumber;
CPetText *_text;
uint _textBorder;
@@ -533,7 +537,7 @@ public:
/**
* Returns the clip list, if any, associated with the item
*/
- virtual const CMovieClipList *getClipList() const { return &_clipList1; }
+ virtual const CMovieClipList *getClipList() const { return &_movieClips; }
/**
* Allows the item to draw itself
diff --git a/engines/titanic/core/game_object_desc_item.h b/engines/titanic/core/game_object_desc_item.h
index 4ac5816dbc..5bfc483b44 100644
--- a/engines/titanic/core/game_object_desc_item.h
+++ b/engines/titanic/core/game_object_desc_item.h
@@ -23,7 +23,7 @@
#ifndef TITANIC_GAME_OBJECT_DESK_ITEM_H
#define TITANIC_GAME_OBJECT_DESK_ITEM_H
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
#include "titanic/core/tree_item.h"
#include "titanic/core/list.h"
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 9c376396f7..328d5bcc06 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -25,7 +25,7 @@
#include "titanic/support/mouse_cursor.h"
#include "titanic/core/named_item.h"
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
namespace Titanic {
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index f44a525b60..eb7f4c43bf 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -25,7 +25,7 @@
#include "titanic/support/rect.h"
#include "titanic/core/list.h"
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
#include "titanic/core/named_item.h"
#include "titanic/core/resource_key.h"
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 300d9718bd..ad98ac4dfd 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -70,7 +70,7 @@
#include "titanic/core/list.h"
#include "titanic/core/mail_man.h"
#include "titanic/core/message_target.h"
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
#include "titanic/core/multi_drop_target.h"
#include "titanic/core/node_item.h"
#include "titanic/core/project_item.h"
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 3985ebfa81..3c752bf13a 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -63,7 +63,6 @@ MODULE_OBJS := \
core/list.o \
core/mail_man.o \
core/message_target.o \
- core/movie_clip.o \
core/multi_drop_target.o \
core/named_item.o \
core/node_item.o \
@@ -442,6 +441,7 @@ MODULE_OBJS := \
support/image_decoders.o \
support/mouse_cursor.o \
support/movie.o \
+ support/movie_clip.o \
support/movie_event.o \
support/movie_range_info.o \
support/credit_text.o \
diff --git a/engines/titanic/core/movie_clip.cpp b/engines/titanic/support/movie_clip.cpp
index 9e5df67bd7..da655ce76a 100644
--- a/engines/titanic/core/movie_clip.cpp
+++ b/engines/titanic/support/movie_clip.cpp
@@ -20,7 +20,7 @@
*
*/
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
#include "titanic/core/game_object.h"
namespace Titanic {
@@ -65,20 +65,6 @@ void CMovieClip::load(SimpleFile *file) {
ListItem::load(file);
}
-void CMovieClip::process(CGameObject *owner) {
- int flags = 0;
- if (_endFrame)
- flags |= CLIPFLAG_HAS_END_FRAME;
- if (_startFrame)
- flags |= CLIPFLAG_HAS_START_FRAME;
-
- warning("TODO: CMovieClip::process");
-
- owner->checkPlayMovie(_name, flags);
-
-
-}
-
CMovieClip *CMovieClipList::findByName(const Common::String &name) const {
for (const_iterator i = begin(); i != end(); ++i) {
CMovieClip *clip = *i;
diff --git a/engines/titanic/core/movie_clip.h b/engines/titanic/support/movie_clip.h
index 6486259c3b..0b1106f420 100644
--- a/engines/titanic/core/movie_clip.h
+++ b/engines/titanic/support/movie_clip.h
@@ -62,8 +62,6 @@ public:
* Load the data for the class from file
*/
virtual void load(SimpleFile *file);
-
- void process(CGameObject *owner);
};
/**
diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp
index 6242673c10..ff246fbe7b 100644
--- a/engines/titanic/support/movie_range_info.cpp
+++ b/engines/titanic/support/movie_range_info.cpp
@@ -64,4 +64,18 @@ void CMovieRangeInfo::load(SimpleFile *file) {
}
}
+void CMovieRangeInfo::process(CGameObject *owner) {
+/*
+ int flags = 0;
+ if (_endFrame)
+ flags |= CLIPFLAG_HAS_END_FRAME;
+ if (_startFrame)
+ flags |= CLIPFLAG_HAS_START_FRAME;
+
+ warning("TODO: CMovieClip::process");
+
+ owner->checkPlayMovie(_name, flags);
+ */
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h
index e751e303db..2c7d86f3c5 100644
--- a/engines/titanic/support/movie_range_info.h
+++ b/engines/titanic/support/movie_range_info.h
@@ -30,6 +30,8 @@
namespace Titanic {
+class CGameObject;
+
class CMovieRangeInfo : public ListItem {
public:
int _fieldC;
@@ -57,6 +59,11 @@ public:
* Adds an event to the events list
*/
void add(CMovieEvent *movieEvent) { _events.push_back(movieEvent); }
+
+ void process(CGameObject *owner);
+};
+
+class CMovieRangeInfoList : public List<CMovieRangeInfo> {
};
} // End of namespace Titanic