aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-07-07 10:41:43 +0200
committerStrangerke2014-07-07 10:41:43 +0200
commitc5855b4293522f365329593e41a16e68b1424967 (patch)
tree055128676035bc133fc8f84f58994998da7c15b7
parent21a4c44bea2e413444716994671f63e8fe6aa373 (diff)
downloadscummvm-rg350-c5855b4293522f365329593e41a16e68b1424967.tar.gz
scummvm-rg350-c5855b4293522f365329593e41a16e68b1424967.tar.bz2
scummvm-rg350-c5855b4293522f365329593e41a16e68b1424967.zip
CGE2: Add workaround for the missing dialogs in room 21 (concert)
-rw-r--r--engines/cge2/text.cpp15
-rw-r--r--engines/cge2/text.h1
2 files changed, 10 insertions, 6 deletions
diff --git a/engines/cge2/text.cpp b/engines/cge2/text.cpp
index 24fc8e5376..ecc5521a14 100644
--- a/engines/cge2/text.cpp
+++ b/engines/cge2/text.cpp
@@ -38,16 +38,19 @@ Text::Text(CGE2Engine *vm, const char *fname) : _vm(vm) {
_vm->mergeExt(_fileName, fname, kSayExt);
if (!_vm->_resman->exist(_fileName))
error("No talk (%s)", _fileName);
- int16 txtCount = count() + 1;
- if (!txtCount)
+ _txtCount = count();
+ if (_txtCount == -1)
error("Unable to read dialog file %s", _fileName);
- _cache = new Handler[txtCount];
- for (_size = 0; _size < txtCount; _size++) {
+ _txtCount += 2;
+ _cache = new Handler[_txtCount];
+ for (_size = 0; _size < _txtCount; _size++) {
_cache[_size]._ref = 0;
_cache[_size]._text = nullptr;
}
load();
+ _cache[_txtCount - 1]._ref = 0;
+ _cache[_txtCount - 1]._text = "";
}
Text::~Text() {
@@ -127,8 +130,8 @@ char *Text::getText(int ref) {
if (i < _size)
return _cache[i]._text;
- warning("getText: Unable to find ref %d", ref);
- return NULL;
+ warning("getText: Unable to find ref %d:%d", ref / 256, ref % 256);
+ return _cache[_txtCount - 1]._text;
}
void Text::say(const char *text, Sprite *spr) {
diff --git a/engines/cge2/text.h b/engines/cge2/text.h
index bca774357a..88ed501158 100644
--- a/engines/cge2/text.h
+++ b/engines/cge2/text.h
@@ -48,6 +48,7 @@ class Text {
char *_text;
} *_cache;
int _size;
+ int16 _txtCount;
char _fileName[kPathMax];
void load();
int16 count();