aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-06 21:31:48 +0300
committerEugene Sandulenko2013-09-06 14:51:11 +0300
commit8a84a1133fcc21a4115826755bfa1a534b735815 (patch)
tree820b2e488da60bdd9bbc607487adb6bca509a221
parent6d92638e7f1eba7d348488cee693ad4c0ab4ce0a (diff)
downloadscummvm-rg350-8a84a1133fcc21a4115826755bfa1a534b735815.tar.gz
scummvm-rg350-8a84a1133fcc21a4115826755bfa1a534b735815.tar.bz2
scummvm-rg350-8a84a1133fcc21a4115826755bfa1a534b735815.zip
FULLPIPE: Implement copy constructor for StaticANIObject
-rw-r--r--engines/fullpipe/statics.cpp81
-rw-r--r--engines/fullpipe/statics.h4
2 files changed, 84 insertions, 1 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 72a10807f5..6939005b22 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -80,7 +80,36 @@ StaticANIObject::StaticANIObject() {
}
StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
- warning("STUB: StaticANIObject(src)");
+ _shadowsOn = src->_shadowsOn;
+ _field_30 = src->_field_30;
+ _field_34 = 1;
+ _initialCounter = 0;
+
+ _messageQueueId = 0;
+ _animExFlag = 0;
+ _counter = 0;
+ _someDynamicPhaseIndex = -1;
+ _sceneId = src->_sceneId;
+ _callback1 = src->_callback1;
+ _callback2 = src->_callback2;
+
+ for (uint i = 0; i < src->_staticsList.size(); i++)
+ _staticsList.push_back(new Statics((Statics *)src->_staticsList[i], 0));
+
+ _movement = 0;
+ _statics = 0;
+
+ for (uint i = 0; i < src->_movements.size(); i++) {
+ Movement *mov;
+ if (((Movement *)src->_movements[i])->_currMovement) {
+ mov = new Movement(getMovementById(src->getMovementIdById(((Movement *)src->_movements[i])->_id)), this);
+ mov->_id = ((Movement *)src->_movements[i])->_id;
+ } else {
+ mov = new Movement(((Movement *)src->_movements[i]), 0, -1, this);
+ }
+
+ _movements.push_back(mov);
+ }
}
bool StaticANIObject::load(MfcArchive &file) {
@@ -192,6 +221,20 @@ Movement *StaticANIObject::getMovementById(int itemId) {
return 0;
}
+int StaticANIObject::getMovementIdById(int itemId) {
+ for (uint i = 0; i < _movements.size(); i++) {
+ Movement *mov = (Movement *)_movements[i];
+ if (mov->_currMovement) {
+ if (mov->_id == itemId)
+ return mov->_id;
+ if (mov->_currMovement->_id == itemId)
+ return mov->_id;
+ }
+ }
+
+ return 0;
+}
+
Movement *StaticANIObject::getMovementByName(char *name) {
for (uint i = 0; i < _movements.size(); i++)
if (!strcmp(((Movement *)_movements[i])->_objectName, name))
@@ -487,6 +530,42 @@ Movement::Movement() {
_counterMax = 83;
}
+Movement::Movement(Movement *src, StaticANIObject *ani) {
+ _lastFrameSpecialFlag = 0;
+ _flipFlag = src->_flipFlag;
+ _updateFlag1 = src->_updateFlag1;
+ _staticsObj1 = 0;
+ _staticsObj2 = 0;
+ _mx = 0;
+ _my = 0;
+ _m2x = 0;
+ _m2y = 0;
+
+ _field_78 = 0;
+ _framePosOffsets = 0;
+ _field_84 = 0;
+ _currDynamicPhase = 0;
+ _field_8C = 0;
+ _currDynamicPhaseIndex = src->_currDynamicPhaseIndex;
+ _field_94 = 0;
+
+ _currMovement = src;
+ _ox = src->_ox;
+ _oy = src->_oy;
+
+ initStatics(ani);
+
+ _counterMax = src->_counterMax;
+ _counter = src->_counter;
+ _field_50 = src->_field_50;
+
+ updateCurrDynamicPhase();
+}
+
+Movement::Movement(Movement *src, int *flag1, int flag2, StaticANIObject *ani) {
+ warning("STUB: Movement(src, %p, %d, ani)", (void *)flag1, flag2);
+}
+
bool Movement::load(MfcArchive &file) {
warning("STUB: Movement::load");
return true;
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index e21f06666d..9e800c2b67 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -134,6 +134,9 @@ class Movement : public GameObject {
public:
Movement();
+ Movement(Movement *src, StaticANIObject *ani);
+ Movement(Movement *src, int *flag1, int flag2, StaticANIObject *ani);
+
virtual bool load(MfcArchive &file);
bool load(MfcArchive &file, StaticANIObject *ani);
@@ -191,6 +194,7 @@ class StaticANIObject : public GameObject {
void setOXY(int x, int y);
Statics *getStaticsById(int id);
Movement *getMovementById(int id);
+ int getMovementIdById(int itemId);
Movement *getMovementByName(char *name);
Common::Point *getCurrDimensions(Common::Point &p);