Skip to content

Commit

Permalink
NEVERHOOD: Change sound stuff in Module2100
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoe123 authored and wjp committed May 8, 2013
1 parent a8dda6c commit 78df19c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 5 additions & 5 deletions engines/neverhood/module2100.cpp
Expand Up @@ -78,7 +78,7 @@ void Module2100::updateScene() {
// Scene2101

Class538::Class538(NeverhoodEngine *vm, bool flag)
: AnimatedSprite(vm, 1100), _soundResource(vm) {
: AnimatedSprite(vm, 1100) {

// TODO createSurface3(100, dword_4B9018);
createSurface(100, 640, 480); //TODO: Remove once the line above is done
Expand Down Expand Up @@ -114,15 +114,15 @@ void Class538::openDoor() {
startAnimation(0x0C202B9C, 0, -1);
_newStickFrameIndex = -2;
setVisible(true);
_soundResource.play(calcHash("fxDoorOpen32"));
playSound(0, calcHash("fxDoorOpen32"));
}

void Class538::closeDoor() {
startAnimation(0xC222A8D4, 0, -1);
_newStickFrameIndex = -2;
setVisible(true);
NextState(&Class538::hide);
_soundResource.play(calcHash("fxDoorClose32"));
playSound(0, calcHash("fxDoorClose32"));
}

void Class538::hide() {
Expand Down Expand Up @@ -157,7 +157,7 @@ uint32 Class539::handleMessage(int messageNum, const MessageParam &param, Entity
}

Class427::Class427(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int surfacePriority, uint32 soundFileHash)
: StaticSprite(vm, 1100), _soundResource(vm), _parentScene(parentScene), _countdown(0),
: StaticSprite(vm, 1100), _parentScene(parentScene), _countdown(0),
_fileHash1(fileHash1), _fileHash2(fileHash2), _soundFileHash(soundFileHash) {

SetUpdateHandler(&Class427::update);
Expand Down Expand Up @@ -193,7 +193,7 @@ uint32 Class427::handleMessage(int messageNum, const MessageParam &param, Entity
load(_fileHash2, true, true);
StaticSprite::update();
_countdown = 16;
_soundResource.play(_soundFileHash);
playSound(0, _soundFileHash);
break;
}
return messageResult;
Expand Down
2 changes: 0 additions & 2 deletions engines/neverhood/module2100.h
Expand Up @@ -45,7 +45,6 @@ class Class538 : public AnimatedSprite {
public:
Class538(NeverhoodEngine *vm, bool flag);
protected:
SoundResource _soundResource;
uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
void openDoor();
void closeDoor();
Expand All @@ -65,7 +64,6 @@ class Class427 : public StaticSprite {
Class427(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int surfacePriority, uint32 soundFileHash);
protected:
Scene *_parentScene;
SoundResource _soundResource;
uint32 _soundFileHash;
uint32 _fileHash1, _fileHash2;
int16 _countdown;
Expand Down

0 comments on commit 78df19c

Please sign in to comment.