aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/neverhood/background.cpp5
-rw-r--r--engines/neverhood/background.h1
-rw-r--r--engines/neverhood/klayman.cpp87
-rw-r--r--engines/neverhood/klayman.h10
-rw-r--r--engines/neverhood/module2800.cpp402
-rw-r--r--engines/neverhood/module2800.h54
6 files changed, 541 insertions, 18 deletions
diff --git a/engines/neverhood/background.cpp b/engines/neverhood/background.cpp
index e235eaa1b3..03c531f40a 100644
--- a/engines/neverhood/background.cpp
+++ b/engines/neverhood/background.cpp
@@ -59,6 +59,11 @@ void Background::load(uint32 fileHash) {
// DirtyBackground
+DirtyBackground::DirtyBackground(NeverhoodEngine *vm, int objectPriority)
+ : Background(vm, objectPriority) {
+ // Empty
+}
+
DirtyBackground::DirtyBackground(NeverhoodEngine *vm, const char *fileName, int objectPriority, int surfacePriority)
: Background(vm, objectPriority) {
diff --git a/engines/neverhood/background.h b/engines/neverhood/background.h
index 8ac3581a51..d8f624b73d 100644
--- a/engines/neverhood/background.h
+++ b/engines/neverhood/background.h
@@ -46,6 +46,7 @@ protected:
class DirtyBackground : public Background {
public:
+ DirtyBackground(NeverhoodEngine *vm, int objectPriority);
DirtyBackground(NeverhoodEngine *vm, const char *fileName, int objectPriority, int surfacePriority);
DirtyBackground(NeverhoodEngine *vm, uint32 fileHash, int objectPriority, int surfacePriority);
void createSurface(int surfacePriority, int16 width, int16 height);
diff --git a/engines/neverhood/klayman.cpp b/engines/neverhood/klayman.cpp
index 3e8c007339..f69686aa66 100644
--- a/engines/neverhood/klayman.cpp
+++ b/engines/neverhood/klayman.cpp
@@ -2278,6 +2278,27 @@ void Klayman::sub420460() {
}
}
+void Klayman::sub420500() {
+ _status2 = 1;
+ _acceptInput = false;
+ startAnimationByHash(0x00AB8C10, 0x320AC306, 0);
+ SetUpdateHandler(&Klayman::update);
+ SetSpriteUpdate(NULL);
+ SetMessageHandler(&Klayman::handleMessage41F0E0);
+ NextState(&Klayman::stReleaseRing);
+}
+
+uint32 Klayman::handleMessage41F0E0(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = handleMessage41D480(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x100D:
+ if (param.asInteger() == 0x320AC306)
+ _soundResource1.play(0x5860C640);
+ break;
+ }
+ return messageResult;
+}
+
//##############################################################################
// KmScene1001
@@ -5266,6 +5287,69 @@ uint32 KmScene2801::xHandleMessage(int messageNum, const MessageParam &param) {
return 0;
}
+KmScene2803::KmScene2803(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y, NRect *clipRects, int clipRectsCount)
+ : Klayman(vm, parentScene, x, y, 1000, 1000) {
+
+ // TODO ClipRects stuff
+ _dataResource.load(0x00900849);
+}
+
+uint32 KmScene2803::xHandleMessage(int messageNum, const MessageParam &param) {
+ switch (messageNum) {
+ case 0x4001:
+ case 0x4800:
+ startWalkToX(param.asPoint().x, false);
+ break;
+ case 0x4004:
+ GotoState(&Klayman::stTryStandIdle);
+ break;
+ case 0x4803:
+ _destY = param.asInteger();
+ GotoState(&Klayman::sub4204C0);
+ break;
+ case 0x4804:
+ if (param.asInteger() == 3)
+ GotoState(&Klayman::sub421230);
+ break;
+ case 0x480D:
+ GotoState(&Klayman::sub420F60);
+ break;
+ case 0x4817:
+ setDoDeltaX(param.asInteger());
+ gotoNextStateExt();
+ break;
+ case 0x4818:
+ startWalkToX(_dataResource.getPoint(param.asInteger()).x, false);
+ break;
+ case 0x481D:
+ GotoState(&Klayman::stTurnToUse);
+ break;
+ case 0x481E:
+ GotoState(&Klayman::stReturnFromUse);
+ break;
+ case 0x481F:
+ if (param.asInteger() == 1) {
+ GotoState(&Klayman::stWonderAboutAfter);
+ } else {
+ GotoState(&Klayman::stWonderAboutHalf);
+ }
+ break;
+ case 0x482E:
+ GotoState(&Klayman::stWalkToFront);
+ break;
+ case 0x482F:
+ GotoState(&Klayman::stTurnToBack);
+ break;
+ case 0x4834:
+ GotoState(&Klayman::stStepOver);
+ break;
+ case 0x4838:
+ GotoState(&Klayman::sub420500);
+ break;
+ }
+ return 0;
+}
+
KmScene2803b::KmScene2803b(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y)
: Klayman(vm, parentScene, x, y, 1000, 1000), _soundResource(vm) {
@@ -5807,8 +5891,7 @@ uint32 KmScene2810Small::xHandleMessage(int messageNum, const MessageParam &para
return 0;
}
-KmScene2810::KmScene2810(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y,
- NRect *clipRects, uint clipRectsCount)
+KmScene2810::KmScene2810(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y, NRect *clipRects, uint clipRectsCount)
: Klayman(vm, parentScene, x, y, 1000, 1000) {
// TODO ClipRects stuff
diff --git a/engines/neverhood/klayman.h b/engines/neverhood/klayman.h
index 18791ff623..6cfb0fc733 100644
--- a/engines/neverhood/klayman.h
+++ b/engines/neverhood/klayman.h
@@ -168,6 +168,9 @@ public:
void sub421270();
void sub420460();
+
+ void sub420500();
+ uint32 handleMessage41F0E0(int messageNum, const MessageParam &param, Entity *sender);
protected:
Entity *_parentScene;
@@ -582,6 +585,13 @@ protected:
uint32 xHandleMessage(int messageNum, const MessageParam &param);
};
+class KmScene2803 : public Klayman {
+public:
+ KmScene2803(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y, NRect *clipRects, int clipRectsCount);
+protected:
+ uint32 xHandleMessage(int messageNum, const MessageParam &param);
+};
+
class KmScene2803b : public Klayman {
public:
KmScene2803b(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y);
diff --git a/engines/neverhood/module2800.cpp b/engines/neverhood/module2800.cpp
index 2bf023cdd7..97fb18f9f2 100644
--- a/engines/neverhood/module2800.cpp
+++ b/engines/neverhood/module2800.cpp
@@ -77,12 +77,11 @@ void Module2800::createScene(int sceneNum, int which) {
break;
case 2:
// TODO Music18hList_play(0xD2FA4D14, 0, 2, 1);
- setGlobalVar(0x1860C990,1);//DEBUG
+ //setGlobalVar(0x1860C990,1);//DEBUG
if (getGlobalVar(0x1860C990))
_childObject = new Scene2803b(_vm, this, which);
- else {
- // TODO _childObject = new Scene2803(_vm, this, which);
- }
+ else
+ _childObject = new Scene2803(_vm, this, which);
break;
case 3:
_childObject = new Scene2804(_vm, this, which);
@@ -477,7 +476,7 @@ uint32 Scene2801::handleMessage(int messageNum, const MessageParam &param, Entit
return messageResult;
}
-Class488::Class488(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int16 x, int16 y)
+AsScene2803LightCord::AsScene2803LightCord(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int16 x, int16 y)
: AnimatedSprite(vm, 1100), _parentScene(parentScene), _fileHash1(fileHash1), _fileHash2(fileHash2),
_flag1(false), _flag2(false), _soundResource(vm) {
@@ -489,7 +488,7 @@ Class488::Class488(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, ui
sub4343C0();
}
-uint32 Class488::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+uint32 AsScene2803LightCord::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x100D:
@@ -511,7 +510,7 @@ uint32 Class488::handleMessage(int messageNum, const MessageParam &param, Entity
return messageResult;
}
-uint32 Class488::handleMessage434340(int messageNum, const MessageParam &param, Entity *sender) {
+uint32 AsScene2803LightCord::handleMessage434340(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x3002:
@@ -521,21 +520,21 @@ uint32 Class488::handleMessage434340(int messageNum, const MessageParam &param,
return messageResult;
}
-void Class488::sub434380() {
+void AsScene2803LightCord::sub434380() {
_flag2 = false;
_flag1 = true;
startAnimation(_fileHash2, 0, -1);
- SetMessageHandler(&Class488::handleMessage434340);
- NextState(&Class488::sub4343C0);
+ SetMessageHandler(&AsScene2803LightCord::handleMessage434340);
+ NextState(&AsScene2803LightCord::sub4343C0);
}
-void Class488::sub4343C0() {
+void AsScene2803LightCord::sub4343C0() {
_flag1 = false;
startAnimation(_fileHash1, 0, -1);
- SetMessageHandler(&Class488::handleMessage);
+ SetMessageHandler(&AsScene2803LightCord::handleMessage);
}
-void Class488::setFileHashes(uint32 fileHash1, uint32 fileHash2) {
+void AsScene2803LightCord::setFileHashes(uint32 fileHash1, uint32 fileHash2) {
_fileHash1 = fileHash1;
_fileHash2 = fileHash2;
if (_flag1) {
@@ -546,6 +545,381 @@ void Class488::setFileHashes(uint32 fileHash1, uint32 fileHash2) {
}
}
+AsScene2803TestTubeOne::AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileHash1, uint32 fileHash2)
+ : AnimatedSprite(vm, 1200), _fileHash1(fileHash1), _fileHash2(fileHash2) {
+
+ createSurface1(fileHash1, 100);
+ SetUpdateHandler(&AnimatedSprite::update);
+ SetMessageHandler(&AsScene2803TestTubeOne::handleMessage);
+ _x = 529;
+ _y = 326;
+}
+
+uint32 AsScene2803TestTubeOne::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x2000:
+ if (param.asInteger())
+ startAnimation(_fileHash2, 0, -1);
+ else
+ startAnimation(_fileHash1, 0, -1);
+ break;
+ }
+ return messageResult;
+}
+
+AsScene2803Rope::AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x)
+ : AnimatedSprite(vm, 1100), _parentScene(parentScene) {
+
+ createSurface(990, 68, 476);
+ SetUpdateHandler(&AnimatedSprite::update);
+ SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
+ SetMessageHandler(&AsScene2803Rope::handleMessage);
+ startAnimation(0x9D098C23, 35, 53);
+ NextState(&AsScene2803Rope::sub476A70);
+ _x = x;
+ _y = -276;
+}
+
+uint32 AsScene2803Rope::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x3002:
+ startAnimation(0x9D098C23, 50, -1);
+ SetMessageHandler(&AsScene2803Rope::handleMessage4769E0);
+ break;
+ case 0x482A:
+ sendMessage(_parentScene, 0x1022, 990);
+ break;
+ case 0x482B:
+ sendMessage(_parentScene, 0x1022, 1010);
+ break;
+ }
+ return messageResult;
+}
+
+uint32 AsScene2803Rope::handleMessage4769E0(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x3002:
+ gotoNextState();
+ break;
+ case 0x482A:
+ sendMessage(_parentScene, 0x1022, 990);
+ break;
+ case 0x482B:
+ sendMessage(_parentScene, 0x1022, 1010);
+ break;
+ }
+ return messageResult;
+}
+
+void AsScene2803Rope::sub476A70() {
+ startAnimation(0x8258A030, 0, 1);
+ NextState(&AsScene2803Rope::stHide);
+}
+
+void AsScene2803Rope::stHide() {
+ stopAnimation();
+ setVisible(false);
+}
+
+Scene2803::Scene2803(NeverhoodEngine *vm, Module *parentModule, int which)
+ : Scene(vm, parentModule, true), _field134(0) {
+
+ static const uint32 kScene2803FileHashes1[] = {
+ 0,
+ 0x081000F1,
+ 0x08100171,
+ 0x08100271
+ };
+
+ static const uint32 kScene2803FileHashes2[] = {
+ 0,
+ 0x286800D4,
+ 0x286806D4,
+ 0x28680AD4
+ };
+
+ setGlobalVar(0x1C1B8A9A, 1);
+ _vm->gameModule()->initScene2808Vars1();
+
+ SetMessageHandler(&Scene2803::handleMessage);
+
+ loadDataResource(0x00900849);
+
+ _surfaceFlag = true;
+
+ _background = new DirtyBackground(_vm, 0);
+ _background->createSurface(0, 640, 480);
+ addBackground(_background);
+
+ setPalette(0x412A423E);
+ addEntity(_palette);
+
+ insertMouse433(0xA423A41A);
+
+ if (getSubVar(0x0C601058, 0) == 0) {
+ _asTestTubeOne = (StaticSprite*)insertStaticSprite(0x66121222, 100);
+ } else {
+ _asTestTubeOne = (StaticSprite*)insertSprite<AsScene2803TestTubeOne>(
+ kScene2803FileHashes1[getSubVar(0x0C601058, 0)],
+ kScene2803FileHashes2[getSubVar(0x0C601058, 0)]);
+ }
+
+ if (getSubVar(0x0C601058, 1) == 3)
+ _asTestTubeTwo = (StaticSprite*)insertStaticSprite(0x64330236, 100);
+
+ if (getSubVar(0x0C601058, 2) == 3)
+ _asTestTubeThree = (StaticSprite*)insertStaticSprite(0x2E4A22A2, 100);
+
+ _asLightCord = insertSprite<AsScene2803LightCord>(this, 0x8FAD5932, 0x276E1A3D, 578, 200);
+ _sprite3 = (StaticSprite*)insertStaticSprite(0xA40EF2FB, 1100);
+ _sprite4 = (StaticSprite*)insertStaticSprite(0x0C03AA23, 1100);
+ _sprite5 = (StaticSprite*)insertStaticSprite(0x2A822E2E, 1100);
+ _sprite6 = (StaticSprite*)insertStaticSprite(0x2603A202, 1100);
+ _sprite7 = (StaticSprite*)insertStaticSprite(0x24320220, 1100);
+ _sprite8 = (StaticSprite*)insertStaticSprite(0x3C42022F, 1100);
+ _sprite9 = (StaticSprite*)insertStaticSprite(0x341A0237, 1100);
+ _sprite10 = insertStaticSprite(0x855820A3, 1200);
+
+ _clipRects1[0].x1 = 0;
+ _clipRects1[0].y1 = 0;
+ _clipRects1[0].x2 = 640;
+ _clipRects1[0].y2 = _sprite8->getDrawRect().y2();
+
+ _clipRects1[1].x1 = _sprite8->getDrawRect().x2();
+ _clipRects1[1].y1 = _sprite8->getDrawRect().y2();
+ _clipRects1[1].x2 = 640;
+ _clipRects1[1].y2 = 480;
+
+ _clipRects2[0].x1 = _sprite5->getDrawRect().x;
+ _clipRects2[0].y1 = 0;
+ _clipRects2[0].x2 = _sprite5->getDrawRect().x2();
+ _clipRects2[0].y2 = _sprite5->getDrawRect().y2();
+
+ _clipRects2[1].x1 = _sprite6->getDrawRect().x;
+ _clipRects2[1].y1 = 0;
+ _clipRects2[1].x2 = _sprite3->getDrawRect().x;
+ _clipRects2[1].y2 = _sprite6->getDrawRect().y2();
+
+ _clipRects2[2].x1 = _sprite3->getDrawRect().x;
+ _clipRects2[2].y1 = 0;
+ _clipRects2[2].x2 = _sprite4->getDrawRect().x2();
+ _clipRects2[2].y2 = 480;
+
+ if (which < 0) {
+ insertKlayman<KmScene2803>(302, 445, _clipRects1, 2);
+ setMessageList(0x004B79F0);
+ sub476090();
+ } else if (which == 1) {
+ insertKlayman<KmScene2803>(200, 445, _clipRects1, 2);
+ setMessageList(0x004B79C8);
+ sub476090();
+ } else if (which == 3) {
+ NPoint pt = _dataResource.getPoint(0xC2A08694);
+ insertKlayman<KmScene2803>(pt.x, pt.y, _clipRects2, 3);
+ setMessageList(0x004B7A00);
+ sub475FF0();
+ } else if (which == 5) {
+ insertKlayman<KmScene2803>(253, 298, _clipRects2, 3);
+ setMessageList(0x004B7A00);
+ sub475FF0();
+ } else if (which == 6) {
+ _asRope = insertSprite<AsScene2803Rope>(this, 384);
+ _asRope->setClipRect(0, 25, 640, 480);
+ insertKlayman<KmScene2803>(384, 0, _clipRects1, 2);
+ sendEntityMessage(_klayman, 0x1014, _asRope);
+ _klayman->setClipRect(0, 25, 640, 480);
+ setMessageList(0x004B7A78);
+ sub476090();
+ } else if (which == 2) {
+ insertKlayman<KmScene2803>(400, 445, _clipRects1, 2);
+ setMessageList(0x004B79F8);
+ sub476090();
+ } else {
+ insertKlayman<KmScene2803>(50, 231, _clipRects2, 3);
+ setMessageList(0x004B79C0);
+ sub475FF0();
+ }
+
+ sub476180();
+
+}
+
+void Scene2803::update475E40() {
+ if (_klayman->getX() < 350) {
+ sub4765D0();
+ } else {
+ sub4765F0();
+ }
+ Scene::update();
+}
+
+uint32 Scene2803::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x480F:
+ sub476130();
+ // NOTE Intentional fall-through
+ case 0x100D:
+ if (param.asInteger() == 0x84251F82)
+ setMessageList(0x004B7A50);
+ else if (param.asInteger() == 0x4254A2D2)
+ setMessageList(0x004B7A58);
+ else if (param.asInteger() == 0xE90A40A0)
+ setMessageList(0x004B7A08);
+ else if (param.asInteger() == 0x482D1210)
+ setMessageList(0x004B7A30);
+ else if (param.asInteger() == 0x802402B2) {
+ sendEntityMessage(_klayman, 0x1014, _asLightCord);
+ setMessageList(0x004B7A68);
+ } else if (param.asInteger() == 0x9626F390)
+ setMessageList(0x004B7A88);
+ break;
+ case 0x482A:
+ sub475FF0();
+ sub4765F0();
+ break;
+ case 0x482B:
+ sub476090();
+ sub4765D0();
+ break;
+ }
+ return messageResult;
+}
+
+void Scene2803::sub475FF0() {
+ SetUpdateHandler(&Scene2803::update475E40);
+ // TODO _klayman->setClipRects(_clipRects2, 3);
+ sendMessage(_klayman, 0x482C, 0xE5A48297);
+ _sprite3->setVisible(true);
+ _sprite4->setVisible(true);
+ _sprite5->setVisible(true);
+ _sprite6->setVisible(true);
+ _sprite7->setVisible(true);
+ _sprite8->setVisible(false);
+ _sprite9->setVisible(false);
+}
+
+void Scene2803::sub476090() {
+ SetUpdateHandler(&Scene::update);
+ // TODO _klayman->setClipRects(_clipRects1, 2);
+ sendMessage(_klayman, 0x482C, 0);
+ _sprite3->setVisible(false);
+ _sprite4->setVisible(false);
+ _sprite5->setVisible(false);
+ _sprite6->setVisible(false);
+ _sprite7->setVisible(false);
+ _sprite8->setVisible(true);
+ _sprite9->setVisible(true);
+}
+
+void Scene2803::sub476130() {
+ setGlobalVar(0x190A1D18, getGlobalVar(0x190A1D18) ? 0 : 1);
+ sub476180();
+}
+
+void Scene2803::sub476180() {
+ // TODO? g_screen->resetDirtyRects();
+ if (getGlobalVar(0x190A1D18)) {
+ _asLightCord->setFileHashes(0x8FAD5932, 0x276E1A3D);
+ _background->load(0x412A423E);
+ _palette->addPalette(0x412A423E, 0, 256, 0);
+ _palette->addBasePalette(0x412A423E, 0, 256, 0);
+ _sprite3->load(0xA40EF2FB, false, false);
+ _sprite3->update();
+ _sprite4->load(0x0C03AA23, false, false);
+ _sprite4->update();
+ _sprite5->load(0x2A822E2E, false, false);
+ _sprite5->update();
+ _sprite6->load(0x2603A202, false, false);
+ _sprite6->update();
+ _sprite7->load(0x24320220, false, false);
+ _sprite7->update();
+ _mouseCursor->load(0xA423A41A);
+ _mouseCursor->updateCursor();
+ _sprite8->load(0x3C42022F, false, false);
+ _sprite8->update();
+ _sprite9->load(0x341A0237, false, false);
+ _sprite9->update();
+ if (getSubVar(0x0C601058, 0) == 0) {
+ _asTestTubeOne->load(0x66121222, false, false);
+ _asTestTubeOne->update();
+ } else
+ sendMessage(_asTestTubeOne, 0x2000, 0);
+ if (getSubVar(0x0C601058, 1) == 3) {
+ _asTestTubeTwo->load(0x64330236, false, false);
+ _asTestTubeTwo->update();
+ }
+ if (getSubVar(0x0C601058, 2) == 3) {
+ _asTestTubeThree->load(0x2E4A22A2, false, false);
+ _asTestTubeThree->update();
+ }
+ _sprite10->setVisible(true);
+ } else {
+ _asLightCord->setFileHashes(0xAFAD591A, 0x276E321D);
+ _background->load(0x29800A01);
+ _palette->addPalette(0x29800A01, 0, 256, 0);
+ _palette->addBasePalette(0x29800A01, 0, 256, 0);
+ _sprite3->load(0x234340A0, false, false);
+ _sprite3->update();
+ _sprite4->load(0x16202200, false, false);
+ _sprite4->update();
+ _sprite5->load(0x1030169A, false, false);
+ _sprite5->update();
+ _sprite6->load(0x1600A6A8, false, false);
+ _sprite6->update();
+ _sprite7->load(0xD0802EA0, false, false);
+ _sprite7->update();
+ _mouseCursor->load(0x00A05290);
+ _mouseCursor->updateCursor();
+ _sprite8->load(0x108012C1, false, false);
+ _sprite8->update();
+ _sprite9->load(0x708072E0, false, false);
+ _sprite9->update();
+ if (getSubVar(0x0C601058, 0) == 0) {
+ _asTestTubeOne->load(0x50C027A8, false, false);
+ _asTestTubeOne->update();
+ } else
+ sendMessage(_asTestTubeOne, 0x2000, 1);
+ if (getSubVar(0x0C601058, 1) == 3) {
+ _asTestTubeTwo->load(0xD48077A0, false, false);
+ _asTestTubeTwo->update();
+ }
+ if (getSubVar(0x0C601058, 2) == 3) {
+ _asTestTubeThree->load(0x30022689, false, false);
+ _asTestTubeThree->update();
+ }
+ _sprite10->setVisible(false);
+ }
+ sub476610();
+}
+
+void Scene2803::sub4765D0() {
+ if (_field134) {
+ _field134 = 0;
+ sub476610();
+ }
+}
+
+void Scene2803::sub4765F0() {
+ if (!_field134) {
+ _field134 = 1;
+ sub476610();
+ }
+}
+
+void Scene2803::sub476610() {
+ uint32 fadePaletteHash;
+ if (getGlobalVar(0x190A1D18))
+ fadePaletteHash = _field134 ? 0xB103B604 : 0x412A423E;
+ else
+ fadePaletteHash = _field134 ? 0x0263D144 : 0x29800A01;
+ _palette->addBasePalette(fadePaletteHash, 0, 64, 0);
+ _palette->startFadeToPalette(12);
+}
+
Scene2803b::Scene2803b(NeverhoodEngine *vm, Module *parentModule, int which)
: Scene(vm, parentModule, true), _palStatus(0) {
@@ -563,7 +937,7 @@ Scene2803b::Scene2803b(NeverhoodEngine *vm, Module *parentModule, int which)
loadDataResource(0x81120132);
insertMouse433(0x00A05290);
- insertSprite<Class488>(this, 0xAFAD591A, 0x276E321D, 578, 200);
+ insertSprite<AsScene2803LightCord>(this, 0xAFAD591A, 0x276E321D, 578, 200);
if (getGlobalVar(0x190A1D18)) {
setBackground(0x412A423E);
diff --git a/engines/neverhood/module2800.h b/engines/neverhood/module2800.h
index 9daf820e21..50db1615c8 100644
--- a/engines/neverhood/module2800.h
+++ b/engines/neverhood/module2800.h
@@ -54,9 +54,9 @@ protected:
uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
};
-class Class488 : public AnimatedSprite {
+class AsScene2803LightCord : public AnimatedSprite {
public:
- Class488(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int16 x, int16 y);
+ AsScene2803LightCord(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int16 x, int16 y);
void sub434380();
void sub4343C0();
void setFileHashes(uint32 fileHash1, uint32 fileHash2);
@@ -69,6 +69,56 @@ protected:
uint32 handleMessage434340(int messageNum, const MessageParam &param, Entity *sender);
};
+class AsScene2803TestTubeOne : public AnimatedSprite {
+public:
+ AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileHash1, uint32 fileHash2);
+protected:
+ uint32 _fileHash1, _fileHash2;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class AsScene2803Rope : public AnimatedSprite {
+public:
+ AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x);
+protected:
+ Scene *_parentScene;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ uint32 handleMessage4769E0(int messageNum, const MessageParam &param, Entity *sender);
+ void sub476A70();
+ void stHide();
+};
+
+class Scene2803 : public Scene {
+public:
+ Scene2803(NeverhoodEngine *vm, Module *parentModule, int which);
+protected:
+ StaticSprite *_asTestTubeOne;
+ StaticSprite *_asTestTubeTwo;
+ StaticSprite *_asTestTubeThree;
+ Sprite *_asRope;
+ AsScene2803LightCord *_asLightCord;
+ StaticSprite *_sprite3;
+ StaticSprite *_sprite4;
+ StaticSprite *_sprite5;
+ StaticSprite *_sprite6;
+ StaticSprite *_sprite7;
+ StaticSprite *_sprite8;
+ StaticSprite *_sprite9;
+ Sprite *_sprite10;
+ NRect _clipRects1[2];
+ NRect _clipRects2[3];
+ bool _field134;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ void update475E40();
+ void sub475FF0();
+ void sub476090();
+ void sub476130();
+ void sub476180();
+ void sub4765D0();
+ void sub4765F0();
+ void sub476610();
+};
+
class Scene2803b : public Scene {
public:
Scene2803b(NeverhoodEngine *vm, Module *parentModule, int which);