aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/fullpipe.h2
-rw-r--r--engines/fullpipe/messages.cpp1
-rw-r--r--engines/fullpipe/messages.h6
-rw-r--r--engines/fullpipe/scene.cpp4
-rw-r--r--engines/fullpipe/scene.h1
-rw-r--r--engines/fullpipe/scenes.cpp225
-rw-r--r--engines/fullpipe/sound.cpp4
-rw-r--r--engines/fullpipe/statics.cpp168
-rw-r--r--engines/fullpipe/statics.h15
9 files changed, 423 insertions, 3 deletions
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 7598ff40ed..ac9cb856d8 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -66,6 +66,8 @@ int global_messageHandler1(ExCommand *cmd);
int global_messageHandler2(ExCommand *cmd);
int global_messageHandler3(ExCommand *cmd);
int global_messageHandler4(ExCommand *cmd);
+void global_messageHandler_handleSound(ExCommand *cmd);
+
class FullpipeEngine : public ::Engine {
protected:
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index c93cd42172..55a0b5f0bd 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -629,6 +629,7 @@ void clearMessageHandlers() {
}
void processMessages() {
+ warning("###################### processing");
if (!g_fullpipe->_isProcessingMessages) {
g_fullpipe->_isProcessingMessages = true;
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index 650a237381..03d30f2b7d 100644
--- a/engines/fullpipe/messages.h
+++ b/engines/fullpipe/messages.h
@@ -76,6 +76,12 @@ class ExCommand : public Message {
void handle();
};
+class ExCommand2 : public ExCommand {
+ public:
+ Common::Point **_points;
+ int _pointsSize;
+};
+
class CObjstateCommand : public CObject {
ExCommand _cmd;
char *_objCommandName;
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index a895010cb7..7ef4e731b5 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -407,6 +407,10 @@ void Scene::updateScrolling() {
warning("STUB Scene::updateScrolling()");
}
+void Scene::updateScrolling2() {
+ warning("STUB Scene::updateScrolling2()");
+}
+
void Scene::update(int counterdiff) {
debug(0, "Scene::update(%d)", counterdiff);
diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h
index defa3851e8..d8d436208b 100644
--- a/engines/fullpipe/scene.h
+++ b/engines/fullpipe/scene.h
@@ -55,6 +55,7 @@ class Scene : public Background {
void draw();
void drawContent(int minPri, int maxPri, bool drawBG);
void updateScrolling();
+ void updateScrolling2();
void update(int counterdiff);
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 0f1202abd0..f7aa525ad3 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -835,9 +835,230 @@ int global_messageHandler3(ExCommand *cmd) {
}
int global_messageHandler4(ExCommand *cmd) {
- warning("STUB: global_messageHandler4()");
+ StaticANIObject *ani = 0;
- return 0;
+ switch (cmd->_messageKind) {
+ case 18: {
+ MessageQueue *mq = new MessageQueue(g_fullpipe->_currentScene->getMessageQueueById(cmd->_messageNum), cmd->_parId, 0);
+
+ if (cmd->_excFlags & 1)
+ mq->_flag1 = 1;
+ else
+ mq->_flag1 = 0;
+
+ mq->sendNextCommand();
+ break;
+ }
+ case 2:
+ if (!g_fullpipe->_currentScene)
+ break;
+
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ ani->trySetMessageQueue(cmd->_messageNum, cmd->_parId);
+ break;
+
+ case 1: {
+ if (!g_fullpipe->_currentScene)
+ break;
+
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ int flags = cmd->_field_14;
+ if (flags <= 0)
+ flags = -1;
+
+ if (cmd->_excFlags & 1)
+ ani->startAnim(cmd->_messageNum, 0, flags);
+ else
+ ani->startAnim(cmd->_messageNum, cmd->_parId, flags);
+
+ break;
+ }
+ case 8:
+ if (!g_fullpipe->_currentScene)
+ break;
+
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ ani->startAnimEx(cmd->_messageNum, cmd->_parId, -1, -1);
+ break;
+
+ case 20: {
+ if (!g_fullpipe->_currentScene)
+ break;
+
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ int flags = cmd->_field_14;
+ if (flags <= 0)
+ flags = -1;
+
+ ExCommand2 *cmd2 = (ExCommand2 *)cmd;
+
+ if (cmd->_excFlags & 1) {
+ ani->startAnimSteps(cmd->_messageNum, 0, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize >> 3, flags);
+ } else {
+ ani->startAnimSteps(cmd->_messageNum, cmd->_parId, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize >> 3, flags);
+ }
+ break;
+ }
+ case 21:
+ if (!g_fullpipe->_currentScene)
+ break;
+
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ ani->queueMessageQueue(0);
+ ani->playIdle();
+ break;
+ case 9:
+ // Nop in original
+ break;
+ case 3:
+ g_fullpipe->_currentScene->_y = cmd->_messageNum - cmd->_messageNum % g_fullpipe->_scrollSpeed;
+ break;
+
+ case 4:
+ g_fullpipe->_currentScene->_x = cmd->_messageNum - cmd->_messageNum % g_fullpipe->_scrollSpeed;
+ break;
+
+ case 19: {
+ if (!g_fullpipe->_currentScene)
+ break;
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ MessageQueue *mq = ani->getMessageQueue();
+ MessageQueue *mq2 = ani->changeStatics1(cmd->_messageNum);
+
+ if (!mq2 || !mq2->getExCommandByIndex(0) || !mq)
+ break;
+
+ mq2->_parId = mq->_id;
+ mq2->_flag1 = (cmd->_field_24 == 0);
+ break;
+ }
+ case 22:
+ if (!g_fullpipe->_currentScene)
+ break;
+
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ ani->_flags |= 4;
+ ani->changeStatics2(cmd->_messageNum);
+ break;
+
+ case 6:
+ if (!g_fullpipe->_currentScene)
+ break;
+
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ ani->hide();
+ break;
+
+ case 27:
+ if (!g_fullpipe->_currentScene || g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode) == 0) {
+ ani = g_fullpipe->accessScene(cmd->_field_20)->getStaticANIObject1ById(cmd->_parentId, -1);
+ if (ani) {
+ ani = new StaticANIObject(ani);
+ g_fullpipe->_currentScene->addStaticANIObject(ani, 1);
+ }
+ }
+
+ // fall through
+ case 5:
+ if (g_fullpipe->_currentScene)
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+
+ if (!ani)
+ break;
+
+ if (cmd->_field_14 >= 0)
+ ani->_priority = cmd->_field_14;
+
+ ani->show1(cmd->_x, cmd->_y, cmd->_messageNum, cmd->_parId);
+ break;
+
+ case 10:
+ if (!g_fullpipe->_currentScene)
+ break;
+
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ if (cmd->_field_14 >= 0)
+ ani->_priority = cmd->_field_14;
+
+ ani->show2(cmd->_x, cmd->_y, cmd->_messageNum, cmd->_parId);
+ break;
+
+ case 7: {
+ if (!g_fullpipe->_currentScene->_picObjList.size())
+ break;
+
+ int offX = g_fullpipe->_scrollSpeed * (cmd->_x / g_fullpipe->_scrollSpeed);
+ int offY = g_fullpipe->_scrollSpeed * (cmd->_y / g_fullpipe->_scrollSpeed);
+
+ if (cmd->_messageNum) {
+ g_fullpipe->_currentScene->_x = offX - g_fullpipe->_sceneRect.left;
+ g_fullpipe->_currentScene->_y = offY - g_fullpipe->_sceneRect.top;
+
+ if (cmd->_field_24) {
+ g_fullpipe->_currentScene->_messageQueueId = cmd->_parId;
+ }
+ } else {
+ g_fullpipe->_sceneRect.moveTo(offX, offY);
+
+ g_fullpipe->_currentScene->_x = 0;
+ g_fullpipe->_currentScene->_y = 0;
+
+ g_fullpipe->_currentScene->updateScrolling2();
+ }
+ break;
+ }
+ case 34:
+ if (!g_fullpipe->_currentScene)
+ break;
+
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (!ani)
+ break;
+
+ ani->_flags = cmd->_messageNum | (ani->_flags & ~cmd->_field_14);
+
+ break;
+
+ case 35:
+ global_messageHandler_handleSound(cmd);
+ break;
+
+ case 11:
+ case 12:
+ break;
+ default:
+ return 0;
+ break;
+ }
+
+ return 1;
}
int defaultUpdateCursor() {
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index 7c64dd088b..d69ce35777 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -126,6 +126,10 @@ void FullpipeEngine::playSound(int id, int flag) {
warning("STUB: FullpipeEngine::playSounds(%d, %d)", id, flag);
}
+void global_messageHandler_handleSound(ExCommand *cmd) {
+ warning("STUB: global_messageHandler_handleSound()");
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 3a82f7dbe6..f03e19c5f6 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -234,6 +234,26 @@ void StaticANIObject::queueMessageQueue(MessageQueue *mq) {
}
}
+MessageQueue *StaticANIObject::getMessageQueue() {
+ if (this->_messageQueueId <= 0 )
+ return 0;
+
+ return g_fullpipe->_globalMessageQueueList->getMessageQueueById(_messageQueueId);
+}
+
+bool StaticANIObject::trySetMessageQueue(int msgNum, int qId) {
+ if (_messageQueueId || !msgNum) {
+ updateGlobalMessageQueue(qId, _id);
+ return false;
+ }
+
+ _flags |= 2;
+ _messageNum = msgNum;
+ _messageQueueId = qId;
+
+ return true;
+}
+
bool StaticANIObject::isIdle() {
if (_messageQueueId) {
MessageQueue *m = g_fullpipe->_globalMessageQueueList->getMessageQueueById(_messageQueueId);
@@ -607,6 +627,154 @@ bool StaticANIObject::setPicAniInfo(PicAniInfo *picAniInfo) {
return true;
}
+MessageQueue *StaticANIObject::changeStatics1(int msgNum) {
+ warning("STUB: StaticANIObject::changeStatics1(%d)", msgNum);
+
+ return 0;
+}
+
+void StaticANIObject::changeStatics2(int objId) {
+ warning("STUB: StaticANIObject::changeStatics2(%d)", objId);
+}
+
+void StaticANIObject::hide() {
+ if (!_messageQueueId) {
+ if (_flags & 4)
+ _flags ^= 4;
+ }
+}
+
+void StaticANIObject::show1(int x, int y, int movementId, int mqId) {
+ warning("STUB: StaticANIObject::show1(%d, %d, %d, %d)", x, y, movementId, mqId);
+}
+
+void StaticANIObject::show2(int x, int y, int movementId, int mqId) {
+ warning("STUB: StaticANIObject::show2(%d, %d, %d, %d)", x, y, movementId, mqId);
+}
+
+void StaticANIObject::playIdle() {
+ if (isIdle())
+ adjustSomeXY();
+}
+
+void StaticANIObject::startAnimSteps(int movementId, int messageQueueId, int x, int y, Common::Point **points, int pointsCount, int someDynamicPhaseIndex) {
+ warning("STUB: StaticANIObject::startAnimSteps()");
+}
+
+bool StaticANIObject::startAnimEx(int movid, int parId, int flag1, int flag2) {
+ bool res = startAnim(movid, parId, -1);
+ if (res)
+ _animExFlag = 1;
+
+ _someDynamicPhaseIndex = -1;
+ return res;
+}
+
+bool StaticANIObject::startAnim(int movementId, int messageQueueId, int dynPhaseIdx) {
+ if (_flags & 0x80)
+ return false;
+
+ warning("STUB: StaticANIObject::startAnim(%d, %d, %d)", movementId, messageQueueId, dynPhaseIdx);
+
+ if (_messageQueueId) {
+ updateGlobalMessageQueue(messageQueueId, _id);
+ return false;
+ }
+
+ bool found = false;
+ Movement *mov;
+
+ for (uint i = 0; i < _movements.size(); i++) {
+ mov = (Movement *)_movements[i];
+
+ if (mov->_id != movementId) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ updateGlobalMessageQueue(messageQueueId, _id);
+ return false;
+ }
+
+ if (mov == _movement) {
+ _flags |= 1;
+ _messageQueueId = messageQueueId;
+
+ return 1;
+ }
+
+ int newx = _ox;
+ int newy = _oy;
+ Common::Point point;
+
+ if (_movement) {
+ _movement->getCurrDynamicPhaseXY(point);
+ } else if (_statics) {
+ _statics->getSomeXY(point);
+
+ newx -= point.x;
+ newy -= point.y;
+ }
+
+ _movement = mov;
+
+ _stepArray.clear();
+
+ if (_flags & 0x40)
+ _movement->gotoLastFrame();
+ else
+ _movement->gotoFirstFrame();
+
+ 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 = new ExCommand(ex);
+ newex->_excFlags |= 2;
+ newex->sendMessage();
+ }
+ }
+ }
+ }
+
+ _movement->getCurrDynamicPhaseXY(point);
+ setOXY(point.x + newx, point.y + newy);
+
+ if (_movement->_staticsObj2->_staticsId & 0x4000)
+ _flags |= 8;
+ else
+ _flags &= 0xFFF7;
+
+ _flags |= 1;
+
+ _messageQueueId = messageQueueId;
+ _movement->_currDynamicPhase->_countdown = _movement->_currDynamicPhase->_initialCountdown;
+ _movement->_counter = 0;
+
+ _counter = _initialCounter;
+ _someDynamicPhaseIndex = dynPhaseIdx;
+
+ _stepArray.clear();
+
+ ExCommand *newex = new ExCommand(_id, 17, 23, 0, 0, movementId, 1, 0, 0, 0);
+
+ newex->_keyCode = _field_4;
+ newex->_excFlags = 2;
+
+ newex->postMessage();
+
+ return true;
+}
+
Statics::Statics() {
_staticsId = 0;
_picture = 0;
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index ee99861a00..97a044f95f 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -197,6 +197,8 @@ class StaticANIObject : public GameObject {
void deleteFromGlobalMessageQueue();
void queueMessageQueue(MessageQueue *msg);
+ MessageQueue *getMessageQueue();
+ bool trySetMessageQueue(int msgNum, int qId);
void initMovements();
void loadMovementsPixelData();
@@ -204,7 +206,16 @@ class StaticANIObject : public GameObject {
bool setPicAniInfo(PicAniInfo *picAniInfo);
void setSomeDynamicPhaseIndex(int val) { _someDynamicPhaseIndex = val; }
+ void adjustSomeXY();
+
+ bool startAnim(int movementId, int messageQueueId, int dynPhaseIdx);
+ bool startAnimEx(int movid, int parId, int flag1, int flag2);
+ void startAnimSteps(int movementId, int messageQueueId, int x, int y, Common::Point **points, int pointsCount, int someDynamicPhaseIndex);
+ void hide();
+ void show1(int x, int y, int movementId, int mqId);
+ void show2(int x, int y, int movementId, int mqId);
+ void playIdle();
void update(int counterdiff);
Statics *addReverseStatics(Statics *ani);
@@ -215,7 +226,9 @@ class StaticANIObject : public GameObject {
void setSpeed(int speed);
void stopAnim_maybe();
- void adjustSomeXY();
+
+ MessageQueue *changeStatics1(int msgNum);
+ void changeStatics2(int objId);
};
struct MovTable {