Skip to content

Commit

Permalink
PEGASUS: Push the sound spots file name to subclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Hoops committed Sep 28, 2011
1 parent c581cb1 commit d0914e6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 36 deletions.
36 changes: 1 addition & 35 deletions engines/pegasus/neighborhood/neighborhood.cpp
Expand Up @@ -131,7 +131,7 @@ void Neighborhood::init() {
_navMovie.initFromMovieFile(getNavMovieName());
_navMovie.setVolume(_vm->getSoundFXLevel());

loadSoundSpots();
_spotSounds.initFromQuickTime(getSoundSpotsName());
_spotSounds.setVolume(_vm->getSoundFXLevel());

_navMovie.setDisplayOrder(kNavMovieOrder);
Expand Down Expand Up @@ -367,40 +367,6 @@ void Neighborhood::createNeighborhoodSpots() {
delete hotspotList;
}

void Neighborhood::loadSoundSpots() {
// TODO: Eventually push to the subclasses

Common::String fileName = "Sounds/";

switch (getObjectID()) {
case kCaldoriaID:
fileName += "Caldoria/Caldoria Spots";
break;
case kFullTSAID:
case kFinalTSAID:
case kTinyTSAID:
fileName += "TSA/TSA Spots";
break;
case kPrehistoricID:
fileName += "Prehistoric/Prehistoric Spots";
break;
case kMarsID:
fileName += "Mars/Mars Spots";
break;
case kWSCID:
fileName += "World Science Center/WSC Spots";
break;
case kNoradAlphaID:
fileName += "Norad/Norad Alpha Spots";
break;
case kNoradDeltaID:
fileName += "Norad/Norad Delta Spots";
break;
}

_spotSounds.initFromQuickTime(fileName);
}

void Neighborhood::popActionQueue() {
if (!_actionQueue.empty()) {
tQueueRequest topRequest = _actionQueue.pop();
Expand Down
2 changes: 1 addition & 1 deletion engines/pegasus/neighborhood/neighborhood.h
Expand Up @@ -253,7 +253,7 @@ friend void timerFunction(FunctionPtr *, void *);
PegasusEngine *_vm;
Common::String _resName;

virtual void loadSoundSpots();
virtual Common::String getSoundSpotsName() = 0;
virtual Common::String getNavMovieName() = 0;

// Notification function.
Expand Down
4 changes: 4 additions & 0 deletions engines/pegasus/neighborhood/prehistoric.cpp
Expand Up @@ -682,4 +682,8 @@ Common::String Prehistoric::getNavMovieName() {
return "Images/Prehistoric/Prehistoric.movie";
}

Common::String Prehistoric::getSoundSpotsName() {
return "Sounds/Prehistoric/Prehistoric Spots";
}

} // End of namespace Pegasus
1 change: 1 addition & 0 deletions engines/pegasus/neighborhood/prehistoric.h
Expand Up @@ -150,6 +150,7 @@ class Prehistoric : public Neighborhood {
FlagsArray<byte, kNumPrehistoricPrivateFlags> _privateFlags;

Common::String getNavMovieName();
Common::String getSoundSpotsName();
};

} // End of namespace Pegasus
Expand Down

0 comments on commit d0914e6

Please sign in to comment.