mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 09:23:37 +00:00
STARK: Suspend the script while running opSpeakWithoutTalking
This commit is contained in:
parent
3438afcd42
commit
756a8bf383
@ -98,7 +98,7 @@ Command *Command::execute(uint32 callMode, Script *script) {
|
||||
case kActivateMesh:
|
||||
return opActivateMesh(_arguments[1].referenceValue);
|
||||
case kSpeakWithoutTalking:
|
||||
return opSpeakWithoutTalking(_arguments[1].referenceValue, _arguments[2].intValue);
|
||||
return opSpeakWithoutTalking(script, _arguments[1].referenceValue, _arguments[2].intValue);
|
||||
case kIsOnFloorField:
|
||||
return opIsOnFloorField(_arguments[0].intValue, _arguments[1].intValue, _arguments[2].referenceValue, _arguments[3].referenceValue);
|
||||
case kIsSet:
|
||||
@ -333,14 +333,20 @@ Command *Command::opActivateMesh(const ResourceReference &meshRef) {
|
||||
return nextCommand();
|
||||
}
|
||||
|
||||
Command *Command::opSpeakWithoutTalking(const ResourceReference &speechRef, int32 unknown) {
|
||||
Command *Command::opSpeakWithoutTalking(Script *script, const ResourceReference &speechRef, int32 suspend) {
|
||||
assert(_arguments.size() == 3);
|
||||
Speech *speechObj = speechRef.resolve<Speech>();
|
||||
warning("(TODO: Implement) opSpeakWithoutTalking(%s, %d) : %s", speechObj->getName().c_str(), unknown, speechRef.describe().c_str());
|
||||
Speech *speech = speechRef.resolve<Speech>();
|
||||
warning("(TODO: Implement) opSpeakWithoutTalking(%s, %d) : %s", speech->getName().c_str(), suspend, speechRef.describe().c_str());
|
||||
|
||||
// TODO: Block further calls untill it'd done
|
||||
speechObj->playSound();
|
||||
return nextCommand();
|
||||
// TODO: Complete
|
||||
speech->playSound();
|
||||
|
||||
if (suspend) {
|
||||
script->suspend(speech);
|
||||
return this; // Stay on the same command while suspended
|
||||
} else {
|
||||
return nextCommand();
|
||||
}
|
||||
}
|
||||
|
||||
Command *Command::opIsOnFloorField(int branch1, int branch2, const ResourceReference &itemRef, const ResourceReference &floorFieldRef) {
|
||||
|
@ -154,7 +154,7 @@ protected:
|
||||
Command *opItemPlaceDirection(const ResourceReference &itemRef, int32 direction);
|
||||
Command *opActivateTexture(const ResourceReference &textureRef);
|
||||
Command *opActivateMesh(const ResourceReference &meshRef);
|
||||
Command *opSpeakWithoutTalking(const ResourceReference &speechRef, int32 unknown);
|
||||
Command *opSpeakWithoutTalking(Script *script, const ResourceReference &speechRef, int32 unknown);
|
||||
Command *opIsOnFloorField(int branch1, int branch2, const ResourceReference &itemRef, const ResourceReference &floorFieldRef);
|
||||
Command *opIsSet(int branch1, int branch2, const ResourceReference &knowledgeRef);
|
||||
Command *opIsRandom(int branch1, int branch2, int32 unknown);
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "engines/stark/resources/command.h"
|
||||
#include "engines/stark/resources/item.h"
|
||||
#include "engines/stark/resources/sound.h"
|
||||
#include "engines/stark/resources/speech.h"
|
||||
#include "engines/stark/services/dialogplayer.h"
|
||||
#include "engines/stark/services/global.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
@ -197,6 +198,14 @@ void Script::updateSuspended() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Type::kSpeech: {
|
||||
Speech *speech = Object::cast<Speech>(_suspendingResource);
|
||||
if (!speech->isPlaying()) {
|
||||
// Resume the script execution once the speech has stopped playing
|
||||
_suspendingResource = nullptr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
error("Unhandled suspending resource type %s", _suspendingResource->getType().getName());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user