aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/neverhood/gamemodule.cpp2
-rw-r--r--engines/neverhood/module1000.cpp50
-rw-r--r--engines/neverhood/module1000.h16
-rw-r--r--engines/neverhood/scene.cpp5
-rw-r--r--engines/neverhood/scene.h1
5 files changed, 13 insertions, 61 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index f281a17b3d..e3787757b0 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -299,7 +299,7 @@ void GameModule::startup() {
// TODO: Displaying of error text probably not needed in ScummVM
// createModule(1500, 0); // Logos and intro video //Real
#if 1
- _vm->gameState().sceneNum = 6;
+ _vm->gameState().sceneNum = 1;
createModule(1000, -1);
#endif
#if 0
diff --git a/engines/neverhood/module1000.cpp b/engines/neverhood/module1000.cpp
index ab4c051f5a..4fdb3db523 100644
--- a/engines/neverhood/module1000.cpp
+++ b/engines/neverhood/module1000.cpp
@@ -458,44 +458,6 @@ uint32 Scene1001::handleMessage(int messageNum, const MessageParam &param, Entit
// Scene1002
-SsScene1002LadderArch::SsScene1002LadderArch(NeverhoodEngine *vm, Scene *parentScene)
- : StaticSprite(vm, 0x152C1313, 1015), _parentScene(parentScene) {
-
- SetMessageHandler(&SsScene1002LadderArch::handleMessage);
-}
-
-uint32 SsScene1002LadderArch::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
- uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
- switch (messageNum) {
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 995);
- break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1015);
- break;
- }
- return messageResult;
-}
-
-Class599::Class599(NeverhoodEngine *vm, Scene *parentScene)
- : StaticSprite(vm, 0x316C4BB4, 1015), _parentScene(parentScene) {
-
- SetMessageHandler(&Class599::handleMessage);
-}
-
-uint32 Class599::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
- uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
- switch (messageNum) {
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 995);
- break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1015);
- break;
- }
- return messageResult;
-}
-
AsScene1002Ring::AsScene1002Ring(NeverhoodEngine *vm, Scene *parentScene, bool flag1, int16 x, int16 y, int16 clipY1, bool flag2)
: AnimatedSprite(vm, 1100), _parentScene(parentScene), _flag1(flag1) {
@@ -1327,12 +1289,12 @@ Scene1002::Scene1002(NeverhoodEngine *vm, Module *parentModule, int which)
insertStaticSprite(0x06149428, 1100);
insertStaticSprite(0x312C8774, 1100);
- _ssLadderArch = insertSprite<SsScene1002LadderArch>(this);
+ _ssLadderArch = insertStaticSprite(0x152C1313, 1015);
_ssLadderArchPart1 = insertStaticSprite(0x060000A0, 1200);
_ssLadderArchPart2 = insertStaticSprite(0xB2A423B0, 1100);
_ssLadderArchPart3 = insertStaticSprite(0x316E0772, 1100);
- _class599 = insertSprite<Class599>(this);
+ _class599 = insertStaticSprite(0x316C4BB4, 1015);
if (which < 0) {
if (_vm->_gameState.field2 == 0) {
@@ -1552,12 +1514,12 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam &param, Entit
sendMessage(_asOutsideDoorBackground, 0x4808, 0);
break;
case 0x8000:
- sendMessage(_class599, 0x482A, 0);
- sendMessage(_ssLadderArch, 0x482A, 0);
+ setSpriteSurfacePriority(_class599, 995);
+ setSpriteSurfacePriority(_ssLadderArch, 995);
break;
case 0x8001:
- sendMessage(_class599, 0x482B, 0);
- sendMessage(_ssLadderArch, 0x482B, 0);
+ setSpriteSurfacePriority(_class599, 1015);
+ setSpriteSurfacePriority(_ssLadderArch, 1015);
break;
}
return messageResult;
diff --git a/engines/neverhood/module1000.h b/engines/neverhood/module1000.h
index db8fdb6448..864b5ccf94 100644
--- a/engines/neverhood/module1000.h
+++ b/engines/neverhood/module1000.h
@@ -112,22 +112,6 @@ protected:
// Scene1002
-class SsScene1002LadderArch : public StaticSprite {
-public:
- SsScene1002LadderArch(NeverhoodEngine *vm, Scene *parentScene);
-protected:
- Scene *_parentScene;
- uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
-};
-
-class Class599 : public StaticSprite {
-public:
- Class599(NeverhoodEngine *vm, Scene *parentScene);
-protected:
- Scene *_parentScene;
- uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
-};
-
class AsScene1002Ring : public AnimatedSprite {
public:
AsScene1002Ring(NeverhoodEngine *vm, Scene *parentScene, bool flag1, int16 x, int16 y, int16 clipY1, bool flag2);
diff --git a/engines/neverhood/scene.cpp b/engines/neverhood/scene.cpp
index 8520d6467d..dde437dc62 100644
--- a/engines/neverhood/scene.cpp
+++ b/engines/neverhood/scene.cpp
@@ -169,6 +169,11 @@ void Scene::setSurfacePriority(BaseSurface *surface, int priority) {
addSurface(surface);
}
+void Scene::setSpriteSurfacePriority(Sprite *sprite, int priority) {
+ if (sprite)
+ setSurfacePriority(sprite->getSurface(), priority);
+}
+
void Scene::deleteSprite(Sprite **sprite) {
_vm->_collisionMan->removeSprite(*sprite);
removeSurface((*sprite)->getSurface());
diff --git a/engines/neverhood/scene.h b/engines/neverhood/scene.h
index f9e221a6da..35adb44ee8 100644
--- a/engines/neverhood/scene.h
+++ b/engines/neverhood/scene.h
@@ -49,6 +49,7 @@ public:
Sprite *addSprite(Sprite *sprite);
void removeSprite(Sprite *sprite);
void setSurfacePriority(BaseSurface *surface, int priority);
+ void setSpriteSurfacePriority(Sprite *sprite, int priority);
void deleteSprite(Sprite **sprite);
Background *addBackground(Background *background);
void setBackground(uint32 fileHash, bool dirtyBackground = true);