[Scummvm-cvs-logs] scummvm master -> 42f4bb6b1ed04499eba0a15275521bdafcdb2cd5

sev- sev at scummvm.org
Sun Apr 13 10:34:17 CEST 2014


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b2c6483d1a FULLPIPE: Implement StaticANIObject::startAnimSteps()
42f4bb6b1e FULLPIPE: Implement StepArray::insertPoints()


Commit: b2c6483d1a22bcffd0f561f32a868371483c286b
    https://github.com/scummvm/scummvm/commit/b2c6483d1a22bcffd0f561f32a868371483c286b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-04-13T11:33:05+03:00

Commit Message:
FULLPIPE: Implement StaticANIObject::startAnimSteps()

Changed paths:
    engines/fullpipe/statics.cpp
    engines/fullpipe/statics.h



diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 7327057..7e66132 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -105,6 +105,10 @@ bool StepArray::gotoNextPoint() {
 	}
 }
 
+void StepArray::insertPoints(Common::Point **points, int pointsCount) {
+	warning("STUB: StepArray::insertPoints()");
+}
+
 StaticANIObject::StaticANIObject() {
 	_shadowsOn = 1;
 	_field_30 = 0;
@@ -1137,7 +1141,85 @@ void StaticANIObject::playIdle() {
 }
 
 void StaticANIObject::startAnimSteps(int movementId, int messageQueueId, int x, int y, Common::Point **points, int pointsCount, int someDynamicPhaseIndex) {
-	warning("STUB: StaticANIObject::startAnimSteps()");
+	Movement *mov = 0;
+
+	if (!(_flags & 0x80)) {
+		if (!_messageQueueId)
+			for (uint i = 0; i < _movements.size(); i++) {
+				if (((Movement *)_movements[i])->_id == movementId) {
+					mov = (Movement *)_movements[i];
+					break;
+				}
+			}
+	}
+
+	if (!mov) {
+		updateGlobalMessageQueue(messageQueueId, _id);
+
+		return;
+	}
+
+
+	if (_movement || !_statics)
+		return;
+
+	Common::Point point;
+
+	_statics->getSomeXY(point);
+
+	int newx = _ox - point.x;
+	int newy = _oy - point.y;
+
+	_movement = mov;
+
+	if (_flags & 0x40)
+		_movement->gotoLastFrame();
+	else
+		_movement->gotoFirstFrame();
+
+	_stepArray.clear();
+	_stepArray.insertPoints(points, pointsCount);
+
+	if (!(_flags & 0x40)) {
+		if (!_movement->_currDynamicPhaseIndex) {
+			_stepArray.getCurrPoint(&point);
+			newx += point.x + _movement->_mx;
+			newy += point.y + _movement->_my;
+			_stepArray.gotoNextPoint();
+
+			ExCommand *ex = _movement->_currDynamicPhase->getExCommand();
+
+			if (ex) {
+				if (ex->_messageKind == 35) {
+					ExCommand *newEx = ex->createClone();
+
+					newEx->_excFlags |= 2u;
+					newEx->sendMessage();
+				}
+			}
+		}
+	}
+
+	_movement->getCurrDynamicPhaseXY(point);
+	setOXY(point.x + newx, point.y + newy);
+
+	if ((_movement->_staticsObj2->_staticsId >> 8) & 0x40)
+		_flags |= 8;
+	else
+		_flags &= 0xFFF7;
+
+	_flags |= 1;
+	_messageQueueId = messageQueueId;
+	_movement->_currDynamicPhase->_countdown = _movement->_currDynamicPhase->_initialCountdown;
+	_movement->_counter = 0;
+	_counter = _initialCounter;
+	_someDynamicPhaseIndex = someDynamicPhaseIndex;
+
+	ExCommand *ex = new ExCommand(_id, 17, 23, 0, 0, movementId, 1, 0, 0, 0);
+
+	ex->_keyCode = _okeyCode;
+	ex->_excFlags = 2;
+	ex->postMessage();
 }
 
 bool StaticANIObject::startAnimEx(int movid, int parId, int flag1, int flag2) {
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index 8328e76..8970396 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -47,6 +47,7 @@ class StepArray : public CObject {
 	Common::Point *getCurrPoint(Common::Point *point);
 	Common::Point *getPoint(Common::Point *point, int index, int offset);
 	bool gotoNextPoint();
+	void insertPoints(Common::Point **points, int pointsCount);
 };
 
 class StaticPhase : public Picture {


Commit: 42f4bb6b1ed04499eba0a15275521bdafcdb2cd5
    https://github.com/scummvm/scummvm/commit/42f4bb6b1ed04499eba0a15275521bdafcdb2cd5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-04-13T11:33:05+03:00

Commit Message:
FULLPIPE: Implement StepArray::insertPoints()

Changed paths:
    engines/fullpipe/messagehandlers.cpp
    engines/fullpipe/statics.cpp



diff --git a/engines/fullpipe/messagehandlers.cpp b/engines/fullpipe/messagehandlers.cpp
index b8e7b5c..17af2bf 100644
--- a/engines/fullpipe/messagehandlers.cpp
+++ b/engines/fullpipe/messagehandlers.cpp
@@ -528,9 +528,9 @@ int global_messageHandler4(ExCommand *cmd) {
 		ExCommand2 *cmd2 = (ExCommand2 *)cmd;
 
 		if (cmd->_excFlags & 1) {
-			ani->startAnimSteps(cmd->_messageNum, 0, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize >> 3, flags);
+			ani->startAnimSteps(cmd->_messageNum, 0, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize, flags);
 		} else {
-			ani->startAnimSteps(cmd->_messageNum, cmd->_parId, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize >> 3, flags);
+			ani->startAnimSteps(cmd->_messageNum, cmd->_parId, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize, flags);
 		}
 		break;
 	}
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 7e66132..0b13e53 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -106,7 +106,16 @@ bool StepArray::gotoNextPoint() {
 }
 
 void StepArray::insertPoints(Common::Point **points, int pointsCount) {
-	warning("STUB: StepArray::insertPoints()");
+	if (_currPointIndex + pointsCount >= _pointsCount)
+		realloc(_points, sizeof(Common::Point *) * (_currPointIndex + pointsCount));
+
+	_maxPointIndex = _currPointIndex + pointsCount;
+
+	for (int i = 0; i < pointsCount; i++) {
+		_points[_currPointIndex + i] = new Common::Point;
+
+		*_points[_currPointIndex + i] = *points[i];
+	}
 }
 
 StaticANIObject::StaticANIObject() {






More information about the Scummvm-git-logs mailing list