From 1d50acaa50ff88d22326d16b667d5f3cc8991e7f Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sun, 31 Jan 2010 19:45:51 +0000 Subject: SCI: Handle -1 properly when passed as a language id to DoAudio svn-id: r47774 --- engines/sci/engine/ksound.cpp | 10 ++++++++-- engines/sci/resource.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index adb7d60c14..584e58c0be 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -143,8 +143,14 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) { // In SCI1.1: tests for digital audio support if (getSciVersion() == SCI_VERSION_1_1) return make_reg(0, 1); - else - s->resMan->setAudioLanguage(argv[1].toSint16()); + else { + int16 language = argv[1].toSint16(); + + if (language != -1) + s->resMan->setAudioLanguage(language); + + return make_reg(0, s->resMan->getAudioLanguage()); + } break; case kSciAudioCD: return kDoCdAudio(s, argc - 1, argv + 1); diff --git a/engines/sci/resource.h b/engines/sci/resource.h index 661b954256..2b6519a950 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -270,6 +270,7 @@ public: Common::List *listResources(ResourceType type, int mapNumber = -1); void setAudioLanguage(int language); + int getAudioLanguage() const { return (_audioMapSCI1 ? _audioMapSCI1->volume_number : 0); } bool isVGA() const { return (_viewType == kViewVga) || (_viewType == kViewVga11); } bool isAmiga32color() const { return _viewType == kViewAmiga; } ViewType getViewType() const { return _viewType; } -- cgit v1.2.3