Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //**sound.h** line 73
- bool playPCM(const byte *data, uint32 size);
- bool isPlayingVoice(); // add
- void playVoice(const Common::String &filename, int num); // add
- //**sound.cpp** line 29
- #include "audio/decoders/raw.h"
- #include "audio/decoders/wave.h" // add
- #include "audio/mixer.h"
- //**sound.cpp** line 247
- bool Sound::isPlayingVoice() {
- Channel *ch = &_channels[0];
- if (_mixer->isSoundHandleActive(ch->handle)) {
- return true;
- }
- return false;
- }
- void Sound::playVoice(const Common::String &dlgFile, int num) {
- Common::String filename = Common::String::format("aud%s%d.wav", dlgFile.c_str(), num);
- Common::SeekableReadStream *stream = SearchMan.createReadStreamForMember(filename.c_str());
- if (!stream)
- return;
- _mixer->stopAll();
- Audio::AudioStream *input = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
- Channel *ch = &_channels[0];
- byte volume = 127;
- _mixer->playStream(Audio::Mixer::kSpeechSoundType, &ch->handle, input, -1, volume, 0, DisposeAfterUse::YES);
- }
- bool Sound::playPCM(const byte *data, uint32 size) {
- //**dialog.h** line 121
- Common::String _str;
- Common::String _filename;
- //**dgds.cpp** line 122
- const Common::FSNode gameDataDir(ConfMan.getPath("path"));
- SearchMan.addSubDirectoryMatching(gameDataDir, "patches");
- SearchMan.addSubDirectoryMatching(gameDataDir, "audio"); // add
- //**scene.cpp** line 935
- if (!haveTiredDlg) {
- Dialog dlg;
- dlg._filename = Common::String("S61.SDS"); // add
- dlg._num = TIRED_DLG_ID;
- //**scene.cpp** line 1018
- bool finished = false;
- if (clearDlgFlag || (dlg._state->_hideTime && timeNow >= dlg._state->_hideTime && !DgdsEngine::getInstance()->_soundPlayer->isPlayingVoice())) { // change
- finished = true;
- }
- //**dgds.cpp** line 41
- #include "dgds/menu.h"
- #include "dgds/sound.h" // add
- //**scene.h** line 172
- virtual bool parse(Common::SeekableReadStream *s, const Common::String &filename) = 0; // change
- //**scene.h** line 199
- bool readOpList(Common::SeekableReadStream *s, Common::Array<SceneOp> &list) const;
- bool readDialogList(Common::SeekableReadStream *s, Common::Array<Dialog> &list, const Common::String &filename, int16 filenum = 0) const; // change
- bool readTriggerList(Common::SeekableReadStream *s, Common::Array<SceneTrigger> &list) const;
- //**scene.h** line 219
- bool loadRestart(const Common::String &filename, ResourceManager *resourceManager, Decompressor *decompressor);
- bool parse(Common::SeekableReadStream *s, const Common::String &filename) override; // change
- bool parseInf(Common::SeekableReadStream *s);
- //**scene.h** line 275
- bool load(const Common::String &filename, ResourceManager *resourceManager, Decompressor *decompressor);
- bool parse(Common::SeekableReadStream *s, const Common::String &filename) override; // change
- void unload();
- //**scene.cpp** line 260
- bool Scene::readDialogList(Common::SeekableReadStream *s, Common::Array<Dialog> &list, const Common::String &filename, int16 filenum /* = 0 */) const { // change
- //**scene.cpp** line 268
- for (uint i = startsize; i < list.size(); i++) {
- Dialog &dst = list[i];
- dst._filename = filename; // add
- dst._num = s->readUint16LE();
- //**scene.cpp** line 535
- if (chunk.isSection(ID_SDS)) {
- result = parse(stream, filename); // change
- }
- //**scene.cpp** line 546
- bool SDSScene::parse(Common::SeekableReadStream *stream, const Common::String &filename) {
- //**scene.cpp** line 568
- if (isVersionUnder(" 1.214")) {
- readDialogList(stream, _dialogs, filename); // change
- }
- //**scene.cpp** line 720
- _version = fileVersion;
- result = readDialogList(stream, _dialogs, filename, fileNum);
- _version = oldVer;
- //**scene.cpp** line 1160
- DgdsEngine::getInstance()->_soundPlayer->playVoice(dlg._filename, dlg._num); // add
- int time = delay * (9 - engine->getTextSpeed());
- assert(dlg._state);
- //**scene.cpp** line 1721
- if (chunk.isSection(ID_GDS)) {
- // do nothing, this is the container.
- assert(chunk.isContainer());
- } else if (chunk.isSection(ID_INF)) {
- result = parseInf(stream);
- } else if (chunk.isSection(ID_SDS)) {
- result = parse(stream, filename); // change
- }
- //**scene.cpp** line 1912
- bool GDSScene::parse(Common::SeekableReadStream *stream, const Common::String &filename) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement