diff options
| author | richiesams | 2013-07-16 16:57:12 -0500 | 
|---|---|---|
| committer | richiesams | 2013-08-04 13:32:21 -0500 | 
| commit | 92f3de72de273cc4ae3767e5991ff1f7cd85c8ed (patch) | |
| tree | dfecd19363adeecbdd226367e2e480b88ad3fe79 | |
| parent | 76f4d2b3d898710f5fefba47aafafc889037968b (diff) | |
| download | scummvm-rg350-92f3de72de273cc4ae3767e5991ff1f7cd85c8ed.tar.gz scummvm-rg350-92f3de72de273cc4ae3767e5991ff1f7cd85c8ed.tar.bz2 scummvm-rg350-92f3de72de273cc4ae3767e5991ff1f7cd85c8ed.zip | |
ZVISION: Convert console sound handling to use new fileName decoding
| -rw-r--r-- | engines/zvision/console.cpp | 17 | 
1 files changed, 8 insertions, 9 deletions
| diff --git a/engines/zvision/console.cpp b/engines/zvision/console.cpp index e0ca37c1d2..a18da8605a 100644 --- a/engines/zvision/console.cpp +++ b/engines/zvision/console.cpp @@ -42,7 +42,7 @@ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) {  bool Console::cmdLoadImage(int argc, const char **argv) {  	if (argc != 4) { -		DebugPrintf("Use loadimage <fileName> <x> <y> to load an image to the screen"); +		DebugPrintf("Use loadimage <fileName> <x> <y> to load an image to the screen\n");  		return true;  	}  	_engine->renderImageToScreen(argv[1], atoi(argv[2]), atoi(argv[3])); @@ -52,7 +52,7 @@ bool Console::cmdLoadImage(int argc, const char **argv) {  bool Console::cmdLoadVideo(int argc, const char **argv) {  	if (argc != 2) { -		DebugPrintf("Use loadvideo <fileName> to load a video to the screen"); +		DebugPrintf("Use loadvideo <fileName> to load a video to the screen\n");  		return true;  	} @@ -65,20 +65,19 @@ bool Console::cmdLoadVideo(int argc, const char **argv) {  }  bool Console::cmdLoadSound(int argc, const char **argv) { -	if (argc != 4) { -		DebugPrintf("Use loadsound <fileName> <rate> <stereo: 0 or 1> to load a video to the screen"); +	if (argc != 2) { +		DebugPrintf("Use loadsound <fileName> to load a sound\n");  		return true;  	} -	Common::File *file = new Common::File(); -	if (!file->open(argv[1])) { -		DebugPrintf("File does not exist"); +	if (!Common::File::exists(argv[1])) { +		DebugPrintf("File does not exist\n");  		return true;  	} -	Audio::AudioStream *soundStream = makeRawZorkStream(wrapBufferedSeekableReadStream(file, 2048, DisposeAfterUse::YES), atoi(argv[2]), atoi(argv[3]), DisposeAfterUse::YES); +	Audio::AudioStream *soundStream = makeRawZorkStream(argv[1], _engine);  	Audio::SoundHandle handle; -	_engine->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &handle, soundStream, -1, 100, 0, DisposeAfterUse::YES, false, false); +	_engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &handle, soundStream, -1, 100, 0, DisposeAfterUse::YES, false, false);  	return true;  } | 
