Skip to content

Commit

Permalink
NEVERHOOD: Start with Module1300 and implement Scene1302
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoe123 authored and wjp committed May 8, 2013
1 parent 5214284 commit d4030b7
Show file tree
Hide file tree
Showing 6 changed files with 831 additions and 4 deletions.
31 changes: 30 additions & 1 deletion engines/neverhood/gamemodule.cpp
Expand Up @@ -25,6 +25,7 @@
#include "neverhood/graphics.h"
#include "neverhood/module1000.h"
#include "neverhood/module1200.h"
#include "neverhood/module1300.h"
#include "neverhood/module1400.h"
#include "neverhood/module1500.h"
#include "neverhood/module1700.h"
Expand Down Expand Up @@ -241,10 +242,14 @@ void GameModule::startup() {
_vm->gameState().sceneNum = 0;
createModule2000(-1);
#endif
#if 1
#if 0
_vm->gameState().sceneNum = 46;
createModule2200(-1);
#endif
#if 1
_vm->gameState().sceneNum = 1;
createModule1300(-1);
#endif
}

void GameModule::createModule1000(int which) {
Expand Down Expand Up @@ -292,6 +297,30 @@ void GameModule::updateModule1200() {
}
}

void GameModule::createModule1300(int which) {
setGlobalVar(0x91080831, 0x0061C090);
_childObject = new Module1300(_vm, this, which);
SetUpdateHandler(&GameModule::updateModule1300);
}

void GameModule::updateModule1300() {
if (!_childObject)
return;
_childObject->handleUpdate();
if (_done) {
_done = false;
delete _childObject;
_childObject = NULL;
if (_field20 == 1) {
// TODO _gameState.clear();
// TODO GameModule_handleKeyEscape
} else {
// TODO createModule2900(0);
_childObject->handleUpdate();
}
}
}

void GameModule::createModule1400(int which) {
setGlobalVar(0x91080831, 0x00AD0012);
_childObject = new Module1400(_vm, this, which);
Expand Down
2 changes: 2 additions & 0 deletions engines/neverhood/gamemodule.h
Expand Up @@ -55,6 +55,8 @@ class GameModule : public Module {
void updateModule1000();
void createModule1200(int which);
void updateModule1200();
void createModule1300(int which);
void updateModule1300();
void createModule1400(int which);
void updateModule1400();
void createModule1500(int which);
Expand Down
1 change: 1 addition & 0 deletions engines/neverhood/module.mk
Expand Up @@ -13,6 +13,7 @@ MODULE_OBJS = \
module.o \
module1000.o \
module1200.o \
module1300.o \
module1400.o \
module1500.o \
module1700.o \
Expand Down
5 changes: 2 additions & 3 deletions engines/neverhood/module1000.cpp
Expand Up @@ -1045,7 +1045,7 @@ AsScene1002VenusFlyTrap::AsScene1002VenusFlyTrap(NeverhoodEngine *vm, Scene *par
SetMessageHandler(&AsScene1002VenusFlyTrap::handleMessage448000);
SetSpriteCallback(&AnimatedSprite::updateDeltaXY);

if (!flag) {
if (!_flag) {
if (getGlobalVar(0x8306F218)) {
setDoDeltaX(1);
_x = 366;
Expand Down Expand Up @@ -1110,7 +1110,7 @@ uint32 AsScene1002VenusFlyTrap::handleMessage448000(int messageNum, const Messag
break;
case 0x480B:
setDoDeltaX(param.asInteger() != 0 ? 1 : 0);
if (_flag) {
if (!_flag) {
if (getGlobalVar(0x8306F218)) {
sub448560();
} else {
Expand Down Expand Up @@ -1143,7 +1143,6 @@ uint32 AsScene1002VenusFlyTrap::handleMessage448000(int messageNum, const Messag
}
break;
case 0x4810:
debug("trap collision");
sub448780();
break;
case 0x482A:
Expand Down

0 comments on commit d4030b7

Please sign in to comment.