aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/scenes.cpp71
-rw-r--r--engines/fullpipe/sound.cpp4
-rw-r--r--engines/fullpipe/sound.h2
-rw-r--r--engines/fullpipe/statics.cpp15
-rw-r--r--engines/fullpipe/statics.h8
5 files changed, 91 insertions, 9 deletions
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 843b098aab..09fc158fa8 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -822,10 +822,77 @@ int global_messageHandler1(ExCommand *cmd) {
return 0;
}
+void staticANIObjectCallback(int *arg) {
+ *arg--;
+}
+
int global_messageHandler2(ExCommand *cmd) {
- warning("STUB: global_messageHandler2()");
+ debug(0, "global_messageHandler2()");
- return 0;
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ int res = 0;
+ StaticANIObject *ani;
+
+ switch (cmd->_messageNum) {
+ case 0x44c8:
+ // Unk3_sub_4477A0(&unk3, _parentId, _field_14 != 0);
+ break;
+
+ case 28:
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (ani)
+ ani->_priority = cmd->_field_14;
+ break;
+
+ case 25:
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (ani) {
+ if (cmd->_field_14) {
+ ani->setFlags40(true);
+ ani->_callback2 = staticANIObjectCallback;
+ } else {
+ ani->setFlags40(false);
+ ani->_callback2 = 0;
+ }
+ }
+ break;
+
+ case 26:
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (ani) {
+ Movement *mov = ani->_movement;
+ if (mov)
+ mov->_currDynamicPhase->_field_68 = 0;
+ }
+ break;
+
+ default:
+#if 0
+ // We never put anything into _defMsgArray
+ while (::iterator it = g_fullpipe->_defMsgArray.begin(); it != g_fullpipe->_defMsgArray.end(); ++it)
+ if (((ExCommand *)*it)->_field_24 == _messageNum) {
+ ((ExCommand *)*it)->firef34(v13);
+ res = 1;
+ }
+#endif
+
+ //debug_msg(_messageNum);
+
+ if (!g_fullpipe->_soundEnabled || cmd->_messageNum != 33 || g_fullpipe->_currSoundListCount <= 0)
+ return res;
+
+ for (int snd = 0; snd < g_fullpipe->_currSoundListCount; snd++) {
+ SoundList *s = g_fullpipe->_currSoundList1[snd];
+ int ms = s->getCount();
+ for (int i = 0; i < ms; i++) {
+ s->getSoundByIndex(i)->setPanAndVolumeByStaticAni();
+ }
+ }
+ }
+
+ return res;
}
int global_messageHandler3(ExCommand *cmd) {
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index 7a6696edd6..516e4ab4f0 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -107,6 +107,10 @@ void Sound::updateVolume() {
warning("STUB Sound::updateVolume()");
}
+void Sound::setPanAndVolumeByStaticAni() {
+ warning("STUB Sound::setPanAndVolumeByStaticAni()");
+}
+
void FullpipeEngine::setSceneMusicParameters(CGameVar *var) {
warning("STUB: FullpipeEngine::setSceneMusicParameters()");
}
diff --git a/engines/fullpipe/sound.h b/engines/fullpipe/sound.h
index 93e994a720..4014cdd94e 100644
--- a/engines/fullpipe/sound.h
+++ b/engines/fullpipe/sound.h
@@ -38,6 +38,8 @@ class Sound : public MemoryObject {
Sound();
bool load(MfcArchive &file, NGIArchive *archive);
void updateVolume();
+
+ void setPanAndVolumeByStaticAni();
};
class SoundList : public CObject {
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index a6e9d3ab0a..ce782d1d48 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -201,6 +201,15 @@ void StaticANIObject::clearFlags() {
_stepArray.clear();
}
+void StaticANIObject::setFlags40(bool state) {
+ if (state) {
+ _flags |= 0x40;
+ } else {
+ if (_flags & 0x40)
+ _flags ^= 0x40;
+ }
+}
+
void StaticANIObject::deleteFromGlobalMessageQueue() {
while (_messageQueueId) {
if (g_fullpipe->_globalMessageQueueList->getMessageQueueById(_messageQueueId)) {
@@ -1216,8 +1225,8 @@ void Movement::removeFirstPhase() {
_updateFlag1 = 0;
}
-bool Movement::gotoNextFrame(int callback1, int callback2) {
- debug(8, "Movement::gotoNextFrame(%d, %d)", callback1, callback2);
+bool Movement::gotoNextFrame(int callback1, void (*callback2)(int *)) {
+ debug(8, "Movement::gotoNextFrame()");
if (!callback2) {
if (_currMovement) {
@@ -1250,7 +1259,7 @@ bool Movement::gotoNextFrame(int callback1, int callback2) {
int oldDynIndex = _currDynamicPhaseIndex;
if (callback2)
- ; //callback2(&_currDynamicPhaseIndex);
+ callback2(&_currDynamicPhaseIndex);
else
_currDynamicPhaseIndex++;
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index 40fc91dc06..95030180c3 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -101,8 +101,7 @@ class Statics : public DynamicPhase {
class StaticANIObject;
class Movement : public GameObject {
- friend class StaticANIObject;
-
+ public:
int _field_24;
int _field_28;
int _lastFrameSpecialFlag;
@@ -145,7 +144,7 @@ class Movement : public GameObject {
void setDynamicPhaseIndex(int index);
void removeFirstPhase();
- bool gotoNextFrame(int callback1, int callback2);
+ bool gotoNextFrame(int callback1, void (*callback2)(int *));
bool gotoPrevFrame();
void gotoFirstFrame();
void gotoLastFrame();
@@ -165,7 +164,7 @@ class StaticANIObject : public GameObject {
int _field_34;
int _initialCounter;
int _callback1;
- int _callback2;
+ void (*_callback2)(int *);
CPtrList _movements;
CPtrList _staticsList;
CStepArray _stepArray;
@@ -194,6 +193,7 @@ class StaticANIObject : public GameObject {
Common::Point *getCurrDimensions(Common::Point &p);
void clearFlags();
+ void setFlags40(bool state);
bool isIdle();
void deleteFromGlobalMessageQueue();