HYPNO: added sound action implementation, needed to fix some missing sounds in spider

This commit is contained in:
neuromancer 2022-05-30 23:49:26 +02:00
parent 09e2b6b567
commit d85a1c53b0
4 changed files with 19 additions and 0 deletions

View File

@ -174,6 +174,10 @@ void HypnoEngine::runPlay(Play *a) {
}
}
void HypnoEngine::runSound(Sound *a) {
playSound(a->path, 1);
}
void HypnoEngine::runAmbient(Ambient *a) {
if (a->flag == "/BITMAP") {
Graphics::Surface *frame = decodeFrame(a->path, a->frameNumber);

View File

@ -80,6 +80,7 @@ enum ActionType {
GlobalAction,
TalkAction,
SwapPointerAction,
SoundAction,
ChangeLevelAction
};
@ -235,6 +236,15 @@ public:
Filename path;
};
class Sound : public Action {
public:
Sound(Filename path_) {
type = SoundAction;
path = path_;
}
Filename path;
};
class Intro : public Action {
public:
Intro(Filename path_) {

View File

@ -189,6 +189,7 @@ public:
void runCutscene(Cutscene *a);
void runIntro(Intro *a);
void runPlay(Play *a);
void runSound(Sound *a);
void runPalette(Palette *a);
void runAmbient(Ambient *a);
void runWalN(WalN *a);

View File

@ -172,6 +172,10 @@ void HypnoEngine::clickedHotspot(Common::Point mousePos) {
runPlay((Play *)action);
break;
case SoundAction:
runSound((Sound *)action);
break;
case WalNAction:
runWalN((WalN *)action);
break;