[Scummvm-git-logs] scummvm master -> 826ad134ec0e18f588d5a06eb5b1326d2171d60f
dreammaster
paulfgilbert at gmail.com
Wed Nov 4 03:43:26 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
826ad134ec NUVIE: Further fixes and cleanup for U6 FM-Towns loading
Commit: 826ad134ec0e18f588d5a06eb5b1326d2171d60f
https://github.com/scummvm/scummvm/commit/826ad134ec0e18f588d5a06eb5b1326d2171d60f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-11-03T19:41:52-08:00
Commit Message:
NUVIE: Further fixes and cleanup for U6 FM-Towns loading
Changed paths:
engines/ultima/nuvie/core/converse.cpp
engines/ultima/nuvie/files/nuvie_io_file.cpp
engines/ultima/nuvie/sound/sound_manager.cpp
engines/ultima/nuvie/sound/towns_sfx_manager.cpp
diff --git a/engines/ultima/nuvie/core/converse.cpp b/engines/ultima/nuvie/core/converse.cpp
index bc01a6e7f5..0426026d9a 100644
--- a/engines/ultima/nuvie/core/converse.cpp
+++ b/engines/ultima/nuvie/core/converse.cpp
@@ -147,7 +147,7 @@ void Converse::reset() {
void Converse::load_conv(const Std::string &convfilename) {
string conv_lib_str;
if (gametype == NUVIE_GAME_U6 && using_fmtowns) {
- config->pathFromValue("config/townsdir", convfilename, conv_lib_str); //FIXME handle case insensitive filename here.
+ config->pathFromValue("config/townsdir", convfilename, conv_lib_str);
} else {
config_get_path(config, convfilename, conv_lib_str);
}
diff --git a/engines/ultima/nuvie/files/nuvie_io_file.cpp b/engines/ultima/nuvie/files/nuvie_io_file.cpp
index ec814911f6..32be6b9f26 100644
--- a/engines/ultima/nuvie/files/nuvie_io_file.cpp
+++ b/engines/ultima/nuvie/files/nuvie_io_file.cpp
@@ -39,22 +39,29 @@ bool NuvieIOFileRead::open(const Common::String &filename) {
// We already have a file open, lets bail.
return false;
- if (!_srcFile.open(filename)) {
+ // Handle any relative files under the game path, such as for FM-Towns sound. Though path
+ // delimiters can also be used for resources in ultima.dat
+ if (filename.contains(U6PATH_DELIMITER)) {
Common::FSNode node(ConfMan.get("path"));
Common::String fname = filename;
for (size_t sepPos = fname.findFirstOf(U6PATH_DELIMITER);
- sepPos != Common::String::npos; sepPos = fname.findFirstOf(U6PATH_DELIMITER)) {
+ sepPos != Common::String::npos && node.exists(); sepPos = fname.findFirstOf(U6PATH_DELIMITER)) {
node = node.getChild(fname.substr(0, sepPos));
fname = fname.substr(sepPos + 1);
}
node = node.getChild(fname);
+ if (node.exists())
+ _srcFile.open(node);
+ }
- if (!_srcFile.open(node)) {
- DEBUG(0, LEVEL_ERROR, "Failed opening '%s'\n", filename.c_str());
- return false;
- }
+ if (!_srcFile.isOpen())
+ _srcFile.open(filename);
+
+ if (!_srcFile.isOpen()) {
+ DEBUG(0, LEVEL_ERROR, "Failed opening '%s'\n", filename.c_str());
+ return false;
}
_file = &_srcFile;
diff --git a/engines/ultima/nuvie/sound/sound_manager.cpp b/engines/ultima/nuvie/sound/sound_manager.cpp
index 417bc8cdc1..de403df30b 100644
--- a/engines/ultima/nuvie/sound/sound_manager.cpp
+++ b/engines/ultima/nuvie/sound/sound_manager.cpp
@@ -748,7 +748,7 @@ Sound *SoundManager::RequestSong(string group) {
Audio::SoundHandle SoundManager::playTownsSound(Std::string filename, uint16 sample_num) {
FMtownsDecoderStream *stream = new FMtownsDecoderStream(filename, sample_num);
Audio::SoundHandle handle;
- _mixer->playStream(Audio::Mixer::kPlainSoundType, &handle, stream, -1, music_volume);
+ _mixer->playStream(Audio::Mixer::kSpeechSoundType, &handle, stream, -1);
return handle;
}
diff --git a/engines/ultima/nuvie/sound/towns_sfx_manager.cpp b/engines/ultima/nuvie/sound/towns_sfx_manager.cpp
index 980eb0c340..1d94e5a1a8 100644
--- a/engines/ultima/nuvie/sound/towns_sfx_manager.cpp
+++ b/engines/ultima/nuvie/sound/towns_sfx_manager.cpp
@@ -97,7 +97,7 @@ void TownsSfxManager::loadSound1Dat() {
sounds1_dat[i].len = lib.get_item_size(i);
}
- //Fire SFX is made up of three individual samples played in a random sequence
+ // Fire SFX is made up of three individual samples played in a random sequence
Std::vector<Audio::RewindableAudioStream *> streams;
streams.push_back(new FMtownsDecoderStream(sounds1_dat[6].buf, sounds1_dat[6].len));
streams.push_back(new FMtownsDecoderStream(sounds1_dat[7].buf, sounds1_dat[7].len));
@@ -126,7 +126,8 @@ void TownsSfxManager::playSoundSample(uint8 sample_num, Audio::SoundHandle *loop
Audio::AudioStream *stream = NULL;
Audio::SoundHandle handle;
- if (sample_num > 5 && sample_num < 9) { //fire samples
+ if (sample_num > 5 && sample_num < 9) {
+ // Fire samples
mixer->playStream(Audio::Mixer::kPlainSoundType, looping_handle ? looping_handle : &handle, fireStream, -1, volume, 0, DisposeAfterUse::NO);
return;
}
More information about the Scummvm-git-logs
mailing list