diff options
author | Paul Gilbert | 2015-05-31 14:45:10 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-05-31 14:45:10 -0400 |
commit | e5296ebf8dd09f603499b1894a33865ec71bb28f (patch) | |
tree | d7de032efd54dfdb3159cbc778a0c9ce8cd8aa91 /engines/fullpipe | |
parent | 673537bad93f0b440172a0cc263ebf19cc95ffc0 (diff) | |
parent | 141ff4d08dc24b6bb17098bd71801e2a58e6a38f (diff) | |
download | scummvm-rg350-e5296ebf8dd09f603499b1894a33865ec71bb28f.tar.gz scummvm-rg350-e5296ebf8dd09f603499b1894a33865ec71bb28f.tar.bz2 scummvm-rg350-e5296ebf8dd09f603499b1894a33865ec71bb28f.zip |
Merge branch 'master' into phantom
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/gfx.cpp | 8 | ||||
-rw-r--r-- | engines/fullpipe/input.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/inventory.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/mgm.cpp | 7 | ||||
-rw-r--r-- | engines/fullpipe/modal.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/motion.cpp | 14 | ||||
-rw-r--r-- | engines/fullpipe/scene.cpp | 8 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene02.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene04.cpp | 9 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene14.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene15.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene16.cpp | 10 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene23.cpp | 6 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene28.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene29.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene37.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/sound.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 19 |
20 files changed, 57 insertions, 50 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index bb0838395d..ebaff32550 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -163,7 +163,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) for (int i = 0; i < 11; i++) _currSoundList1[i] = 0; - + for (int i = 0; i < 200; i++) _mapTable[i] = 0; @@ -285,7 +285,7 @@ Common::Error FullpipeEngine::run() { freeGameLoader(); _currentScene = 0; _updateTicks = 0; - + loadGam("fullpipe.gam"); _needRestart = false; } diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index fbf96b3060..7815475d37 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -323,7 +323,7 @@ bool preloadCallback(PreloadItem &pre, int flag) { if (!g_fp->_loaderScene) { g_fp->_gameLoader->loadScene(SC_LDR); - g_fp->_loaderScene = g_fp->accessScene(SC_LDR);; + g_fp->_loaderScene = g_fp->accessScene(SC_LDR); } StaticANIObject *pbar = g_fp->_loaderScene->getStaticANIObject1ById(ANI_PBAR, -1); diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 61fbf7192f..42846850ca 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -153,7 +153,7 @@ bool PictureObject::load(MfcArchive &file, bool bigPicture) { if (count > 0) { GameObject *o = new GameObject(); - + o->load(file); _pictureObject2List->push_back(o); } @@ -286,9 +286,9 @@ bool GameObject::load(MfcArchive &file) { _okeyCode = 0; _flags = 0; _field_20 = 0; - + _id = file.readUint16LE(); - + _objectName = file.readPascalString(); _ox = file.readUint32LE(); _oy = file.readUint32LE(); @@ -498,7 +498,7 @@ bool Picture::load(MfcArchive &file) { _x = file.readUint32LE(); _y = file.readUint32LE(); _field_44 = file.readUint16LE(); - + assert(g_fp->_gameProjectVersion >= 2); _width = file.readUint32LE(); diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp index 7c97461a24..b681f4fbe7 100644 --- a/engines/fullpipe/input.cpp +++ b/engines/fullpipe/input.cpp @@ -70,7 +70,7 @@ void setInputDisabled(bool state) { void InputController::addCursor(CursorInfo *cursor) { CursorInfo *newc = new CursorInfo(cursor); Common::Point p; - + cursor->picture->getDimensions(&p); newc->width = p.x; diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp index e79f9c54df..f9b507c50b 100644 --- a/engines/fullpipe/inventory.cpp +++ b/engines/fullpipe/inventory.cpp @@ -126,7 +126,7 @@ void Inventory2::removeItem2(Scene *sceneObj, int itemId, int x, int y, int prio int idx = getInventoryItemIndexById(itemId); if (idx >= 0) { - if (_inventoryItems[idx]->itemId >> 16) { + if (_inventoryItems[idx]->count) { removeItem(itemId, 1); Scene *sc = g_fp->accessScene(_sceneId); diff --git a/engines/fullpipe/mgm.cpp b/engines/fullpipe/mgm.cpp index aacfd5452a..1c8ca2a7b1 100644 --- a/engines/fullpipe/mgm.cpp +++ b/engines/fullpipe/mgm.cpp @@ -155,13 +155,14 @@ void MGM::rebuildTables(int objId) { if (!obj) return; - for (uint i = 0; i < obj->_staticsList.size(); i++) + for (uint i = 0; i < obj->_staticsList.size(); i++) { _items[idx]->statics.push_back((Statics *)obj->_staticsList[i]); + _items[idx]->subItems.push_back(new MGMSubItem); + } + for (uint i = 0; i < obj->_movements.size(); i++) _items[idx]->movements1.push_back((Movement *)obj->_movements[i]); - - _items[idx]->subItems.clear(); } int MGM::getItemIndexById(int objId) { diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 2fd7ef0c21..096323781f 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -305,7 +305,7 @@ bool ModalMap::init(int counterdiff) { if (_flag) { _rect2.left = _mouseX + _field_38 - g_fp->_mouseScreenPos.x; - _rect2.top = _mouseY + _field_3C - g_fp->_mouseScreenPos.y;; + _rect2.top = _mouseY + _field_3C - g_fp->_mouseScreenPos.y; _rect2.right = _rect2.left + 800; _rect2.bottom = _rect2.top + 600; diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 49cf88434e..9573e0517b 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -1040,11 +1040,11 @@ MessageQueue *MovGraph::doWalkTo(StaticANIObject *subj, int xpos, int ypos, int if (!mq || !mq->getExCommandByIndex(0)) return 0; - + ExCommand *ex = mq->getExCommandByIndex(0); - if ((ex->_messageKind != 1 && ex->_messageKind != 20) || - ex->_messageNum != subj->_movement->_id || + if ((ex->_messageKind != 1 && ex->_messageKind != 20) || + ex->_messageNum != subj->_movement->_id || (ex->_field_14 >= 1 && ex->_field_14 <= subj->_movement->_currDynamicPhaseIndex)) subj->playIdle(); } @@ -1416,8 +1416,8 @@ Common::Array<MovArr *> *MovGraph::genMovArr(int x, int y, int *arrSize, int fla movarr = new MovArr; movarr->_link = lnk; - movarr->_dist = ((double)(lnk->_movGraphNode1->_y - lnk->_movGraphNode2->_y) * (double)(lnk->_movGraphNode1->_y - point.y) + - (double)(lnk->_movGraphNode2->_x - lnk->_movGraphNode1->_x) * (double)(point.x - lnk->_movGraphNode1->_x)) / + movarr->_dist = ((double)(lnk->_movGraphNode1->_y - lnk->_movGraphNode2->_y) * (double)(lnk->_movGraphNode1->_y - point.y) + + (double)(lnk->_movGraphNode2->_x - lnk->_movGraphNode1->_x) * (double)(point.x - lnk->_movGraphNode1->_x)) / lnk->_distance / lnk->_distance; movarr->_point = point; @@ -1445,8 +1445,8 @@ Common::Array<MovArr *> *MovGraph::genMovArr(int x, int y, int *arrSize, int fla } else { movarr = new MovArr; movarr->_link = lnk; - movarr->_dist = ((double)(lnk->_movGraphNode1->_y - lnk->_movGraphNode2->_y) * (double)(lnk->_movGraphNode1->_y - y) + - (double)(lnk->_movGraphNode2->_x - lnk->_movGraphNode1->_x) * (double)(x - lnk->_movGraphNode1->_x)) / + movarr->_dist = ((double)(lnk->_movGraphNode1->_y - lnk->_movGraphNode2->_y) * (double)(lnk->_movGraphNode1->_y - y) + + (double)(lnk->_movGraphNode2->_x - lnk->_movGraphNode1->_x) * (double)(x - lnk->_movGraphNode1->_x)) / lnk->_distance / lnk->_distance; movarr->_point.x = x; movarr->_point.y = y; diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 8463b3ab40..5a3fbe34b6 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -162,7 +162,7 @@ bool Scene::load(MfcArchive &file) { Background::load(file); _sceneId = file.readUint16LE(); - + _sceneName = file.readPascalString(); debug(0, "scene: <%s> %d", transCyrillic((byte *)_sceneName), _sceneId); @@ -672,11 +672,6 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) { debug(1, "_bigPict: %d objlist: %d", _bigPictureArray1Count, _picObjList.size()); - for (uint i = 0; i < _picObjList.size(); i++) { - debug(1, "%d: %d", i, ((PictureObject *)_picObjList[i])->_priority); - } - - if (drawBg && _bigPictureArray1Count && _picObjList.size()) { _bigPictureArray[0][0]->getDimensions(&point); @@ -743,7 +738,6 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) { for (uint i = 1; i < _picObjList.size(); i++) { PictureObject *obj = (PictureObject *)_picObjList[i]; - debug(8, "pri: %d", obj->_priority); if (obj->_priority < minPri || obj->_priority >= maxPri) continue; diff --git a/engines/fullpipe/scenes/scene02.cpp b/engines/fullpipe/scenes/scene02.cpp index 109a20a07a..fd542d580d 100644 --- a/engines/fullpipe/scenes/scene02.cpp +++ b/engines/fullpipe/scenes/scene02.cpp @@ -134,5 +134,5 @@ int sceneHandler02(ExCommand *ex) { return res; } - + } // End of namespace Fullpipe diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp index fd1ececdf2..4a87ae5b87 100644 --- a/engines/fullpipe/scenes/scene04.cpp +++ b/engines/fullpipe/scenes/scene04.cpp @@ -949,7 +949,7 @@ void sceneHandler04_springWobble() { if (g_vars->scene04_bottleWeight < newdelta) g_vars->scene04_springOffset--; - if ((oldDynIndex > g_vars->scene04_bottleWeight && newdelta > g_vars->scene04_bottleWeight) || newdelta <= g_vars->scene04_bottleWeight) { + if ((oldDynIndex <= g_vars->scene04_bottleWeight && newdelta > g_vars->scene04_bottleWeight) || newdelta <= g_vars->scene04_bottleWeight) { g_vars->scene04_springDelay++; if (g_vars->scene04_springOffset && g_vars->scene04_springDelay > 1) { @@ -960,6 +960,8 @@ void sceneHandler04_springWobble() { Common::Point point; + int oldpos = g_vars->scene04_spring->getCurrDimensions(point)->y - oldDynIndex; + if (g_vars->scene04_dynamicPhaseIndex) { if (!g_vars->scene04_spring->_movement) g_vars->scene04_spring->startAnim(MV_SPR_LOWER, 0, -1); @@ -969,8 +971,9 @@ void sceneHandler04_springWobble() { g_vars->scene04_spring->changeStatics2(ST_SPR_UP); } - if (g_vars->scene04_dynamicPhaseIndex != oldDynIndex) - sceneHandler04_bottleUpdateObjects(oldDynIndex - g_vars->scene04_dynamicPhaseIndex); + if (g_vars->scene04_dynamicPhaseIndex != oldDynIndex) { + sceneHandler04_bottleUpdateObjects(oldpos - (g_vars->scene04_spring->getCurrDimensions(point)->y - g_vars->scene04_dynamicPhaseIndex)); + } } void sceneHandler04_leaveScene() { diff --git a/engines/fullpipe/scenes/scene14.cpp b/engines/fullpipe/scenes/scene14.cpp index 21dbe8101f..446f477133 100644 --- a/engines/fullpipe/scenes/scene14.cpp +++ b/engines/fullpipe/scenes/scene14.cpp @@ -57,7 +57,7 @@ void scene14_initScene(Scene *sc) { ball->_flags &= 0xFFFB; g_vars->scene14_balls.push_back(ball); - + for (uint i = 0; i < 3; i++) { ball = new StaticANIObject(ball); // create a copy diff --git a/engines/fullpipe/scenes/scene15.cpp b/engines/fullpipe/scenes/scene15.cpp index 452f2edeca..efc69a5fa6 100644 --- a/engines/fullpipe/scenes/scene15.cpp +++ b/engines/fullpipe/scenes/scene15.cpp @@ -71,7 +71,7 @@ void scene15_initScene(Scene *sc) { grandma->hide(); g_fp->setObjectState(sO_LeftPipe_15, g_fp->getObjectEnumState(sO_LeftPipe_15, sO_IsOpened)); } - + g_vars->scene15_plusminus = sc->getStaticANIObject1ById(ANI_PLUSMINUS, -1); if (g_fp->getObjectState(sO_Guard_2) == g_fp->getObjectEnumState(sO_Guard_2, sO_Off)) diff --git a/engines/fullpipe/scenes/scene16.cpp b/engines/fullpipe/scenes/scene16.cpp index ed3c51a6c2..df005950d2 100644 --- a/engines/fullpipe/scenes/scene16.cpp +++ b/engines/fullpipe/scenes/scene16.cpp @@ -57,9 +57,9 @@ void scene16_initScene(Scene *sc) { boy[1] = new StaticANIObject(boy[0]); sc->addStaticANIObject(boy[1], 1); - + int idx = 0; - + for (int i = 0; i < 3; i++) { g_vars->scene16_figures.push_back(boy[idx]); @@ -68,7 +68,7 @@ void scene16_initScene(Scene *sc) { if (idx >= 2) idx = 0; } - + g_vars->scene16_figures.push_back(sc->getStaticANIObject1ById(ANI_GIRL, -1)); for (int i = 0; i < 4; i++) { @@ -182,7 +182,7 @@ void sceneHandler16_fillMug() { mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_BOYOUT), 0, 1); mq->replaceKeyCode(-1, g_vars->scene16_walkingBoy->_okeyCode); - if (!mq || mq->chain(g_vars->scene16_walkingBoy)) + if (mq->chain(g_vars->scene16_walkingBoy)) return; } else { if (!g_vars->scene16_walkingGirl) @@ -259,7 +259,7 @@ void sceneHandler16_drink() { mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_BOYKICK), 0, 1); mq->replaceKeyCode(-1, g_vars->scene16_walkingBoy->_okeyCode); - + ex = new ExCommand(ANI_MAN, 34, 384, 0, 0, 0, 1, 0, 0, 0); ex->_excFlags |= 3u; ex->_field_14 = 384; diff --git a/engines/fullpipe/scenes/scene23.cpp b/engines/fullpipe/scenes/scene23.cpp index ccfbac9223..ded467e438 100644 --- a/engines/fullpipe/scenes/scene23.cpp +++ b/engines/fullpipe/scenes/scene23.cpp @@ -146,7 +146,7 @@ void scene23_initScene(Scene *sc) { sc->getStaticANIObject1ById(ANI_INV_LEVERHANDLE, -1)->hide(); } - + g_fp->_currentScene = oldsc; } @@ -299,14 +299,14 @@ void sceneHandler23_pushButton(ExCommand *cmd) { MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 276, 438, 1, ST_MAN_RIGHT); if (mq) { - mq->addExCommandToEnd(cmd->createClone());; + mq->addExCommandToEnd(cmd->createClone()); postExCommand(g_fp->_aniMan->_id, 2, 276, 438, 0, -1); } } else { MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC23_TOCALENDAR), 0, 0); - mq->addExCommandToEnd(cmd->createClone());; + mq->addExCommandToEnd(cmd->createClone()); mq->setFlags(mq->getFlags() | 1); mq->chain(0); } diff --git a/engines/fullpipe/scenes/scene28.cpp b/engines/fullpipe/scenes/scene28.cpp index c21ce05502..de5a96e70d 100644 --- a/engines/fullpipe/scenes/scene28.cpp +++ b/engines/fullpipe/scenes/scene28.cpp @@ -46,7 +46,7 @@ void scene28_initScene(Scene *sc) { g_vars->scene28_lift6inside = false; g_fp->_floaters->init(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_28")); - + g_fp->initArcadeKeys("SC_28"); } diff --git a/engines/fullpipe/scenes/scene29.cpp b/engines/fullpipe/scenes/scene29.cpp index 8f82e99ad1..222a541554 100644 --- a/engines/fullpipe/scenes/scene29.cpp +++ b/engines/fullpipe/scenes/scene29.cpp @@ -840,7 +840,7 @@ void sceneHandler29_shootersEscape() { void sceneHandler29_manRideBack() { g_vars->scene29_manX -= 2; - + g_fp->_aniMan->setOXY(g_vars->scene29_manX, g_vars->scene29_manY); } diff --git a/engines/fullpipe/scenes/scene37.cpp b/engines/fullpipe/scenes/scene37.cpp index 09da01f138..324d3ac92d 100644 --- a/engines/fullpipe/scenes/scene37.cpp +++ b/engines/fullpipe/scenes/scene37.cpp @@ -91,7 +91,7 @@ void scene37_initScene(Scene *sc) { g_vars->scene37_rings.push_back(ring); g_fp->setObjectState(sO_LeftPipe_37, g_fp->getObjectEnumState(sO_LeftPipe_37, sO_IsClosed)); - + Scene *oldsc = g_fp->_currentScene; g_fp->_currentScene = sc; diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index a4ca06f489..230d6c39a9 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -62,7 +62,7 @@ bool SoundList::load(MfcArchive &file, char *fname) { } return true; - + } bool SoundList::loadFile(const char *fname, char *libname) { diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 717de84925..de3e1ea728 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -246,7 +246,7 @@ bool StaticANIObject::load(MfcArchive &file) { void StaticANIObject::setOXY(int x, int y) { _ox = x; _oy = y; - + if (_movement) _movement->setOXY(x, y); } @@ -713,7 +713,7 @@ void StaticANIObject::setSpeed(int speed) { void StaticANIObject::setAlpha(int alpha) { for (uint i = 0; i < _movements.size(); i++) _movements[i]->setAlpha(alpha); - + for (uint i = 0; i < _staticsList.size(); i++) _staticsList[i]->setAlpha(alpha); } @@ -1048,8 +1048,11 @@ MessageQueue *StaticANIObject::changeStatics1(int msgNum) { if (_flags & 1) _messageQueueId = mq->_id; } else { - if (!queueMessageQueue(mq)) + if (!queueMessageQueue(mq)) { + delete mq; + return 0; + } g_fp->_globalMessageQueueList->addMessageQueue(mq); } @@ -1594,6 +1597,12 @@ Movement::Movement(Movement *src, int *oldIdxs, int newSize, StaticANIObject *an newSize = src->_dynamicPhases.size(); } + if (!newSize) { + warning("Movement::Movement: newSize = 0"); + + return; + } + _framePosOffsets = (Common::Point **)calloc(newSize, sizeof(Common::Point *)); for (int i = 0; i < newSize; i++) @@ -1813,7 +1822,7 @@ void Movement::initStatics(StaticANIObject *ani) { _staticsObj2 = ani->addReverseStatics(_currMovement->_staticsObj2); _staticsObj1 = ani->addReverseStatics(_currMovement->_staticsObj1); - + _mx = _currMovement->_mx; _my = _currMovement->_my; @@ -2279,7 +2288,7 @@ bool StaticPhase::load(MfcArchive &file) { _initialCountdown = file.readUint16LE(); _field_6A = file.readUint16LE(); - + if (g_fp->_gameProjectVersion >= 12) { _exCommand = (ExCommand *)file.readClass(); |