aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2010-01-31 19:45:51 +0000
committerWalter van Niftrik2010-01-31 19:45:51 +0000
commit1d50acaa50ff88d22326d16b667d5f3cc8991e7f (patch)
tree46cf68263c2fe9c18e338b646dad4ad41753b71c
parent43c15603c3b9bbfe9180a0b9a957d734d0e8a3fc (diff)
downloadscummvm-rg350-1d50acaa50ff88d22326d16b667d5f3cc8991e7f.tar.gz
scummvm-rg350-1d50acaa50ff88d22326d16b667d5f3cc8991e7f.tar.bz2
scummvm-rg350-1d50acaa50ff88d22326d16b667d5f3cc8991e7f.zip
SCI: Handle -1 properly when passed as a language id to DoAudio
svn-id: r47774
-rw-r--r--engines/sci/engine/ksound.cpp10
-rw-r--r--engines/sci/resource.h1
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<ResourceId> *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; }