diff options
Diffstat (limited to 'engines/neverhood/modules/module1700.cpp')
-rw-r--r-- | engines/neverhood/modules/module1700.cpp | 58 |
1 files changed, 8 insertions, 50 deletions
diff --git a/engines/neverhood/modules/module1700.cpp b/engines/neverhood/modules/module1700.cpp index 38ed561d51..6ff34ecd91 100644 --- a/engines/neverhood/modules/module1700.cpp +++ b/engines/neverhood/modules/module1700.cpp @@ -8,20 +8,21 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ -#include "neverhood/modules/module1700.h" #include "neverhood/gamemodule.h" +#include "neverhood/modules/module1700.h" +#include "neverhood/modules/module1700_sprites.h" namespace Neverhood { @@ -36,7 +37,7 @@ static const uint32 kModule1700SoundList[] = { Module1700::Module1700(NeverhoodEngine *vm, Module *parentModule, int which) : Module(vm, parentModule) { - + _vm->_soundMan->addMusic(0x04212331, 0x31114225); _vm->_soundMan->addSoundList(0x04212331, kModule1700SoundList); _vm->_soundMan->setSoundListParams(kModule1700SoundList, true, 50, 600, 5, 150); @@ -125,8 +126,6 @@ void Module1700::updateScene() { } } } - -// Scene1705 static const uint32 kScene1705FileHashes[] = { 0x910EA801, 0x920EA801, 0x940EA801, @@ -135,52 +134,11 @@ static const uint32 kScene1705FileHashes[] = { 0xD10EA801, 0x110EA801, 0x910EA800 }; -SsScene1705WallSymbol::SsScene1705WallSymbol(NeverhoodEngine *vm, uint32 fileHash, int symbolIndex) - : StaticSprite(vm, fileHash, 100) { - - _x = _spriteResource.getPosition().x + symbolIndex * 30; - _y = _spriteResource.getPosition().y + 160; - updatePosition(); -} - -SsScene1705Tape::SsScene1705Tape(NeverhoodEngine *vm, Scene *parentScene, uint32 tapeIndex, int surfacePriority, int16 x, int16 y, uint32 fileHash) - : StaticSprite(vm, fileHash, surfacePriority, x - 24, y - 4), _parentScene(parentScene), _tapeIndex(tapeIndex) { - - if (!getSubVar(VA_HAS_TAPE, _tapeIndex) && !getSubVar(VA_IS_TAPE_INSERTED, _tapeIndex)) { - SetMessageHandler(&SsScene1705Tape::handleMessage); - } else { - setVisible(false); - SetMessageHandler(NULL); - } - _collisionBoundsOffset = _drawOffset; - _collisionBoundsOffset.x -= 4; - _collisionBoundsOffset.y -= 8; - _collisionBoundsOffset.width += 8; - _collisionBoundsOffset.height += 16; - Sprite::updateBounds(); -} - -uint32 SsScene1705Tape::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x1011: - sendMessage(_parentScene, 0x4826, 0); - messageResult = 1; - break; - case 0x4806: - setSubVar(VA_HAS_TAPE, _tapeIndex, 1); - setVisible(false); - SetMessageHandler(NULL); - break; - } - return messageResult; -} - Scene1705::Scene1705(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule), _paletteArea(1) { Sprite *tempSprite; - + setGlobalVar(V_FELL_DOWN_HOLE, 1); _vm->gameModule()->initCannonSymbolsPuzzle(); @@ -257,7 +215,7 @@ void Scene1705::update() { uint32 Scene1705::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { - case 0x2000: + case NM_ANIMATION_UPDATE: if (param.asInteger()) { setRectList(0x004B6B40); _klaymen->setKlaymenIdleTable3(); @@ -271,7 +229,7 @@ uint32 Scene1705::handleMessage(int messageNum, const MessageParam ¶m, Entit sendEntityMessage(_klaymen, 0x1014, sender); setMessageList(0x004B6AC0); } - break; + break; } return 0; } |