Skip to content

Commit

Permalink
NEVERHOOD: Implement the SoundMan; no sound is played yet since the i…
Browse files Browse the repository at this point in the history
…mportant code doesn't exist yet
  • Loading branch information
johndoe123 authored and wjp committed May 8, 2013
1 parent 96153bf commit 65afa25
Show file tree
Hide file tree
Showing 7 changed files with 551 additions and 0 deletions.
1 change: 1 addition & 0 deletions engines/neverhood/module.mk
Expand Up @@ -41,6 +41,7 @@ MODULE_OBJS = \
screen.o \
smackerscene.o \
smackerplayer.o \
sound.o \
sprite.o \
staticdata.o

Expand Down
4 changes: 4 additions & 0 deletions engines/neverhood/neverhood.cpp
Expand Up @@ -35,6 +35,7 @@
#include "neverhood/resourceman.h"
#include "neverhood/resource.h"
#include "neverhood/screen.h"
#include "neverhood/sound.h"
#include "neverhood/staticdata.h"

namespace Neverhood {
Expand Down Expand Up @@ -98,6 +99,8 @@ Common::Error NeverhoodEngine::run() {

#if 1

_soundMan = new SoundMan(this);

_collisionMan = new CollisionMan(this);
_gameModule = new GameModule(this);

Expand Down Expand Up @@ -145,6 +148,7 @@ Common::Error NeverhoodEngine::run() {

delete _gameModule;
delete _collisionMan;
delete _soundMan;
#endif


Expand Down
3 changes: 3 additions & 0 deletions engines/neverhood/neverhood.h
Expand Up @@ -45,6 +45,7 @@ class GameModule;
class GameVars;
class ResourceMan;
class Screen;
class SoundMan;
class StaticData;
struct NPoint;

Expand Down Expand Up @@ -84,6 +85,8 @@ class NeverhoodEngine : public ::Engine {
GameModule *_gameModule;
StaticData *_staticData;
CollisionMan *_collisionMan;

SoundMan *_soundMan;

public:

Expand Down
6 changes: 6 additions & 0 deletions engines/neverhood/resource.cpp
Expand Up @@ -654,12 +654,18 @@ bool SoundResource::isPlaying() {
void SoundResource::load(uint32 fileHash) {
}

void SoundResource::unload() {
}

void SoundResource::play(uint32 fileHash, bool looping) {
}

void SoundResource::play() {
}

void SoundResource::setVolume(int volume) {
}

uint32 calcHash(const char *value) {
uint32 hash = 0, shiftValue = 0;
while (*value != 0) {
Expand Down
2 changes: 2 additions & 0 deletions engines/neverhood/resource.h
Expand Up @@ -198,9 +198,11 @@ class SoundResource {
SoundResource(NeverhoodEngine *vm);
bool isPlaying();
void load(uint32 fileHash);
void unload();
void play(uint32 fileHash, bool looping = false);
void play();
void stop() { /*DUMMY*/ }
void setVolume(int volume);
protected:
NeverhoodEngine *_vm;
};
Expand Down

0 comments on commit 65afa25

Please sign in to comment.