diff options
Diffstat (limited to 'engines/composer')
-rw-r--r-- | engines/composer/composer.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp index 9b7b4d6f03..93b201e263 100644 --- a/engines/composer/composer.cpp +++ b/engines/composer/composer.cpp @@ -1578,8 +1578,25 @@ int16 ComposerEngine::scriptFuncCall(uint16 id, int16 param1, int16 param2, int1 warning("ignoring kFuncSaveData(%d, %d, %d)", param1, param2, param3); return 1; case kFuncLoadData: - // TODO - warning("ignoring kFuncLoadData(%d, %d, %d)", param1, param2, param3); + debug(3, "ignoring kFuncLoadData(%d, %d, %d)", param1, param2, param3); + { + Common::String filename = getFilename("Data", param1); + Common::File *file = new Common::File(); + if (!file->open(filename)) + error("couldn't open '%s' to get data id '%d'", filename.c_str(), param1); + if (param3 == 0) + param3 = 1000; + else + param3 = param3 / 2; + if (param2 < 0 || param3 < 0 || param2 + param3 > 1000) + error("can't read %d entries into %d from file '%s' for data id '%d'", param3, param2, filename.c_str(), param1); + for (uint i = 0; i < (uint)param3; i++) { + if (file->pos() + 1 > file->size()) + break; + _vars[param2 + i] = file->readUint16LE(); + } + delete file; + } return 1; case kFuncGetSpriteSize: debug(3, "kFuncGetSpriteSize(%d, %d, %d)", param1, param2, param3); |