aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/cloud/box/boxstorage.cpp40
-rw-r--r--backends/cloud/box/boxstorage.h2
-rw-r--r--backends/cloud/cloudmanager.cpp2
-rw-r--r--backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp4
-rw-r--r--backends/cloud/dropbox/dropboxinforequest.cpp8
-rw-r--r--backends/cloud/googledrive/googledrivestorage.cpp32
-rw-r--r--backends/cloud/googledrive/googledrivestorage.h2
-rw-r--r--backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp4
-rw-r--r--backends/cloud/onedrive/onedrivestorage.cpp22
-rw-r--r--backends/cloud/storagefile.cpp8
-rw-r--r--backends/cloud/storagefile.h2
-rw-r--r--backends/fs/abstract-fs.h4
-rw-r--r--backends/fs/amigaos4/amigaos4-fs.cpp2
-rw-r--r--backends/fs/amigaos4/amigaos4-fs.h2
-rw-r--r--backends/fs/chroot/chroot-fs.cpp2
-rw-r--r--backends/fs/chroot/chroot-fs.h2
-rw-r--r--backends/fs/ds/ds-fs.cpp8
-rw-r--r--backends/fs/ds/ds-fs.h6
-rw-r--r--backends/fs/n64/n64-fs.cpp2
-rw-r--r--backends/fs/n64/n64-fs.h2
-rw-r--r--backends/fs/posix/posix-fs.cpp10
-rw-r--r--backends/fs/posix/posix-fs.h2
-rw-r--r--backends/fs/ps2/ps2-fs.cpp2
-rw-r--r--backends/fs/ps2/ps2-fs.h2
-rw-r--r--backends/fs/psp/psp-fs.cpp2
-rw-r--r--backends/fs/psp/psp-fs.h2
-rw-r--r--backends/fs/symbian/symbian-fs.cpp2
-rw-r--r--backends/fs/symbian/symbian-fs.h2
-rw-r--r--backends/fs/wii/wii-fs.cpp2
-rw-r--r--backends/fs/wii/wii-fs.h2
-rw-r--r--backends/fs/windows/windows-fs.cpp10
-rw-r--r--backends/fs/windows/windows-fs.h2
-rw-r--r--backends/networking/curl/networkreadstream.cpp18
-rw-r--r--backends/networking/curl/networkreadstream.h2
-rw-r--r--common/EventMapper.cpp1
-rw-r--r--common/debug-channels.h2
-rw-r--r--common/debug.cpp8
-rw-r--r--common/debug.h1
-rw-r--r--common/json.cpp8
-rw-r--r--engines/adl/disk.cpp2
-rw-r--r--engines/bladerunner/item.cpp8
-rw-r--r--engines/bladerunner/item.h2
-rw-r--r--engines/bladerunner/items.cpp8
-rw-r--r--engines/bladerunner/items.h2
-rw-r--r--engines/bladerunner/vqa_decoder.cpp19
-rw-r--r--engines/director/archive.cpp52
-rw-r--r--engines/director/archive.h16
-rw-r--r--engines/director/cast.cpp42
-rw-r--r--engines/director/cast.h10
-rw-r--r--engines/director/director.cpp3
-rw-r--r--engines/director/director.h9
-rw-r--r--engines/director/frame.cpp534
-rw-r--r--engines/director/frame.h16
-rw-r--r--engines/director/graphics.cpp155
-rw-r--r--engines/director/images.cpp148
-rw-r--r--engines/director/images.h20
-rw-r--r--engines/director/lingo/lingo-builtins.cpp262
-rw-r--r--engines/director/lingo/lingo-code.cpp164
-rw-r--r--engines/director/lingo/lingo-codegen.cpp72
-rw-r--r--engines/director/lingo/lingo-funcs.cpp44
-rw-r--r--engines/director/lingo/lingo-gr.cpp1904
-rw-r--r--engines/director/lingo/lingo-gr.h264
-rw-r--r--engines/director/lingo/lingo-gr.y95
-rw-r--r--engines/director/lingo/lingo-lex.cpp878
-rw-r--r--engines/director/lingo/lingo-lex.l90
-rw-r--r--engines/director/lingo/lingo-the.cpp49
-rw-r--r--engines/director/lingo/lingo-the.h118
-rw-r--r--engines/director/lingo/lingo.cpp40
-rw-r--r--engines/director/lingo/lingo.h64
-rw-r--r--engines/director/lingo/tests/arrays.lingo2
-rw-r--r--engines/director/lingo/tests/events.lingo2
-rw-r--r--engines/director/lingo/tests/the.lingo5
-rw-r--r--engines/director/module.mk1
-rw-r--r--engines/director/resource.cpp4
-rw-r--r--engines/director/score.cpp123
-rw-r--r--engines/director/score.h7
-rw-r--r--engines/director/sound.cpp10
-rw-r--r--engines/director/sound.h4
-rw-r--r--engines/director/sprite.cpp2
-rw-r--r--engines/director/sprite.h3
-rw-r--r--engines/macventure/gui.cpp2
-rw-r--r--engines/mads/screen.cpp2
-rw-r--r--engines/mads/screen.h4
-rw-r--r--engines/sci/detection_tables.h251
-rw-r--r--engines/sci/engine/features.h13
-rw-r--r--engines/sci/engine/file.cpp9
-rw-r--r--engines/sci/engine/kernel.cpp6
-rw-r--r--engines/sci/engine/kernel.h5
-rw-r--r--engines/sci/engine/kernel_tables.h31
-rw-r--r--engines/sci/engine/kfile.cpp10
-rw-r--r--engines/sci/engine/kgraphics32.cpp53
-rw-r--r--engines/sci/engine/ksound.cpp4
-rw-r--r--engines/sci/engine/kstring.cpp4
-rw-r--r--engines/sci/engine/script_patches.cpp82
-rw-r--r--engines/sci/engine/seg_manager.cpp5
-rw-r--r--engines/sci/engine/vm.cpp4
-rw-r--r--engines/sci/engine/vm.h4
-rw-r--r--engines/sci/engine/workarounds.cpp45
-rw-r--r--engines/sci/engine/workarounds.h3
-rw-r--r--engines/sci/graphics/celobj32.cpp20
-rw-r--r--engines/sci/graphics/cursor32.cpp1
-rw-r--r--engines/sci/graphics/frameout.cpp27
-rw-r--r--engines/sci/graphics/paint32.cpp6
-rw-r--r--engines/sci/graphics/screen_item32.cpp6
-rw-r--r--engines/sci/graphics/transitions32.cpp61
-rw-r--r--engines/sci/graphics/transitions32.h6
-rw-r--r--engines/sci/graphics/video32.cpp7
-rw-r--r--engines/sci/resource.cpp2
-rw-r--r--engines/sci/resource.h2
-rw-r--r--engines/sci/resource_audio.cpp59
-rw-r--r--engines/sci/sci.h2
-rw-r--r--engines/sci/sound/audio32.cpp10
-rw-r--r--engines/sci/sound/decoders/sol.cpp72
-rw-r--r--engines/sci/sound/decoders/sol.h4
-rw-r--r--engines/sci/sound/music.cpp3
-rw-r--r--engines/sci/video/robot_decoder.cpp12
-rw-r--r--engines/titanic/carry/arm.cpp6
-rw-r--r--engines/titanic/carry/auditory_centre.cpp2
-rw-r--r--engines/titanic/carry/bowl_ear.cpp2
-rw-r--r--engines/titanic/carry/carry.cpp8
-rw-r--r--engines/titanic/carry/carry.h2
-rw-r--r--engines/titanic/carry/carry_parrot.cpp14
-rw-r--r--engines/titanic/carry/crushed_tv.cpp2
-rw-r--r--engines/titanic/carry/ear.cpp2
-rw-r--r--engines/titanic/carry/fruit.cpp2
-rw-r--r--engines/titanic/carry/hammer.cpp2
-rw-r--r--engines/titanic/carry/head_piece.cpp2
-rw-r--r--engines/titanic/carry/key.cpp2
-rw-r--r--engines/titanic/carry/long_stick.cpp2
-rw-r--r--engines/titanic/carry/maitred_right_arm.cpp2
-rw-r--r--engines/titanic/carry/phonograph_ear.cpp2
-rw-r--r--engines/titanic/carry/photograph.cpp2
-rw-r--r--engines/titanic/carry/speech_centre.cpp2
-rw-r--r--engines/titanic/carry/vision_centre.cpp6
-rw-r--r--engines/titanic/core/game_object.cpp4
-rw-r--r--engines/titanic/game/music_system_lock.cpp6
-rw-r--r--engines/titanic/game/phonograph_lid.cpp8
-rw-r--r--engines/titanic/input_handler.cpp2
-rw-r--r--engines/titanic/moves/restaurant_pan_handler.cpp4
-rw-r--r--engines/titanic/npcs/parrot.cpp2
-rw-r--r--engines/titanic/true_talk/barbot_script.cpp9
-rw-r--r--engines/titanic/true_talk/tt_string_node.cpp3
-rw-r--r--engines/titanic/true_talk/tt_synonym.cpp8
-rw-r--r--engines/titanic/true_talk/tt_synonym.h5
-rw-r--r--engines/xeen/worldofxeen/clouds_cutscenes.cpp3
-rw-r--r--graphics/macgui/macfontmanager.h9
-rw-r--r--graphics/macgui/mactext.cpp2
-rw-r--r--graphics/macgui/macwindowmanager.cpp92
-rw-r--r--graphics/macgui/macwindowmanager.h19
-rw-r--r--gui/KeysDialog.cpp18
-rw-r--r--gui/ThemeEngine.cpp2
-rw-r--r--gui/options.cpp4
-rw-r--r--image/codecs/codec.cpp2
-rw-r--r--image/codecs/indeo3.cpp17
-rw-r--r--image/codecs/indeo3.h2
-rw-r--r--image/codecs/indeo4.cpp2
-rw-r--r--po/be_BY.po25
-rw-r--r--po/ca_ES.po17
-rw-r--r--po/cs_CZ.po17
-rw-r--r--po/da_DK.po21
-rw-r--r--po/de_DE.po21
-rw-r--r--po/el.po25
-rw-r--r--po/es_ES.po21
-rw-r--r--po/eu.po17
-rw-r--r--po/fi_FI.po35
-rw-r--r--po/fr_FR.po21
-rw-r--r--po/gl_ES.po17
-rw-r--r--po/hu_HU.po25
-rw-r--r--po/it_IT.po21
-rw-r--r--po/nb_NO.po21
-rw-r--r--po/nl_NL.po21
-rw-r--r--po/nn_NO.po17
-rw-r--r--po/pl_PL.po21
-rw-r--r--po/pt_BR.po17
-rw-r--r--po/pt_PT.po17
-rw-r--r--po/ru_RU.po25
-rw-r--r--po/scummvm.pot17
-rw-r--r--po/sv_SE.po25
-rw-r--r--po/uk_UA.po25
-rw-r--r--po/zh-Latn_CN.po21
-rw-r--r--video/avi_decoder.cpp4
-rw-r--r--video/coktel_decoder.cpp2
182 files changed, 4645 insertions, 2482 deletions
diff --git a/backends/cloud/box/boxstorage.cpp b/backends/cloud/box/boxstorage.cpp
index 598ca55c15..fb01521016 100644
--- a/backends/cloud/box/boxstorage.cpp
+++ b/backends/cloud/box/boxstorage.cpp
@@ -67,8 +67,8 @@ void BoxStorage::loadKeyAndSecret() {
#endif
}
-BoxStorage::BoxStorage(Common::String accessToken, Common::String refreshToken):
- _token(accessToken), _refreshToken(refreshToken) {}
+BoxStorage::BoxStorage(Common::String token, Common::String refreshToken):
+ _token(token), _refreshToken(refreshToken) {}
BoxStorage::BoxStorage(Common::String code) {
getAccessToken(
@@ -191,36 +191,36 @@ void BoxStorage::infoInnerCallback(StorageInfoCallback outerCallback, Networking
return;
}
- Common::JSONObject info = json->asObject();
+ Common::JSONObject jsonInfo = json->asObject();
- Common::String uid, name, email;
+ Common::String uid, displayName, email;
uint64 quotaUsed = 0, quotaAllocated = 0;
// can check that "type": "user"
// there is also "max_upload_size", "phone" and "avatar_url"
- if (Networking::CurlJsonRequest::jsonContainsString(info, "id", "BoxStorage::infoInnerCallback"))
- uid = info.getVal("id")->asString();
+ if (Networking::CurlJsonRequest::jsonContainsString(jsonInfo, "id", "BoxStorage::infoInnerCallback"))
+ uid = jsonInfo.getVal("id")->asString();
- if (Networking::CurlJsonRequest::jsonContainsString(info, "name", "BoxStorage::infoInnerCallback"))
- name = info.getVal("name")->asString();
+ if (Networking::CurlJsonRequest::jsonContainsString(jsonInfo, "name", "BoxStorage::infoInnerCallback"))
+ displayName = jsonInfo.getVal("name")->asString();
- if (Networking::CurlJsonRequest::jsonContainsString(info, "login", "BoxStorage::infoInnerCallback"))
- email = info.getVal("login")->asString();
+ if (Networking::CurlJsonRequest::jsonContainsString(jsonInfo, "login", "BoxStorage::infoInnerCallback"))
+ email = jsonInfo.getVal("login")->asString();
- if (Networking::CurlJsonRequest::jsonContainsIntegerNumber(info, "space_amount", "BoxStorage::infoInnerCallback"))
- quotaAllocated = info.getVal("space_amount")->asIntegerNumber();
+ if (Networking::CurlJsonRequest::jsonContainsIntegerNumber(jsonInfo, "space_amount", "BoxStorage::infoInnerCallback"))
+ quotaAllocated = jsonInfo.getVal("space_amount")->asIntegerNumber();
- if (Networking::CurlJsonRequest::jsonContainsIntegerNumber(info, "space_used", "BoxStorage::infoInnerCallback"))
- quotaUsed = info.getVal("space_used")->asIntegerNumber();
+ if (Networking::CurlJsonRequest::jsonContainsIntegerNumber(jsonInfo, "space_used", "BoxStorage::infoInnerCallback"))
+ quotaUsed = jsonInfo.getVal("space_used")->asIntegerNumber();
Common::String username = email;
- if (username == "") username = name;
+ if (username == "") username = displayName;
if (username == "") username = uid;
CloudMan.setStorageUsername(kStorageBoxId, username);
if (outerCallback) {
- (*outerCallback)(StorageInfoResponse(nullptr, StorageInfo(uid, name, email, quotaUsed, quotaAllocated)));
+ (*outerCallback)(StorageInfoResponse(nullptr, StorageInfo(uid, displayName, email, quotaUsed, quotaAllocated)));
delete outerCallback;
}
@@ -245,8 +245,8 @@ void BoxStorage::createDirectoryInnerCallback(BoolCallback outerCallback, Networ
if (outerCallback) {
if (Networking::CurlJsonRequest::jsonIsObject(json, "BoxStorage::createDirectoryInnerCallback")) {
- Common::JSONObject info = json->asObject();
- (*outerCallback)(BoolResponse(nullptr, info.contains("id")));
+ Common::JSONObject jsonInfo = json->asObject();
+ (*outerCallback)(BoolResponse(nullptr, jsonInfo.contains("id")));
} else {
(*outerCallback)(BoolResponse(nullptr, false));
}
@@ -256,7 +256,7 @@ void BoxStorage::createDirectoryInnerCallback(BoolCallback outerCallback, Networ
delete json;
}
-Networking::Request *BoxStorage::createDirectoryWithParentId(Common::String parentId, Common::String name, BoolCallback callback, Networking::ErrorCallback errorCallback) {
+Networking::Request *BoxStorage::createDirectoryWithParentId(Common::String parentId, Common::String directoryName, BoolCallback callback, Networking::ErrorCallback errorCallback) {
if (!errorCallback)
errorCallback = getErrorPrintingCallback();
@@ -270,7 +270,7 @@ Networking::Request *BoxStorage::createDirectoryWithParentId(Common::String pare
parentObject.setVal("id", new Common::JSONValue(parentId));
Common::JSONObject jsonRequestParameters;
- jsonRequestParameters.setVal("name", new Common::JSONValue(name));
+ jsonRequestParameters.setVal("name", new Common::JSONValue(directoryName));
jsonRequestParameters.setVal("parent", new Common::JSONValue(parentObject));
Common::JSONValue value(jsonRequestParameters);
diff --git a/backends/cloud/box/boxstorage.h b/backends/cloud/box/boxstorage.h
index 27bf60e39b..a641669b2a 100644
--- a/backends/cloud/box/boxstorage.h
+++ b/backends/cloud/box/boxstorage.h
@@ -74,7 +74,7 @@ public:
/** Public Cloud API comes down there. */
virtual Networking::Request *listDirectoryById(Common::String id, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback);
- virtual Networking::Request *createDirectoryWithParentId(Common::String parentId, Common::String name, BoolCallback callback, Networking::ErrorCallback errorCallback);
+ virtual Networking::Request *createDirectoryWithParentId(Common::String parentId, Common::String directoryName, BoolCallback callback, Networking::ErrorCallback errorCallback);
/** Returns UploadStatus struct with info about uploaded file. */
virtual Networking::Request *upload(Common::String remotePath, Common::String localPath, UploadCallback callback, Networking::ErrorCallback errorCallback);
diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp
index 5f7d6942ca..4fb38ad779 100644
--- a/backends/cloud/cloudmanager.cpp
+++ b/backends/cloud/cloudmanager.cpp
@@ -272,6 +272,8 @@ void CloudManager::connectStorage(uint32 index, Common::String code) {
// when the token is received, they call replaceStorage()
// or removeStorage(), if some error occurred
// thus, no memory leak happens
+
+ // FIXME: storage is set, but never used. Should it be returned from this function for class variable _storages?
}
Networking::Request *CloudManager::listDirectory(Common::String path, Storage::ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive) {
diff --git a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp
index 411e367a9d..d6937d9cb2 100644
--- a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp
+++ b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp
@@ -52,8 +52,8 @@ void DropboxCreateDirectoryRequest::start() {
_ignoreCallback = false;
Networking::JsonCallback innerCallback = new Common::Callback<DropboxCreateDirectoryRequest, Networking::JsonResponse>(this, &DropboxCreateDirectoryRequest::responseCallback);
- Networking::ErrorCallback errorCallback = new Common::Callback<DropboxCreateDirectoryRequest, Networking::ErrorResponse>(this, &DropboxCreateDirectoryRequest::errorCallback);
- Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, errorCallback, DROPBOX_API_CREATE_FOLDER);
+ Networking::ErrorCallback errorResponseCallback = new Common::Callback<DropboxCreateDirectoryRequest, Networking::ErrorResponse>(this, &DropboxCreateDirectoryRequest::errorCallback);
+ Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, errorResponseCallback, DROPBOX_API_CREATE_FOLDER);
request->addHeader("Authorization: Bearer " + _token);
request->addHeader("Content-Type: application/json");
diff --git a/backends/cloud/dropbox/dropboxinforequest.cpp b/backends/cloud/dropbox/dropboxinforequest.cpp
index 3d82c8d34b..ebf2d12170 100644
--- a/backends/cloud/dropbox/dropboxinforequest.cpp
+++ b/backends/cloud/dropbox/dropboxinforequest.cpp
@@ -54,8 +54,8 @@ void DropboxInfoRequest::start() {
_ignoreCallback = false;
Networking::JsonCallback innerCallback = new Common::Callback<DropboxInfoRequest, Networking::JsonResponse>(this, &DropboxInfoRequest::userResponseCallback);
- Networking::ErrorCallback errorCallback = new Common::Callback<DropboxInfoRequest, Networking::ErrorResponse>(this, &DropboxInfoRequest::errorCallback);
- Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, errorCallback, DROPBOX_API_GET_CURRENT_ACCOUNT);
+ Networking::ErrorCallback errorResponseCallback = new Common::Callback<DropboxInfoRequest, Networking::ErrorResponse>(this, &DropboxInfoRequest::errorCallback);
+ Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, errorResponseCallback, DROPBOX_API_GET_CURRENT_ACCOUNT);
request->addHeader("Authorization: Bearer " + _token);
request->addHeader("Content-Type: application/json");
request->addPostField("null"); //use POST
@@ -108,8 +108,8 @@ void DropboxInfoRequest::userResponseCallback(Networking::JsonResponse response)
delete json;
Networking::JsonCallback innerCallback = new Common::Callback<DropboxInfoRequest, Networking::JsonResponse>(this, &DropboxInfoRequest::quotaResponseCallback);
- Networking::ErrorCallback errorCallback = new Common::Callback<DropboxInfoRequest, Networking::ErrorResponse>(this, &DropboxInfoRequest::errorCallback);
- Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, errorCallback, DROPBOX_API_GET_SPACE_USAGE);
+ Networking::ErrorCallback errorResponseCallback = new Common::Callback<DropboxInfoRequest, Networking::ErrorResponse>(this, &DropboxInfoRequest::errorCallback);
+ Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, errorResponseCallback, DROPBOX_API_GET_SPACE_USAGE);
request->addHeader("Authorization: Bearer " + _token);
request->addHeader("Content-Type: application/json");
request->addPostField("null"); //use POST
diff --git a/backends/cloud/googledrive/googledrivestorage.cpp b/backends/cloud/googledrive/googledrivestorage.cpp
index ec4c84400c..c00d954966 100644
--- a/backends/cloud/googledrive/googledrivestorage.cpp
+++ b/backends/cloud/googledrive/googledrivestorage.cpp
@@ -68,8 +68,8 @@ void GoogleDriveStorage::loadKeyAndSecret() {
#endif
}
-GoogleDriveStorage::GoogleDriveStorage(Common::String accessToken, Common::String refreshToken):
- _token(accessToken), _refreshToken(refreshToken) {}
+GoogleDriveStorage::GoogleDriveStorage(Common::String token, Common::String refreshToken):
+ _token(token), _refreshToken(refreshToken) {}
GoogleDriveStorage::GoogleDriveStorage(Common::String code) {
getAccessToken(
@@ -192,28 +192,28 @@ void GoogleDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Ne
return;
}
- Common::JSONObject info = json->asObject();
+ Common::JSONObject jsonInfo = json->asObject();
- Common::String uid, name, email;
+ Common::String uid, displayName, email;
uint64 quotaUsed = 0, quotaAllocated = 0;
- if (Networking::CurlJsonRequest::jsonContainsAttribute(info, "user", "GoogleDriveStorage::infoInnerCallback") &&
- Networking::CurlJsonRequest::jsonIsObject(info.getVal("user"), "GoogleDriveStorage::infoInnerCallback")) {
+ if (Networking::CurlJsonRequest::jsonContainsAttribute(jsonInfo, "user", "GoogleDriveStorage::infoInnerCallback") &&
+ Networking::CurlJsonRequest::jsonIsObject(jsonInfo.getVal("user"), "GoogleDriveStorage::infoInnerCallback")) {
//"me":true, "kind":"drive#user","photoLink": "",
//"displayName":"Alexander Tkachev","emailAddress":"alexander@tkachov.ru","permissionId":""
- Common::JSONObject user = info.getVal("user")->asObject();
+ Common::JSONObject user = jsonInfo.getVal("user")->asObject();
if (Networking::CurlJsonRequest::jsonContainsString(user, "permissionId", "GoogleDriveStorage::infoInnerCallback"))
uid = user.getVal("permissionId")->asString(); //not sure it's user's id, but who cares anyway?
if (Networking::CurlJsonRequest::jsonContainsString(user, "displayName", "GoogleDriveStorage::infoInnerCallback"))
- name = user.getVal("displayName")->asString();
+ displayName = user.getVal("displayName")->asString();
if (Networking::CurlJsonRequest::jsonContainsString(user, "emailAddress", "GoogleDriveStorage::infoInnerCallback"))
email = user.getVal("emailAddress")->asString();
}
- if (Networking::CurlJsonRequest::jsonContainsAttribute(info, "storageQuota", "GoogleDriveStorage::infoInnerCallback") &&
- Networking::CurlJsonRequest::jsonIsObject(info.getVal("storageQuota"), "GoogleDriveStorage::infoInnerCallback")) {
+ if (Networking::CurlJsonRequest::jsonContainsAttribute(jsonInfo, "storageQuota", "GoogleDriveStorage::infoInnerCallback") &&
+ Networking::CurlJsonRequest::jsonIsObject(jsonInfo.getVal("storageQuota"), "GoogleDriveStorage::infoInnerCallback")) {
//"usageInDrive":"6332462","limit":"18253611008","usage":"6332462","usageInDriveTrash":"0"
- Common::JSONObject storageQuota = info.getVal("storageQuota")->asObject();
+ Common::JSONObject storageQuota = jsonInfo.getVal("storageQuota")->asObject();
if (Networking::CurlJsonRequest::jsonContainsString(storageQuota, "usage", "GoogleDriveStorage::infoInnerCallback")) {
Common::String usage = storageQuota.getVal("usage")->asString();
@@ -229,7 +229,7 @@ void GoogleDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Ne
CloudMan.setStorageUsername(kStorageGoogleDriveId, email);
if (outerCallback) {
- (*outerCallback)(StorageInfoResponse(nullptr, StorageInfo(uid, name, email, quotaUsed, quotaAllocated)));
+ (*outerCallback)(StorageInfoResponse(nullptr, StorageInfo(uid, displayName, email, quotaUsed, quotaAllocated)));
delete outerCallback;
}
@@ -246,8 +246,8 @@ void GoogleDriveStorage::createDirectoryInnerCallback(BoolCallback outerCallback
if (outerCallback) {
if (Networking::CurlJsonRequest::jsonIsObject(json, "GoogleDriveStorage::createDirectoryInnerCallback")) {
- Common::JSONObject info = json->asObject();
- (*outerCallback)(BoolResponse(nullptr, info.contains("id")));
+ Common::JSONObject jsonInfo = json->asObject();
+ (*outerCallback)(BoolResponse(nullptr, jsonInfo.contains("id")));
} else {
(*outerCallback)(BoolResponse(nullptr, false));
}
@@ -289,7 +289,7 @@ void GoogleDriveStorage::printInfo(StorageInfoResponse response) {
debug(9, "\tdisk usage: %lu/%lu", response.value.used(), response.value.available());
}
-Networking::Request *GoogleDriveStorage::createDirectoryWithParentId(Common::String parentId, Common::String name, BoolCallback callback, Networking::ErrorCallback errorCallback) {
+Networking::Request *GoogleDriveStorage::createDirectoryWithParentId(Common::String parentId, Common::String directoryName, BoolCallback callback, Networking::ErrorCallback errorCallback) {
if (!errorCallback)
errorCallback = getErrorPrintingCallback();
@@ -304,7 +304,7 @@ Networking::Request *GoogleDriveStorage::createDirectoryWithParentId(Common::Str
Common::JSONObject jsonRequestParameters;
jsonRequestParameters.setVal("mimeType", new Common::JSONValue("application/vnd.google-apps.folder"));
- jsonRequestParameters.setVal("name", new Common::JSONValue(name));
+ jsonRequestParameters.setVal("name", new Common::JSONValue(directoryName));
jsonRequestParameters.setVal("parents", new Common::JSONValue(parentsArray));
Common::JSONValue value(jsonRequestParameters);
diff --git a/backends/cloud/googledrive/googledrivestorage.h b/backends/cloud/googledrive/googledrivestorage.h
index 457369dc90..d0585bc403 100644
--- a/backends/cloud/googledrive/googledrivestorage.h
+++ b/backends/cloud/googledrive/googledrivestorage.h
@@ -86,7 +86,7 @@ public:
virtual Networking::Request *streamFileById(Common::String id, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback);
/** Calls the callback when finished. */
- virtual Networking::Request *createDirectoryWithParentId(Common::String parentId, Common::String name, BoolCallback callback, Networking::ErrorCallback errorCallback);
+ virtual Networking::Request *createDirectoryWithParentId(Common::String parentId, Common::String directoryName, BoolCallback callback, Networking::ErrorCallback errorCallback);
/** Returns the StorageInfo struct. */
virtual Networking::Request *info(StorageInfoCallback callback, Networking::ErrorCallback errorCallback);
diff --git a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp
index da67266d12..74cf3208e3 100644
--- a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp
+++ b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp
@@ -72,8 +72,8 @@ void OneDriveCreateDirectoryRequest::start() {
url += ":/" + ConnMan.urlEncode(parent) + ":";
url += "/children";
Networking::JsonCallback innerCallback = new Common::Callback<OneDriveCreateDirectoryRequest, Networking::JsonResponse>(this, &OneDriveCreateDirectoryRequest::responseCallback);
- Networking::ErrorCallback errorCallback = new Common::Callback<OneDriveCreateDirectoryRequest, Networking::ErrorResponse>(this, &OneDriveCreateDirectoryRequest::errorCallback);
- Networking::CurlJsonRequest *request = new OneDriveTokenRefresher(_storage, innerCallback, errorCallback, url.c_str());
+ Networking::ErrorCallback errorResponseCallback = new Common::Callback<OneDriveCreateDirectoryRequest, Networking::ErrorResponse>(this, &OneDriveCreateDirectoryRequest::errorCallback);
+ Networking::CurlJsonRequest *request = new OneDriveTokenRefresher(_storage, innerCallback, errorResponseCallback, url.c_str());
request->addHeader("Authorization: Bearer " + _storage->accessToken());
request->addHeader("Content-Type: application/json");
diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp
index 8799f3d69f..14e803d980 100644
--- a/backends/cloud/onedrive/onedrivestorage.cpp
+++ b/backends/cloud/onedrive/onedrivestorage.cpp
@@ -67,8 +67,8 @@ void OneDriveStorage::loadKeyAndSecret() {
#endif
}
-OneDriveStorage::OneDriveStorage(Common::String accessToken, Common::String userId, Common::String refreshToken):
- _token(accessToken), _uid(userId), _refreshToken(refreshToken) {}
+OneDriveStorage::OneDriveStorage(Common::String token, Common::String uid, Common::String refreshToken):
+ _token(token), _uid(uid), _refreshToken(refreshToken) {}
OneDriveStorage::OneDriveStorage(Common::String code) {
getAccessToken(
@@ -193,35 +193,35 @@ void OneDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Netwo
return;
}
- Common::JSONObject info = json->asObject();
+ Common::JSONObject jsonInfo = json->asObject();
- Common::String uid, name, email;
+ Common::String uid, displayName, email;
uint64 quotaUsed = 0, quotaAllocated = 26843545600LL; // 25 GB, because I actually don't know any way to find out the real one
- if (Networking::CurlJsonRequest::jsonContainsObject(info, "createdBy", "OneDriveStorage::infoInnerCallback")) {
- Common::JSONObject createdBy = info.getVal("createdBy")->asObject();
+ if (Networking::CurlJsonRequest::jsonContainsObject(jsonInfo, "createdBy", "OneDriveStorage::infoInnerCallback")) {
+ Common::JSONObject createdBy = jsonInfo.getVal("createdBy")->asObject();
if (Networking::CurlJsonRequest::jsonContainsObject(createdBy, "user", "OneDriveStorage::infoInnerCallback")) {
Common::JSONObject user = createdBy.getVal("user")->asObject();
if (Networking::CurlJsonRequest::jsonContainsString(user, "id", "OneDriveStorage::infoInnerCallback"))
uid = user.getVal("id")->asString();
if (Networking::CurlJsonRequest::jsonContainsString(user, "displayName", "OneDriveStorage::infoInnerCallback"))
- name = user.getVal("displayName")->asString();
+ displayName = user.getVal("displayName")->asString();
}
}
- if (Networking::CurlJsonRequest::jsonContainsIntegerNumber(info, "size", "OneDriveStorage::infoInnerCallback")) {
- quotaUsed = info.getVal("size")->asIntegerNumber();
+ if (Networking::CurlJsonRequest::jsonContainsIntegerNumber(jsonInfo, "size", "OneDriveStorage::infoInnerCallback")) {
+ quotaUsed = jsonInfo.getVal("size")->asIntegerNumber();
}
Common::String username = email;
if (username == "")
- username = name;
+ username = displayName;
if (username == "")
username = uid;
CloudMan.setStorageUsername(kStorageOneDriveId, username);
if (outerCallback) {
- (*outerCallback)(StorageInfoResponse(nullptr, StorageInfo(uid, name, email, quotaUsed, quotaAllocated)));
+ (*outerCallback)(StorageInfoResponse(nullptr, StorageInfo(uid, displayName, email, quotaUsed, quotaAllocated)));
delete outerCallback;
}
diff --git a/backends/cloud/storagefile.cpp b/backends/cloud/storagefile.cpp
index 2428d8ff80..90ec7da120 100644
--- a/backends/cloud/storagefile.cpp
+++ b/backends/cloud/storagefile.cpp
@@ -56,10 +56,10 @@ StorageFile::StorageFile(Common::String pth, uint32 sz, uint32 ts, bool dir) {
_isDirectory = dir;
}
-StorageFile::StorageFile(Common::String id, Common::String path, Common::String name, uint32 sz, uint32 ts, bool dir) {
- _id = id;
- _path = path;
- _name = name;
+StorageFile::StorageFile(Common::String fileId, Common::String filePath, Common::String fileName, uint32 sz, uint32 ts, bool dir) {
+ _id = fileId;
+ _path = filePath;
+ _name = fileName;
_size = sz;
_timestamp = ts;
_isDirectory = dir;
diff --git a/backends/cloud/storagefile.h b/backends/cloud/storagefile.h
index 44f16c3689..c29ac77dd1 100644
--- a/backends/cloud/storagefile.h
+++ b/backends/cloud/storagefile.h
@@ -48,7 +48,7 @@ class StorageFile {
public:
StorageFile(); //invalid empty file
StorageFile(Common::String pth, uint32 sz, uint32 ts, bool dir);
- StorageFile(Common::String id, Common::String path, Common::String name, uint32 sz, uint32 ts, bool dir);
+ StorageFile(Common::String fileId, Common::String filePath, Common::String fileName, uint32 sz, uint32 ts, bool dir);
Common::String id() const { return _id; }
Common::String path() const { return _path; }
diff --git a/backends/fs/abstract-fs.h b/backends/fs/abstract-fs.h
index 24286b649d..28ea3bbecd 100644
--- a/backends/fs/abstract-fs.h
+++ b/backends/fs/abstract-fs.h
@@ -195,11 +195,11 @@ public:
/**
* Creates a file referred by this node.
*
- * @param isDirectory true if created file must be a directory
+ * @param isDirectoryFlag true if created file must be a directory
*
* @return true if file is created successfully
*/
- virtual bool create(bool isDirectory) = 0;
+ virtual bool create(bool isDirectoryFlag) = 0;
};
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index 24a8fb98ad..09ba3a1c83 100644
--- a/backends/fs/amigaos4/amigaos4-fs.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs.cpp
@@ -443,7 +443,7 @@ Common::WriteStream *AmigaOSFilesystemNode::createWriteStream() {
return StdioStream::makeFromPath(getPath(), true);
}
-bool AmigaOSFilesystemNode::create(bool isDirectory) {
+bool AmigaOSFilesystemNode::create(bool isDirectoryFlag) {
error("Not supported");
return false;
}
diff --git a/backends/fs/amigaos4/amigaos4-fs.h b/backends/fs/amigaos4/amigaos4-fs.h
index 3ed45d3f77..c86bb4c57a 100644
--- a/backends/fs/amigaos4/amigaos4-fs.h
+++ b/backends/fs/amigaos4/amigaos4-fs.h
@@ -116,7 +116,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
};
diff --git a/backends/fs/chroot/chroot-fs.cpp b/backends/fs/chroot/chroot-fs.cpp
index be6805bbd8..ac7cde3398 100644
--- a/backends/fs/chroot/chroot-fs.cpp
+++ b/backends/fs/chroot/chroot-fs.cpp
@@ -108,7 +108,7 @@ Common::WriteStream *ChRootFilesystemNode::createWriteStream() {
return _realNode->createWriteStream();
}
-bool ChRootFilesystemNode::create(bool /*isDir*/) {
+bool ChRootFilesystemNode::create(bool isDirectoryFlag) {
error("Not supported");
return false;
}
diff --git a/backends/fs/chroot/chroot-fs.h b/backends/fs/chroot/chroot-fs.h
index e0ecc1c47e..76902bc92a 100644
--- a/backends/fs/chroot/chroot-fs.h
+++ b/backends/fs/chroot/chroot-fs.h
@@ -49,7 +49,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
private:
static Common::String addPathComponent(const Common::String &path, const Common::String &component);
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp
index 83b1295838..035178dbb4 100644
--- a/backends/fs/ds/ds-fs.cpp
+++ b/backends/fs/ds/ds-fs.cpp
@@ -211,7 +211,7 @@ Common::WriteStream *DSFileSystemNode::createWriteStream() {
return Common::wrapBufferedWriteStream(stream, WRITE_BUFFER_SIZE);
}
-bool DSFileSystemNode::create(bool isDirectory) {
+bool DSFileSystemNode::create(bool isDirectoryFlag) {
error("Not supported");
return false;
}
@@ -271,7 +271,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path) {
_path = path;
}
-GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path, bool isDir) {
+GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path, bool isDirectoryFlag) {
//consolePrintf("'%s'",path.c_str());
int lastSlash = 3;
@@ -284,7 +284,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path, bool isDir)
_displayName = Common::String(path.c_str() + lastSlash + 1);
_path = path;
_isValid = true;
- _isDirectory = isDir;
+ _isDirectory = isDirectoryFlag;
}
@@ -398,7 +398,7 @@ Common::WriteStream *GBAMPFileSystemNode::createWriteStream() {
return Common::wrapBufferedWriteStream(stream, WRITE_BUFFER_SIZE);
}
-bool GBAMPFileSystemNode::create(bool isDirectory) {
+bool GBAMPFileSystemNode::create(bool isDirectoryFlag) {
error("Not supported");
return false;
}
diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h
index 939d1a1555..12dd6d6a59 100644
--- a/backends/fs/ds/ds-fs.h
+++ b/backends/fs/ds/ds-fs.h
@@ -91,7 +91,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
/**
* Returns the zip file this node points to.
@@ -132,7 +132,7 @@ public:
* @param path String with the path the new node should point to.
* @param path true if path is a directory, false otherwise.
*/
- GBAMPFileSystemNode(const Common::String &path, bool isDirectory);
+ GBAMPFileSystemNode(const Common::String &path, bool isDirectoryFlag);
/**
* Copy constructor.
@@ -157,7 +157,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
};
struct fileHandle {
diff --git a/backends/fs/n64/n64-fs.cpp b/backends/fs/n64/n64-fs.cpp
index d568500d30..5a131c0305 100644
--- a/backends/fs/n64/n64-fs.cpp
+++ b/backends/fs/n64/n64-fs.cpp
@@ -160,7 +160,7 @@ Common::WriteStream *N64FilesystemNode::createWriteStream() {
return RomfsStream::makeFromPath(getPath(), true);
}
-bool N64FilesystemNode::create(bool isDirectory) {
+bool N64FilesystemNode::create(bool isDirectoryFlag) {
error("Not supported");
return false;
}
diff --git a/backends/fs/n64/n64-fs.h b/backends/fs/n64/n64-fs.h
index d520ad5be6..b2de8a4bc4 100644
--- a/backends/fs/n64/n64-fs.h
+++ b/backends/fs/n64/n64-fs.h
@@ -73,7 +73,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
};
#endif
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index ce5715210a..4434bcba97 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -253,10 +253,10 @@ Common::WriteStream *POSIXFilesystemNode::createWriteStream() {
return StdioStream::makeFromPath(getPath(), true);
}
-bool POSIXFilesystemNode::create(bool isDir) {
+bool POSIXFilesystemNode::create(bool isDirectoryFlag) {
bool success;
- if (isDir) {
+ if (isDirectoryFlag) {
success = mkdir(_path.c_str(), 0755) == 0;
} else {
int fd = open(_path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0755);
@@ -270,12 +270,12 @@ bool POSIXFilesystemNode::create(bool isDir) {
if (success) {
setFlags();
if (_isValid) {
- if (_isDirectory != isDir) warning("failed to create %s: got %s", isDir ? "directory" : "file", _isDirectory ? "directory" : "file");
- return _isDirectory == isDir;
+ if (_isDirectory != isDirectoryFlag) warning("failed to create %s: got %s", isDirectoryFlag ? "directory" : "file", _isDirectory ? "directory" : "file");
+ return _isDirectory == isDirectoryFlag;
}
warning("POSIXFilesystemNode: %s() was a success, but stat indicates there is no such %s",
- isDir ? "mkdir" : "creat", isDir ? "directory" : "file");
+ isDirectoryFlag ? "mkdir" : "creat", isDirectoryFlag ? "directory" : "file");
return false;
}
diff --git a/backends/fs/posix/posix-fs.h b/backends/fs/posix/posix-fs.h
index 4ebce7e9d9..5a6b6bd2bd 100644
--- a/backends/fs/posix/posix-fs.h
+++ b/backends/fs/posix/posix-fs.h
@@ -73,7 +73,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
private:
/**
diff --git a/backends/fs/ps2/ps2-fs.cpp b/backends/fs/ps2/ps2-fs.cpp
index 8391e063a0..eba740e948 100644
--- a/backends/fs/ps2/ps2-fs.cpp
+++ b/backends/fs/ps2/ps2-fs.cpp
@@ -441,7 +441,7 @@ Common::WriteStream *Ps2FilesystemNode::createWriteStream() {
return PS2FileStream::makeFromPath(getPath(), true);
}
-bool Ps2FilesystemNode::create(bool isDirectory) {
+bool Ps2FilesystemNode::create(bool isDirectoryFlag) {
error("Not supported");
return false;
}
diff --git a/backends/fs/ps2/ps2-fs.h b/backends/fs/ps2/ps2-fs.h
index c9da434535..ca476eca9f 100644
--- a/backends/fs/ps2/ps2-fs.h
+++ b/backends/fs/ps2/ps2-fs.h
@@ -96,7 +96,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
int getDev() { return 0; }
};
diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp
index 6bd5e93435..c69592ea99 100644
--- a/backends/fs/psp/psp-fs.cpp
+++ b/backends/fs/psp/psp-fs.cpp
@@ -239,7 +239,7 @@ Common::WriteStream *PSPFilesystemNode::createWriteStream() {
return Common::wrapBufferedWriteStream(stream, WRITE_BUFFER_SIZE);
}
-bool PSPFilesystemNode::create(bool isDirectory) {
+bool PSPFilesystemNode::create(bool isDirectoryFlag) {
error("Not supported");
return false;
}
diff --git a/backends/fs/psp/psp-fs.h b/backends/fs/psp/psp-fs.h
index 648544650b..47c6d04a70 100644
--- a/backends/fs/psp/psp-fs.h
+++ b/backends/fs/psp/psp-fs.h
@@ -65,7 +65,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
};
#endif
diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp
index e4163caa33..c6d5cc4955 100644
--- a/backends/fs/symbian/symbian-fs.cpp
+++ b/backends/fs/symbian/symbian-fs.cpp
@@ -232,7 +232,7 @@ Common::WriteStream *SymbianFilesystemNode::createWriteStream() {
return SymbianStdioStream::makeFromPath(getPath(), true);
}
-bool SymbianFilesystemNode::create(bool isDirectory) {
+bool SymbianFilesystemNode::create(bool isDirectoryFlag) {
error("Not supported");
return false;
}
diff --git a/backends/fs/symbian/symbian-fs.h b/backends/fs/symbian/symbian-fs.h
index 1327f9f2e9..0f8212035f 100644
--- a/backends/fs/symbian/symbian-fs.h
+++ b/backends/fs/symbian/symbian-fs.h
@@ -66,7 +66,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
};
#endif
diff --git a/backends/fs/wii/wii-fs.cpp b/backends/fs/wii/wii-fs.cpp
index e036b75019..c3fdbc07b2 100644
--- a/backends/fs/wii/wii-fs.cpp
+++ b/backends/fs/wii/wii-fs.cpp
@@ -213,7 +213,7 @@ Common::WriteStream *WiiFilesystemNode::createWriteStream() {
return StdioStream::makeFromPath(getPath(), true);
}
-bool WiiFilesystemNode::create(bool isDirectory) {
+bool WiiFilesystemNode::create(bool isDirectoryFlag) {
error("Not supported");
return false;
}
diff --git a/backends/fs/wii/wii-fs.h b/backends/fs/wii/wii-fs.h
index affb765884..491c8d1d2c 100644
--- a/backends/fs/wii/wii-fs.h
+++ b/backends/fs/wii/wii-fs.h
@@ -69,7 +69,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
};
#endif
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index b43686f911..caf0e31360 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -244,10 +244,10 @@ Common::WriteStream *WindowsFilesystemNode::createWriteStream() {
return StdioStream::makeFromPath(getPath(), true);
}
-bool WindowsFilesystemNode::create(bool isDirectory) {
+bool WindowsFilesystemNode::create(bool isDirectoryFlag) {
bool success;
- if (isDirectory) {
+ if (isDirectoryFlag) {
success = CreateDirectory(toUnicode(_path.c_str()), NULL) != 0;
} else {
success = CreateFile(toUnicode(_path.c_str()), GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL) != INVALID_HANDLE_VALUE;
@@ -264,12 +264,12 @@ bool WindowsFilesystemNode::create(bool isDirectory) {
_path += '\\';
}
- if (_isDirectory != isDirectory) warning("failed to create %s: got %s", isDirectory ? "directory" : "file", _isDirectory ? "directory" : "file");
- return _isDirectory == isDirectory;
+ if (_isDirectory != isDirectoryFlag) warning("failed to create %s: got %s", isDirectoryFlag ? "directory" : "file", _isDirectory ? "directory" : "file");
+ return _isDirectory == isDirectoryFlag;
}
warning("WindowsFilesystemNode: Create%s() was a success, but GetFileAttributes() indicates there is no such %s",
- isDirectory ? "Directory" : "File", isDirectory ? "directory" : "file");
+ isDirectoryFlag ? "Directory" : "File", isDirectoryFlag ? "directory" : "file");
return false;
}
diff --git a/backends/fs/windows/windows-fs.h b/backends/fs/windows/windows-fs.h
index 7c9f2c1e1a..3758877f05 100644
--- a/backends/fs/windows/windows-fs.h
+++ b/backends/fs/windows/windows-fs.h
@@ -88,7 +88,7 @@ public:
virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream();
- virtual bool create(bool isDirectory);
+ virtual bool create(bool isDirectoryFlag);
private:
/**
diff --git a/backends/networking/curl/networkreadstream.cpp b/backends/networking/curl/networkreadstream.cpp
index b4516701a7..4da18ce311 100644
--- a/backends/networking/curl/networkreadstream.cpp
+++ b/backends/networking/curl/networkreadstream.cpp
@@ -228,19 +228,19 @@ Common::String NetworkReadStream::responseHeaders() const {
}
uint32 NetworkReadStream::fillWithSendingContents(char *bufferToFill, uint32 maxSize) {
- uint32 size = _sendingContentsSize - _sendingContentsPos;
- if (size > maxSize)
- size = maxSize;
- for (uint32 i = 0; i < size; ++i) {
+ uint32 sendSize = _sendingContentsSize - _sendingContentsPos;
+ if (sendSize > maxSize)
+ sendSize = maxSize;
+ for (uint32 i = 0; i < sendSize; ++i) {
bufferToFill[i] = _sendingContentsBuffer[_sendingContentsPos + i];
}
- _sendingContentsPos += size;
- return size;
+ _sendingContentsPos += sendSize;
+ return sendSize;
}
-uint32 NetworkReadStream::addResponseHeaders(char *buffer, uint32 size) {
- _responseHeaders += Common::String(buffer, size);
- return size;
+uint32 NetworkReadStream::addResponseHeaders(char *buffer, uint32 bufferSize) {
+ _responseHeaders += Common::String(buffer, bufferSize);
+ return bufferSize;
}
double NetworkReadStream::getProgress() const {
diff --git a/backends/networking/curl/networkreadstream.h b/backends/networking/curl/networkreadstream.h
index 62a3e41d9b..275d8dbd79 100644
--- a/backends/networking/curl/networkreadstream.h
+++ b/backends/networking/curl/networkreadstream.h
@@ -128,7 +128,7 @@ public:
*
* @returns how many bytes were actually read
*/
- uint32 addResponseHeaders(char *buffer, uint32 size);
+ uint32 addResponseHeaders(char *buffer, uint32 bufferSize);
/** Returns a number in range [0, 1], where 1 is "complete". */
double getProgress() const;
diff --git a/common/EventMapper.cpp b/common/EventMapper.cpp
index cf65946d50..f84d24b4d0 100644
--- a/common/EventMapper.cpp
+++ b/common/EventMapper.cpp
@@ -35,7 +35,6 @@ List<Event> DefaultEventMapper::mapEvent(const Event &ev, EventSource *source) {
// of middle mouse button.
const uint32 vkeybdTime = 1000;
- static bool vkeybd = false;
static uint32 vkeybdThen = 0;
if (ev.type == EVENT_MBUTTONDOWN) {
diff --git a/common/debug-channels.h b/common/debug-channels.h
index 1414a1053a..0fb8006803 100644
--- a/common/debug-channels.h
+++ b/common/debug-channels.h
@@ -117,7 +117,7 @@ public:
/**
* Test whether the given debug channel is enabled.
*/
- bool isDebugChannelEnabled(uint32 channel);
+ bool isDebugChannelEnabled(uint32 channel, bool enforce = false);
private:
typedef HashMap<String, DebugChannel, IgnoreCase_Hash, IgnoreCase_EqualTo> DebugChannelMap;
diff --git a/common/debug.cpp b/common/debug.cpp
index c61fc63dea..5db8990db8 100644
--- a/common/debug.cpp
+++ b/common/debug.cpp
@@ -110,9 +110,9 @@ void DebugManager::disableAllDebugChannels() {
disableDebugChannel(i->_value.name);
}
-bool DebugManager::isDebugChannelEnabled(uint32 channel) {
+bool DebugManager::isDebugChannelEnabled(uint32 channel, bool enforce) {
// Debug level 11 turns on all special debug level messages
- if (gDebugLevel == 11)
+ if (gDebugLevel == 11 && enforce == false)
return true;
else
return (gDebugChannelsEnabled & channel) != 0;
@@ -125,8 +125,8 @@ bool debugLevelSet(int level) {
}
bool debugChannelSet(int level, uint32 debugChannels) {
- if (gDebugLevel != 11)
- if (level > gDebugLevel || !(DebugMan.isDebugChannelEnabled(debugChannels)))
+ if (gDebugLevel != 11 || level == -1)
+ if ((level != -1 && level > gDebugLevel) || !(DebugMan.isDebugChannelEnabled(debugChannels, level == -1)))
return false;
return true;
diff --git a/common/debug.h b/common/debug.h
index 883a0bf29d..5ec37f2f1e 100644
--- a/common/debug.h
+++ b/common/debug.h
@@ -117,6 +117,7 @@ bool debugLevelSet(int level);
/**
* Returns true if the debug level and channel are active
*
+ * @param level debug level to check against. If set to -1, only channel check is active
* @see enableDebugChannel
*/
bool debugChannelSet(int level, uint32 debugChannels);
diff --git a/common/json.cpp b/common/json.cpp
index 792d1967e9..c8caf01519 100644
--- a/common/json.cpp
+++ b/common/json.cpp
@@ -979,17 +979,13 @@ String JSONValue::stringifyImpl(size_t const indentDepth) const {
if (isinf(_numberValue) || isnan(_numberValue))
ret_string = "null";
else {
- char str[80];
- sprintf(str, "%g", _numberValue);
- ret_string = str;
+ ret_string = String::format("%g", _numberValue);
}
break;
}
case JSONType_IntegerNumber: {
- char str[80];
- sprintf(str, "%lld", _integerValue);
- ret_string = str;
+ ret_string = String::format("%lld", _integerValue);
break;
}
diff --git a/engines/adl/disk.cpp b/engines/adl/disk.cpp
index d07e0c540c..133c655706 100644
--- a/engines/adl/disk.cpp
+++ b/engines/adl/disk.cpp
@@ -69,7 +69,7 @@ static Common::SeekableReadStream *readImage_NIB(const Common::String &filename)
byte *const diskImage = (byte *)calloc(imageSize, 1);
bool sawAddress = false;
- uint8 volNo, track, sector;
+ uint8 volNo = 0, track = 0, sector = 0;
bool newStyle;
byte buffer[trackLen];
diff --git a/engines/bladerunner/item.cpp b/engines/bladerunner/item.cpp
index 6200668e14..b8d4cd2c1f 100644
--- a/engines/bladerunner/item.cpp
+++ b/engines/bladerunner/item.cpp
@@ -122,7 +122,7 @@ void Item::setXYZ(Vector3 position) {
_depth = screenPosition.z * 25.5f;
}
-void Item::setup(int itemId, int setId, int animationId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy) {
+void Item::setup(int itemId, int setId, int animationId, Vector3 position, int facing, int height, int width, bool isTargetableFlag, bool isVisibleFlag, bool isPoliceMazeEnemyFlag) {
_itemId = itemId;
_setId = setId;
_animationId = animationId;
@@ -130,9 +130,9 @@ void Item::setup(int itemId, int setId, int animationId, Vector3 position, int f
_angle = facing * (M_PI / 512.0f);
_width = width;
_height = height;
- _isTargetable = isTargetable;
- _isVisible = isVisible;
- _isPoliceMazeEnemy = isPoliceMazeEnemy;
+ _isTargetable = isTargetableFlag;
+ _isVisible = isVisibleFlag;
+ _isPoliceMazeEnemy = isPoliceMazeEnemyFlag;
setXYZ(position);
_screenRectangle.bottom = -1;
_screenRectangle.right = -1;
diff --git a/engines/bladerunner/item.h b/engines/bladerunner/item.h
index 3f12a6ad3a..0c74bf3be3 100644
--- a/engines/bladerunner/item.h
+++ b/engines/bladerunner/item.h
@@ -70,7 +70,7 @@ public:
bool isTargetable();
void tick(bool special);
- void setup(int itemId, int setId, int animationId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy);
+ void setup(int itemId, int setId, int animationId, Vector3 position, int facing, int height, int width, bool isTargetableFlag, bool isVisibleFlag, bool isPoliceMazeEnemyFlag);
};
}
diff --git a/engines/bladerunner/items.cpp b/engines/bladerunner/items.cpp
index 2bc06e0a72..6fa17dffd5 100644
--- a/engines/bladerunner/items.cpp
+++ b/engines/bladerunner/items.cpp
@@ -62,7 +62,7 @@ void Items::tick() {
}
}
-bool Items::addToWorld(int itemId, int animationId, int setId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy, bool addToSet) {
+bool Items::addToWorld(int itemId, int animationId, int setId, Vector3 position, int facing, int height, int width, bool isTargetableFlag, bool isVisibleFlag, bool isPoliceMazeEnemyFlag, bool addToSetFlag) {
if (_items.size() >= 100) {
return false;
}
@@ -72,11 +72,11 @@ bool Items::addToWorld(int itemId, int animationId, int setId, Vector3 position,
}
Item *item = new Item(_vm);
- item->setup(itemId, setId, animationId, position, facing, height, width, isTargetable, isVisible, isPoliceMazeEnemy);
+ item->setup(itemId, setId, animationId, position, facing, height, width, isTargetableFlag, isVisibleFlag, isPoliceMazeEnemyFlag);
_items.push_back(item);
- if (addToSet && setId == _vm->_scene->getSetId()) {
- return _vm->_sceneObjects->addItem(itemId + SCENE_OBJECTS_ITEMS_OFFSET, &item->_boundingBox, &item->_screenRectangle, isTargetable, isVisible);
+ if (addToSetFlag && setId == _vm->_scene->getSetId()) {
+ return _vm->_sceneObjects->addItem(itemId + SCENE_OBJECTS_ITEMS_OFFSET, &item->_boundingBox, &item->_screenRectangle, isTargetableFlag, isVisibleFlag);
}
return true;
}
diff --git a/engines/bladerunner/items.h b/engines/bladerunner/items.h
index 667117fba2..c288e93bae 100644
--- a/engines/bladerunner/items.h
+++ b/engines/bladerunner/items.h
@@ -43,7 +43,7 @@ public:
void getWidthHeight(int itemId, int *width, int *height);
void tick();
- bool addToWorld(int itemId, int animationId, int setId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy, bool b);
+ bool addToWorld(int itemId, int animationId, int setId, Vector3 position, int facing, int height, int width, bool isTargetableFlag, bool isVisibleFlag, bool isPoliceMazeEnemyFlag, bool addToSetFlag);
bool addToSet(int itemId);
bool remove(int itemId);
diff --git a/engines/bladerunner/vqa_decoder.cpp b/engines/bladerunner/vqa_decoder.cpp
index fe94012c51..15bf49306a 100644
--- a/engines/bladerunner/vqa_decoder.cpp
+++ b/engines/bladerunner/vqa_decoder.cpp
@@ -434,10 +434,9 @@ bool VQADecoder::readCINF(Common::SeekableReadStream *s, uint32 size) {
return false;
for (int i = 0; i != _clipInfo.clipCount; ++i) {
- uint16 a;
- uint32 b;
- a = s->readUint16LE();
- b = s->readUint32LE();
+ uint16 a = s->readUint16LE();
+ uint32 b = s->readUint32LE();
+ debug("VQADecoder::readCINF() i: %d a: 0x%04x b: 0x%08x", i, a, b);
}
return true;
@@ -471,13 +470,13 @@ bool VQADecoder::readLNIN(Common::SeekableReadStream *s, uint32 size) {
if (chd.id != kLNIH || chd.size != 10)
return false;
- uint16 loopNamesCount, loopUnk1, loopUnk2, loopUnk3, loopUnk4;
+ uint16 loopNamesCount = s->readUint16LE();
+ uint16 loopUnk1 = s->readUint16LE();
+ uint16 loopUnk2 = s->readUint16LE();
+ uint16 loopUnk3 = s->readUint16LE();
+ uint16 loopUnk4 = s->readUint16LE();
- loopNamesCount = s->readUint16LE();
- loopUnk1 = s->readUint16LE();
- loopUnk2 = s->readUint16LE();
- loopUnk3 = s->readUint16LE();
- loopUnk4 = s->readUint16LE();
+ debug("VQADecoder::readLNIN() Unknown Values: 0x%04x 0x%04x 0x%04x 0x%04x", loopUnk1, loopUnk2, loopUnk3, loopUnk4);
if (loopNamesCount != _loopInfo.loopCount)
return false;
diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 5b1a26ffd4..593fb638e4 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -100,6 +100,18 @@ Common::SeekableSubReadStreamEndian *Archive::getResource(uint32 tag, uint16 id)
return new Common::SeekableSubReadStreamEndian(_stream, res.offset, res.offset + res.size, _isBigEndian, DisposeAfterUse::NO);
}
+Resource Archive::getResourceDetail(uint32 tag, uint16 id) {
+ if (!_types.contains(tag))
+ error("Archive does not contain '%s' %04x", tag2str(tag), id);
+
+ const ResourceMap &resMap = _types[tag];
+
+ if (!resMap.contains(id))
+ error("Archive does not contain '%s' %04x", tag2str(tag), id);
+
+ return resMap[id];
+}
+
uint32 Archive::getOffset(uint32 tag, uint16 id) const {
if (!_types.contains(tag))
error("Archive does not contain '%s' %04x", tag2str(tag), id);
@@ -365,6 +377,7 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
subStream.readUint32(); // unknown
Common::Array<Resource> resources;
+ resources.reserve(2048);
// Need to look for these two resources
const Resource *keyRes = 0;
@@ -395,6 +408,11 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
keyRes = &resources[resources.size() - 1];
else if (tag == MKTAG('C', 'A', 'S', '*'))
casRes = &resources[resources.size() - 1];
+ //or the children of
+ else if (tag == MKTAG('S', 'T', 'X', 'T') ||
+ tag == MKTAG('B', 'I', 'T', 'D') ||
+ tag == MKTAG('D', 'I', 'B', ' '))
+ _types[tag][i] = res;
}
// We need to have found the 'File' resource already
@@ -409,6 +427,8 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
return false;
}
+ uint castTag = MKTAG('C', 'A', 'S', 't');
+
// Parse the CAS*, if present
if (casRes) {
Common::SeekableSubReadStreamEndian casStream(stream, casRes->offset + 8, casRes->offset + 8 + casRes->size, _isBigEndian, DisposeAfterUse::NO);
@@ -420,8 +440,10 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
for (uint i = 0; i < casSize; i++) {
uint32 index = casStream.readUint32();
- const Resource &res = resources[index];
- _types[MKTAG('C', 'A', 'S', 't')][i + 1] = res;
+ Resource &res = resources[index];
+ res.index = index;
+ res.castId = i + 1;
+ _types[castTag][res.castId] = res;
debugCN(2, kDebugLoading, "%d ", index);
}
@@ -444,10 +466,20 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
debugC(2, kDebugLoading, "KEY*: index: %d id: %d resTag: %s", index, id, tag2str(resTag));
- const Resource &res = resources[index];
+ Resource &res = resources[index];
debug(3, "Found RIFX resource: '%s' id: 0x%04x, %d @ 0x%08x (%d)", tag2str(resTag), id, res.size, res.offset, res.offset);
_types[resTag][id] = res;
- _types[resTag][1024 + i + 1] = res;
+ //_types[resTag][1024 + i + 1] = res;
+
+ if (id < 1024) {
+ for (uint cast = 0; cast < _types[castTag].size(); cast++) {
+ if (_types[castTag][cast].index == id) {
+ res.index = index;
+ _types[castTag][cast].children.push_back(res);
+ break;
+ }
+ }
+ }
}
_stream = stream;
@@ -471,5 +503,17 @@ Common::SeekableSubReadStreamEndian *RIFXArchive::getResource(uint32 tag, uint16
return new Common::SeekableSubReadStreamEndian(_stream, offset, offset + size, true, DisposeAfterUse::NO);
}
+Resource RIFXArchive::getResourceDetail(uint32 tag, uint16 id) {
+ if (!_types.contains(tag))
+ error("Archive does not contain '%s' %04x", tag2str(tag), id);
+
+ const ResourceMap &resMap = _types[tag];
+
+ if (!resMap.contains(id))
+ error("Archive does not contain '%s' %04x", tag2str(tag), id);
+
+ return resMap[id];
+}
+
} // End of namespace Director
diff --git a/engines/director/archive.h b/engines/director/archive.h
index 93f4ce7ee9..b77bace9ba 100644
--- a/engines/director/archive.h
+++ b/engines/director/archive.h
@@ -33,6 +33,15 @@ class MacResManager;
namespace Director {
// Completely ripped off of Mohawk's Archive code
+
+struct Resource {
+ uint32 index;
+ uint32 offset;
+ uint32 size;
+ uint32 castId;
+ Common::String name;
+ Common::Array<Resource> children;
+};
class Archive {
public:
@@ -50,6 +59,7 @@ public:
bool hasResource(uint32 tag, uint16 id) const;
bool hasResource(uint32 tag, const Common::String &resName) const;
virtual Common::SeekableSubReadStreamEndian *getResource(uint32 tag, uint16 id);
+ virtual Resource getResourceDetail(uint32 tag, uint16 id);
uint32 getOffset(uint32 tag, uint16 id) const;
uint16 findResourceID(uint32 tag, const Common::String &resName) const;
Common::String getName(uint32 tag, uint16 id) const;
@@ -61,11 +71,6 @@ public:
protected:
Common::SeekableReadStream *_stream;
- struct Resource {
- uint32 offset;
- uint32 size;
- Common::String name;
- };
typedef Common::HashMap<uint16, Resource> ResourceMap;
typedef Common::HashMap<uint32, ResourceMap> TypeMap;
TypeMap _types;
@@ -103,6 +108,7 @@ public:
bool openStream(Common::SeekableReadStream *stream, uint32 startOffset = 0);
Common::SeekableSubReadStreamEndian *getResource(uint32 tag, uint16 id);
+ Resource getResourceDetail(uint32 tag, uint16 id);
};
} // End of namespace Director
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 892ac48f8c..0db59cbd64 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -41,11 +41,18 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint16 version) {
unk2 = stream.readUint16();
}
} else {
+ stream.readByte();
+ stream.readByte();
+
initialRect = Score::readRect(stream);
boundingRect = Score::readRect(stream);
regX = stream.readUint16();
regY = stream.readUint16();
+ bitsPerPixel = stream.readUint16();
+ if (bitsPerPixel == 0)
+ bitsPerPixel = 1;
+
int tail = 0;
while (!stream.eos()) {
@@ -83,11 +90,33 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
if (flags & 0x4)
textFlags.push_back(kTextFlagDoNotWrap);
if (flags & 0xf8)
- warning("Unproxessed text cast flags: %x", flags & 0xf8);
+ warning("Unprocessed text cast flags: %x", flags & 0xf8);
// TODO: FIXME: guesswork
fontId = stream.readByte();
fontSize = stream.readByte();
+ } else if (version < 5) {
+ borderSize = static_cast<SizeType>(stream.readByte());
+ gutterSize = static_cast<SizeType>(stream.readByte());
+ boxShadow = static_cast<SizeType>(stream.readByte());
+ textType = static_cast<TextType>(stream.readByte());
+ textAlign = static_cast<TextAlignType>(stream.readSint16()); //this is because 'right' is -1? or should that be 255?
+ stream.readUint16();
+ stream.readUint16();
+ stream.readUint16();
+ stream.readUint16();
+
+ fontId = 1; //this is in STXT
+
+ initialRect = Score::readRect(stream);
+ stream.readUint16();
+ textShadow = static_cast<SizeType>(stream.readByte());
+ byte flags = stream.readByte();
+
+ if (flags)
+ warning("Unproxessed text cast flags: %x", flags);
+
+ fontSize = stream.readUint16();
} else {
initialRect = Score::readRect(stream);
boundingRect = Score::readRect(stream);
@@ -109,6 +138,9 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
lineThickness = stream.readByte();
lineDirection = stream.readByte();
} else {
+ stream.readByte();
+ stream.readByte();
+
initialRect = Score::readRect(stream);
boundingRect = Score::readRect(stream);
}
@@ -119,8 +151,13 @@ ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextC
if (version < 4) {
buttonType = static_cast<ButtonType>(stream.readUint16BE());
} else {
+ stream.readByte();
+ stream.readByte();
+
initialRect = Score::readRect(stream);
boundingRect = Score::readRect(stream);
+
+ buttonType = static_cast<ButtonType>(stream.readUint16BE());
}
modified = 0;
}
@@ -129,6 +166,9 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
if (version < 4) {
error("Unhandled Script cast");
} else {
+ stream.readByte();
+ stream.readByte();
+
initialRect = Score::readRect(stream);
boundingRect = Score::readRect(stream);
diff --git a/engines/director/cast.h b/engines/director/cast.h
index 69edf8ce89..953c94c4c6 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -25,10 +25,12 @@
#include "common/rect.h"
#include "common/substream.h"
+#include "director/archive.h"
namespace Director {
enum CastType {
+ kCastTypeNull = 0,
kCastBitmap = 1,
kCastFilmLoop = 2,
kCastText = 3,
@@ -39,13 +41,14 @@ enum CastType {
kCastShape = 8,
kCastMovie = 9,
kCastDigitalVideo = 10,
- kCastScript = 11
+ kCastLingoScript = 11
};
struct Cast {
CastType type;
Common::Rect initialRect;
Common::Rect boundingRect;
+ Common::Array<Resource> children;
byte modified;
};
@@ -58,6 +61,8 @@ struct BitmapCast : Cast {
uint8 flags;
uint16 someFlaggyThing;
uint16 unk1, unk2;
+
+ uint16 bitsPerPixel;
};
enum ShapeType {
@@ -119,8 +124,9 @@ struct TextCast : Cast {
TextType textType;
TextAlignType textAlign;
SizeType textShadow;
+ byte textSlant;
Common::Array<TextFlag> textFlags;
- int16 palinfo1, palinfo2, palinfo3;
+ uint16 palinfo1, palinfo2, palinfo3;
};
enum ButtonType {
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index c21624168f..fa5ae9402e 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -51,6 +51,9 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
// Setup mixer
syncSoundSettings();
+ // Load Patterns
+ loadPatterns();
+
_sharedCasts = nullptr;
_currentScore = nullptr;
diff --git a/engines/director/director.h b/engines/director/director.h
index 7ec9608662..3a7a4c8427 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -34,7 +34,8 @@ class MacResManager;
}
namespace Graphics {
-class MacWindowManager;
+class MacWindowManager;
+typedef Common::Array<byte *> MacPatterns;
}
namespace Director {
@@ -73,6 +74,7 @@ public:
Common::Language getLanguage() const;
Common::String getEXEName() const;
DirectorSound *getSoundManager() const { return _soundManager; }
+ Graphics::MacWindowManager *getMacWindowManager() const { return _wm; }
Archive *getMainArchive() const { return _mainArchive; }
Lingo *getLingo() const { return _lingo; }
Score *getCurrentScore() const { return _currentScore; }
@@ -81,6 +83,8 @@ public:
const byte *getPalette() const { return _currentPalette; }
uint16 getPaletteColorCount() const { return _currentPaletteLength; }
void loadSharedCastsFrom(Common::String filename);
+ void loadPatterns();
+ Graphics::MacPatterns &getPatterns();
void loadMainArchive();
Archive *createArchive();
@@ -133,6 +137,9 @@ private:
uint16 _currentPaletteLength;
Lingo *_lingo;
+ Graphics::MacPatterns _director3Patterns;
+ Graphics::MacPatterns _director3QuickDrawPatterns;
+
Common::String _sharedCastFile;
private:
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index de0de6d4d0..97252344cd 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -24,6 +24,7 @@
#include "graphics/font.h"
#include "graphics/macgui/macfontmanager.h"
#include "graphics/macgui/macwindowmanager.h"
+#include "graphics/primitives.h"
#include "image/bmp.h"
#include "director/director.h"
@@ -114,54 +115,61 @@ void Frame::readChannel(Common::SeekableSubReadStreamEndian &stream, uint16 offs
}
void Frame::readChannels(Common::ReadStreamEndian *stream) {
- _actionId = stream->readByte();
- _soundType1 = stream->readByte(); // type: 0x17 for sounds (sound is cast id), 0x16 for MIDI (sound is cmd id)
- uint8 transFlags = stream->readByte(); // 0x80 is whole stage (vs changed area), rest is duration in 1/4ths of a second
-
- if (transFlags & 0x80)
- _transArea = 1;
- else
- _transArea = 0;
- _transDuration = transFlags & 0x7f;
-
- _transChunkSize = stream->readByte();
- _tempo = stream->readByte();
- _transType = static_cast<TransitionType>(stream->readByte());
- _sound1 = stream->readUint16();
- if (_vm->getPlatform() == Common::kPlatformMacintosh) {
- _sound2 = stream->readUint16();
- _soundType2 = stream->readByte();
- } else {
- byte unk[3];
- stream->read(unk, 3);
- warning("unk1: %x unk2: %x unk3: %x", unk[0], unk[1], unk[2]);
- }
- _skipFrameFlag = stream->readByte();
- _blend = stream->readByte();
+ byte unk[16];
- if (_vm->getPlatform() != Common::kPlatformMacintosh) {
- _sound2 = stream->readUint16();
- _soundType2 = stream->readByte();
- }
+ if (_vm->getVersion() < 4) {
+ _actionId = stream->readByte();
+ _soundType1 = stream->readByte(); // type: 0x17 for sounds (sound is cast id), 0x16 for MIDI (sound is cmd id)
+ uint8 transFlags = stream->readByte(); // 0x80 is whole stage (vs changed area), rest is duration in 1/4ths of a second
- uint16 palette = stream->readUint16();
+ if (transFlags & 0x80)
+ _transArea = 1;
+ else
+ _transArea = 0;
+ _transDuration = transFlags & 0x7f;
+
+ _transChunkSize = stream->readByte();
+ _tempo = stream->readByte();
+ _transType = static_cast<TransitionType>(stream->readByte());
+ _sound1 = stream->readUint16();
+ if (_vm->getPlatform() == Common::kPlatformMacintosh) {
+ _sound2 = stream->readUint16();
+ _soundType2 = stream->readByte();
+ } else {
+ stream->read(unk, 3);
+ warning("unk1: %x unk2: %x unk3: %x", unk[0], unk[1], unk[2]);
+ }
+ _skipFrameFlag = stream->readByte();
+ _blend = stream->readByte();
- if (palette) {
- warning("STUB: Palette info");
- }
+ if (_vm->getPlatform() != Common::kPlatformMacintosh) {
+ _sound2 = stream->readUint16();
+ _soundType2 = stream->readByte();
+ }
- debugC(kDebugLoading, 8, "%d %d %d %d %d %d %d %d %d %d %d", _actionId, _soundType1, _transDuration, _transChunkSize, _tempo, _transType, _sound1, _skipFrameFlag, _blend, _sound2, _soundType2);
+ uint16 palette = stream->readUint16();
- _palette = new PaletteInfo();
- _palette->firstColor = stream->readByte(); // for cycles. note: these start at 0x80 (for pal entry 0)!
- _palette->lastColor = stream->readByte();
- _palette->flags = stream->readByte();
- _palette->speed = stream->readByte();
- _palette->frameCount = stream->readUint16();
+ if (palette) {
+ warning("STUB: Palette info");
+ }
+
+ debugC(kDebugLoading, 8, "%d %d %d %d %d %d %d %d %d %d %d", _actionId, _soundType1, _transDuration, _transChunkSize, _tempo, _transType, _sound1, _skipFrameFlag, _blend, _sound2, _soundType2);
+
+ _palette = new PaletteInfo();
+ _palette->firstColor = stream->readByte(); // for cycles. note: these start at 0x80 (for pal entry 0)!
+ _palette->lastColor = stream->readByte();
+ _palette->flags = stream->readByte();
+ _palette->speed = stream->readByte();
+ _palette->frameCount = stream->readUint16();
+
+ _palette->cycleCount = stream->readUint16();
+ } else if (_vm->getVersion() < 5) {
+ stream->read(unk, 16);
+ _actionId = stream->readUint16();
+ stream->read(unk, 5);
+ }
- _palette->cycleCount = stream->readUint16();
- byte unk[11];
stream->read(unk, 6);
if (_vm->getPlatform() == Common::kPlatformMacintosh) {
@@ -181,8 +189,9 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
for (int i = 0; i < CHANNEL_COUNT; i++) {
Sprite &sprite = *_sprites[i + 1];
- sprite._x1 = stream->readByte();
- sprite._enabled = (stream->readByte() != 0);
+ sprite._scriptId = stream->readByte();
+ sprite._spriteType = stream->readByte();
+ sprite._enabled = sprite._spriteType != 0;
sprite._x2 = stream->readUint16();
sprite._flags = stream->readUint16();
@@ -193,14 +202,14 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
else
sprite._trails = 0;
+ sprite._lineSize = (sprite._flags >> 8) & 0x03;
+
sprite._castId = stream->readUint16();
sprite._startPoint.y = stream->readUint16();
sprite._startPoint.x = stream->readUint16();
sprite._height = stream->readUint16();
sprite._width = stream->readUint16();
- debugC(kDebugLoading, 8, "%03d(%d)[%x,%x,%04x,%d/%d/%d/%d]", sprite._castId, sprite._enabled, sprite._x1, sprite._x2, sprite._flags, sprite._startPoint.x, sprite._startPoint.y, sprite._width, sprite._height);
-
if (_vm->getPlatform() == Common::kPlatformMacintosh && _vm->getVersion() >= 4) {
sprite._scriptId = stream->readUint16();
sprite._flags2 = stream->readByte(); // 0x40 editable, 0x80 moveable
@@ -209,6 +218,11 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
if (_vm->getVersion() >= 5)
sprite._unk3 = stream->readUint32();
}
+
+ debugC(kDebugLoading, 8, "%03d(%d)[%x,%x,%04x,%d/%d/%d/%d/%d] script:%d",
+ sprite._castId, sprite._enabled, sprite._x1, sprite._x2, sprite._flags,
+ sprite._startPoint.x, sprite._startPoint.y, sprite._width, sprite._height,
+ sprite._lineSize, sprite._scriptId);
}
}
@@ -360,6 +374,7 @@ void Frame::readSprite(Common::SeekableSubReadStreamEndian &stream, uint16 offse
}
void Frame::prepareFrame(Score *score) {
+ _drawRects.clear();
renderSprites(*score->_surface, false);
renderSprites(*score->_trailSurface, true);
@@ -529,85 +544,175 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
if ((_sprites[i]->_trails == 0 && renderTrail) || (_sprites[i]->_trails == 1 && !renderTrail))
continue;
- Cast *cast;
- if (!_vm->_currentScore->_casts.contains(_sprites[i]->_castId)) {
- if (!_vm->getSharedCasts()->contains(_sprites[i]->_castId)) {
- warning("Cast id %d not found", _sprites[i]->_castId);
- continue;
- } else {
- warning("Getting cast id %d from shared cast", _sprites[i]->_castId);
- cast = _vm->getSharedCasts()->getVal(_sprites[i]->_castId);
+ CastType castType = kCastTypeNull;
+ Cast *cast = nullptr;
+ if (_vm->getVersion() < 4) {
+ switch (_sprites[i]->_spriteType) {
+ case 0x01:
+ castType = kCastBitmap;
+ break;
+ case 0x02:
+ case 0x0c: //this is actually a mouse-over shape? I don't think it's a real button.
+ castType = kCastShape;
+ break;
+ case 0x07:
+ castType = kCastText;
+ break;
}
} else {
- cast = _vm->_currentScore->_casts[_sprites[i]->_castId];
+ if (!_vm->_currentScore->_casts.contains(_sprites[i]->_castId)) {
+ if (!_vm->getSharedCasts()->contains(_sprites[i]->_castId)) {
+ warning("Cast id %d not found", _sprites[i]->_castId);
+ continue;
+ } else {
+ warning("Getting cast id %d from shared cast", _sprites[i]->_castId);
+ cast = _vm->getSharedCasts()->getVal(_sprites[i]->_castId);
+ }
+ } else {
+ cast = _vm->_currentScore->_casts[_sprites[i]->_castId];
+ }
+ castType = cast->type;
}
- if (cast->type == kCastText) {
- renderText(surface, i);
- continue;
- }
+ //this needs precedence to be hit first... D3 does something really tricky with cast IDs for shapes.
+ //I don't like this implementation 100% as the 'cast' above might not actually hit a member and be null?
+ if (castType == kCastShape) {
+ renderShape(surface, i);
+ } else if (castType == kCastText) {
+ renderText(surface, i, _vm->getVersion() < 4 ? _sprites[i]->_castId + 1024 : cast->children[0].index);
+ } else if (castType == kCastButton) {
+ renderButton(surface, i, _vm->getVersion() < 4 ? _sprites[i]->_castId + 1024 : cast->children[0].index);
+ } else {
+ Image::ImageDecoder *img = getImageFrom(_sprites[i]->_castId);
- Image::ImageDecoder *img = getImageFrom(_sprites[i]->_castId);
+ if (!img) {
+ warning("Image with id %d not found", _sprites[i]->_castId);
+ continue;
+ }
- if (!img) {
- warning("Image with id %d not found", _sprites[i]->_castId);
- continue;
- }
+ if (!img->getSurface()) {
+ warning("Frame::renderSprites: Could not load image %d", _sprites[i]->_castId);
+ continue;
+ }
- if (!img->getSurface()) {
- warning("Frame::renderSprites: Could not load image %d", _sprites[i]->_castId);
- continue;
- }
+ assert(_sprites[i]->_cast);
- assert(_sprites[i]->_cast);
-
- uint32 regX = static_cast<BitmapCast *>(_sprites[i]->_cast)->regX;
- uint32 regY = static_cast<BitmapCast *>(_sprites[i]->_cast)->regY;
- uint32 rectLeft = static_cast<BitmapCast *>(_sprites[i]->_cast)->initialRect.left;
- uint32 rectTop = static_cast<BitmapCast *>(_sprites[i]->_cast)->initialRect.top;
-
- int x = _sprites[i]->_startPoint.x - regX + rectLeft;
- int y = _sprites[i]->_startPoint.y - regY + rectTop;
- int height = _sprites[i]->_height;
- int width = _sprites[i]->_width;
-
- Common::Rect drawRect = Common::Rect(x, y, x + width, y + height);
- _drawRects.push_back(drawRect);
-
- switch (_sprites[i]->_ink) {
- case kInkTypeCopy:
- surface.blitFrom(*img->getSurface(), Common::Point(x, y));
- break;
- case kInkTypeTransparent:
- // FIXME: is it always white (last entry in pallette)?
- surface.transBlitFrom(*img->getSurface(), Common::Point(x, y), _vm->getPaletteColorCount() - 1);
- break;
- case kInkTypeBackgndTrans:
- drawBackgndTransSprite(surface, *img->getSurface(), drawRect);
- break;
- case kInkTypeMatte:
- drawMatteSprite(surface, *img->getSurface(), drawRect);
- break;
- case kInkTypeGhost:
- drawGhostSprite(surface, *img->getSurface(), drawRect);
- break;
- case kInkTypeReverse:
- drawReverseSprite(surface, *img->getSurface(), drawRect);
- break;
- default:
- warning("Unhandled ink type %d", _sprites[i]->_ink);
- surface.blitFrom(*img->getSurface(), Common::Point(x, y));
- break;
+ BitmapCast *bitmapCast = static_cast<BitmapCast *>(_sprites[i]->_cast);
+ //TODO: might want a quicker way to determine if cast is from Shared Cast.
+ if (_vm->getSharedBMP() != NULL && _vm->getSharedBMP()->contains(_sprites[i]->_castId + 1024)) {
+ bitmapCast = static_cast<BitmapCast *>(_vm->getSharedCasts()->getVal(_sprites[i]->_castId));
+ }
+
+ uint32 regX = bitmapCast->regX;
+ uint32 regY = bitmapCast->regY;
+ uint32 rectLeft = bitmapCast->initialRect.left;
+ uint32 rectTop = bitmapCast->initialRect.top;
+
+ int x = _sprites[i]->_startPoint.x - regX + rectLeft;
+ int y = _sprites[i]->_startPoint.y - regY + rectTop;
+ int height = _sprites[i]->_height;
+ int width = _sprites[i]->_width;
+
+ Common::Rect drawRect(x, y, x + width, y + height);
+
+ addDrawRect(i, drawRect);
+
+ switch (_sprites[i]->_ink) {
+ case kInkTypeCopy:
+ surface.blitFrom(*img->getSurface(), Common::Point(x, y));
+ break;
+ case kInkTypeTransparent:
+ // FIXME: is it always white (last entry in pallette)?
+ surface.transBlitFrom(*img->getSurface(), Common::Point(x, y), _vm->getPaletteColorCount() - 1);
+ break;
+ case kInkTypeBackgndTrans:
+ drawBackgndTransSprite(surface, *img->getSurface(), drawRect);
+ break;
+ case kInkTypeMatte:
+ drawMatteSprite(surface, *img->getSurface(), drawRect);
+ break;
+ case kInkTypeGhost:
+ drawGhostSprite(surface, *img->getSurface(), drawRect);
+ break;
+ case kInkTypeReverse:
+ drawReverseSprite(surface, *img->getSurface(), drawRect);
+ break;
+ default:
+ warning("Unhandled ink type %d", _sprites[i]->_ink);
+ surface.blitFrom(*img->getSurface(), Common::Point(x, y));
+ break;
+ }
}
}
}
}
-void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
- renderText(surface, spriteId);
+void Frame::addDrawRect(uint16 spriteId, Common::Rect &rect) {
+ FrameEntity *fi = new FrameEntity();
+ fi->spriteId = spriteId;
+ fi->rect = rect;
+ _drawRects.push_back(fi);
+}
+
+void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
+ Common::Rect shapeRect = Common::Rect(_sprites[spriteId]->_startPoint.x,
+ _sprites[spriteId]->_startPoint.y,
+ _sprites[spriteId]->_startPoint.x + _sprites[spriteId]->_width,
+ _sprites[spriteId]->_startPoint.y + _sprites[spriteId]->_height);
+
+ Graphics::ManagedSurface tmpSurface;
+ tmpSurface.create(shapeRect.width(), shapeRect.height(), Graphics::PixelFormat::createFormatCLUT8());
+ if (_vm->getVersion() <= 3 && _sprites[spriteId]->_spriteType == 0x0c) {
+ tmpSurface.fillRect(Common::Rect(shapeRect.width(), shapeRect.height()), 255);
+ tmpSurface.frameRect(Common::Rect(shapeRect.width(), shapeRect.height()), 0);
+ //TODO: don't override, work out how to display correctly.
+ _sprites[spriteId]->_ink = kInkTypeTransparent;
+ } else {
+ //No minus one on the pattern here! MacPlotData will do that for us!
+ Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), _sprites[spriteId]->_castId, 1, _sprites[spriteId]->_backColor);
+ Common::Rect fillRect(shapeRect.width(), shapeRect.height());
+ Graphics::drawFilledRect(fillRect, _sprites[spriteId]->_foreColor, Graphics::macDrawPixel, &pd);
+ }
+
+ if (_sprites[spriteId]->_lineSize > 0) {
+ for (int rr = 0; rr < (_sprites[spriteId]->_lineSize - 1); rr++)
+ tmpSurface.frameRect(Common::Rect(rr, rr, shapeRect.width() - (rr * 2), shapeRect.height() - (rr * 2)), 0);
+ }
+
+ switch (_sprites[spriteId]->_ink) {
+ case kInkTypeCopy:
+ surface.blitFrom(tmpSurface, Common::Point(_sprites[spriteId]->_startPoint.x, _sprites[spriteId]->_startPoint.y));
+ break;
+ case kInkTypeTransparent:
+ // FIXME: is it always white (last entry in pallette)?
+ surface.transBlitFrom(tmpSurface, Common::Point(_sprites[spriteId]->_startPoint.x, _sprites[spriteId]->_startPoint.y), _vm->getPaletteColorCount() - 1);
+ break;
+ case kInkTypeBackgndTrans:
+ drawBackgndTransSprite(surface, tmpSurface, shapeRect);
+ break;
+ case kInkTypeMatte:
+ drawMatteSprite(surface, tmpSurface, shapeRect);
+ break;
+ case kInkTypeGhost:
+ drawGhostSprite(surface, tmpSurface, shapeRect);
+ break;
+ case kInkTypeReverse:
+ drawReverseSprite(surface, tmpSurface, shapeRect);
+ break;
+ default:
+ warning("Unhandled ink type %d", _sprites[spriteId]->_ink);
+ surface.blitFrom(tmpSurface, Common::Point(_sprites[spriteId]->_startPoint.x, _sprites[spriteId]->_startPoint.y));
+ break;
+ }
+
+ addDrawRect(spriteId, shapeRect);
+}
+
+void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 textId) {
+ renderText(surface, spriteId, _vm->getMainArchive()->getResource(MKTAG('S', 'T', 'X', 'T'), textId), true);
- uint16 castID = _sprites[spriteId]->_castId;
- ButtonCast *button = static_cast<ButtonCast *>(_vm->_currentScore->_casts[castID]);
+ uint16 castId = _sprites[spriteId]->_castId;
+ ButtonCast *button = static_cast<ButtonCast *>(_vm->_currentScore->_casts[castId]);
uint32 rectLeft = button->initialRect.left;
uint32 rectTop = button->initialRect.top;
@@ -617,13 +722,21 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
int height = _sprites[spriteId]->_height;
int width = _sprites[spriteId]->_width;
+ Common::Rect _rect;
+
switch (button->buttonType) {
case kTypeCheckBox:
// Magic numbers: checkbox square need to move left about 5px from text and 12px side size (D4)
- surface.frameRect(Common::Rect(x - 17, y, x + 12, y + 12), 0);
+ _rect = Common::Rect(x - 17, y, x + 12, y + 12);
+ surface.frameRect(_rect, 0);
+ addDrawRect(spriteId, _rect);
break;
- case kTypeButton:
- surface.frameRect(Common::Rect(x, y, x + width, y + height), 0);
+ case kTypeButton: {
+ _rect = Common::Rect(x, y, x + width - 1, y + height + 5);
+ Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 1);
+ Graphics::drawRoundRect(_rect, 4, 0, false, Graphics::macDrawPixel, &pd);
+ addDrawRect(spriteId, _rect);
+ }
break;
case kTypeRadio:
warning("STUB: renderButton: kTypeRadio");
@@ -633,6 +746,10 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {
uint16 imgId = spriteId + 1024;
+
+ if (_vm->getVersion() >= 4 && _vm->_currentScore->_casts[spriteId]->children.size() > 0)
+ imgId = _vm->_currentScore->_casts[spriteId]->children[0].index;
+
Image::ImageDecoder *img = NULL;
if (_vm->_currentScore->getArchive()->hasResource(MKTAG('D', 'I', 'B', ' '), imgId)) {
@@ -647,16 +764,31 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {
return img;
}
- if (_vm->_currentScore->getArchive()->hasResource(MKTAG('B', 'I', 'T', 'D'), imgId)) {
- Common::SeekableReadStream *pic = _vm->_currentScore->getArchive()->getResource(MKTAG('B', 'I', 'T', 'D'), imgId);
+ Common::SeekableReadStream *pic = NULL;
+ BitmapCast *bc = NULL;
- if (_vm->getVersion() <= 4) {
- BitmapCast *bc = static_cast<BitmapCast *>(_vm->_currentScore->_casts[spriteId]);
+ if (_vm->getSharedBMP() != NULL && _vm->getSharedBMP()->contains(imgId)) {
+ pic = _vm->getSharedBMP()->getVal(imgId);
+ bc = static_cast<BitmapCast *>(_vm->getSharedCasts()->getVal(spriteId));
+ } else if (_vm->_currentScore->getArchive()->hasResource(MKTAG('B', 'I', 'T', 'D'), imgId)) {
+ pic = _vm->_currentScore->getArchive()->getResource(MKTAG('B', 'I', 'T', 'D'), imgId);
+ bc = static_cast<BitmapCast *>(_vm->_currentScore->_casts[spriteId]);
+ }
+
+ if (pic != NULL && bc != NULL) {
+ if (_vm->getVersion() < 4) {
int w = bc->initialRect.width(), h = bc->initialRect.height();
debugC(2, kDebugImages, "id: %d, w: %d, h: %d, flags: %x, some: %x, unk1: %d, unk2: %d",
imgId, w, h, bc->flags, bc->someFlaggyThing, bc->unk1, bc->unk2);
img = new BITDDecoder(w, h);
+ } else if (_vm->getVersion() < 6) {
+ bc = static_cast<BitmapCast *>(_vm->_currentScore->_casts[spriteId]);
+ int w = bc->initialRect.width(), h = bc->initialRect.height();
+
+ debugC(2, kDebugImages, "id: %d, w: %d, h: %d, flags: %x, some: %x, unk1: %d, unk2: %d",
+ imgId, w, h, bc->flags, bc->someFlaggyThing, bc->unk1, bc->unk2);
+ img = new BITDDecoderV4(w, h, bc->bitsPerPixel);
} else {
img = new Image::BitmapDecoder();
}
@@ -666,34 +798,37 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {
byte buf[1024];
int n = s->read(buf, 1024);
Common::hexdump(buf, n);
+ s->seek(0);
}
img->loadStream(*pic);
return img;
}
- if (_vm->getSharedBMP() != NULL && _vm->getSharedBMP()->contains(imgId)) {
- img = new Image::BitmapDecoder();
- img->loadStream(*_vm->getSharedBMP()->getVal(imgId));
- return img;
- }
-
warning("Image %d not found", spriteId);
return img;
}
-void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) {
- uint16 castID = _sprites[spriteID]->_castId;
-
- TextCast *textCast = static_cast<TextCast *>(_vm->_currentScore->_casts[castID]);
- Common::SeekableSubReadStreamEndian *textStream;
+void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 castId) {
+ Common::SeekableSubReadStreamEndian *textStream = NULL;
- if (_vm->_currentScore->_movieArchive->hasResource(MKTAG('S','T','X','T'), castID + 1024)) {
- textStream = _vm->_currentScore->_movieArchive->getResource(MKTAG('S','T','X','T'), castID + 1024);
- } else {
- textStream = _vm->getSharedSTXT()->getVal(spriteID + 1024);
+ if (_vm->_currentScore->_movieArchive->hasResource(MKTAG('S', 'T', 'X', 'T'), castId)) {
+ textStream = _vm->_currentScore->_movieArchive->getResource(MKTAG('S', 'T', 'X', 'T'), castId);
+ } else if (_vm->getSharedSTXT() != nullptr) {
+ textStream = _vm->getSharedSTXT()->getVal(spriteId + 1024);
}
+
+ renderText(surface, spriteId, textStream, false);
+}
+
+void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::SeekableSubReadStreamEndian *textStream, bool isButtonLabel) {
+ if (textStream == NULL)
+ return;
+
+ uint16 castId = _sprites[spriteId]->_castId;
+ TextCast *textCast = static_cast<TextCast *>(_vm->_currentScore->_casts[castId]);
+
uint32 unk1 = textStream->readUint32();
uint32 strLen = textStream->readUint32();
uint32 dataLen = textStream->readUint32();
@@ -711,15 +846,43 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) {
if (strLen < 200)
debugC(3, kDebugText, "text: '%s'", text.c_str());
- uint32 rectLeft = static_cast<TextCast *>(_sprites[spriteID]->_cast)->initialRect.left;
- uint32 rectTop = static_cast<TextCast *>(_sprites[spriteID]->_cast)->initialRect.top;
+ if (_vm->getVersion() >= 4) {
+ uint16 a = textStream->readUint16();
+ uint32 b = textStream->readUint32();
+ uint16 c = textStream->readUint16();
+ uint16 d = textStream->readUint16();
+
+ debugC(3, kDebugText, "text: a: %x b: %x c: %x d: %x", a, b, c, d);
+
+ textCast->fontId = textStream->readUint16();
+ textCast->textSlant = textStream->readByte();
+ textStream->readByte();
+ textCast->fontSize = textStream->readUint16();
+
+ textCast->palinfo1 = textStream->readUint16();
+ textCast->palinfo2 = textStream->readUint16();
+ textCast->palinfo3 = textStream->readUint16();
+ }
+
+ uint16 boxShadow = (uint16)textCast->boxShadow;
+ uint16 borderSize = (uint16)textCast->borderSize;
+ uint16 padding = (uint16)textCast->gutterSize;
+ uint16 textShadow = (uint16)textCast->textShadow;
+
+ //uint32 rectLeft = textCast->initialRect.left;
+ //uint32 rectTop = textCast->initialRect.top;
+
+ int x = _sprites[spriteId]->_startPoint.x; // +rectLeft;
+ int y = _sprites[spriteId]->_startPoint.y; // +rectTop;
- int x = _sprites[spriteID]->_startPoint.x + rectLeft;
- int y = _sprites[spriteID]->_startPoint.y + rectTop;
- int height = _sprites[spriteID]->_height;
- int width = _sprites[spriteID]->_width;
+ int height = _sprites[spriteId]->_height;
+ if (_vm->getVersion() >= 4 && !isButtonLabel) height = textCast->initialRect.bottom;
+ height += textShadow;
+
+ int width = _sprites[spriteId]->_width;
+ if (_vm->getVersion() >= 4 && !isButtonLabel) width = textCast->initialRect.right;
- Graphics::MacFont macFont(textCast->fontId, textCast->fontSize);
+ Graphics::MacFont macFont(textCast->fontId, textCast->fontSize, textCast->textSlant);
if (_vm->_currentScore->_fontMap.contains(textCast->fontId)) {
// Override
@@ -730,44 +893,66 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) {
debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(macFont));
- font->drawString(&surface, text, x, y, width, 0);
+ int alignment = (int)textCast->textAlign;
+ if (alignment == -1) alignment = 3;
+ else alignment++;
- if (textCast->borderSize != kSizeNone) {
- uint16 size = textCast->borderSize;
-
- // Indent from borders, measured in d4
- x -= 1;
- y -= 4;
+ uint16 textX = x, textY = y;
+ if (!isButtonLabel) {
+ if (borderSize > 0) {
+ textX += (borderSize + 1);
+ textY += borderSize;
+ }
- height += 4;
- width += 1;
+ if (padding > 0) {
+ width += padding * 2;
+ height += padding;
+ if (textCast->textAlign == kTextAlignLeft) textX += padding;
+ else if (textCast->textAlign == kTextAlignRight) textX -= (padding + 1);
+ //TODO: alignment issue with odd-size-width center-aligned text
+ //else if (textCast->textAlign == kTextAlignCenter && ((borderSize + padding) % 2 == 1)) textX--;
+ textY += padding / 2;
+ }
- while (size) {
- surface.frameRect(Common::Rect(x, y, x + height, y + width), 0);
- x--;
- y--;
- height += 2;
- width += 2;
- size--;
+ if (textShadow > 0) {
+ if (borderSize == 0) textX += 1;
+ font->drawString(&surface, text, textX + textShadow, textY + textShadow,
+ width, (_sprites[spriteId]->_ink == kInkTypeReverse ? 255 : 0), (Graphics::TextAlign)alignment);
+ height -= textShadow;
}
+ } else {
+ textY += 2;
}
- if (textCast->gutterSize != kSizeNone) {
- x -= 1;
- y -= 4;
-
- height += 4;
- width += 1;
- uint16 size = textCast->gutterSize;
-
- surface.frameRect(Common::Rect(x, y, x + height, y + width), 0);
+ //TODO: the colour is wrong here... need to determine the correct colour for all versions!
+ font->drawString(&surface, text, textX, textY,
+ width, (_sprites[spriteId]->_ink == kInkTypeReverse ? 255 : 0), (Graphics::TextAlign)alignment);
+
+ if (isButtonLabel)
+ return;
+
+ uint16 borderX = x + borderSize - 1, borderY = y + borderSize - 1, borderHeight = height, borderWidth = width;
+ if (borderSize != kSizeNone) {
+ while (borderSize) {
+ borderWidth += 2;
+ borderHeight += 2;
+ surface.frameRect(Common::Rect(borderX, borderY, borderX + borderWidth, borderY + borderHeight), 0);
+ borderSize--;
+ borderX--;
+ borderY--;
+ }
+ }
- while (size) {
- surface.drawLine(x + width, y, x + width, y + height, 0);
- surface.drawLine(x, y + height, x + width, y + height, 0);
- x++;
- y++;
- size--;
+ if (boxShadow > 0) {
+ borderSize = (uint16)textCast->borderSize;
+ uint baseOffsetX = x + boxShadow;
+ uint baseOffsetY = y + height + (borderSize * 2);
+ uint sideOffsetX = x + borderWidth;
+ uint sideOffsetY = y + boxShadow;
+ while (boxShadow) {
+ surface.drawLine(baseOffsetX, baseOffsetY + (boxShadow - 1), baseOffsetX + borderWidth - 1, baseOffsetY + (boxShadow - 1), 0);
+ surface.drawLine(sideOffsetX + (boxShadow - 1), sideOffsetY, sideOffsetX + (boxShadow - 1), sideOffsetY + borderHeight - 1, 0);
+ boxShadow--;
}
}
}
@@ -883,11 +1068,10 @@ void Frame::drawMatteSprite(Graphics::ManagedSurface &target, const Graphics::Su
}
uint16 Frame::getSpriteIDFromPos(Common::Point pos) {
- // Find first from top to bottom
- for (uint16 i = _drawRects.size() - 1; i > 0; i--) {
- if (_drawRects[i].contains(pos))
- return i;
- }
+ // Find first from front to back
+ for (int dr = _drawRects.size() - 1; dr >= 0; dr--)
+ if (_drawRects[dr]->rect.contains(pos))
+ return _drawRects[dr]->spriteId;
return 0;
}
diff --git a/engines/director/frame.h b/engines/director/frame.h
index ce82fa527c..f21e3a7055 100644
--- a/engines/director/frame.h
+++ b/engines/director/frame.h
@@ -104,6 +104,11 @@ struct PaletteInfo {
uint16 cycleCount;
};
+struct FrameEntity {
+ uint16 spriteId;
+ Common::Rect rect;
+};
+
class Frame {
public:
@@ -119,16 +124,19 @@ private:
void playTransition(Score *score);
void playSoundChannel();
void renderSprites(Graphics::ManagedSurface &surface, bool renderTrail);
- void renderText(Graphics::ManagedSurface &surface, uint16 spriteId);
- void renderButton(Graphics::ManagedSurface &surface, uint16 spriteId);
+ void renderText(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 castId);
+ void renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::SeekableSubReadStreamEndian *textStream, bool isButtonLabel);
+ void renderShape(Graphics::ManagedSurface &surface, uint16 spriteId);
+ void renderButton(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 textId);
void readPaletteInfo(Common::SeekableSubReadStreamEndian &stream);
void readSprite(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size);
void readMainChannels(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size);
- Image::ImageDecoder *getImageFrom(uint16 spriteID);
+ Image::ImageDecoder *getImageFrom(uint16 spriteId);
void drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
void drawMatteSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
void drawGhostSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
void drawReverseSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
+ void addDrawRect(uint16 entityId, Common::Rect &rect);
public:
byte _channelData[kChannelDataSize];
@@ -148,7 +156,7 @@ public:
uint8 _skipFrameFlag;
uint8 _blend;
Common::Array<Sprite *> _sprites;
- Common::Array<Common::Rect > _drawRects;
+ Common::Array<FrameEntity *> _drawRects;
DirectorEngine *_vm;
};
diff --git a/engines/director/graphics.cpp b/engines/director/graphics.cpp
new file mode 100644
index 0000000000..f980edee5c
--- /dev/null
+++ b/engines/director/graphics.cpp
@@ -0,0 +1,155 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "director/director.h"
+
+namespace Director {
+
+static byte director3Patterns[][8] = { { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
+ { 0xFF, 0xFF, 0x77, 0xFF, 0xFF, 0xFF, 0x77, 0xFF },
+ { 0x77, 0xFF, 0xDD, 0xFF, 0x77, 0xFF, 0xDD, 0xFF },
+ { 0xFF, 0xDD, 0xFF, 0x55, 0xFF, 0xDD, 0xFF, 0x55 },
+ { 0xFF, 0xD5, 0xFF, 0x55, 0xFF, 0x5D, 0xFF, 0x55 },
+ { 0xFF, 0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF, 0xAA },
+ { 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA },
+ { 0xAA, 0x44, 0xAA, 0x11, 0xAA, 0x44, 0xAA, 0x11 },
+ { 0xAA, 0x44, 0xAA, 0x00, 0xAA, 0x44, 0xAA, 0x00 },
+ { 0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00 },
+ { 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x88 },
+ { 0x88, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00 },
+ { 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 },
+ { 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 },
+ { 0x21, 0x42, 0x84, 0x09, 0x12, 0x24, 0x48, 0x90 },
+ { 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88 },
+ { 0xEE, 0xDD, 0xBB, 0x77, 0xEE, 0xDD, 0xBB, 0x77 },
+ { 0xF6, 0xED, 0xDB, 0xB7, 0x6F, 0xDE, 0xBD, 0x7B },
+ { 0xFE, 0xFD, 0xFB, 0xF7, 0xEF, 0xDF, 0xBF, 0x7F },
+ { 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF },
+ { 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF },
+ { 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF },
+ { 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF },
+ { 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00 },
+ { 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00 },
+ { 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00 },
+ { 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 },
+ { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 },
+ { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88 },
+ { 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94 },
+ { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA },
+ { 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD },
+ { 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB },
+ { 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7 },
+ { 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF },
+ { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00 },
+ { 0x7F, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, 0x7F, 0x00 },
+ { 0x77, 0x77, 0x77, 0x00, 0x77, 0x77, 0x77, 0x00 },
+ { 0x88, 0x88, 0x88, 0xFF, 0x88, 0x88, 0x88, 0xFF },
+ { 0x80, 0x80, 0x80, 0xFF, 0x80, 0x80, 0x80, 0xFF },
+ { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF },
+ { 0x01, 0x82, 0x44, 0x28, 0x10, 0x28, 0x44, 0x82 },
+ { 0x11, 0x82, 0x45, 0xAB, 0xD7, 0xAB, 0x45, 0x82 },
+ { 0xF7, 0x7F, 0xBE, 0x5D, 0x2A, 0x5D, 0xBE, 0x7F },
+ { 0xFE, 0x7D, 0xBB, 0xD7, 0xEF, 0xD7, 0xBB, 0x7D },
+ { 0xFE, 0x7F, 0xBF, 0xDF, 0xEF, 0xDF, 0xBF, 0x7F },
+ { 0xEE, 0x77, 0xBB, 0xDD, 0xEE, 0xDD, 0xBB, 0x77 },
+ { 0x11, 0x88, 0x44, 0x22, 0x11, 0x22, 0x44, 0x88 },
+ { 0x01, 0x80, 0x40, 0x20, 0x10, 0x20, 0x40, 0x80 },
+ { 0x22, 0x00, 0x01, 0x22, 0x54, 0x88, 0x01, 0x00 },
+ { 0xBF, 0xAF, 0xAB, 0xAA, 0xEA, 0xFA, 0xFE, 0xFF },
+ { 0xFF, 0xFF, 0xBE, 0x9C, 0xAA, 0xB6, 0xBE, 0xFF }
+};
+
+static byte director3QuickDrawPatterns[][8] = { { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
+ { 0xDD, 0xFF, 0x77, 0xFF, 0xDD, 0xFF, 0x77, 0xFF },
+ { 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77 },
+ { 0xEE, 0xDD, 0xBB, 0x77, 0xEE, 0xDD, 0xBB, 0x77 },
+ { 0xFF, 0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF, 0xAA },
+ { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 },
+ { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 },
+ { 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88 },
+ { 0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00 },
+ { 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22 },
+ { 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x88 },
+ { 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x04, 0x08 },
+ { 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 },
+ { 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88 },
+ { 0x58, 0xDF, 0x00, 0xDF, 0xDF, 0x58, 0x58, 0x58 },
+ { 0xB1, 0x36, 0x06, 0x60, 0x63, 0x1B, 0x18, 0x81 },
+ { 0x08, 0xFF, 0x01, 0x01, 0x01, 0xFF, 0x08, 0x08 },
+ { 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00 },
+ { 0x80, 0x80, 0x80, 0xFF, 0x80, 0x80, 0x80, 0x80 },
+ { 0x80, 0x10, 0x02, 0x40, 0x04, 0x20, 0x09, 0x00 },
+ { 0x80, 0x01, 0x82, 0x44, 0x38, 0x10, 0x20, 0x40 },
+ { 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00 },
+ { 0x22, 0xFF, 0x22, 0x22, 0x22, 0xFF, 0x22, 0x22 },
+ { 0x00, 0x08, 0x14, 0x2A, 0x55, 0x2A, 0x14, 0x08 },
+ { 0x81, 0xAA, 0x14, 0x08, 0x08, 0xAA, 0x41, 0x80 },
+ { 0x3E, 0x1D, 0x88, 0xD1, 0xE3, 0xC5, 0x88, 0x5C },
+ { 0xAA, 0x00, 0x80, 0x00, 0x88, 0x00, 0x80, 0x00 },
+ { 0x00, 0x11, 0x82, 0x44, 0x28, 0x11, 0x00, 0x55 },
+ { 0x7C, 0x10, 0x10, 0x28, 0xC7, 0x01, 0x01, 0x82 },
+ { 0xEE, 0x31, 0xF1, 0xF1, 0xEE, 0x13, 0x1F, 0x1F },
+ { 0x00, 0x40, 0x20, 0x10, 0x00, 0x01, 0x02, 0x04 },
+ { 0x00, 0x00, 0x40, 0xA0, 0x00, 0x04, 0x0A, 0x00 },
+ { 0x20, 0x60, 0x90, 0x09, 0x06, 0x81, 0x40, 0x20 },
+ { 0x00, 0x7F, 0x43, 0x5F, 0x5F, 0x5F, 0x7F, 0x7F },
+ { 0x01, 0x02, 0x45, 0xAA, 0xFF, 0x20, 0x40, 0x80 },
+ { 0x00, 0x44, 0x0A, 0x11, 0x11, 0x11, 0x51, 0x24 },
+ { 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0 },
+ { 0xF8, 0xFC, 0xFA, 0xFC, 0xFA, 0x54, 0x2A, 0x00 },
+ { 0x42, 0xC3, 0x3C, 0x3C, 0x3C, 0x3C, 0xC3, 0x42 },
+ { 0x10, 0x38, 0x7C, 0xFE, 0x7D, 0x3A, 0x14, 0x08 },
+ { 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF },
+ { 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC },
+ { 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00 },
+ { 0xBB, 0xDD, 0xAE, 0x77, 0xEE, 0xDD, 0xAB, 0x77 },
+ { 0x80, 0x40, 0x40, 0x20, 0x20, 0x18, 0x06, 0x01 },
+ { 0x01, 0x82, 0x44, 0x28, 0x10, 0x28, 0x44, 0x82 },
+ { 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xFF },
+ { 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xFF, 0xFF, 0xFF },
+ { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00 },
+ { 0xC3, 0x87, 0x0F, 0x1E, 0x3C, 0x78, 0xF0, 0xE1 },
+ { 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0 },
+ { 0xFF, 0xFF, 0xE7, 0xC3, 0x81, 0x18, 0x3C, 0x7E },
+ { 0x1F, 0x8F, 0xC7, 0xE3, 0xC7, 0x8F, 0x1F, 0x3E },
+ { 0xFF, 0x2A, 0xFF, 0xC8, 0xFF, 0x65, 0xFF, 0x9D }
+};
+
+void DirectorEngine::loadPatterns() {
+ for (int i = 0; i < ARRAYSIZE(director3Patterns); i++)
+ _director3Patterns.push_back(director3Patterns[i]);
+
+ for (int i = 0; i < ARRAYSIZE(director3QuickDrawPatterns); i++)
+ _director3QuickDrawPatterns.push_back(director3QuickDrawPatterns[i]);
+}
+
+Graphics::MacPatterns &DirectorEngine::getPatterns() {
+ //TOOD: implement switch and other version patterns. (use getVersion());
+ return _director3QuickDrawPatterns;
+}
+
+}
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 0ec84af0d3..7d5e08936e 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -201,4 +201,152 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
return true;
}
+/****************************
+* BITD V4+
+****************************/
+
+BITDDecoderV4::BITDDecoderV4(int w, int h, uint16 bitsPerPixel) {
+ _surface = new Graphics::Surface();
+
+ // We make the surface pitch a multiple of 16.
+ int pitch = w;
+ if (w % 16)
+ pitch += 16 - (w % 16);
+
+ Graphics::PixelFormat pf = Graphics::PixelFormat::createFormatCLUT8();
+ switch (bitsPerPixel) {
+ case 2:
+ break;
+ case 4:
+ break;
+ case 8:
+ break;
+ case 16:
+ break;
+ case 32:
+ //pf = Graphics::PixelFormat::PixelFormat(bitsPerPixel / 8, 8, 8, 8, 8, 24, 16, 8, 0);
+ break;
+ }
+
+
+ // HACK: Create a padded surface by adjusting w after create()
+ _surface->create(pitch, h, pf);
+ _surface->w = w;
+
+ _palette = new byte[256 * 3];
+
+ _palette[0] = _palette[1] = _palette[2] = 0;
+ _palette[255 * 3 + 0] = _palette[255 * 3 + 1] = _palette[255 * 3 + 2] = 0xff;
+
+ _paletteColorCount = 2;
+
+ _bitsPerPixel = bitsPerPixel;
+}
+
+BITDDecoderV4::~BITDDecoderV4() {
+ destroy();
+}
+
+void BITDDecoderV4::destroy() {
+ _surface = 0;
+
+ delete[] _palette;
+ _palette = 0;
+ _paletteColorCount = 0;
+}
+
+void BITDDecoderV4::loadPalette(Common::SeekableReadStream &stream) {
+ // no op
+}
+
+bool BITDDecoderV4::loadStream(Common::SeekableReadStream &stream) {
+ int x = 0, y = 0;
+
+ // If the stream has exactly the required number of bits for this image,
+ // we assume it is uncompressed.
+ if (stream.size() * 8 == _surface->pitch * _surface->h) {
+ debugC(3, kDebugImages, "Skipping compression");
+ for (y = 0; y < _surface->h; y++) {
+ for (x = 0; x < _surface->pitch; ) {
+ byte color = stream.readByte();
+ for (int c = 0; c < 8; c++)
+ *((byte *)_surface->getBasePtr(x++, y)) = (color & (1 << (7 - c))) ? 0 : 0xff;
+ }
+ }
+
+ return true;
+ }
+
+ Common::Array<int> pixels;
+
+ while (!stream.eos()) {
+ int data = stream.readByte();
+ int len = data + 1;
+ if ((data & 0x80) != 0) {
+ len = ((data ^ 0xFF) & 0xff) + 2;
+ data = stream.readByte();
+ for (int p = 0; p < len; p++) {
+ pixels.push_back(data);
+ //*((byte *)_surface->getBasePtr(x, y)) = data;
+ }
+ //data = stream.readByte();
+ } else {
+ for (int p = 0; p < len; p++) {
+ data = stream.readByte();
+ pixels.push_back(data);
+ }
+ }
+ if (_bitsPerPixel == 32 && pixels.size() % (_surface->w * 3) == 0)
+ stream.readUint16BE();
+ }
+
+ int offset = 0;
+ if (_surface->w < (pixels.size() / _surface->h))
+ offset = (pixels.size() / _surface->h) - _surface->w;
+
+ if (pixels.size() > 0) {
+ for (y = 0; y < _surface->h; y++) {
+ for (x = 0; x < _surface->w;) {
+ switch (_bitsPerPixel) {
+ case 1: {
+ for (int c = 0; c < 8; c++, x++) {
+ *((byte *)_surface->getBasePtr(x, y)) = (pixels[(((y * _surface->pitch) + x) / 8)] & (1 << (7 - c))) ? 0 : 0xff;
+ }
+ break;
+ }
+
+ case 8:
+ //this calculation is wrong.. need a demo with colours.
+ *((byte *)_surface->getBasePtr(x, y)) = 0xff - pixels[(y * _surface->w) + x + (y * offset)];
+ x++;
+ break;
+
+ case 16:
+ *((uint16*)_surface->getBasePtr(x, y)) = _surface->format.RGBToColor(
+ (pixels[((y * _surface->w) * 2) + x] & 0x7c) << 1,
+ (pixels[((y * _surface->w) * 2) + x] & 0x03) << 6 |
+ (pixels[((y * _surface->w) * 2) + (_surface->w) + x] & 0xe0) >> 2,
+ (pixels[((y * _surface->w) * 2) + (_surface->w) + x] & 0x1f) << 3);
+ x++;
+ break;
+
+ case 32:
+ *((uint32*)_surface->getBasePtr(x, y)) = _surface->format.RGBToColor(
+ pixels[((y * _surface->w) * 3) + x],
+ pixels[(((y * _surface->w) * 3) + (_surface->w)) + x],
+ pixels[(((y * _surface->w) * 3) + (2 * _surface->w)) + x]);
+ x++;
+ break;
+
+ default:
+ x++;
+ break;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
} // End of namespace Director
diff --git a/engines/director/images.h b/engines/director/images.h
index 54e824588f..8d25d348d2 100644
--- a/engines/director/images.h
+++ b/engines/director/images.h
@@ -81,6 +81,26 @@ private:
uint8 _paletteColorCount;
};
+class BITDDecoderV4 : public Image::ImageDecoder {
+public:
+ BITDDecoderV4(int w, int h, uint16 bitsPerPixel);
+ virtual ~BITDDecoderV4();
+
+ // ImageDecoder API
+ void destroy();
+ virtual bool loadStream(Common::SeekableReadStream &stream);
+ virtual const Graphics::Surface *getSurface() const { return _surface; }
+ const byte *getPalette() const { return _palette; }
+ void loadPalette(Common::SeekableReadStream &stream);
+ uint16 getPaletteColorCount() const { return _paletteColorCount; }
+
+private:
+ Graphics::Surface *_surface;
+ byte *_palette;
+ uint8 _paletteColorCount;
+ uint16 _bitsPerPixel;
+};
+
} // End of namespace Director
#endif
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 1d93b9ab44..4d3b7ddf5b 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -48,11 +48,38 @@ static struct BuiltinProto {
// String
{ "chars", Lingo::b_chars, 3, 3, true }, // D2
{ "charToNum", Lingo::b_charToNum, 1, 1, true }, // D2
+ { "delete", Lingo::b_delete, 1, 1, true }, // D3
+ { "hilite", Lingo::b_hilite, 1, 1, true }, // D3
{ "length", Lingo::b_length, 1, 1, true }, // D2
{ "numToChar", Lingo::b_numToChar, 1, 1, true }, // D2
{ "offset", Lingo::b_offset, 2, 2, true }, // D2
{ "string", Lingo::b_string, 1, 1, true }, // D2
{ "value", Lingo::b_value, 1, 1, true }, // D2
+ // Lists
+ { "add", Lingo::b_add, 2, 2, false }, // D4
+ { "addAt", Lingo::b_addAt, 3, 3, false }, // D4
+ { "addProp", Lingo::b_addProp, 3, 3, false }, // D4
+ { "append", Lingo::b_append, 2, 2, false }, // D4
+ { "count", Lingo::b_count, 1, 1, true }, // D4
+ { "deleteAt", Lingo::b_deleteAt, 2, 2, false }, // D4
+ { "deleteProp", Lingo::b_deleteProp, 2, 2, false }, // D4
+ { "findPos", Lingo::b_findPos, 2, 2, true }, // D4
+ { "findPosNear", Lingo::b_findPosNear, 2, 2, true }, // D4
+ { "getaProp", Lingo::b_getaProp, 2, 2, true }, // D4
+ { "getAt", Lingo::b_getAt, 2, 2, true }, // D4
+ { "getLast", Lingo::b_getLast, 1, 1, true }, // D4
+ { "getOne", Lingo::b_getOne, 2, 2, true }, // D4
+ { "getPos", Lingo::b_getPos, 2, 2, true }, // D4
+ { "getProp", Lingo::b_getProp, 2, 2, true }, // D4
+ { "getPropAt", Lingo::b_getPropAt, 2, 2, true }, // D4
+ { "list", Lingo::b_list, -1, 0, true }, // D4
+ { "listP", Lingo::b_listP, 1, 1, true }, // D4
+ { "max", Lingo::b_max, 1, 1, true }, // D4
+ { "min", Lingo::b_min, 1, 1, true }, // D4
+ { "setaProp", Lingo::b_setaProp, 3, 3, false }, // D4
+ { "setAt", Lingo::b_setAt, 3, 3, false }, // D4
+ { "setProp", Lingo::b_setProp, 3, 3, false }, // D4
+ { "sort", Lingo::b_sort, 1, 1, false }, // D4
// Files
{ "closeDA", Lingo::b_closeDA, 0, 0, false }, // D2
{ "closeResFile", Lingo::b_closeResFile, 0, 1, false }, // D2
@@ -66,6 +93,7 @@ static struct BuiltinProto {
{ "showXlib", Lingo::b_showXlib, 0, 1, false }, // D2
{ "xFactoryList", Lingo::b_xFactoryList, 1, 1, true }, // D3
// Control
+ { "abort", Lingo::b_abort, 0, 0, false }, // D4
{ "continue", Lingo::b_continue, 0, 0, false }, // D2
{ "dontPassEvent", Lingo::b_dontPassEvent, 0, 0, false }, // D2
{ "delay", Lingo::b_delay, 1, 1, false }, // D2
@@ -75,6 +103,8 @@ static struct BuiltinProto {
// play // D2
{ "playAccel", Lingo::b_playAccel, -1,0, false }, // D2
// play done // D2
+ { "preLoad", Lingo::b_preLoad, -1,0, false }, // D3
+ { "preLoadCast", Lingo::b_preLoadCast, -1,0, false }, // D3
{ "quit", Lingo::b_quit, 0, 0, false }, // D2
{ "restart", Lingo::b_restart, 0, 0, false }, // D2
{ "shutDown", Lingo::b_shutDown, 0, 0, false }, // D2
@@ -85,7 +115,7 @@ static struct BuiltinProto {
// when timeOut // D2
// Types
{ "floatP", Lingo::b_floatP, 1, 1, true }, // D3
- { "ilk", Lingo::b_ilk, 1, 2, true }, // D4
+ { "ilk", Lingo::b_ilk, 1, 2, false }, // D4
{ "integerp", Lingo::b_integerp, 1, 1, true }, // D2
{ "objectp", Lingo::b_objectp, 1, 1, true }, // D2
{ "stringp", Lingo::b_stringp, 1, 1, true }, // D2
@@ -93,6 +123,8 @@ static struct BuiltinProto {
// Misc
{ "alert", Lingo::b_alert, 1, 1, false }, // D2
{ "cursor", Lingo::b_cursor, 1, 1, false }, // D2
+ { "framesToHMS", Lingo::b_framesToHMS, 4, 4, false }, // D3
+ { "HMStoFrames", Lingo::b_HMStoFrames, 4, 4, false }, // D3
{ "printFrom", Lingo::b_printFrom, -1,0, false }, // D2
// put // D2
// set // D2
@@ -101,7 +133,9 @@ static struct BuiltinProto {
// Score
{ "constrainH", Lingo::b_constrainH, 2, 2, true }, // D2
{ "constrainV", Lingo::b_constrainV, 2, 2, true }, // D2
+ { "duplicate-cast", Lingo::b_duplicateCast, 1, 2, false }, // D4
{ "editableText", Lingo::b_editableText, 0, 0, false }, // D2
+ { "erase-cast", Lingo::b_eraseCast, 1, 2, false }, // D4
// go // D2
{ "installMenu", Lingo::b_installMenu, 1, 1, false }, // D2
{ "label", Lingo::b_label, 1, 1, true }, // D2
@@ -136,6 +170,7 @@ static struct BuiltinProto {
{ "return", Lingo::b_return, 0, 0, false }, // D2
{ "tab", Lingo::b_tab, 0, 0, false }, // D2
{ "true", Lingo::b_true, 0, 0, false }, // D2
+ { "version", Lingo::b_version, 0, 0, false }, // D3
// References
{ "field", Lingo::b_field, 1, 1, false }, // D3
{ "me", Lingo::b_me, -1,0, false }, // D3
@@ -144,6 +179,13 @@ static struct BuiltinProto {
{ 0, 0, 0, 0, false }
};
+static const char *twoWordBuiltins[] = {
+ "duplicate",
+ "erase",
+ "sound",
+ 0
+};
+
void Lingo::initBuiltIns() {
for (BuiltinProto *blt = builtins; blt->name; blt++) {
Symbol *sym = new Symbol;
@@ -156,10 +198,13 @@ void Lingo::initBuiltIns() {
sym->parens = blt->parens;
sym->u.bltin = blt->func;
- _handlers[blt->name] = sym;
+ _builtins[blt->name] = sym;
_functions[(void *)sym->u.s] = new FuncDesc(blt->name, "");
}
+
+ for (const char **b = twoWordBuiltins; *b; b++)
+ _twoWordBuiltins[*b] = true;
}
void Lingo::printStubWithArglist(const char *funcname, int nargs) {
@@ -350,6 +395,26 @@ void Lingo::b_charToNum(int nargs) {
g_lingo->push(d);
}
+void Lingo::b_delete(int nargs) {
+ Datum d = g_lingo->pop();
+
+ d.toInt();
+
+ warning("STUB: b_delete");
+
+ g_lingo->push(Datum((char)d.u.i));
+}
+
+void Lingo::b_hilite(int nargs) {
+ Datum d = g_lingo->pop();
+
+ d.toInt();
+
+ warning("STUB: b_hilite");
+
+ g_lingo->push(Datum((char)d.u.i));
+}
+
void Lingo::b_length(int nargs) {
Datum d = g_lingo->pop();
@@ -397,6 +462,129 @@ void Lingo::b_value(int nargs) {
g_lingo->push(d);
}
+///////////////////
+// Lists
+///////////////////
+void Lingo::b_add(int nargs) {
+ g_lingo->printStubWithArglist("b_add", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_addAt(int nargs) {
+ g_lingo->printStubWithArglist("b_addAt", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_addProp(int nargs) {
+ g_lingo->printStubWithArglist("b_addProp", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_append(int nargs) {
+ g_lingo->printStubWithArglist("b_append", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_count(int nargs) {
+ g_lingo->printStubWithArglist("b_count", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_deleteAt(int nargs) {
+ g_lingo->printStubWithArglist("b_deleteAt", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_deleteProp(int nargs) {
+ g_lingo->printStubWithArglist("b_deleteProp", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_findPos(int nargs) {
+ g_lingo->printStubWithArglist("b_findPos", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_findPosNear(int nargs) {
+ g_lingo->printStubWithArglist("b_findPosNear", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_getaProp(int nargs) {
+ g_lingo->printStubWithArglist("b_getaProp", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_getAt(int nargs) {
+ g_lingo->printStubWithArglist("b_getAt", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_getLast(int nargs) {
+ g_lingo->printStubWithArglist("b_getLast", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_getOne(int nargs) {
+ g_lingo->printStubWithArglist("b_getOne", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_getPos(int nargs) {
+ g_lingo->printStubWithArglist("b_getPos", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_getProp(int nargs) {
+ g_lingo->printStubWithArglist("b_getProp", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_getPropAt(int nargs) {
+ g_lingo->printStubWithArglist("b_getPropAt", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_list(int nargs) {
+ g_lingo->printStubWithArglist("b_list", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_listP(int nargs) {
+ g_lingo->printStubWithArglist("b_listP", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_max(int nargs) {
+ g_lingo->printStubWithArglist("b_max", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_min(int nargs) {
+ g_lingo->printStubWithArglist("b_min", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_setaProp(int nargs) {
+ g_lingo->printStubWithArglist("b_setaProp", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_setAt(int nargs) {
+ g_lingo->printStubWithArglist("b_setAt", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_setProp(int nargs) {
+ g_lingo->printStubWithArglist("b_setProp", nargs);
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_sort(int nargs) {
+ g_lingo->printStubWithArglist("b_sort", nargs);
+ g_lingo->dropStack(nargs);
+}
+
///////////////////
// Files
@@ -492,14 +680,18 @@ void Lingo::b_xFactoryList(int nargs) {
///////////////////
// Control
///////////////////
-void Lingo::b_dontPassEvent(int nargs) {
- warning("STUB: b_dontPassEvent");
+void Lingo::b_abort(int nargs) {
+ warning("STUB: b_continue");
}
void Lingo::b_continue(int nargs) {
warning("STUB: b_continue");
}
+void Lingo::b_dontPassEvent(int nargs) {
+ warning("STUB: b_dontPassEvent");
+}
+
void Lingo::b_nothing(int nargs) {
warning("STUB: b_nothing");
}
@@ -526,6 +718,34 @@ void Lingo::b_playAccel(int nargs) {
g_lingo->dropStack(nargs);
}
+void Lingo::b_preLoad(int nargs) {
+ g_lingo->printStubWithArglist("b_preLoad", nargs);
+
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_preLoadCast(int nargs) {
+ g_lingo->printStubWithArglist("b_preLoadCast", nargs);
+
+ g_lingo->dropStack(nargs);
+}
+
+void Lingo::b_framesToHMS(int nargs) {
+ g_lingo->printStubWithArglist("b_framesToHMS", nargs);
+
+ g_lingo->dropStack(nargs);
+
+ g_lingo->push(Datum(0));
+}
+
+void Lingo::b_HMStoFrames(int nargs) {
+ g_lingo->printStubWithArglist("b_HMStoFrames", nargs);
+
+ g_lingo->dropStack(nargs);
+
+ g_lingo->push(Datum(0));
+}
+
void Lingo::b_printFrom(int nargs) {
g_lingo->printStubWithArglist("b_printFrom", nargs);
@@ -615,7 +835,7 @@ void Lingo::b_alert(int nargs) {
void Lingo::b_cursor(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
- warning("STUB: b_cursor(%d)", d.u.i);
+ g_lingo->func_cursor(d.u.i);
}
void Lingo::b_showGlobals(int nargs) {
@@ -653,10 +873,22 @@ void Lingo::b_constrainV(int nargs) {
g_lingo->push(Datum(0));
}
+void Lingo::b_duplicateCast(int nargs) {
+ g_lingo->printStubWithArglist("b_duplicateCast", nargs);
+
+ g_lingo->dropStack(nargs);
+}
+
void Lingo::b_editableText(int nargs) {
warning("STUB: b_editableText");
}
+void Lingo::b_eraseCast(int nargs) {
+ g_lingo->printStubWithArglist("b_eraseCast", nargs);
+
+ g_lingo->dropStack(nargs);
+}
+
void Lingo::b_installMenu(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_installMenu(%d)", d.u.i);
@@ -767,7 +999,7 @@ void Lingo::b_point(int nargs) {
///////////////////
void Lingo::b_beep(int nargs) {
Datum d = g_lingo->pop();
- warning("STUB: b_beep(%d)", d.u.i);
+ g_lingo->func_beep(d.u.i);
}
void Lingo::b_mci(int nargs) {
@@ -851,6 +1083,10 @@ void Lingo::b_true(int nargs) {
g_lingo->push(Datum(1));
}
+void Lingo::b_version(int nargs) {
+ g_lingo->push(Datum(g_director->getVersion()));
+}
+
///////////////////
// Factory
///////////////////
@@ -858,6 +1094,20 @@ void Lingo::b_factory(int nargs) {
// This is intentionally empty
}
+// TODO:
+// List of predefined methods in D3
+// mAtFrame
+// mDescribe
+// mDispose
+// mGet
+// mInstanceRespondsTo
+// mMessageList
+// mName
+// mNew
+// mPerform
+// mPut
+// mRespondsTo
+
void Lingo::factoryCall(Common::String &name, int nargs) {
Common::String s("factoryCall: ");
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index c9f9c14e84..f55c6946b1 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -53,13 +53,15 @@ static struct FuncDescr {
const char *name;
const char *args;
} funcDescr[] = {
- { 0, "STOP", "" },
+ { 0, "STOP", "" },
{ Lingo::c_xpop, "c_xpop", "" },
+ { Lingo::c_arraypush, "c_arraypush", "i" },
{ Lingo::c_printtop, "c_printtop", "" },
{ Lingo::c_constpush, "c_constpush", "i" },
{ Lingo::c_voidpush, "c_voidpush", "" },
{ Lingo::c_fconstpush, "c_fconstpush", "f" },
{ Lingo::c_stringpush, "c_stringpush", "s" },
+ { Lingo::c_symbolpush, "c_symbolpush", "s" }, // D3
{ Lingo::c_varpush, "c_varpush", "s" },
{ Lingo::c_assign, "c_assign", "" },
{ Lingo::c_eval, "c_eval", "s" },
@@ -73,11 +75,21 @@ static struct FuncDescr {
{ Lingo::c_mod, "c_mod", "" },
{ Lingo::c_negate, "c_negate", "" },
{ Lingo::c_ampersand, "c_ampersand", "" },
+ { Lingo::c_after, "c_after", "" }, // D3
+ { Lingo::c_before, "c_before", "" }, // D3
{ Lingo::c_concat, "c_concat", "" },
{ Lingo::c_contains, "c_contains", "" },
{ Lingo::c_starts, "c_starts", "" },
{ Lingo::c_intersects, "c_intersects", "" },
{ Lingo::c_within, "c_within", "" },
+ { Lingo::c_charOf, "c_charOf", "" }, // D3
+ { Lingo::c_charToOf, "c_charToOf", "" }, // D3
+ { Lingo::c_itemOf, "c_itemOf", "" }, // D3
+ { Lingo::c_itemToOf, "c_itemToOf", "" }, // D3
+ { Lingo::c_lineOf, "c_lineOf", "" }, // D3
+ { Lingo::c_lineToOf, "c_lineToOf", "" }, // D3
+ { Lingo::c_wordOf, "c_wordOf", "" }, // D3
+ { Lingo::c_wordToOf, "c_wordToOf", "" }, // D3
{ Lingo::c_and, "c_and", "" },
{ Lingo::c_or, "c_or", "" },
{ Lingo::c_not, "c_not", "" },
@@ -212,20 +224,45 @@ void Lingo::c_stringpush() {
g_lingo->push(Datum(new Common::String(s)));
}
+void Lingo::c_symbolpush() {
+ char *s = (char *)&(*g_lingo->_currentScript)[g_lingo->_pc];
+ g_lingo->_pc += g_lingo->calcStringAlignment(s);
+
+ warning("STUB: c_symbolpush()");
+
+ // TODO: FIXME: Must push symbol instead of string
+ g_lingo->push(Datum(new Common::String(s)));
+}
+
+void Lingo::c_arraypush() {
+ Datum d;
+ inst v = (*g_lingo->_currentScript)[g_lingo->_pc++];
+ int arraySize = READ_UINT32(&v);
+
+ warning("STUB: c_arraypush()");
+
+ for (int i = 0; i < arraySize; i++)
+ g_lingo->pop();
+
+ d.u.i = arraySize;
+ d.type = INT;
+ g_lingo->push(d);
+}
+
void Lingo::c_varpush() {
- char *name = (char *)&(*g_lingo->_currentScript)[g_lingo->_pc];
+ Common::String name((char *)&(*g_lingo->_currentScript)[g_lingo->_pc]);
Datum d;
- g_lingo->_pc += g_lingo->calcStringAlignment(name);
+ g_lingo->_pc += g_lingo->calcStringAlignment(name.c_str());
- if (g_lingo->_handlers.contains(name)) {
+ if (g_lingo->getHandler(name) != NULL) {
d.type = HANDLER;
d.u.s = new Common::String(name);
g_lingo->push(d);
return;
}
- d.u.sym = g_lingo->lookupVar(name);
+ d.u.sym = g_lingo->lookupVar(name.c_str());
if (d.u.sym->type == CASTREF) {
d.type = INT;
int val = d.u.sym->u.i;
@@ -465,6 +502,34 @@ void Lingo::c_ampersand() {
g_lingo->push(d1);
}
+void Lingo::c_after() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.toString();
+ d2.toString();
+
+ warning("STUB: c_after");
+
+ delete d2.u.s;
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_before() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.toString();
+ d2.toString();
+
+ warning("STUB: c_before");
+
+ delete d2.u.s;
+
+ g_lingo->push(d1);
+}
+
void Lingo::c_concat() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -530,7 +595,7 @@ void Lingo::c_intersects() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
- warning("STUB: c_intersects: %d", d2.u.i);
+ warning("STUB: c_intersects: %d %d", d1.u.i, d2.u.i);
g_lingo->push(d1);
}
@@ -539,7 +604,83 @@ void Lingo::c_within() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
- warning("STUB: c_within: %d", d2.u.i);
+ warning("STUB: c_within: %d %d", d1.u.i, d2.u.i);
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_charOf() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ warning("STUB: c_charOf: %d %d", d1.u.i, d2.u.i);
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_charToOf() {
+ Datum d3 = g_lingo->pop();
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ warning("STUB: c_charToOf: %d %d %d", d1.u.i, d2.u.i, d3.u.i);
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_itemOf() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ warning("STUB: c_itemOf: %d %d", d1.u.i, d2.u.i);
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_itemToOf() {
+ Datum d3 = g_lingo->pop();
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ warning("STUB: c_itemToOf: %d %d %d", d1.u.i, d2.u.i, d3.u.i);
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_lineOf() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ warning("STUB: c_lineOf: %d %d", d1.u.i, d2.u.i);
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_lineToOf() {
+ Datum d3 = g_lingo->pop();
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ warning("STUB: c_lineToOf: %d %d %d", d1.u.i, d2.u.i, d3.u.i);
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_wordOf() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ warning("STUB: c_wordOf: %d %d", d1.u.i, d2.u.i);
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_wordToOf() {
+ Datum d3 = g_lingo->pop();
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ warning("STUB: c_wordToOf: %d %d %d", d1.u.i, d2.u.i, d3.u.i);
g_lingo->push(d1);
}
@@ -859,22 +1000,21 @@ void Lingo::c_call() {
void Lingo::call(Common::String name, int nargs) {
bool dropArgs = false;
- Symbol *sym;
+ Symbol *sym = g_lingo->getHandler(name);
- if (!g_lingo->_handlers.contains(name)) {
+ if (!g_lingo->_eventHandlerTypeIds.contains(name)) {
Symbol *s = g_lingo->lookupVar(name.c_str(), false);
if (s && s->type == OBJECT) {
debugC(3, kDebugLingoExec, "Dereferencing object reference: %s to %s", name.c_str(), s->u.s->c_str());
name = *s->u.s;
+ sym = g_lingo->getHandler(name);
}
}
- if (!g_lingo->_handlers.contains(name)) {
+ if (sym == NULL) {
warning("Call to undefined handler '%s'. Dropping %d stack items", name.c_str(), nargs);
dropArgs = true;
} else {
- sym = g_lingo->_handlers[name];
-
if (sym->type == BLTIN && sym->nargs != -1 && sym->nargs != nargs && sym->maxArgs != nargs) {
if (sym->nargs == sym->maxArgs)
warning("Incorrect number of arguments to handler '%s', expecting %d. Dropping %d stack items", name.c_str(), sym->nargs, nargs);
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index ba39d10447..da5c8de35e 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -99,6 +99,14 @@ Common::String Lingo::decodeInstruction(uint pc, uint *newPc) {
res += Common::String::format(" %d", v);
break;
}
+ case 'f':
+ {
+ i = (*_currentScript)[pc++];
+ double v = *((double *)&i);
+
+ res += Common::String::format(" %f", v);
+ break;
+ }
case 'o':
{
i = (*_currentScript)[pc++];
@@ -184,32 +192,39 @@ Symbol *Lingo::lookupVar(const char *name, bool create, bool putInGlobalList) {
void Lingo::cleanLocalVars() {
// Clean up current scope local variables and clean up memory
+ debugC(3, kDebugLingoExec, "cleanLocalVars: have %d vars", _localvars->size());
+
for (SymbolHash::const_iterator h = _localvars->begin(); h != _localvars->end(); ++h) {
- if (!h->_value->global)
- delete h->_value;
+ if (!h->_value->global) {
+ Symbol *sym = h->_value;
+ free(sym->name);
+ delete sym;
+ }
}
+
delete g_lingo->_localvars;
+
+ g_lingo->_localvars = 0;
}
void Lingo::define(Common::String &name, int start, int nargs, Common::String *prefix, int end) {
- Symbol *sym;
-
if (prefix)
name = *prefix + "-" + name;
debugC(3, kDebugLingoCompile, "define(\"%s\", %d, %d, %d)", name.c_str(), start, _currentScript->size() - 1, nargs);
- if (!_handlers.contains(name)) { // Create variable if it was not defined
+ Symbol *sym = getHandler(name);
+ if (sym == NULL) { // Create variable if it was not defined
sym = new Symbol;
sym->name = (char *)calloc(name.size() + 1, 1);
Common::strlcpy(sym->name, name.c_str(), name.size() + 1);
sym->type = HANDLER;
- _handlers[name] = sym;
+ _handlers[ENTITY_INDEX(_eventHandlerTypeIds[name.c_str()], _currentEntityId)] = sym;
} else {
- sym = g_lingo->_handlers[name];
-
+ //we don't want to be here. The getHandler call should have used the EntityId and the result
+ //should have been unique!
warning("Redefining handler '%s'", name.c_str());
delete sym->u.defn;
}
@@ -219,6 +234,7 @@ void Lingo::define(Common::String &name, int start, int nargs, Common::String *p
sym->u.defn = new ScriptData(&(*_currentScript)[start], end - start + 1);
sym->nargs = nargs;
+ sym->maxArgs = nargs;
}
int Lingo::codeString(const char *str) {
@@ -264,6 +280,15 @@ int Lingo::codeConst(int val) {
return res;
}
+int Lingo::codeArray(int arraySize) {
+ int res = g_lingo->code1(g_lingo->c_arraypush);
+ inst i = 0;
+ WRITE_UINT32(&i, arraySize);
+ g_lingo->code1(i);
+
+ return res;
+}
+
void Lingo::codeArg(Common::String *s) {
_argstack.push_back(s);
}
@@ -289,17 +314,24 @@ void Lingo::codeArgStore() {
int Lingo::codeFunc(Common::String *s, int numpar) {
int ret = g_lingo->code1(g_lingo->c_call);
- if (s->equalsIgnoreCase("me")) {
- if (!g_lingo->_currentFactory.empty()) {
- g_lingo->codeString(g_lingo->_currentFactory.c_str());
- debugC(2, kDebugLingoCompile, "Replaced 'me' with %s", g_lingo->_currentFactory.c_str());
- } else {
- warning("'me' out of factory method");
- g_lingo->codeString(s->c_str());
- }
- } else {
- g_lingo->codeString(s->c_str());
- }
+ g_lingo->codeString(s->c_str());
+
+ inst num = 0;
+ WRITE_UINT32(&num, numpar);
+ g_lingo->code1(num);
+
+ return ret;
+}
+
+int Lingo::codeMe(Common::String *method, int numpar) {
+ int ret = g_lingo->code1(g_lingo->c_call);
+
+ Common::String m(g_lingo->_currentFactory);
+
+ m += '-';
+ m += *method;
+
+ g_lingo->codeString(m.c_str());
inst num = 0;
WRITE_UINT32(&num, numpar);
@@ -352,7 +384,7 @@ void Lingo::codeFactory(Common::String &name) {
sym->parens = true;
sym->u.bltin = g_lingo->b_factory;
- _handlers[name] = sym;
+ _handlers[ENTITY_INDEX(_eventHandlerTypeIds[name.c_str()], _currentEntityId)] = sym;
}
}
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index e22044c1e9..0deab0760c 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -26,6 +26,7 @@
#include "common/util.h"
#include "director/lingo/lingo-gr.h"
#include "director/sound.h"
+#include "graphics/macgui/macwindowmanager.h"
namespace Director {
@@ -199,15 +200,58 @@ void Lingo::func_goto(Datum &frame, Datum &movie) {
}
void Lingo::func_gotoloop() {
+ if (!_vm->_currentScore)
+ return;
+
_vm->_currentScore->gotoloop();
}
void Lingo::func_gotonext() {
+ if (!_vm->_currentScore)
+ return;
+
_vm->_currentScore->gotonext();
}
void Lingo::func_gotoprevious() {
+ if (!_vm->_currentScore)
+ return;
+
_vm->_currentScore->gotoprevious();
}
+void Lingo::func_cursor(int c) {
+ if (_cursorOnStack) {
+ //pop cursor
+ _vm->getMacWindowManager()->popCursor();
+ }
+
+ //and then push cursor.
+ switch (c) {
+ case 0:
+ case -1:
+ _vm->getMacWindowManager()->pushArrowCursor();
+ break;
+ case 1:
+ _vm->getMacWindowManager()->pushBeamCursor();
+ break;
+ case 2:
+ _vm->getMacWindowManager()->pushCrossHairCursor();
+ break;
+ case 3:
+ _vm->getMacWindowManager()->pushCrossBarCursor();
+ break;
+ case 4:
+ _vm->getMacWindowManager()->pushWatchCursor();
+ break;
+ }
+
+ warning("STUB: func_cursor(%d)", c);
+}
+
+void Lingo::func_beep(int repeats) {
+ for (int r = 0; r <= repeats; r++)
+ _vm->getSoundManager()->systemBeep();
+}
+
}
diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp
index 8cc5f695e4..03ac16c6a8 100644
--- a/engines/director/lingo/lingo-gr.cpp
+++ b/engines/director/lingo/lingo-gr.cpp
@@ -73,71 +73,77 @@
POINT = 262,
RECT = 263,
ARRAY = 264,
- SYMBOL = 265,
- OBJECT = 266,
- INT = 267,
- THEENTITY = 268,
- THEENTITYWITHID = 269,
- FLOAT = 270,
- BLTIN = 271,
- BLTINNOARGS = 272,
- BLTINNOARGSORONE = 273,
- BLTINONEARG = 274,
- BLTINARGLIST = 275,
+ OBJECT = 265,
+ INT = 266,
+ THEENTITY = 267,
+ THEENTITYWITHID = 268,
+ FLOAT = 269,
+ BLTIN = 270,
+ BLTINNOARGS = 271,
+ BLTINNOARGSORONE = 272,
+ BLTINONEARG = 273,
+ BLTINARGLIST = 274,
+ TWOWORDBUILTIN = 275,
ID = 276,
STRING = 277,
HANDLER = 278,
- tDOWN = 279,
- tELSE = 280,
- tNLELSIF = 281,
- tEND = 282,
- tEXIT = 283,
- tFRAME = 284,
- tGLOBAL = 285,
- tGO = 286,
- tIF = 287,
- tINTO = 288,
- tLOOP = 289,
- tMACRO = 290,
- tMOVIE = 291,
- tNEXT = 292,
- tOF = 293,
- tPREVIOUS = 294,
- tPUT = 295,
- tREPEAT = 296,
- tSET = 297,
- tTHEN = 298,
- tTO = 299,
- tWHEN = 300,
- tWITH = 301,
- tWHILE = 302,
- tNLELSE = 303,
- tFACTORY = 304,
- tMETHOD = 305,
- tOPEN = 306,
- tPLAY = 307,
- tDONE = 308,
- tPLAYACCEL = 309,
- tINSTANCE = 310,
- tGE = 311,
- tLE = 312,
- tGT = 313,
- tLT = 314,
- tEQ = 315,
- tNEQ = 316,
- tAND = 317,
- tOR = 318,
- tNOT = 319,
- tMOD = 320,
- tCONCAT = 321,
- tCONTAINS = 322,
- tSTARTS = 323,
- tSPRITE = 324,
- tINTERSECTS = 325,
- tWITHIN = 326,
- tON = 327,
- tME = 328,
- tSOUND = 329
+ SYMBOL = 279,
+ ENDCLAUSE = 280,
+ tDOWN = 281,
+ tELSE = 282,
+ tNLELSIF = 283,
+ tEXIT = 284,
+ tFRAME = 285,
+ tGLOBAL = 286,
+ tGO = 287,
+ tIF = 288,
+ tINTO = 289,
+ tLOOP = 290,
+ tMACRO = 291,
+ tMOVIE = 292,
+ tNEXT = 293,
+ tOF = 294,
+ tPREVIOUS = 295,
+ tPUT = 296,
+ tREPEAT = 297,
+ tSET = 298,
+ tTHEN = 299,
+ tTO = 300,
+ tWHEN = 301,
+ tWITH = 302,
+ tWHILE = 303,
+ tNLELSE = 304,
+ tFACTORY = 305,
+ tMETHOD = 306,
+ tOPEN = 307,
+ tPLAY = 308,
+ tDONE = 309,
+ tPLAYACCEL = 310,
+ tINSTANCE = 311,
+ tGE = 312,
+ tLE = 313,
+ tGT = 314,
+ tLT = 315,
+ tEQ = 316,
+ tNEQ = 317,
+ tAND = 318,
+ tOR = 319,
+ tNOT = 320,
+ tMOD = 321,
+ tAFTER = 322,
+ tBEFORE = 323,
+ tCONCAT = 324,
+ tCONTAINS = 325,
+ tSTARTS = 326,
+ tCHAR = 327,
+ tITEM = 328,
+ tLINE = 329,
+ tWORD = 330,
+ tSPRITE = 331,
+ tINTERSECTS = 332,
+ tWITHIN = 333,
+ tON = 334,
+ tME = 335
};
#endif
/* Tokens. */
@@ -148,71 +154,77 @@
#define POINT 262
#define RECT 263
#define ARRAY 264
-#define SYMBOL 265
-#define OBJECT 266
-#define INT 267
-#define THEENTITY 268
-#define THEENTITYWITHID 269
-#define FLOAT 270
-#define BLTIN 271
-#define BLTINNOARGS 272
-#define BLTINNOARGSORONE 273
-#define BLTINONEARG 274
-#define BLTINARGLIST 275
+#define OBJECT 265
+#define INT 266
+#define THEENTITY 267
+#define THEENTITYWITHID 268
+#define FLOAT 269
+#define BLTIN 270
+#define BLTINNOARGS 271
+#define BLTINNOARGSORONE 272
+#define BLTINONEARG 273
+#define BLTINARGLIST 274
+#define TWOWORDBUILTIN 275
#define ID 276
#define STRING 277
#define HANDLER 278
-#define tDOWN 279
-#define tELSE 280
-#define tNLELSIF 281
-#define tEND 282
-#define tEXIT 283
-#define tFRAME 284
-#define tGLOBAL 285
-#define tGO 286
-#define tIF 287
-#define tINTO 288
-#define tLOOP 289
-#define tMACRO 290
-#define tMOVIE 291
-#define tNEXT 292
-#define tOF 293
-#define tPREVIOUS 294
-#define tPUT 295
-#define tREPEAT 296
-#define tSET 297
-#define tTHEN 298
-#define tTO 299
-#define tWHEN 300
-#define tWITH 301
-#define tWHILE 302
-#define tNLELSE 303
-#define tFACTORY 304
-#define tMETHOD 305
-#define tOPEN 306
-#define tPLAY 307
-#define tDONE 308
-#define tPLAYACCEL 309
-#define tINSTANCE 310
-#define tGE 311
-#define tLE 312
-#define tGT 313
-#define tLT 314
-#define tEQ 315
-#define tNEQ 316
-#define tAND 317
-#define tOR 318
-#define tNOT 319
-#define tMOD 320
-#define tCONCAT 321
-#define tCONTAINS 322
-#define tSTARTS 323
-#define tSPRITE 324
-#define tINTERSECTS 325
-#define tWITHIN 326
-#define tON 327
-#define tME 328
-#define tSOUND 329
+#define SYMBOL 279
+#define ENDCLAUSE 280
+#define tDOWN 281
+#define tELSE 282
+#define tNLELSIF 283
+#define tEXIT 284
+#define tFRAME 285
+#define tGLOBAL 286
+#define tGO 287
+#define tIF 288
+#define tINTO 289
+#define tLOOP 290
+#define tMACRO 291
+#define tMOVIE 292
+#define tNEXT 293
+#define tOF 294
+#define tPREVIOUS 295
+#define tPUT 296
+#define tREPEAT 297
+#define tSET 298
+#define tTHEN 299
+#define tTO 300
+#define tWHEN 301
+#define tWITH 302
+#define tWHILE 303
+#define tNLELSE 304
+#define tFACTORY 305
+#define tMETHOD 306
+#define tOPEN 307
+#define tPLAY 308
+#define tDONE 309
+#define tPLAYACCEL 310
+#define tINSTANCE 311
+#define tGE 312
+#define tLE 313
+#define tGT 314
+#define tLT 315
+#define tEQ 316
+#define tNEQ 317
+#define tAND 318
+#define tOR 319
+#define tNOT 320
+#define tMOD 321
+#define tAFTER 322
+#define tBEFORE 323
+#define tCONCAT 324
+#define tCONTAINS 325
+#define tSTARTS 326
+#define tCHAR 327
+#define tITEM 328
+#define tLINE 329
+#define tWORD 330
+#define tSPRITE 331
+#define tINTERSECTS 332
+#define tWITHIN 333
+#define tON 334
+#define tME 335
@@ -236,6 +248,16 @@ void yyerror(const char *s) {
warning("%s at line %d col %d", s, g_lingo->_linenumber, g_lingo->_colnumber);
}
+void checkEnd(Common::String *token, const char *expect, bool required) {
+ if (required) {
+ if (token->compareToIgnoreCase(expect)) {
+ Common::String err = Common::String::format("end mismatch. Expected %s but got %s", expect, token->c_str());
+ yyerror(err.c_str());
+ }
+ }
+
+ delete token;
+}
@@ -259,7 +281,7 @@ void yyerror(const char *s) {
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 69 "engines/director/lingo/lingo-gr.y"
+#line 79 "engines/director/lingo/lingo-gr.y"
{
Common::String *s;
int i;
@@ -270,7 +292,7 @@ typedef union YYSTYPE
Common::Array<double> *arr;
}
/* Line 193 of yacc.c. */
-#line 274 "engines/director/lingo/lingo-gr.cpp"
+#line 296 "engines/director/lingo/lingo-gr.cpp"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
@@ -283,7 +305,7 @@ typedef union YYSTYPE
/* Line 216 of yacc.c. */
-#line 287 "engines/director/lingo/lingo-gr.cpp"
+#line 309 "engines/director/lingo/lingo-gr.cpp"
#ifdef short
# undef short
@@ -496,22 +518,22 @@ union yyalloc
#endif
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 96
+#define YYFINAL 110
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 990
+#define YYLAST 1648
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 88
+#define YYNTOKENS 96
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 38
+#define YYNNTS 39
/* YYNRULES -- Number of rules. */
-#define YYNRULES 133
+#define YYNRULES 150
/* YYNRULES -- Number of states. */
-#define YYNSTATES 282
+#define YYNSTATES 329
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 329
+#define YYMAXUTOK 335
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -520,15 +542,15 @@ union yyalloc
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 82, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 81, 76, 2,
- 83, 84, 79, 77, 87, 78, 2, 80, 2, 2,
+ 88, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 86, 75, 85, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 87, 82, 2,
+ 89, 90, 85, 83, 95, 84, 2, 86, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 92, 81, 91, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 93, 2, 94, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -551,7 +573,8 @@ static const yytype_uint8 yytranslate[] =
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80
};
#if YYDEBUG
@@ -560,93 +583,105 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 7, 9, 12, 14, 15, 17, 19,
- 21, 23, 25, 30, 35, 40, 46, 51, 56, 62,
- 64, 66, 68, 70, 79, 91, 104, 108, 117, 129,
- 141, 148, 159, 170, 171, 175, 178, 180, 183, 185,
- 192, 194, 200, 202, 206, 210, 213, 217, 219, 221,
- 222, 223, 224, 227, 230, 234, 236, 238, 240, 242,
- 247, 249, 251, 254, 256, 260, 264, 268, 272, 276,
- 280, 284, 288, 292, 296, 300, 304, 307, 311, 315,
- 319, 323, 326, 329, 333, 338, 343, 346, 348, 350,
- 353, 355, 358, 361, 364, 367, 369, 372, 377, 380,
- 384, 386, 390, 392, 396, 399, 402, 405, 408, 412,
- 415, 418, 420, 424, 427, 430, 433, 437, 440, 441,
- 450, 453, 454, 463, 464, 475, 476, 478, 482, 487,
- 488, 492, 493, 495
+ 21, 23, 25, 30, 35, 40, 45, 50, 56, 61,
+ 66, 72, 74, 76, 78, 80, 88, 99, 111, 115,
+ 123, 134, 145, 152, 163, 174, 175, 179, 182, 184,
+ 187, 189, 196, 198, 204, 206, 210, 214, 217, 221,
+ 223, 225, 226, 227, 228, 231, 234, 238, 240, 242,
+ 244, 246, 248, 253, 255, 257, 260, 262, 266, 270,
+ 274, 278, 282, 286, 290, 294, 298, 302, 306, 310,
+ 313, 317, 321, 325, 329, 333, 336, 339, 343, 347,
+ 352, 357, 362, 369, 374, 381, 386, 393, 398, 405,
+ 408, 410, 412, 415, 417, 420, 423, 426, 429, 431,
+ 436, 439, 444, 451, 456, 459, 463, 465, 469, 471,
+ 475, 478, 481, 484, 487, 491, 494, 497, 499, 503,
+ 506, 509, 512, 516, 519, 520, 529, 532, 533, 542,
+ 543, 544, 555, 556, 558, 562, 567, 568, 572, 573,
+ 575
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int8 yyrhs[] =
+static const yytype_int16 yyrhs[] =
{
- 89, 0, -1, 89, 90, 91, -1, 91, -1, 1,
- 90, -1, 82, -1, -1, 118, -1, 111, -1, 124,
- -1, 92, -1, 94, -1, 40, 110, 33, 21, -1,
- 42, 21, 75, 110, -1, 42, 13, 75, 110, -1,
- 42, 14, 110, 75, 110, -1, 42, 21, 44, 110,
- -1, 42, 13, 44, 110, -1, 42, 14, 110, 44,
- 110, -1, 110, -1, 111, -1, 93, -1, 95, -1,
- 102, 83, 101, 84, 108, 107, 27, 41, -1, 103,
- 75, 110, 107, 44, 110, 107, 108, 107, 27, 41,
- -1, 103, 75, 110, 107, 24, 44, 110, 107, 108,
- 107, 27, 41, -1, 109, 110, 107, -1, 104, 101,
- 43, 90, 108, 107, 27, 32, -1, 104, 101, 43,
- 90, 108, 107, 48, 108, 107, 27, 32, -1, 104,
- 101, 43, 90, 108, 107, 106, 97, 107, 27, 32,
- -1, 104, 101, 43, 106, 93, 107, -1, 104, 101,
- 43, 106, 93, 107, 48, 106, 93, 107, -1, 104,
- 101, 43, 106, 93, 107, 98, 107, 96, 107, -1,
- -1, 48, 106, 93, -1, 97, 100, -1, 100, -1,
- 98, 99, -1, 99, -1, 105, 101, 43, 106, 94,
- 107, -1, 98, -1, 105, 101, 43, 108, 107, -1,
- 110, -1, 110, 75, 110, -1, 83, 101, 84, -1,
- 41, 47, -1, 41, 46, 21, -1, 32, -1, 26,
- -1, -1, -1, -1, 108, 90, -1, 108, 94, -1,
- 45, 21, 43, -1, 12, -1, 15, -1, 22, -1,
- 17, -1, 21, 83, 125, 84, -1, 21, -1, 13,
- -1, 14, 110, -1, 92, -1, 110, 77, 110, -1,
- 110, 78, 110, -1, 110, 79, 110, -1, 110, 80,
- 110, -1, 110, 65, 110, -1, 110, 85, 110, -1,
- 110, 86, 110, -1, 110, 61, 110, -1, 110, 56,
- 110, -1, 110, 57, 110, -1, 110, 62, 110, -1,
- 110, 63, 110, -1, 64, 110, -1, 110, 76, 110,
- -1, 110, 66, 110, -1, 110, 67, 110, -1, 110,
- 68, 110, -1, 77, 110, -1, 78, 110, -1, 83,
- 110, 84, -1, 69, 110, 70, 110, -1, 69, 110,
- 71, 110, -1, 40, 110, -1, 114, -1, 117, -1,
- 28, 41, -1, 28, -1, 30, 112, -1, 55, 113,
- -1, 19, 110, -1, 18, 110, -1, 18, -1, 20,
- 125, -1, 51, 110, 46, 110, -1, 51, 110, -1,
- 74, 21, 125, -1, 21, -1, 112, 87, 21, -1,
- 21, -1, 113, 87, 21, -1, 31, 34, -1, 31,
- 37, -1, 31, 39, -1, 31, 115, -1, 31, 115,
- 116, -1, 31, 116, -1, 29, 110, -1, 110, -1,
- 38, 36, 110, -1, 36, 110, -1, 52, 53, -1,
- 52, 115, -1, 52, 115, 116, -1, 52, 116, -1,
- -1, 35, 21, 119, 106, 122, 90, 123, 108, -1,
- 49, 21, -1, -1, 50, 21, 120, 106, 122, 90,
- 123, 108, -1, -1, 72, 21, 121, 106, 122, 90,
- 123, 108, 27, 21, -1, -1, 21, -1, 122, 87,
- 21, -1, 122, 90, 87, 21, -1, -1, 21, 106,
- 125, -1, -1, 110, -1, 125, 87, 110, -1
+ 97, 0, -1, 97, 98, 99, -1, 99, -1, 1,
+ 98, -1, 88, -1, -1, 126, -1, 119, -1, 133,
+ -1, 100, -1, 102, -1, 41, 118, 34, 21, -1,
+ 41, 118, 67, 118, -1, 41, 118, 68, 118, -1,
+ 43, 21, 81, 118, -1, 43, 12, 81, 118, -1,
+ 43, 13, 118, 81, 118, -1, 43, 21, 45, 118,
+ -1, 43, 12, 45, 118, -1, 43, 13, 118, 45,
+ 118, -1, 118, -1, 119, -1, 101, -1, 103, -1,
+ 110, 89, 109, 90, 116, 115, 25, -1, 111, 81,
+ 118, 115, 45, 118, 115, 116, 115, 25, -1, 111,
+ 81, 118, 115, 26, 45, 118, 115, 116, 115, 25,
+ -1, 117, 118, 115, -1, 112, 109, 44, 98, 116,
+ 115, 25, -1, 112, 109, 44, 98, 116, 115, 49,
+ 116, 115, 25, -1, 112, 109, 44, 98, 116, 115,
+ 114, 105, 115, 25, -1, 112, 109, 44, 114, 101,
+ 115, -1, 112, 109, 44, 114, 101, 115, 49, 114,
+ 101, 115, -1, 112, 109, 44, 114, 101, 115, 106,
+ 115, 104, 115, -1, -1, 49, 114, 101, -1, 105,
+ 108, -1, 108, -1, 106, 107, -1, 107, -1, 113,
+ 109, 44, 114, 102, 115, -1, 106, -1, 113, 109,
+ 44, 116, 115, -1, 118, -1, 118, 81, 118, -1,
+ 89, 109, 90, -1, 42, 48, -1, 42, 47, 21,
+ -1, 33, -1, 28, -1, -1, -1, -1, 116, 98,
+ -1, 116, 102, -1, 46, 21, 44, -1, 11, -1,
+ 14, -1, 24, -1, 22, -1, 16, -1, 21, 89,
+ 134, 90, -1, 21, -1, 12, -1, 13, 118, -1,
+ 100, -1, 118, 83, 118, -1, 118, 84, 118, -1,
+ 118, 85, 118, -1, 118, 86, 118, -1, 118, 66,
+ 118, -1, 118, 91, 118, -1, 118, 92, 118, -1,
+ 118, 62, 118, -1, 118, 57, 118, -1, 118, 58,
+ 118, -1, 118, 63, 118, -1, 118, 64, 118, -1,
+ 65, 118, -1, 118, 82, 118, -1, 118, 67, 118,
+ -1, 118, 69, 118, -1, 118, 70, 118, -1, 118,
+ 71, 118, -1, 83, 118, -1, 84, 118, -1, 89,
+ 118, 90, -1, 93, 134, 94, -1, 76, 118, 77,
+ 118, -1, 76, 118, 78, 118, -1, 72, 118, 39,
+ 118, -1, 72, 118, 45, 118, 39, 118, -1, 73,
+ 118, 39, 118, -1, 73, 118, 45, 118, 39, 118,
+ -1, 74, 118, 39, 118, -1, 74, 118, 45, 118,
+ 39, 118, -1, 75, 118, 39, 118, -1, 75, 118,
+ 45, 118, 39, 118, -1, 41, 118, -1, 122, -1,
+ 125, -1, 29, 42, -1, 29, -1, 31, 120, -1,
+ 56, 121, -1, 18, 118, -1, 17, 118, -1, 17,
+ -1, 19, 89, 134, 90, -1, 19, 134, -1, 80,
+ 89, 21, 90, -1, 80, 89, 21, 95, 134, 90,
+ -1, 52, 118, 47, 118, -1, 52, 118, -1, 20,
+ 21, 134, -1, 21, -1, 120, 95, 21, -1, 21,
+ -1, 121, 95, 21, -1, 32, 35, -1, 32, 38,
+ -1, 32, 40, -1, 32, 123, -1, 32, 123, 124,
+ -1, 32, 124, -1, 30, 118, -1, 118, -1, 39,
+ 37, 118, -1, 37, 118, -1, 53, 54, -1, 53,
+ 123, -1, 53, 123, 124, -1, 53, 124, -1, -1,
+ 36, 21, 127, 114, 131, 98, 132, 116, -1, 50,
+ 21, -1, -1, 51, 21, 128, 114, 131, 98, 132,
+ 116, -1, -1, -1, 79, 21, 129, 114, 130, 131,
+ 98, 132, 116, 25, -1, -1, 21, -1, 131, 95,
+ 21, -1, 131, 98, 95, 21, -1, -1, 21, 114,
+ 134, -1, -1, 118, -1, 134, 95, 118, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 106, 106, 107, 108, 111, 116, 117, 118, 119,
- 120, 121, 124, 130, 136, 144, 152, 158, 166, 175,
- 176, 178, 179, 184, 195, 211, 223, 231, 238, 247,
- 256, 266, 276, 287, 288, 291, 292, 295, 296, 299,
- 307, 308, 316, 317, 318, 320, 322, 328, 334, 341,
- 343, 345, 346, 347, 350, 356, 357, 360, 363, 366,
- 369, 373, 380, 386, 387, 388, 389, 390, 391, 392,
- 393, 394, 395, 396, 397, 398, 399, 400, 401, 402,
- 403, 404, 405, 406, 407, 408, 411, 412, 413, 414,
- 415, 417, 418, 419, 422, 425, 428, 429, 430, 431,
- 434, 435, 438, 439, 450, 451, 452, 453, 456, 459,
- 464, 465, 468, 469, 472, 473, 476, 479, 509, 509,
- 515, 518, 518, 523, 523, 535, 536, 537, 538, 540,
- 544, 552, 553, 554
+ 0, 117, 117, 118, 119, 122, 127, 128, 129, 130,
+ 131, 132, 135, 141, 142, 143, 149, 157, 165, 171,
+ 179, 188, 189, 191, 192, 197, 210, 228, 242, 250,
+ 260, 272, 284, 294, 304, 315, 316, 319, 320, 323,
+ 324, 327, 335, 336, 344, 345, 346, 348, 350, 356,
+ 362, 369, 371, 373, 374, 375, 378, 384, 385, 388,
+ 391, 394, 397, 400, 404, 411, 417, 418, 419, 420,
+ 421, 422, 423, 424, 425, 426, 427, 428, 429, 430,
+ 431, 432, 433, 434, 435, 436, 437, 438, 439, 440,
+ 441, 442, 443, 444, 445, 446, 447, 448, 449, 452,
+ 453, 454, 455, 456, 458, 459, 460, 463, 466, 469,
+ 470, 471, 472, 473, 474, 475, 478, 479, 482, 483,
+ 494, 495, 496, 497, 500, 503, 508, 509, 512, 513,
+ 516, 517, 520, 523, 553, 553, 559, 562, 562, 567,
+ 568, 567, 578, 579, 580, 581, 583, 587, 595, 596,
+ 597
};
#endif
@@ -656,24 +691,25 @@ static const yytype_uint16 yyrline[] =
static const char *const yytname[] =
{
"$end", "error", "$undefined", "UNARY", "CASTREF", "VOID", "VAR",
- "POINT", "RECT", "ARRAY", "SYMBOL", "OBJECT", "INT", "THEENTITY",
+ "POINT", "RECT", "ARRAY", "OBJECT", "INT", "THEENTITY",
"THEENTITYWITHID", "FLOAT", "BLTIN", "BLTINNOARGS", "BLTINNOARGSORONE",
- "BLTINONEARG", "BLTINARGLIST", "ID", "STRING", "HANDLER", "tDOWN",
- "tELSE", "tNLELSIF", "tEND", "tEXIT", "tFRAME", "tGLOBAL", "tGO", "tIF",
- "tINTO", "tLOOP", "tMACRO", "tMOVIE", "tNEXT", "tOF", "tPREVIOUS",
- "tPUT", "tREPEAT", "tSET", "tTHEN", "tTO", "tWHEN", "tWITH", "tWHILE",
- "tNLELSE", "tFACTORY", "tMETHOD", "tOPEN", "tPLAY", "tDONE",
- "tPLAYACCEL", "tINSTANCE", "tGE", "tLE", "tGT", "tLT", "tEQ", "tNEQ",
- "tAND", "tOR", "tNOT", "tMOD", "tCONCAT", "tCONTAINS", "tSTARTS",
- "tSPRITE", "tINTERSECTS", "tWITHIN", "tON", "tME", "tSOUND", "'='",
- "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "'\\n'", "'('", "')'", "'>'",
- "'<'", "','", "$accept", "program", "nl", "programline", "asgn",
+ "BLTINONEARG", "BLTINARGLIST", "TWOWORDBUILTIN", "ID", "STRING",
+ "HANDLER", "SYMBOL", "ENDCLAUSE", "tDOWN", "tELSE", "tNLELSIF", "tEXIT",
+ "tFRAME", "tGLOBAL", "tGO", "tIF", "tINTO", "tLOOP", "tMACRO", "tMOVIE",
+ "tNEXT", "tOF", "tPREVIOUS", "tPUT", "tREPEAT", "tSET", "tTHEN", "tTO",
+ "tWHEN", "tWITH", "tWHILE", "tNLELSE", "tFACTORY", "tMETHOD", "tOPEN",
+ "tPLAY", "tDONE", "tPLAYACCEL", "tINSTANCE", "tGE", "tLE", "tGT", "tLT",
+ "tEQ", "tNEQ", "tAND", "tOR", "tNOT", "tMOD", "tAFTER", "tBEFORE",
+ "tCONCAT", "tCONTAINS", "tSTARTS", "tCHAR", "tITEM", "tLINE", "tWORD",
+ "tSPRITE", "tINTERSECTS", "tWITHIN", "tON", "tME", "'='", "'&'", "'+'",
+ "'-'", "'*'", "'/'", "'%'", "'\\n'", "'('", "')'", "'>'", "'<'", "'['",
+ "']'", "','", "$accept", "program", "nl", "programline", "asgn",
"stmtoneliner", "stmt", "ifstmt", "elsestmtoneliner", "elseifstmt",
"elseifstmtoneliner", "elseifstmtoneliner1", "elseifstmt1", "cond",
"repeatwhile", "repeatwith", "if", "elseif", "begin", "end", "stmtlist",
"when", "expr", "func", "globallist", "instancelist", "gotofunc",
- "gotoframe", "gotomovie", "playfunc", "defn", "@1", "@2", "@3", "argdef",
- "argstore", "macro", "arglist", 0
+ "gotoframe", "gotomovie", "playfunc", "defn", "@1", "@2", "@3", "@4",
+ "argdef", "argstore", "macro", "arglist", 0
};
#endif
@@ -689,47 +725,52 @@ static const yytype_uint16 yytoknum[] =
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
- 325, 326, 327, 328, 329, 61, 38, 43, 45, 42,
- 47, 37, 10, 40, 41, 62, 60, 44
+ 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
+ 335, 61, 38, 43, 45, 42, 47, 37, 10, 40,
+ 41, 62, 60, 91, 93, 44
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 88, 89, 89, 89, 90, 91, 91, 91, 91,
- 91, 91, 92, 92, 92, 92, 92, 92, 92, 93,
- 93, 94, 94, 94, 94, 94, 94, 95, 95, 95,
- 95, 95, 95, 96, 96, 97, 97, 98, 98, 99,
- 100, 100, 101, 101, 101, 102, 103, 104, 105, 106,
- 107, 108, 108, 108, 109, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 112, 112, 113, 113, 114, 114, 114, 114, 114, 114,
- 115, 115, 116, 116, 117, 117, 117, 117, 119, 118,
- 118, 120, 118, 121, 118, 122, 122, 122, 122, 123,
- 124, 125, 125, 125
+ 0, 96, 97, 97, 97, 98, 99, 99, 99, 99,
+ 99, 99, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 101, 101, 102, 102, 102, 102, 102, 102, 103,
+ 103, 103, 103, 103, 103, 104, 104, 105, 105, 106,
+ 106, 107, 108, 108, 109, 109, 109, 110, 111, 112,
+ 113, 114, 115, 116, 116, 116, 117, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 119,
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
+ 119, 119, 119, 119, 119, 119, 120, 120, 121, 121,
+ 122, 122, 122, 122, 122, 122, 123, 123, 124, 124,
+ 125, 125, 125, 125, 127, 126, 126, 128, 126, 129,
+ 130, 126, 131, 131, 131, 131, 132, 133, 134, 134,
+ 134
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 3, 1, 2, 1, 0, 1, 1, 1,
- 1, 1, 4, 4, 4, 5, 4, 4, 5, 1,
- 1, 1, 1, 8, 11, 12, 3, 8, 11, 11,
- 6, 10, 10, 0, 3, 2, 1, 2, 1, 6,
- 1, 5, 1, 3, 3, 2, 3, 1, 1, 0,
- 0, 0, 2, 2, 3, 1, 1, 1, 1, 4,
- 1, 1, 2, 1, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 2, 3, 3, 3,
- 3, 2, 2, 3, 4, 4, 2, 1, 1, 2,
- 1, 2, 2, 2, 2, 1, 2, 4, 2, 3,
- 1, 3, 1, 3, 2, 2, 2, 2, 3, 2,
- 2, 1, 3, 2, 2, 2, 3, 2, 0, 8,
- 2, 0, 8, 0, 10, 0, 1, 3, 4, 0,
- 3, 0, 1, 3
+ 1, 1, 4, 4, 4, 4, 4, 5, 4, 4,
+ 5, 1, 1, 1, 1, 7, 10, 11, 3, 7,
+ 10, 10, 6, 10, 10, 0, 3, 2, 1, 2,
+ 1, 6, 1, 5, 1, 3, 3, 2, 3, 1,
+ 1, 0, 0, 0, 2, 2, 3, 1, 1, 1,
+ 1, 1, 4, 1, 1, 2, 1, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
+ 3, 3, 3, 3, 3, 2, 2, 3, 3, 4,
+ 4, 4, 6, 4, 6, 4, 6, 4, 6, 2,
+ 1, 1, 2, 1, 2, 2, 2, 2, 1, 4,
+ 2, 4, 6, 4, 2, 3, 1, 3, 1, 3,
+ 2, 2, 2, 2, 3, 2, 2, 1, 3, 2,
+ 2, 2, 3, 2, 0, 8, 2, 0, 8, 0,
+ 0, 10, 0, 1, 3, 4, 0, 3, 0, 1,
+ 3
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -737,337 +778,479 @@ static const yytype_uint8 yyr2[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 0, 0, 55, 61, 0, 56, 58, 95, 0, 131,
- 49, 57, 90, 0, 0, 47, 0, 0, 0, 0,
+ 0, 0, 57, 64, 0, 58, 61, 108, 0, 148,
+ 0, 51, 60, 59, 103, 0, 0, 49, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3, 63, 21, 11, 22, 0,
- 0, 0, 0, 19, 8, 87, 88, 7, 9, 5,
- 4, 60, 0, 63, 62, 94, 93, 132, 96, 131,
- 131, 89, 100, 91, 0, 104, 0, 105, 0, 106,
- 111, 107, 109, 118, 86, 0, 45, 0, 0, 0,
- 0, 120, 121, 98, 114, 115, 117, 102, 92, 76,
- 0, 123, 131, 81, 82, 0, 1, 6, 0, 0,
- 0, 0, 42, 50, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 148,
+ 0, 3, 66, 23, 11, 24, 0, 0, 0, 0,
+ 21, 8, 100, 101, 7, 9, 5, 4, 63, 0,
+ 66, 65, 107, 106, 148, 149, 110, 148, 148, 148,
+ 102, 116, 104, 0, 120, 0, 121, 0, 122, 127,
+ 123, 125, 134, 99, 0, 47, 0, 0, 0, 0,
+ 136, 137, 114, 130, 131, 133, 118, 105, 79, 0,
+ 0, 0, 0, 0, 139, 0, 85, 86, 0, 0,
+ 1, 6, 0, 0, 0, 0, 44, 52, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 130, 0, 110, 113, 0, 108, 49,
- 0, 46, 0, 0, 0, 0, 0, 54, 49, 0,
- 116, 0, 0, 0, 49, 99, 83, 2, 0, 50,
- 0, 0, 49, 0, 26, 72, 73, 71, 74, 75,
- 68, 78, 79, 80, 77, 64, 65, 66, 67, 69,
- 70, 133, 59, 101, 112, 125, 12, 17, 14, 0,
- 0, 16, 13, 125, 97, 103, 84, 85, 125, 51,
- 0, 44, 51, 0, 43, 126, 0, 18, 15, 0,
- 0, 50, 0, 0, 50, 50, 20, 0, 129, 129,
- 129, 52, 53, 0, 0, 50, 49, 30, 127, 0,
- 51, 51, 51, 0, 50, 51, 0, 51, 0, 48,
- 49, 50, 38, 0, 128, 119, 122, 0, 23, 51,
- 50, 27, 50, 50, 40, 36, 0, 0, 37, 33,
- 0, 0, 50, 0, 0, 35, 0, 0, 50, 49,
- 50, 49, 124, 0, 0, 0, 0, 49, 31, 0,
- 32, 0, 0, 24, 28, 29, 50, 34, 50, 25,
- 41, 39
+ 0, 0, 0, 0, 0, 0, 149, 0, 0, 115,
+ 0, 147, 0, 126, 129, 0, 124, 51, 0, 0,
+ 0, 48, 0, 0, 0, 0, 0, 56, 51, 0,
+ 132, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 51, 0, 87, 88, 2, 0, 52, 0,
+ 0, 51, 0, 28, 75, 76, 74, 77, 78, 71,
+ 81, 82, 83, 84, 80, 67, 68, 69, 70, 72,
+ 73, 109, 150, 62, 117, 128, 142, 12, 13, 14,
+ 19, 16, 0, 0, 18, 15, 142, 113, 119, 91,
+ 0, 93, 0, 95, 0, 97, 0, 89, 90, 140,
+ 111, 148, 53, 0, 46, 53, 0, 45, 143, 0,
+ 20, 17, 0, 0, 0, 0, 0, 142, 0, 52,
+ 0, 0, 52, 52, 22, 0, 146, 146, 92, 94,
+ 96, 98, 0, 112, 54, 55, 0, 0, 52, 51,
+ 32, 144, 0, 53, 53, 146, 25, 52, 53, 29,
+ 53, 0, 50, 51, 52, 40, 0, 145, 135, 138,
+ 53, 53, 52, 52, 52, 42, 38, 0, 0, 39,
+ 35, 0, 0, 52, 0, 0, 37, 0, 0, 52,
+ 51, 52, 51, 141, 0, 26, 30, 31, 51, 33,
+ 0, 34, 0, 27, 52, 36, 52, 43, 41
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 33, 211, 34, 53, 36, 212, 38, 260, 243,
- 244, 232, 245, 101, 39, 40, 41, 233, 271, 154,
- 201, 42, 43, 206, 63, 88, 45, 71, 72, 46,
- 47, 129, 138, 144, 196, 220, 48, 58
+ -1, 40, 264, 41, 60, 43, 265, 45, 311, 294,
+ 295, 285, 296, 115, 46, 47, 48, 286, 322, 183,
+ 249, 49, 50, 254, 72, 97, 52, 80, 81, 53,
+ 54, 147, 158, 172, 247, 239, 273, 55, 66
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -214
+#define YYPACT_NINF -266
static const yytype_int16 yypact[] =
{
- 263, -63, -214, -214, 11, -214, -214, 11, 11, 11,
- 172, -214, -14, 15, 671, -214, 31, 11, 61, 77,
- 47, 82, 84, 11, 703, 88, 11, 11, 89, 90,
- 11, 11, 11, 2, -214, 3, -214, -214, -214, 29,
- 38, 659, 11, 904, -214, -214, -214, -214, -214, -214,
- -214, 32, 11, -214, 904, 904, 904, 904, 27, 11,
- 11, -214, -214, 30, 11, -214, 11, -214, 80, -214,
- 904, 24, -214, -214, 722, 98, -214, -38, 11, -36,
- 78, -214, -214, 774, -214, 24, -214, -214, 35, -8,
- 800, -214, 11, -8, -8, 852, -214, 335, 659, 11,
- 659, 83, 878, 904, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 722, 11, 9, 27, 106, 904, 904, 11, -214, -214,
- 110, -214, 11, 11, 748, 11, 11, -214, -214, 11,
- -214, 113, 11, 11, -214, 27, -214, -214, 52, 904,
- 53, 826, -63, 11, -214, 244, 244, 244, -8, -8,
- -8, 904, 244, 244, 316, -45, -45, -8, -8, 904,
- 904, 904, -214, -214, 904, 120, -214, 904, 904, 11,
- 11, 904, 904, 120, 904, -214, 904, 904, 120, -214,
- -2, -214, -214, 613, 904, -214, -37, 904, 904, -37,
- -37, 474, 116, 11, 474, -214, -214, 142, 79, 79,
- 79, -214, -214, 138, 11, 904, 28, -10, -214, 147,
- -214, -214, -214, 128, 904, -214, 139, -214, 148, -214,
- -214, 148, -214, 659, -214, 474, 474, 402, -214, -214,
- 474, -214, 474, 148, 148, -214, 659, 613, -214, 130,
- 137, 160, 474, 157, 159, -214, 163, 144, -214, -214,
- -214, -214, -214, 164, 151, 162, 165, -17, -214, 613,
- -214, 546, 154, -214, -214, -214, 474, -214, -214, -214,
- -214, -214
+ 317, -63, -266, -266, 908, -266, -266, 908, 908, 946,
+ 18, 1546, -266, -266, 6, 29, 806, -266, 39, 908,
+ 10, 43, 46, 47, 58, 908, 872, 59, 908, 908,
+ 908, 908, 908, 908, 61, -4, 908, 908, 908, 908,
+ 11, -266, 12, -266, -266, -266, -3, 7, 982, 908,
+ 1515, -266, -266, -266, -266, -266, -266, -266, 3, 908,
+ -266, 1515, 1515, 1515, 908, 1515, 13, 908, 908, 908,
+ -266, -266, 14, 908, -266, 908, -266, 69, -266, 1515,
+ -11, -266, -266, 1010, 86, -266, -29, 908, -28, 68,
+ -266, -266, 1360, -266, -11, -266, -266, 22, -49, 1046,
+ 1082, 1118, 1154, 1391, -266, 97, -49, -49, 1453, -19,
+ -266, 400, 982, 908, 982, 75, 1484, 1515, 908, 908,
+ 908, 908, 908, 908, 908, 908, 908, 908, 908, 908,
+ 908, 908, 908, 908, 908, 1010, 1453, -36, 908, 13,
+ -24, 13, 99, 1515, 1515, 908, -266, -266, 100, 908,
+ 908, -266, 908, 908, 1329, 908, 908, -266, -266, 908,
+ -266, 101, 908, 908, 908, 908, 908, 908, 908, 908,
+ 908, 908, -266, -12, -266, -266, -266, 33, 1515, 35,
+ 1422, -63, 908, -266, 768, 768, 768, -49, -49, -49,
+ 1515, 1515, 768, 768, 1556, 78, 78, -49, -49, 1515,
+ 1515, -266, 1515, -266, -266, 1515, 105, -266, 1515, 1515,
+ 1515, 1515, 908, 908, 1515, 1515, 105, 1515, -266, 1515,
+ 1190, 1515, 1226, 1515, 1262, 1515, 1298, 1515, 1515, -266,
+ -266, 908, -266, -5, -266, -266, 732, 1515, -266, -64,
+ 1515, 1515, -64, 908, 908, 908, 908, 105, 15, 566,
+ 82, 908, 566, -266, -266, 107, 36, 36, 1515, 1515,
+ 1515, 1515, -64, -266, -266, -266, 110, 908, 1515, -2,
+ -15, -266, 109, -266, -266, 36, -266, 1515, -266, -266,
+ -266, 108, -266, -266, 108, -266, 982, -266, 566, 566,
+ -266, -266, 566, 566, 108, 108, -266, 982, 732, -266,
+ 90, 102, 483, 566, 118, 124, -266, 125, 111, -266,
+ -266, -266, -266, -266, 128, -266, -266, -266, -18, -266,
+ 732, -266, 649, -266, 566, -266, -266, -266, -266
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -214, -214, 10, 99, 4, -186, 0, -214, -214, -214,
- -19, -175, -43, -69, -214, -214, -214, -213, -9, -16,
- -97, -214, 40, 5, -214, -214, -214, 177, -12, -214,
- -214, -214, -214, -214, -109, -123, -214, -46
+ -266, -266, 1, 45, 4, -233, 0, -266, -266, -266,
+ -116, -265, -137, -85, -266, -266, -266, -259, -10, -27,
+ -229, -266, 65, 5, -266, -266, -266, 132, -17, -266,
+ -266, -266, -266, -266, -266, -201, -243, -266, -31
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -61
+#define YYTABLE_NINF -64
static const yytype_int16 yytable[] =
{
- 37, 60, 96, -10, 35, 44, 132, 205, 135, -51,
- -51, 50, 86, 122, 123, 246, 229, 107, 108, 49,
- 109, 110, 202, 2, 3, 4, 5, 61, 6, 148,
- 246, 150, 51, 11, 116, 117, 62, 133, 230, 136,
- 118, 119, 203, 97, 54, 49, 145, 55, 56, 57,
- 207, 52, 73, 19, 70, 226, 248, 74, 110, 128,
- 66, 258, 68, 83, 70, -51, 89, 90, 80, 248,
- 93, 94, 95, 140, 199, 26, 227, 118, 119, 200,
- 27, 102, 103, 277, 49, -10, 221, 222, 30, 31,
- 77, 78, 120, 172, 32, 204, 121, 37, 79, 57,
- 57, 35, 44, 81, 125, 82, 126, 75, 76, 87,
- 91, 92, 98, 99, 121, 59, 127, 124, 134, 131,
- 175, 137, 141, 235, 236, 237, 152, 173, 240, 183,
- 242, 176, 57, 190, 185, 188, 189, 191, 102, 149,
- 151, 195, 252, 193, 155, 156, 157, 158, 159, 160,
- 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
- 214, 171, 192, 218, 250, 223, 219, 174, 234, 238,
- 276, 241, 177, 178, 229, 181, 182, 257, 259, 184,
- 261, 262, 186, 187, 264, 213, 265, 267, 216, 217,
- 266, 272, 273, 194, 274, 279, 147, 275, 231, 225,
- 255, 85, 0, 0, 0, 0, 208, 228, 239, 209,
- 210, 0, 0, 0, 0, 249, 0, 0, 0, 197,
- 198, 247, 0, 0, 253, 0, 254, 256, -60, -60,
- 0, 0, 0, -60, -60, -60, 263, -60, -60, -60,
- -60, 0, 268, 215, 270, 0, 0, 0, -60, 0,
- 269, -60, -60, 0, 224, 59, 0, -60, -60, 0,
- 280, 0, 281, -6, 1, 0, 0, 0, 0, 0,
- 0, 278, 0, 102, 0, 2, 3, 4, 5, 0,
- 6, 7, 8, 9, 10, 11, 102, 0, 0, 0,
- 0, 12, 0, 13, 14, 15, 0, 0, 16, 0,
- 0, 0, 0, 17, 18, 19, 107, 108, 20, 109,
- 110, 0, 21, 22, 23, 24, 0, 0, 25, 0,
- 113, 114, 115, 116, 117, 0, 0, 26, 0, 118,
- 119, 0, 27, 0, 0, 28, 0, 29, 0, 0,
- 30, 31, 0, 0, 0, -6, 32, 2, 3, 4,
- 5, 0, 6, 7, 8, 9, 10, 11, 0, 0,
- 0, 0, 0, 12, 0, 13, 14, 15, 0, 0,
- 16, 0, 0, 0, 0, 17, 18, 19, 107, 108,
- 20, 109, 110, 0, 21, 22, 23, 24, 0, 0,
- 25, 0, 0, 114, 115, 116, 117, 0, 0, 26,
- 0, 118, 119, 0, 27, 0, 0, 28, 0, 29,
- 0, 0, 30, 31, 2, 3, 4, 5, 32, 6,
- 7, 8, 9, 51, 11, 0, 0, 0, 0, 251,
- 12, 0, 13, 14, 15, 0, 0, 0, 0, 0,
- 0, 0, 17, 18, 19, 0, 0, 20, 0, 0,
- 0, 0, 0, 23, 24, 0, 0, 25, 0, 0,
- 0, 0, 0, 0, 0, 0, 26, 0, 0, 0,
- 0, 27, 0, 0, 0, 0, 29, 0, 0, 30,
- 31, 0, 0, 0, 49, 32, 2, 3, 4, 5,
- 0, 6, 7, 8, 9, 51, 11, 0, 0, 0,
- 0, 0, 12, 0, 13, 14, 15, 0, 0, 0,
- 0, 0, 0, 0, 17, 18, 19, 0, 0, 20,
- 0, 0, 0, 0, 0, 23, 24, 0, 0, 25,
- 0, 0, 0, 0, 0, 0, 0, 0, 26, 0,
- 0, 0, 0, 27, 0, 0, 0, 0, 29, 0,
- 0, 30, 31, 0, 0, 0, 49, 32, 2, 3,
- 4, 5, 0, 6, 7, 8, 9, 51, 11, 0,
- 0, 0, 0, 0, 12, 0, 13, 14, 15, 0,
- 0, 0, 0, 0, 0, 0, 17, 18, 19, 0,
- 0, 20, 0, 0, 0, 0, 0, 23, 24, 0,
- 0, 25, 0, 0, 0, 0, 0, 0, 0, 0,
- 26, 0, 0, 0, 0, 27, 0, 0, 0, 0,
- 29, 0, 0, 30, 31, 2, 3, 4, 5, 32,
- 6, 7, 8, 9, 51, 11, 0, 0, 0, 0,
- 0, 12, 0, 13, 14, 0, 0, 0, 0, 0,
- 0, 0, 0, 17, 0, 19, 0, 0, 0, 0,
- 0, 0, 0, 0, 23, 24, 0, 0, 25, 0,
- 0, 2, 3, 4, 5, 0, 6, 26, 0, 0,
- 51, 11, 27, 2, 3, 4, 5, 29, 6, 0,
- 30, 31, 51, 11, 0, 0, 32, 0, 0, 52,
- 64, 19, 0, 0, 0, 65, 0, 66, 67, 68,
- 69, 52, 0, 19, 0, 2, 3, 4, 5, 0,
- 6, 0, 0, 26, 51, 11, 0, 0, 27, 0,
- 0, 0, 64, 0, 0, 26, 30, 31, 0, 66,
- 27, 68, 100, 52, 0, 19, 0, 0, 30, 31,
- 0, 0, 0, 0, 32, 130, 84, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 26, 0, 0,
- 0, 0, 27, 0, 0, 0, 0, 0, 104, 105,
- 30, 31, 0, 106, 107, 108, 32, 109, 110, 111,
- 112, 0, 179, 0, 0, 0, 0, 0, 113, 114,
- 115, 116, 117, 0, 104, 105, 0, 118, 119, 106,
- 107, 108, 0, 109, 110, 111, 112, 0, 0, 0,
- 139, 0, 0, 180, 113, 114, 115, 116, 117, 0,
- 104, 105, 0, 118, 119, 106, 107, 108, 0, 109,
- 110, 111, 112, 0, 0, 0, 0, 0, 0, 0,
- 113, 114, 115, 116, 117, 0, 104, 105, 0, 118,
- 119, 106, 107, 108, 0, 109, 110, 111, 112, 0,
- 142, 143, 0, 0, 0, 0, 113, 114, 115, 116,
- 117, 0, 104, 105, 0, 118, 119, 106, 107, 108,
- 0, 109, 110, 111, 112, 0, 0, 0, 0, 0,
- 0, 153, 113, 114, 115, 116, 117, 0, 104, 105,
- 146, 118, 119, 106, 107, 108, 0, 109, 110, 111,
- 112, 0, 0, 0, 0, 0, 0, 0, 113, 114,
- 115, 116, 117, 0, 104, 105, 146, 118, 119, 106,
- 107, 108, 0, 109, 110, 111, 112, 0, 0, 0,
- 0, 0, 0, 153, 113, 114, 115, 116, 117, 0,
- 104, 105, 0, 118, 119, 106, 107, 108, 0, 109,
- 110, 111, 112, 0, 0, 0, 0, 0, 0, 0,
- 113, 114, 115, 116, 117, 0, 0, 0, 0, 118,
- 119
+ 44, 69, 57, 253, 42, 51, 252, -53, 109, 95,
+ -53, 110, -10, 282, 274, 242, 152, 155, 124, 299,
+ 125, 250, 297, 279, 56, 56, 75, 177, 77, 179,
+ 299, 255, 290, 137, 283, 297, 139, 140, 141, 67,
+ 251, 111, 133, 134, 288, 289, 262, 280, 70, 292,
+ 71, 293, 153, 156, 201, 86, 87, 84, 85, 138,
+ 82, 302, 303, 146, 88, 309, 203, 89, 90, 61,
+ -53, 138, 62, 63, 65, 175, 138, 160, 230, 91,
+ 96, 79, 104, 231, 83, 105, 112, 325, 113, 324,
+ 92, 79, 68, 98, 99, 100, 101, 102, 103, 56,
+ -10, 106, 107, 108, 65, 263, 145, 151, 138, 142,
+ 138, 44, 157, 116, 117, 42, 51, 161, 173, 181,
+ 204, 207, 218, 232, 135, 234, 238, 267, 271, 136,
+ 287, 272, 65, 65, 65, 276, 282, 206, 143, 310,
+ 144, 121, 122, 315, 123, 124, 312, 125, 216, 316,
+ 317, 233, 154, 323, 284, 318, 176, 306, 94, 0,
+ 0, 0, 229, 131, 132, 0, 0, 0, 0, 133,
+ 134, 236, 0, 0, 0, 0, 0, 116, 178, 180,
+ 0, 0, 235, 184, 185, 186, 187, 188, 189, 190,
+ 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
+ 248, 301, 0, 202, 0, 0, 0, 0, 0, 0,
+ 205, 0, 308, 0, 208, 209, 0, 210, 211, 0,
+ 214, 215, 266, 0, 217, 269, 270, 219, 220, 221,
+ 222, 223, 224, 225, 226, 227, 228, 0, 0, 0,
+ 256, 278, 0, 257, 0, 0, 0, 237, 0, 0,
+ 291, 0, 0, 0, 0, 0, 0, 300, 0, 281,
+ 0, 0, 0, 275, 0, 304, 305, 307, 0, 0,
+ 0, 0, 0, 298, 0, 0, 314, 240, 241, 0,
+ 0, 0, 319, 0, 321, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 65, 327, 0, 328,
+ 320, 0, 0, 0, 0, 0, 0, 0, 258, 259,
+ 260, 261, 0, 0, 0, 0, 268, -6, 1, 0,
+ 0, 0, 326, 0, 0, 0, 0, 0, 2, 3,
+ 4, 5, 277, 6, 7, 8, 9, 10, 11, 12,
+ 0, 13, 0, 0, 0, 0, 14, 0, 15, 16,
+ 17, 116, 0, 18, 0, 0, 0, 0, 19, 20,
+ 21, 0, 116, 22, 0, 0, 0, 23, 24, 25,
+ 26, 0, 0, 27, 0, 0, 0, 0, 0, 0,
+ 0, 0, 28, 0, 0, 0, 0, 0, 0, 29,
+ 30, 31, 32, 33, 0, 0, 34, 35, 0, 0,
+ 36, 37, 0, 0, 0, -6, 38, 0, 0, 0,
+ 39, 2, 3, 4, 5, 0, 6, 7, 8, 9,
+ 10, 11, 12, 0, 13, 0, 0, 0, 0, 14,
+ 0, 15, 16, 17, 0, 0, 18, 0, 0, 0,
+ 0, 19, 20, 21, 0, 0, 22, 0, 0, 0,
+ 23, 24, 25, 26, 0, 0, 27, 0, 0, 0,
+ 0, 0, 0, 0, 0, 28, 0, 0, 0, 0,
+ 0, 0, 29, 30, 31, 32, 33, 0, 0, 34,
+ 35, 0, 0, 36, 37, 0, 0, 0, 0, 38,
+ 0, 0, 0, 39, 2, 3, 4, 5, 0, 6,
+ 7, 8, 9, 10, 58, 12, 0, 13, 313, 0,
+ 0, 0, 14, 0, 15, 16, 17, 0, 0, 0,
+ 0, 0, 0, 0, 19, 20, 21, 0, 0, 22,
+ 0, 0, 0, 0, 0, 25, 26, 0, 0, 27,
+ 0, 0, 0, 0, 0, 0, 0, 0, 28, 0,
+ 0, 0, 0, 0, 0, 29, 30, 31, 32, 33,
+ 0, 0, 0, 35, 0, 0, 36, 37, 0, 0,
+ 0, 56, 38, 0, 0, 0, 39, 2, 3, 4,
+ 5, 0, 6, 7, 8, 9, 10, 58, 12, 0,
+ 13, 0, 0, 0, 0, 14, 0, 15, 16, 17,
+ 0, 0, 0, 0, 0, 0, 0, 19, 20, 21,
+ 0, 0, 22, 0, 0, 0, 0, 0, 25, 26,
+ 0, 0, 27, 0, 0, 0, 0, 0, 0, 0,
+ 0, 28, 0, 0, 0, 0, 0, 0, 29, 30,
+ 31, 32, 33, 0, 0, 0, 35, 0, 0, 36,
+ 37, 0, 0, 0, 56, 38, 0, 0, 0, 39,
+ 2, 3, 4, 5, 0, 6, 7, 8, 9, 10,
+ 58, 12, 0, 13, 0, 0, 0, 0, 14, 0,
+ 15, 16, 17, 0, 0, 0, 0, 0, 0, 0,
+ 19, 20, 21, 0, 0, 22, 0, 0, 0, 0,
+ 0, 25, 26, 0, 0, 27, 0, 0, 0, 0,
+ 0, 0, 0, 0, 28, 0, 0, 0, 0, 0,
+ 0, 29, 30, 31, 32, 33, 0, 0, 0, 35,
+ 0, 0, 36, 37, 0, 0, 0, 0, 38, 0,
+ 0, 0, 39, 2, 3, 4, 5, 0, 6, 7,
+ 8, 9, 10, 58, 12, 0, 13, 0, 0, 0,
+ 0, 14, 0, 15, 16, 0, 0, 0, 0, 0,
+ 0, 0, 0, 19, 0, 21, 0, 0, 0, 0,
+ 0, 0, 0, 0, 25, 26, 0, 0, 27, 0,
+ 0, 0, 0, 0, 0, 0, 0, 28, 0, 0,
+ 0, 0, 0, 0, 29, 30, 31, 32, 33, 0,
+ 0, 0, 35, 0, 0, 36, 37, 2, 3, 4,
+ 5, 38, 6, 0, 0, 39, 0, 58, 12, 0,
+ 13, 121, 122, 0, 123, 124, 73, 125, 0, 0,
+ 0, 74, 0, 75, 76, 77, 78, 59, 0, 21,
+ 128, 129, 130, 131, 132, 0, 0, 0, 0, 133,
+ 134, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 28, 0, 0, 0, 0, 0, 0, 29, 30,
+ 31, 32, 33, 2, 3, 4, 5, 0, 6, 36,
+ 37, 0, 0, 58, 12, 38, 13, 0, 0, 39,
+ 0, 0, 73, 0, 0, 0, 0, 0, 0, 75,
+ 0, 77, 0, 59, 0, 21, 0, 0, 0, 2,
+ 3, 4, 5, 0, 6, 0, 93, 0, 0, 58,
+ 12, 0, 13, 0, 0, 0, 0, 28, 0, 0,
+ 0, 0, 0, 0, 29, 30, 31, 32, 33, 59,
+ 0, 21, 0, 0, 0, 36, 37, 2, 3, 4,
+ 5, 38, 6, 0, 0, 39, 0, 58, 12, 0,
+ 13, 0, 0, 28, 0, 0, 0, 0, 0, 0,
+ 29, 30, 31, 32, 33, 0, 0, 59, 0, 21,
+ 0, 36, 37, 2, 3, 4, 5, 38, 6, 0,
+ 0, 39, 0, 58, 12, 0, 13, 0, 0, 0,
+ 0, 28, 0, 0, 0, 0, 0, 0, 29, 30,
+ 31, 32, 33, 59, 0, 21, 0, 0, 0, 36,
+ 37, 0, 0, 0, 0, 64, 0, 0, 0, 39,
+ 0, 0, 0, 0, 148, 0, 0, 28, 0, 0,
+ 0, 0, 0, 0, 29, 30, 31, 32, 33, 0,
+ 0, 0, 0, 0, 0, 36, 37, 118, 119, 0,
+ 0, 114, 120, 121, 122, 39, 123, 149, 150, 125,
+ 126, 127, 0, 0, 0, 162, 0, 0, 0, 0,
+ 0, 163, 128, 129, 130, 131, 132, 0, 0, 0,
+ 0, 133, 134, 118, 119, 0, 0, 0, 120, 121,
+ 122, 0, 123, 124, 0, 125, 126, 127, 0, 0,
+ 0, 164, 0, 0, 0, 0, 0, 165, 128, 129,
+ 130, 131, 132, 0, 0, 0, 0, 133, 134, 118,
+ 119, 0, 0, 0, 120, 121, 122, 0, 123, 124,
+ 0, 125, 126, 127, 0, 0, 0, 166, 0, 0,
+ 0, 0, 0, 167, 128, 129, 130, 131, 132, 0,
+ 0, 0, 0, 133, 134, 118, 119, 0, 0, 0,
+ 120, 121, 122, 0, 123, 124, 0, 125, 126, 127,
+ 0, 0, 0, 168, 0, 0, 0, 0, 0, 169,
+ 128, 129, 130, 131, 132, 0, 0, 0, 0, 133,
+ 134, 118, 119, 0, 0, 0, 120, 121, 122, 0,
+ 123, 124, 0, 125, 126, 127, 0, 0, 0, 243,
+ 0, 0, 0, 0, 0, 0, 128, 129, 130, 131,
+ 132, 0, 0, 0, 0, 133, 134, 118, 119, 0,
+ 0, 0, 120, 121, 122, 0, 123, 124, 0, 125,
+ 126, 127, 0, 0, 0, 244, 0, 0, 0, 0,
+ 0, 0, 128, 129, 130, 131, 132, 0, 0, 0,
+ 0, 133, 134, 118, 119, 0, 0, 0, 120, 121,
+ 122, 0, 123, 124, 0, 125, 126, 127, 0, 0,
+ 0, 245, 0, 0, 0, 0, 0, 0, 128, 129,
+ 130, 131, 132, 0, 0, 0, 0, 133, 134, 118,
+ 119, 0, 0, 0, 120, 121, 122, 0, 123, 124,
+ 0, 125, 126, 127, 0, 0, 0, 246, 0, 0,
+ 0, 0, 0, 0, 128, 129, 130, 131, 132, 0,
+ 0, 0, 0, 133, 134, 118, 119, 0, 0, 0,
+ 120, 121, 122, 0, 123, 124, 0, 125, 126, 127,
+ 0, 0, 0, 0, 212, 0, 0, 0, 0, 0,
+ 128, 129, 130, 131, 132, 0, 118, 119, 0, 133,
+ 134, 120, 121, 122, 0, 123, 124, 0, 125, 126,
+ 127, 0, 0, 0, 0, 0, 0, 159, 0, 0,
+ 213, 128, 129, 130, 131, 132, 0, 118, 119, 0,
+ 133, 134, 120, 121, 122, 0, 123, 124, 0, 125,
+ 126, 127, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 128, 129, 130, 131, 132, 0, 118, 119,
+ 0, 133, 134, 120, 121, 122, 0, 123, 124, 0,
+ 125, 126, 127, 0, 0, 0, 0, 0, 170, 171,
+ 0, 0, 0, 128, 129, 130, 131, 132, 0, 118,
+ 119, 0, 133, 134, 120, 121, 122, 0, 123, 124,
+ 0, 125, 126, 127, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 182, 128, 129, 130, 131, 132, 0,
+ 118, 119, 174, 133, 134, 120, 121, 122, 0, 123,
+ 124, 0, 125, 126, 127, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 128, 129, 130, 131, 132,
+ 0, 118, 119, 174, 133, 134, 120, 121, 122, 0,
+ 123, 124, 0, 125, 126, 127, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 182, 128, 129, 130, 131,
+ 132, 0, 118, 119, 0, 133, 134, 120, 121, 122,
+ 0, 123, 124, 0, 125, 126, 127, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 128, 129, 130,
+ 131, 132, 0, -63, -63, 0, 133, 134, -63, -63,
+ -63, 0, -63, -63, 0, -63, -63, -63, 0, 121,
+ 122, 0, 123, 124, 0, 125, 0, 0, -63, 0,
+ 0, -63, -63, 0, 0, 68, 0, -63, -63, 129,
+ 130, 131, 132, 0, 0, 0, 0, 133, 134
};
static const yytype_int16 yycheck[] =
{
- 0, 10, 0, 0, 0, 0, 44, 193, 44, 26,
- 27, 1, 24, 59, 60, 228, 26, 62, 63, 82,
- 65, 66, 24, 12, 13, 14, 15, 41, 17, 98,
- 243, 100, 21, 22, 79, 80, 21, 75, 48, 75,
- 85, 86, 44, 33, 4, 82, 92, 7, 8, 9,
- 87, 40, 21, 42, 14, 27, 231, 17, 66, 71,
- 36, 247, 38, 23, 24, 82, 26, 27, 21, 244,
- 30, 31, 32, 85, 183, 64, 48, 85, 86, 188,
- 69, 41, 42, 269, 82, 82, 209, 210, 77, 78,
- 13, 14, 52, 84, 83, 192, 87, 97, 21, 59,
- 60, 97, 97, 21, 64, 21, 66, 46, 47, 21,
- 21, 21, 83, 75, 87, 83, 36, 87, 78, 21,
- 129, 43, 87, 220, 221, 222, 43, 21, 225, 138,
- 227, 21, 92, 149, 21, 144, 84, 84, 98, 99,
- 100, 21, 239, 152, 104, 105, 106, 107, 108, 109,
- 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
- 44, 121, 152, 21, 233, 27, 87, 127, 21, 41,
- 267, 32, 132, 133, 26, 135, 136, 246, 48, 139,
- 43, 21, 142, 143, 27, 201, 27, 43, 204, 205,
- 27, 27, 41, 153, 32, 41, 97, 32, 217, 215,
- 243, 24, -1, -1, -1, -1, 196, 216, 224, 199,
- 200, -1, -1, -1, -1, 231, -1, -1, -1, 179,
- 180, 230, -1, -1, 240, -1, 242, 243, 56, 57,
- -1, -1, -1, 61, 62, 63, 252, 65, 66, 67,
- 68, -1, 258, 203, 260, -1, -1, -1, 76, -1,
- 259, 79, 80, -1, 214, 83, -1, 85, 86, -1,
- 276, -1, 278, 0, 1, -1, -1, -1, -1, -1,
- -1, 271, -1, 233, -1, 12, 13, 14, 15, -1,
- 17, 18, 19, 20, 21, 22, 246, -1, -1, -1,
- -1, 28, -1, 30, 31, 32, -1, -1, 35, -1,
- -1, -1, -1, 40, 41, 42, 62, 63, 45, 65,
- 66, -1, 49, 50, 51, 52, -1, -1, 55, -1,
- 76, 77, 78, 79, 80, -1, -1, 64, -1, 85,
- 86, -1, 69, -1, -1, 72, -1, 74, -1, -1,
- 77, 78, -1, -1, -1, 82, 83, 12, 13, 14,
- 15, -1, 17, 18, 19, 20, 21, 22, -1, -1,
- -1, -1, -1, 28, -1, 30, 31, 32, -1, -1,
- 35, -1, -1, -1, -1, 40, 41, 42, 62, 63,
- 45, 65, 66, -1, 49, 50, 51, 52, -1, -1,
- 55, -1, -1, 77, 78, 79, 80, -1, -1, 64,
- -1, 85, 86, -1, 69, -1, -1, 72, -1, 74,
- -1, -1, 77, 78, 12, 13, 14, 15, 83, 17,
- 18, 19, 20, 21, 22, -1, -1, -1, -1, 27,
- 28, -1, 30, 31, 32, -1, -1, -1, -1, -1,
- -1, -1, 40, 41, 42, -1, -1, 45, -1, -1,
- -1, -1, -1, 51, 52, -1, -1, 55, -1, -1,
- -1, -1, -1, -1, -1, -1, 64, -1, -1, -1,
- -1, 69, -1, -1, -1, -1, 74, -1, -1, 77,
- 78, -1, -1, -1, 82, 83, 12, 13, 14, 15,
- -1, 17, 18, 19, 20, 21, 22, -1, -1, -1,
- -1, -1, 28, -1, 30, 31, 32, -1, -1, -1,
- -1, -1, -1, -1, 40, 41, 42, -1, -1, 45,
- -1, -1, -1, -1, -1, 51, 52, -1, -1, 55,
- -1, -1, -1, -1, -1, -1, -1, -1, 64, -1,
- -1, -1, -1, 69, -1, -1, -1, -1, 74, -1,
- -1, 77, 78, -1, -1, -1, 82, 83, 12, 13,
- 14, 15, -1, 17, 18, 19, 20, 21, 22, -1,
- -1, -1, -1, -1, 28, -1, 30, 31, 32, -1,
- -1, -1, -1, -1, -1, -1, 40, 41, 42, -1,
- -1, 45, -1, -1, -1, -1, -1, 51, 52, -1,
- -1, 55, -1, -1, -1, -1, -1, -1, -1, -1,
- 64, -1, -1, -1, -1, 69, -1, -1, -1, -1,
- 74, -1, -1, 77, 78, 12, 13, 14, 15, 83,
- 17, 18, 19, 20, 21, 22, -1, -1, -1, -1,
- -1, 28, -1, 30, 31, -1, -1, -1, -1, -1,
- -1, -1, -1, 40, -1, 42, -1, -1, -1, -1,
- -1, -1, -1, -1, 51, 52, -1, -1, 55, -1,
- -1, 12, 13, 14, 15, -1, 17, 64, -1, -1,
- 21, 22, 69, 12, 13, 14, 15, 74, 17, -1,
- 77, 78, 21, 22, -1, -1, 83, -1, -1, 40,
- 29, 42, -1, -1, -1, 34, -1, 36, 37, 38,
- 39, 40, -1, 42, -1, 12, 13, 14, 15, -1,
- 17, -1, -1, 64, 21, 22, -1, -1, 69, -1,
- -1, -1, 29, -1, -1, 64, 77, 78, -1, 36,
- 69, 38, 83, 40, -1, 42, -1, -1, 77, 78,
- -1, -1, -1, -1, 83, 33, 53, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 64, -1, -1,
- -1, -1, 69, -1, -1, -1, -1, -1, 56, 57,
- 77, 78, -1, 61, 62, 63, 83, 65, 66, 67,
- 68, -1, 44, -1, -1, -1, -1, -1, 76, 77,
- 78, 79, 80, -1, 56, 57, -1, 85, 86, 61,
- 62, 63, -1, 65, 66, 67, 68, -1, -1, -1,
- 46, -1, -1, 75, 76, 77, 78, 79, 80, -1,
- 56, 57, -1, 85, 86, 61, 62, 63, -1, 65,
- 66, 67, 68, -1, -1, -1, -1, -1, -1, -1,
- 76, 77, 78, 79, 80, -1, 56, 57, -1, 85,
- 86, 61, 62, 63, -1, 65, 66, 67, 68, -1,
- 70, 71, -1, -1, -1, -1, 76, 77, 78, 79,
- 80, -1, 56, 57, -1, 85, 86, 61, 62, 63,
- -1, 65, 66, 67, 68, -1, -1, -1, -1, -1,
- -1, 75, 76, 77, 78, 79, 80, -1, 56, 57,
- 84, 85, 86, 61, 62, 63, -1, 65, 66, 67,
- 68, -1, -1, -1, -1, -1, -1, -1, 76, 77,
- 78, 79, 80, -1, 56, 57, 84, 85, 86, 61,
- 62, 63, -1, 65, 66, 67, 68, -1, -1, -1,
- -1, -1, -1, 75, 76, 77, 78, 79, 80, -1,
- 56, 57, -1, 85, 86, 61, 62, 63, -1, 65,
- 66, 67, 68, -1, -1, -1, -1, -1, -1, -1,
- 76, 77, 78, 79, 80, -1, -1, -1, -1, 85,
- 86
+ 0, 11, 1, 236, 0, 0, 235, 25, 39, 26,
+ 28, 0, 0, 28, 257, 216, 45, 45, 67, 284,
+ 69, 26, 281, 25, 88, 88, 37, 112, 39, 114,
+ 295, 95, 275, 64, 49, 294, 67, 68, 69, 21,
+ 45, 40, 91, 92, 273, 274, 247, 49, 42, 278,
+ 21, 280, 81, 81, 90, 12, 13, 47, 48, 95,
+ 21, 290, 291, 80, 21, 298, 90, 21, 21, 4,
+ 88, 95, 7, 8, 9, 94, 95, 94, 90, 21,
+ 21, 16, 21, 95, 19, 89, 89, 320, 81, 318,
+ 25, 26, 89, 28, 29, 30, 31, 32, 33, 88,
+ 88, 36, 37, 38, 39, 90, 37, 21, 95, 95,
+ 95, 111, 44, 48, 49, 111, 111, 95, 21, 44,
+ 21, 21, 21, 90, 59, 90, 21, 45, 21, 64,
+ 21, 95, 67, 68, 69, 25, 28, 147, 73, 49,
+ 75, 63, 64, 25, 66, 67, 44, 69, 158, 25,
+ 25, 178, 87, 25, 270, 44, 111, 294, 26, -1,
+ -1, -1, 172, 85, 86, -1, -1, -1, -1, 91,
+ 92, 181, -1, -1, -1, -1, -1, 112, 113, 114,
+ -1, -1, 181, 118, 119, 120, 121, 122, 123, 124,
+ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
+ 231, 286, -1, 138, -1, -1, -1, -1, -1, -1,
+ 145, -1, 297, -1, 149, 150, -1, 152, 153, -1,
+ 155, 156, 249, -1, 159, 252, 253, 162, 163, 164,
+ 165, 166, 167, 168, 169, 170, 171, -1, -1, -1,
+ 239, 268, -1, 242, -1, -1, -1, 182, -1, -1,
+ 277, -1, -1, -1, -1, -1, -1, 284, -1, 269,
+ -1, -1, -1, 262, -1, 292, 293, 294, -1, -1,
+ -1, -1, -1, 283, -1, -1, 303, 212, 213, -1,
+ -1, -1, 309, -1, 311, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 231, 324, -1, 326,
+ 310, -1, -1, -1, -1, -1, -1, -1, 243, 244,
+ 245, 246, -1, -1, -1, -1, 251, 0, 1, -1,
+ -1, -1, 322, -1, -1, -1, -1, -1, 11, 12,
+ 13, 14, 267, 16, 17, 18, 19, 20, 21, 22,
+ -1, 24, -1, -1, -1, -1, 29, -1, 31, 32,
+ 33, 286, -1, 36, -1, -1, -1, -1, 41, 42,
+ 43, -1, 297, 46, -1, -1, -1, 50, 51, 52,
+ 53, -1, -1, 56, -1, -1, -1, -1, -1, -1,
+ -1, -1, 65, -1, -1, -1, -1, -1, -1, 72,
+ 73, 74, 75, 76, -1, -1, 79, 80, -1, -1,
+ 83, 84, -1, -1, -1, 88, 89, -1, -1, -1,
+ 93, 11, 12, 13, 14, -1, 16, 17, 18, 19,
+ 20, 21, 22, -1, 24, -1, -1, -1, -1, 29,
+ -1, 31, 32, 33, -1, -1, 36, -1, -1, -1,
+ -1, 41, 42, 43, -1, -1, 46, -1, -1, -1,
+ 50, 51, 52, 53, -1, -1, 56, -1, -1, -1,
+ -1, -1, -1, -1, -1, 65, -1, -1, -1, -1,
+ -1, -1, 72, 73, 74, 75, 76, -1, -1, 79,
+ 80, -1, -1, 83, 84, -1, -1, -1, -1, 89,
+ -1, -1, -1, 93, 11, 12, 13, 14, -1, 16,
+ 17, 18, 19, 20, 21, 22, -1, 24, 25, -1,
+ -1, -1, 29, -1, 31, 32, 33, -1, -1, -1,
+ -1, -1, -1, -1, 41, 42, 43, -1, -1, 46,
+ -1, -1, -1, -1, -1, 52, 53, -1, -1, 56,
+ -1, -1, -1, -1, -1, -1, -1, -1, 65, -1,
+ -1, -1, -1, -1, -1, 72, 73, 74, 75, 76,
+ -1, -1, -1, 80, -1, -1, 83, 84, -1, -1,
+ -1, 88, 89, -1, -1, -1, 93, 11, 12, 13,
+ 14, -1, 16, 17, 18, 19, 20, 21, 22, -1,
+ 24, -1, -1, -1, -1, 29, -1, 31, 32, 33,
+ -1, -1, -1, -1, -1, -1, -1, 41, 42, 43,
+ -1, -1, 46, -1, -1, -1, -1, -1, 52, 53,
+ -1, -1, 56, -1, -1, -1, -1, -1, -1, -1,
+ -1, 65, -1, -1, -1, -1, -1, -1, 72, 73,
+ 74, 75, 76, -1, -1, -1, 80, -1, -1, 83,
+ 84, -1, -1, -1, 88, 89, -1, -1, -1, 93,
+ 11, 12, 13, 14, -1, 16, 17, 18, 19, 20,
+ 21, 22, -1, 24, -1, -1, -1, -1, 29, -1,
+ 31, 32, 33, -1, -1, -1, -1, -1, -1, -1,
+ 41, 42, 43, -1, -1, 46, -1, -1, -1, -1,
+ -1, 52, 53, -1, -1, 56, -1, -1, -1, -1,
+ -1, -1, -1, -1, 65, -1, -1, -1, -1, -1,
+ -1, 72, 73, 74, 75, 76, -1, -1, -1, 80,
+ -1, -1, 83, 84, -1, -1, -1, -1, 89, -1,
+ -1, -1, 93, 11, 12, 13, 14, -1, 16, 17,
+ 18, 19, 20, 21, 22, -1, 24, -1, -1, -1,
+ -1, 29, -1, 31, 32, -1, -1, -1, -1, -1,
+ -1, -1, -1, 41, -1, 43, -1, -1, -1, -1,
+ -1, -1, -1, -1, 52, 53, -1, -1, 56, -1,
+ -1, -1, -1, -1, -1, -1, -1, 65, -1, -1,
+ -1, -1, -1, -1, 72, 73, 74, 75, 76, -1,
+ -1, -1, 80, -1, -1, 83, 84, 11, 12, 13,
+ 14, 89, 16, -1, -1, 93, -1, 21, 22, -1,
+ 24, 63, 64, -1, 66, 67, 30, 69, -1, -1,
+ -1, 35, -1, 37, 38, 39, 40, 41, -1, 43,
+ 82, 83, 84, 85, 86, -1, -1, -1, -1, 91,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 65, -1, -1, -1, -1, -1, -1, 72, 73,
+ 74, 75, 76, 11, 12, 13, 14, -1, 16, 83,
+ 84, -1, -1, 21, 22, 89, 24, -1, -1, 93,
+ -1, -1, 30, -1, -1, -1, -1, -1, -1, 37,
+ -1, 39, -1, 41, -1, 43, -1, -1, -1, 11,
+ 12, 13, 14, -1, 16, -1, 54, -1, -1, 21,
+ 22, -1, 24, -1, -1, -1, -1, 65, -1, -1,
+ -1, -1, -1, -1, 72, 73, 74, 75, 76, 41,
+ -1, 43, -1, -1, -1, 83, 84, 11, 12, 13,
+ 14, 89, 16, -1, -1, 93, -1, 21, 22, -1,
+ 24, -1, -1, 65, -1, -1, -1, -1, -1, -1,
+ 72, 73, 74, 75, 76, -1, -1, 41, -1, 43,
+ -1, 83, 84, 11, 12, 13, 14, 89, 16, -1,
+ -1, 93, -1, 21, 22, -1, 24, -1, -1, -1,
+ -1, 65, -1, -1, -1, -1, -1, -1, 72, 73,
+ 74, 75, 76, 41, -1, 43, -1, -1, -1, 83,
+ 84, -1, -1, -1, -1, 89, -1, -1, -1, 93,
+ -1, -1, -1, -1, 34, -1, -1, 65, -1, -1,
+ -1, -1, -1, -1, 72, 73, 74, 75, 76, -1,
+ -1, -1, -1, -1, -1, 83, 84, 57, 58, -1,
+ -1, 89, 62, 63, 64, 93, 66, 67, 68, 69,
+ 70, 71, -1, -1, -1, 39, -1, -1, -1, -1,
+ -1, 45, 82, 83, 84, 85, 86, -1, -1, -1,
+ -1, 91, 92, 57, 58, -1, -1, -1, 62, 63,
+ 64, -1, 66, 67, -1, 69, 70, 71, -1, -1,
+ -1, 39, -1, -1, -1, -1, -1, 45, 82, 83,
+ 84, 85, 86, -1, -1, -1, -1, 91, 92, 57,
+ 58, -1, -1, -1, 62, 63, 64, -1, 66, 67,
+ -1, 69, 70, 71, -1, -1, -1, 39, -1, -1,
+ -1, -1, -1, 45, 82, 83, 84, 85, 86, -1,
+ -1, -1, -1, 91, 92, 57, 58, -1, -1, -1,
+ 62, 63, 64, -1, 66, 67, -1, 69, 70, 71,
+ -1, -1, -1, 39, -1, -1, -1, -1, -1, 45,
+ 82, 83, 84, 85, 86, -1, -1, -1, -1, 91,
+ 92, 57, 58, -1, -1, -1, 62, 63, 64, -1,
+ 66, 67, -1, 69, 70, 71, -1, -1, -1, 39,
+ -1, -1, -1, -1, -1, -1, 82, 83, 84, 85,
+ 86, -1, -1, -1, -1, 91, 92, 57, 58, -1,
+ -1, -1, 62, 63, 64, -1, 66, 67, -1, 69,
+ 70, 71, -1, -1, -1, 39, -1, -1, -1, -1,
+ -1, -1, 82, 83, 84, 85, 86, -1, -1, -1,
+ -1, 91, 92, 57, 58, -1, -1, -1, 62, 63,
+ 64, -1, 66, 67, -1, 69, 70, 71, -1, -1,
+ -1, 39, -1, -1, -1, -1, -1, -1, 82, 83,
+ 84, 85, 86, -1, -1, -1, -1, 91, 92, 57,
+ 58, -1, -1, -1, 62, 63, 64, -1, 66, 67,
+ -1, 69, 70, 71, -1, -1, -1, 39, -1, -1,
+ -1, -1, -1, -1, 82, 83, 84, 85, 86, -1,
+ -1, -1, -1, 91, 92, 57, 58, -1, -1, -1,
+ 62, 63, 64, -1, 66, 67, -1, 69, 70, 71,
+ -1, -1, -1, -1, 45, -1, -1, -1, -1, -1,
+ 82, 83, 84, 85, 86, -1, 57, 58, -1, 91,
+ 92, 62, 63, 64, -1, 66, 67, -1, 69, 70,
+ 71, -1, -1, -1, -1, -1, -1, 47, -1, -1,
+ 81, 82, 83, 84, 85, 86, -1, 57, 58, -1,
+ 91, 92, 62, 63, 64, -1, 66, 67, -1, 69,
+ 70, 71, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 82, 83, 84, 85, 86, -1, 57, 58,
+ -1, 91, 92, 62, 63, 64, -1, 66, 67, -1,
+ 69, 70, 71, -1, -1, -1, -1, -1, 77, 78,
+ -1, -1, -1, 82, 83, 84, 85, 86, -1, 57,
+ 58, -1, 91, 92, 62, 63, 64, -1, 66, 67,
+ -1, 69, 70, 71, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 81, 82, 83, 84, 85, 86, -1,
+ 57, 58, 90, 91, 92, 62, 63, 64, -1, 66,
+ 67, -1, 69, 70, 71, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 82, 83, 84, 85, 86,
+ -1, 57, 58, 90, 91, 92, 62, 63, 64, -1,
+ 66, 67, -1, 69, 70, 71, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 81, 82, 83, 84, 85,
+ 86, -1, 57, 58, -1, 91, 92, 62, 63, 64,
+ -1, 66, 67, -1, 69, 70, 71, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 82, 83, 84,
+ 85, 86, -1, 57, 58, -1, 91, 92, 62, 63,
+ 64, -1, 66, 67, -1, 69, 70, 71, -1, 63,
+ 64, -1, 66, 67, -1, 69, -1, -1, 82, -1,
+ -1, 85, 86, -1, -1, 89, -1, 91, 92, 83,
+ 84, 85, 86, -1, -1, -1, -1, 91, 92
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 1, 12, 13, 14, 15, 17, 18, 19, 20,
- 21, 22, 28, 30, 31, 32, 35, 40, 41, 42,
- 45, 49, 50, 51, 52, 55, 64, 69, 72, 74,
- 77, 78, 83, 89, 91, 92, 93, 94, 95, 102,
- 103, 104, 109, 110, 111, 114, 117, 118, 124, 82,
- 90, 21, 40, 92, 110, 110, 110, 110, 125, 83,
- 106, 41, 21, 112, 29, 34, 36, 37, 38, 39,
- 110, 115, 116, 21, 110, 46, 47, 13, 14, 21,
- 21, 21, 21, 110, 53, 115, 116, 21, 113, 110,
- 110, 21, 21, 110, 110, 110, 0, 90, 83, 75,
- 83, 101, 110, 110, 56, 57, 61, 62, 63, 65,
- 66, 67, 68, 76, 77, 78, 79, 80, 85, 86,
- 110, 87, 125, 125, 87, 110, 110, 36, 116, 119,
- 33, 21, 44, 75, 110, 44, 75, 43, 120, 46,
- 116, 87, 70, 71, 121, 125, 84, 91, 101, 110,
- 101, 110, 43, 75, 107, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 84, 21, 110, 106, 21, 110, 110, 44,
- 75, 110, 110, 106, 110, 21, 110, 110, 106, 84,
- 107, 84, 90, 106, 110, 21, 122, 110, 110, 122,
- 122, 108, 24, 44, 108, 93, 111, 87, 90, 90,
- 90, 90, 94, 107, 44, 110, 107, 107, 21, 87,
- 123, 123, 123, 27, 110, 107, 27, 48, 106, 26,
- 48, 98, 99, 105, 21, 108, 108, 108, 41, 107,
- 108, 32, 108, 97, 98, 100, 105, 106, 99, 107,
- 101, 27, 108, 107, 107, 100, 107, 101, 93, 48,
- 96, 43, 21, 107, 27, 27, 27, 43, 107, 106,
- 107, 106, 27, 41, 32, 32, 108, 93, 94, 41,
- 107, 107
+ 0, 1, 11, 12, 13, 14, 16, 17, 18, 19,
+ 20, 21, 22, 24, 29, 31, 32, 33, 36, 41,
+ 42, 43, 46, 50, 51, 52, 53, 56, 65, 72,
+ 73, 74, 75, 76, 79, 80, 83, 84, 89, 93,
+ 97, 99, 100, 101, 102, 103, 110, 111, 112, 117,
+ 118, 119, 122, 125, 126, 133, 88, 98, 21, 41,
+ 100, 118, 118, 118, 89, 118, 134, 21, 89, 114,
+ 42, 21, 120, 30, 35, 37, 38, 39, 40, 118,
+ 123, 124, 21, 118, 47, 48, 12, 13, 21, 21,
+ 21, 21, 118, 54, 123, 124, 21, 121, 118, 118,
+ 118, 118, 118, 118, 21, 89, 118, 118, 118, 134,
+ 0, 98, 89, 81, 89, 109, 118, 118, 57, 58,
+ 62, 63, 64, 66, 67, 69, 70, 71, 82, 83,
+ 84, 85, 86, 91, 92, 118, 118, 134, 95, 134,
+ 134, 134, 95, 118, 118, 37, 124, 127, 34, 67,
+ 68, 21, 45, 81, 118, 45, 81, 44, 128, 47,
+ 124, 95, 39, 45, 39, 45, 39, 45, 39, 45,
+ 77, 78, 129, 21, 90, 94, 99, 109, 118, 109,
+ 118, 44, 81, 115, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 90, 118, 90, 21, 118, 114, 21, 118, 118,
+ 118, 118, 45, 81, 118, 118, 114, 118, 21, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 114,
+ 90, 95, 90, 115, 90, 98, 114, 118, 21, 131,
+ 118, 118, 131, 39, 39, 39, 39, 130, 134, 116,
+ 26, 45, 116, 101, 119, 95, 98, 98, 118, 118,
+ 118, 118, 131, 90, 98, 102, 115, 45, 118, 115,
+ 115, 21, 95, 132, 132, 98, 25, 118, 115, 25,
+ 49, 114, 28, 49, 106, 107, 113, 21, 116, 116,
+ 132, 115, 116, 116, 105, 106, 108, 113, 114, 107,
+ 115, 109, 116, 116, 115, 115, 108, 115, 109, 101,
+ 49, 104, 44, 25, 115, 25, 25, 25, 44, 115,
+ 114, 115, 114, 25, 116, 101, 102, 115, 115
};
#define yyerrok (yyerrstatus = 0)
@@ -1882,12 +2065,12 @@ yyreduce:
switch (yyn)
{
case 4:
-#line 108 "engines/director/lingo/lingo-gr.y"
+#line 119 "engines/director/lingo/lingo-gr.y"
{ yyerrok; ;}
break;
case 5:
-#line 111 "engines/director/lingo/lingo-gr.y"
+#line 122 "engines/director/lingo/lingo-gr.y"
{
g_lingo->_linenumber++;
g_lingo->_colnumber = 1;
@@ -1895,12 +2078,12 @@ yyreduce:
break;
case 10:
-#line 120 "engines/director/lingo/lingo-gr.y"
+#line 131 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_xpop); ;}
break;
case 12:
-#line 124 "engines/director/lingo/lingo-gr.y"
+#line 135 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(4) - (4)].s)->c_str());
@@ -1910,7 +2093,17 @@ yyreduce:
break;
case 13:
-#line 130 "engines/director/lingo/lingo-gr.y"
+#line 141 "engines/director/lingo/lingo-gr.y"
+ { (yyval.code) = g_lingo->code1(g_lingo->c_after); ;}
+ break;
+
+ case 14:
+#line 142 "engines/director/lingo/lingo-gr.y"
+ { (yyval.code) = g_lingo->code1(g_lingo->c_before); ;}
+ break;
+
+ case 15:
+#line 143 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str());
@@ -1919,8 +2112,8 @@ yyreduce:
delete (yyvsp[(2) - (4)].s); ;}
break;
- case 14:
-#line 136 "engines/director/lingo/lingo-gr.y"
+ case 16:
+#line 149 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(0); // Put dummy id
g_lingo->code1(g_lingo->c_theentityassign);
@@ -1931,8 +2124,8 @@ yyreduce:
(yyval.code) = (yyvsp[(4) - (4)].code); ;}
break;
- case 15:
-#line 144 "engines/director/lingo/lingo-gr.y"
+ case 17:
+#line 157 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_swap);
g_lingo->code1(g_lingo->c_theentityassign);
@@ -1943,8 +2136,8 @@ yyreduce:
(yyval.code) = (yyvsp[(5) - (5)].code); ;}
break;
- case 16:
-#line 152 "engines/director/lingo/lingo-gr.y"
+ case 18:
+#line 165 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str());
@@ -1953,8 +2146,8 @@ yyreduce:
delete (yyvsp[(2) - (4)].s); ;}
break;
- case 17:
-#line 158 "engines/director/lingo/lingo-gr.y"
+ case 19:
+#line 171 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(0); // Put dummy id
g_lingo->code1(g_lingo->c_theentityassign);
@@ -1965,8 +2158,8 @@ yyreduce:
(yyval.code) = (yyvsp[(4) - (4)].code); ;}
break;
- case 18:
-#line 166 "engines/director/lingo/lingo-gr.y"
+ case 20:
+#line 179 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_swap);
g_lingo->code1(g_lingo->c_theentityassign);
@@ -1977,55 +2170,61 @@ yyreduce:
(yyval.code) = (yyvsp[(5) - (5)].code); ;}
break;
- case 19:
-#line 175 "engines/director/lingo/lingo-gr.y"
+ case 21:
+#line 188 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_xpop); ;}
break;
- case 23:
-#line 184 "engines/director/lingo/lingo-gr.y"
+ case 25:
+#line 197 "engines/director/lingo/lingo-gr.y"
{
inst body = 0, end = 0;
- WRITE_UINT32(&body, (yyvsp[(5) - (8)].code));
- WRITE_UINT32(&end, (yyvsp[(6) - (8)].code));
- (*g_lingo->_currentScript)[(yyvsp[(1) - (8)].code) + 1] = body; /* body of loop */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (8)].code) + 2] = end; ;}
+ WRITE_UINT32(&body, (yyvsp[(5) - (7)].code));
+ WRITE_UINT32(&end, (yyvsp[(6) - (7)].code));
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (7)].code) + 1] = body; /* body of loop */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (7)].code) + 2] = end; /* end, if cond fails */
+
+ checkEnd((yyvsp[(7) - (7)].s), "repeat", true); ;}
break;
- case 24:
-#line 195 "engines/director/lingo/lingo-gr.y"
+ case 26:
+#line 210 "engines/director/lingo/lingo-gr.y"
{
inst init = 0, finish = 0, body = 0, end = 0, inc = 0;
- WRITE_UINT32(&init, (yyvsp[(3) - (11)].code));
- WRITE_UINT32(&finish, (yyvsp[(6) - (11)].code));
- WRITE_UINT32(&body, (yyvsp[(8) - (11)].code));
- WRITE_UINT32(&end, (yyvsp[(9) - (11)].code));
+ WRITE_UINT32(&init, (yyvsp[(3) - (10)].code));
+ WRITE_UINT32(&finish, (yyvsp[(6) - (10)].code));
+ WRITE_UINT32(&body, (yyvsp[(8) - (10)].code));
+ WRITE_UINT32(&end, (yyvsp[(9) - (10)].code));
WRITE_UINT32(&inc, 1);
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 1] = init; /* initial count value */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 2] = finish;/* final count value */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 3] = body; /* body of loop */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 4] = inc; /* increment */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 5] = end; ;}
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 1] = init; /* initial count value */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 2] = finish;/* final count value */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 3] = body; /* body of loop */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 4] = inc; /* increment */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 5] = end; /* end, if cond fails */
+
+ checkEnd((yyvsp[(10) - (10)].s), "repeat", true); ;}
break;
- case 25:
-#line 211 "engines/director/lingo/lingo-gr.y"
+ case 27:
+#line 228 "engines/director/lingo/lingo-gr.y"
{
inst init = 0, finish = 0, body = 0, end = 0, inc = 0;
- WRITE_UINT32(&init, (yyvsp[(3) - (12)].code));
- WRITE_UINT32(&finish, (yyvsp[(7) - (12)].code));
- WRITE_UINT32(&body, (yyvsp[(9) - (12)].code));
- WRITE_UINT32(&end, (yyvsp[(10) - (12)].code));
+ WRITE_UINT32(&init, (yyvsp[(3) - (11)].code));
+ WRITE_UINT32(&finish, (yyvsp[(7) - (11)].code));
+ WRITE_UINT32(&body, (yyvsp[(9) - (11)].code));
+ WRITE_UINT32(&end, (yyvsp[(10) - (11)].code));
WRITE_UINT32(&inc, -1);
- (*g_lingo->_currentScript)[(yyvsp[(1) - (12)].code) + 1] = init; /* initial count value */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (12)].code) + 2] = finish;/* final count value */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (12)].code) + 3] = body; /* body of loop */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (12)].code) + 4] = inc; /* increment */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (12)].code) + 5] = end; ;}
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 1] = init; /* initial count value */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 2] = finish;/* final count value */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 3] = body; /* body of loop */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 4] = inc; /* increment */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 5] = end; /* end, if cond fails */
+
+ checkEnd((yyvsp[(11) - (11)].s), "repeat", true); ;}
break;
- case 26:
-#line 223 "engines/director/lingo/lingo-gr.y"
+ case 28:
+#line 242 "engines/director/lingo/lingo-gr.y"
{
inst end = 0;
WRITE_UINT32(&end, (yyvsp[(3) - (3)].code));
@@ -2034,45 +2233,54 @@ yyreduce:
;}
break;
- case 27:
-#line 231 "engines/director/lingo/lingo-gr.y"
+ case 29:
+#line 250 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, end = 0;
- WRITE_UINT32(&then, (yyvsp[(5) - (8)].code));
- WRITE_UINT32(&end, (yyvsp[(6) - (8)].code));
- (*g_lingo->_currentScript)[(yyvsp[(1) - (8)].code) + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (8)].code) + 3] = end; /* end, if cond fails */
+ WRITE_UINT32(&then, (yyvsp[(5) - (7)].code));
+ WRITE_UINT32(&end, (yyvsp[(6) - (7)].code));
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (7)].code) + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (7)].code) + 3] = end; /* end, if cond fails */
+
+ checkEnd((yyvsp[(7) - (7)].s), "if", true);
+
g_lingo->processIf(0, 0); ;}
break;
- case 28:
-#line 238 "engines/director/lingo/lingo-gr.y"
+ case 30:
+#line 260 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
- WRITE_UINT32(&then, (yyvsp[(5) - (11)].code));
- WRITE_UINT32(&else1, (yyvsp[(8) - (11)].code));
- WRITE_UINT32(&end, (yyvsp[(9) - (11)].code));
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 2] = else1; /* elsepart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 3] = end; /* end, if cond fails */
+ WRITE_UINT32(&then, (yyvsp[(5) - (10)].code));
+ WRITE_UINT32(&else1, (yyvsp[(8) - (10)].code));
+ WRITE_UINT32(&end, (yyvsp[(9) - (10)].code));
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 2] = else1; /* elsepart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 3] = end; /* end, if cond fails */
+
+ checkEnd((yyvsp[(10) - (10)].s), "if", true);
+
g_lingo->processIf(0, 0); ;}
break;
- case 29:
-#line 247 "engines/director/lingo/lingo-gr.y"
+ case 31:
+#line 272 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
- WRITE_UINT32(&then, (yyvsp[(5) - (11)].code));
- WRITE_UINT32(&else1, (yyvsp[(7) - (11)].code));
- WRITE_UINT32(&end, (yyvsp[(9) - (11)].code));
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 2] = else1; /* elsepart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 3] = end; /* end, if cond fails */
- g_lingo->processIf(0, (yyvsp[(9) - (11)].code)); ;}
+ WRITE_UINT32(&then, (yyvsp[(5) - (10)].code));
+ WRITE_UINT32(&else1, (yyvsp[(7) - (10)].code));
+ WRITE_UINT32(&end, (yyvsp[(9) - (10)].code));
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 2] = else1; /* elsepart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 3] = end; /* end, if cond fails */
+
+ checkEnd((yyvsp[(10) - (10)].s), "if", true);
+
+ g_lingo->processIf(0, (yyvsp[(9) - (10)].code)); ;}
break;
- case 30:
-#line 256 "engines/director/lingo/lingo-gr.y"
+ case 32:
+#line 284 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (6)].code));
@@ -2085,8 +2293,8 @@ yyreduce:
g_lingo->processIf(0, 0); ;}
break;
- case 31:
-#line 266 "engines/director/lingo/lingo-gr.y"
+ case 33:
+#line 294 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (10)].code));
@@ -2099,8 +2307,8 @@ yyreduce:
g_lingo->processIf(0, 0); ;}
break;
- case 32:
-#line 276 "engines/director/lingo/lingo-gr.y"
+ case 34:
+#line 304 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (10)].code));
@@ -2113,18 +2321,18 @@ yyreduce:
g_lingo->processIf(0, (yyvsp[(10) - (10)].code)); ;}
break;
- case 33:
-#line 287 "engines/director/lingo/lingo-gr.y"
+ case 35:
+#line 315 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = 0; ;}
break;
- case 34:
-#line 288 "engines/director/lingo/lingo-gr.y"
+ case 36:
+#line 316 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = (yyvsp[(2) - (3)].code); ;}
break;
- case 39:
-#line 299 "engines/director/lingo/lingo-gr.y"
+ case 41:
+#line 327 "engines/director/lingo/lingo-gr.y"
{
inst then = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (6)].code));
@@ -2133,8 +2341,8 @@ yyreduce:
g_lingo->codeLabel((yyvsp[(1) - (6)].code)); ;}
break;
- case 41:
-#line 308 "engines/director/lingo/lingo-gr.y"
+ case 43:
+#line 336 "engines/director/lingo/lingo-gr.y"
{
inst then = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (5)].code));
@@ -2143,23 +2351,23 @@ yyreduce:
g_lingo->codeLabel((yyvsp[(1) - (5)].code)); ;}
break;
- case 42:
-#line 316 "engines/director/lingo/lingo-gr.y"
+ case 44:
+#line 344 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(STOP); ;}
break;
- case 43:
-#line 317 "engines/director/lingo/lingo-gr.y"
+ case 45:
+#line 345 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code2(g_lingo->c_eq, STOP); ;}
break;
- case 45:
-#line 320 "engines/director/lingo/lingo-gr.y"
+ case 47:
+#line 348 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->code3(g_lingo->c_repeatwhilecode, STOP, STOP); ;}
break;
- case 46:
-#line 322 "engines/director/lingo/lingo-gr.y"
+ case 48:
+#line 350 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code3(g_lingo->c_repeatwithcode, STOP, STOP);
g_lingo->code3(STOP, STOP, STOP);
@@ -2167,8 +2375,8 @@ yyreduce:
delete (yyvsp[(3) - (3)].s); ;}
break;
- case 47:
-#line 328 "engines/director/lingo/lingo-gr.y"
+ case 49:
+#line 356 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_ifcode);
g_lingo->code3(STOP, STOP, STOP);
@@ -2176,8 +2384,8 @@ yyreduce:
g_lingo->codeLabel(0); ;}
break;
- case 48:
-#line 334 "engines/director/lingo/lingo-gr.y"
+ case 50:
+#line 362 "engines/director/lingo/lingo-gr.y"
{
inst skipEnd;
WRITE_UINT32(&skipEnd, 1); // We have to skip end to avoid multiple executions
@@ -2186,23 +2394,23 @@ yyreduce:
g_lingo->code1(skipEnd); ;}
break;
- case 49:
-#line 341 "engines/director/lingo/lingo-gr.y"
+ case 51:
+#line 369 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->_currentScript->size(); ;}
break;
- case 50:
-#line 343 "engines/director/lingo/lingo-gr.y"
+ case 52:
+#line 371 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(STOP); (yyval.code) = g_lingo->_currentScript->size(); ;}
break;
- case 51:
-#line 345 "engines/director/lingo/lingo-gr.y"
+ case 53:
+#line 373 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->_currentScript->size(); ;}
break;
- case 54:
-#line 350 "engines/director/lingo/lingo-gr.y"
+ case 56:
+#line 378 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_whencode);
g_lingo->code1(STOP);
@@ -2210,49 +2418,56 @@ yyreduce:
delete (yyvsp[(2) - (3)].s); ;}
break;
- case 55:
-#line 356 "engines/director/lingo/lingo-gr.y"
+ case 57:
+#line 384 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->codeConst((yyvsp[(1) - (1)].i)); ;}
break;
- case 56:
-#line 357 "engines/director/lingo/lingo-gr.y"
+ case 58:
+#line 385 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_fconstpush);
g_lingo->codeFloat((yyvsp[(1) - (1)].f)); ;}
break;
- case 57:
-#line 360 "engines/director/lingo/lingo-gr.y"
+ case 59:
+#line 388 "engines/director/lingo/lingo-gr.y"
+ { // D3
+ (yyval.code) = g_lingo->code1(g_lingo->c_symbolpush);
+ g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); ;}
+ break;
+
+ case 60:
+#line 391 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_stringpush);
g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); ;}
break;
- case 58:
-#line 363 "engines/director/lingo/lingo-gr.y"
+ case 61:
+#line 394 "engines/director/lingo/lingo-gr.y"
{
- (yyval.code) = g_lingo->code1(g_lingo->_handlers[*(yyvsp[(1) - (1)].s)]->u.func);
+ (yyval.code) = g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (1)].s)]->u.func);
delete (yyvsp[(1) - (1)].s); ;}
break;
- case 59:
-#line 366 "engines/director/lingo/lingo-gr.y"
+ case 62:
+#line 397 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->codeFunc((yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].narg));
delete (yyvsp[(1) - (4)].s); ;}
break;
- case 60:
-#line 369 "engines/director/lingo/lingo-gr.y"
+ case 63:
+#line 400 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_eval);
g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str());
delete (yyvsp[(1) - (1)].s); ;}
break;
- case 61:
-#line 373 "engines/director/lingo/lingo-gr.y"
+ case 64:
+#line 404 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->codeConst(0); // Put dummy id
g_lingo->code1(g_lingo->c_theentitypush);
@@ -2262,8 +2477,8 @@ yyreduce:
g_lingo->code2(e, f); ;}
break;
- case 62:
-#line 380 "engines/director/lingo/lingo-gr.y"
+ case 65:
+#line 411 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_theentitypush);
inst e = 0, f = 0;
@@ -2272,262 +2487,327 @@ yyreduce:
g_lingo->code2(e, f); ;}
break;
- case 64:
-#line 387 "engines/director/lingo/lingo-gr.y"
+ case 67:
+#line 418 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_add); ;}
break;
- case 65:
-#line 388 "engines/director/lingo/lingo-gr.y"
+ case 68:
+#line 419 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_sub); ;}
break;
- case 66:
-#line 389 "engines/director/lingo/lingo-gr.y"
+ case 69:
+#line 420 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_mul); ;}
break;
- case 67:
-#line 390 "engines/director/lingo/lingo-gr.y"
+ case 70:
+#line 421 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_div); ;}
break;
- case 68:
-#line 391 "engines/director/lingo/lingo-gr.y"
+ case 71:
+#line 422 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_mod); ;}
break;
- case 69:
-#line 392 "engines/director/lingo/lingo-gr.y"
+ case 72:
+#line 423 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gt); ;}
break;
- case 70:
-#line 393 "engines/director/lingo/lingo-gr.y"
+ case 73:
+#line 424 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_lt); ;}
break;
- case 71:
-#line 394 "engines/director/lingo/lingo-gr.y"
+ case 74:
+#line 425 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_neq); ;}
break;
- case 72:
-#line 395 "engines/director/lingo/lingo-gr.y"
+ case 75:
+#line 426 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_ge); ;}
break;
- case 73:
-#line 396 "engines/director/lingo/lingo-gr.y"
+ case 76:
+#line 427 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_le); ;}
break;
- case 74:
-#line 397 "engines/director/lingo/lingo-gr.y"
+ case 77:
+#line 428 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_and); ;}
break;
- case 75:
-#line 398 "engines/director/lingo/lingo-gr.y"
+ case 78:
+#line 429 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_or); ;}
break;
- case 76:
-#line 399 "engines/director/lingo/lingo-gr.y"
+ case 79:
+#line 430 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_not); ;}
break;
- case 77:
-#line 400 "engines/director/lingo/lingo-gr.y"
+ case 80:
+#line 431 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_ampersand); ;}
break;
- case 78:
-#line 401 "engines/director/lingo/lingo-gr.y"
+ case 81:
+#line 432 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_after); ;}
+ break;
+
+ case 82:
+#line 433 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_concat); ;}
break;
- case 79:
-#line 402 "engines/director/lingo/lingo-gr.y"
+ case 83:
+#line 434 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_contains); ;}
break;
- case 80:
-#line 403 "engines/director/lingo/lingo-gr.y"
+ case 84:
+#line 435 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_starts); ;}
break;
- case 81:
-#line 404 "engines/director/lingo/lingo-gr.y"
+ case 85:
+#line 436 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = (yyvsp[(2) - (2)].code); ;}
break;
- case 82:
-#line 405 "engines/director/lingo/lingo-gr.y"
+ case 86:
+#line 437 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;}
break;
- case 83:
-#line 406 "engines/director/lingo/lingo-gr.y"
+ case 87:
+#line 438 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = (yyvsp[(2) - (3)].code); ;}
break;
- case 84:
-#line 407 "engines/director/lingo/lingo-gr.y"
+ case 88:
+#line 439 "engines/director/lingo/lingo-gr.y"
+ { (yyval.code) = g_lingo->codeArray((yyvsp[(2) - (3)].narg)); ;}
+ break;
+
+ case 89:
+#line 440 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_intersects); ;}
break;
- case 85:
-#line 408 "engines/director/lingo/lingo-gr.y"
+ case 90:
+#line 441 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_within); ;}
break;
- case 86:
-#line 411 "engines/director/lingo/lingo-gr.y"
+ case 91:
+#line 442 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_charOf); ;}
+ break;
+
+ case 92:
+#line 443 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_charToOf); ;}
+ break;
+
+ case 93:
+#line 444 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_itemOf); ;}
+ break;
+
+ case 94:
+#line 445 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_itemToOf); ;}
+ break;
+
+ case 95:
+#line 446 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_lineOf); ;}
+ break;
+
+ case 96:
+#line 447 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_lineToOf); ;}
+ break;
+
+ case 97:
+#line 448 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_wordOf); ;}
+ break;
+
+ case 98:
+#line 449 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_wordToOf); ;}
+ break;
+
+ case 99:
+#line 452 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_printtop); ;}
break;
- case 89:
-#line 414 "engines/director/lingo/lingo-gr.y"
+ case 102:
+#line 455 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_exitRepeat); ;}
break;
- case 90:
-#line 415 "engines/director/lingo/lingo-gr.y"
+ case 103:
+#line 456 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeConst(0); // Push fake value on stack
g_lingo->code1(g_lingo->c_procret); ;}
break;
- case 93:
-#line 419 "engines/director/lingo/lingo-gr.y"
+ case 106:
+#line 460 "engines/director/lingo/lingo-gr.y"
{
- g_lingo->code1(g_lingo->_handlers[*(yyvsp[(1) - (2)].s)]->u.func);
+ g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (2)].s)]->u.func);
delete (yyvsp[(1) - (2)].s); ;}
break;
- case 94:
-#line 422 "engines/director/lingo/lingo-gr.y"
+ case 107:
+#line 463 "engines/director/lingo/lingo-gr.y"
{
- g_lingo->code1(g_lingo->_handlers[*(yyvsp[(1) - (2)].s)]->u.func);
+ g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (2)].s)]->u.func);
delete (yyvsp[(1) - (2)].s); ;}
break;
- case 95:
-#line 425 "engines/director/lingo/lingo-gr.y"
+ case 108:
+#line 466 "engines/director/lingo/lingo-gr.y"
{
- g_lingo->code2(g_lingo->c_voidpush, g_lingo->_handlers[*(yyvsp[(1) - (1)].s)]->u.func);
+ g_lingo->code2(g_lingo->c_voidpush, g_lingo->_builtins[*(yyvsp[(1) - (1)].s)]->u.func);
delete (yyvsp[(1) - (1)].s); ;}
break;
- case 96:
-#line 428 "engines/director/lingo/lingo-gr.y"
+ case 109:
+#line 469 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->codeFunc((yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].narg)); ;}
+ break;
+
+ case 110:
+#line 470 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeFunc((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].narg)); ;}
break;
- case 97:
-#line 429 "engines/director/lingo/lingo-gr.y"
+ case 111:
+#line 471 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->codeMe((yyvsp[(3) - (4)].s), 0); ;}
+ break;
+
+ case 112:
+#line 472 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->codeMe((yyvsp[(3) - (6)].s), (yyvsp[(5) - (6)].narg)); ;}
+ break;
+
+ case 113:
+#line 473 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_open); ;}
break;
- case 98:
-#line 430 "engines/director/lingo/lingo-gr.y"
+ case 114:
+#line 474 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code2(g_lingo->c_voidpush, g_lingo->c_open); ;}
break;
- case 99:
-#line 431 "engines/director/lingo/lingo-gr.y"
- { Common::String s("sound-"); s += *(yyvsp[(2) - (3)].s); g_lingo->codeFunc(&s, (yyvsp[(3) - (3)].narg)); ;}
+ case 115:
+#line 475 "engines/director/lingo/lingo-gr.y"
+ { Common::String s(*(yyvsp[(1) - (3)].s)); s += '-'; s += *(yyvsp[(2) - (3)].s); g_lingo->codeFunc(&s, (yyvsp[(3) - (3)].narg)); ;}
break;
- case 100:
-#line 434 "engines/director/lingo/lingo-gr.y"
+ case 116:
+#line 478 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_global); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;}
break;
- case 101:
-#line 435 "engines/director/lingo/lingo-gr.y"
+ case 117:
+#line 479 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_global); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;}
break;
- case 102:
-#line 438 "engines/director/lingo/lingo-gr.y"
+ case 118:
+#line 482 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_instance); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;}
break;
- case 103:
-#line 439 "engines/director/lingo/lingo-gr.y"
+ case 119:
+#line 483 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_instance); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;}
break;
- case 104:
-#line 450 "engines/director/lingo/lingo-gr.y"
+ case 120:
+#line 494 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotoloop); ;}
break;
- case 105:
-#line 451 "engines/director/lingo/lingo-gr.y"
+ case 121:
+#line 495 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotonext); ;}
break;
- case 106:
-#line 452 "engines/director/lingo/lingo-gr.y"
+ case 122:
+#line 496 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotoprevious); ;}
break;
- case 107:
-#line 453 "engines/director/lingo/lingo-gr.y"
+ case 123:
+#line 497 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(1);
g_lingo->code1(g_lingo->c_goto); ;}
break;
- case 108:
-#line 456 "engines/director/lingo/lingo-gr.y"
+ case 124:
+#line 500 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(3);
g_lingo->code1(g_lingo->c_goto); ;}
break;
- case 109:
-#line 459 "engines/director/lingo/lingo-gr.y"
+ case 125:
+#line 503 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(2);
g_lingo->code1(g_lingo->c_goto); ;}
break;
- case 114:
-#line 472 "engines/director/lingo/lingo-gr.y"
+ case 130:
+#line 516 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_playdone); ;}
break;
- case 115:
-#line 473 "engines/director/lingo/lingo-gr.y"
+ case 131:
+#line 517 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(1);
g_lingo->code1(g_lingo->c_play); ;}
break;
- case 116:
-#line 476 "engines/director/lingo/lingo-gr.y"
+ case 132:
+#line 520 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(3);
g_lingo->code1(g_lingo->c_play); ;}
break;
- case 117:
-#line 479 "engines/director/lingo/lingo-gr.y"
+ case 133:
+#line 523 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(2);
g_lingo->code1(g_lingo->c_play); ;}
break;
- case 118:
-#line 509 "engines/director/lingo/lingo-gr.y"
+ case 134:
+#line 553 "engines/director/lingo/lingo-gr.y"
{ g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;}
break;
- case 119:
-#line 510 "engines/director/lingo/lingo-gr.y"
+ case 135:
+#line 554 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(0); // Push fake value on stack
g_lingo->code1(g_lingo->c_procret);
@@ -2535,72 +2815,76 @@ yyreduce:
g_lingo->_indef = false; ;}
break;
- case 120:
-#line 515 "engines/director/lingo/lingo-gr.y"
+ case 136:
+#line 559 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeFactory(*(yyvsp[(2) - (2)].s));
;}
break;
- case 121:
-#line 518 "engines/director/lingo/lingo-gr.y"
+ case 137:
+#line 562 "engines/director/lingo/lingo-gr.y"
{ g_lingo->_indef = true; ;}
break;
- case 122:
-#line 519 "engines/director/lingo/lingo-gr.y"
+ case 138:
+#line 563 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_procret);
g_lingo->define(*(yyvsp[(2) - (8)].s), (yyvsp[(4) - (8)].code), (yyvsp[(5) - (8)].narg) + 1, &g_lingo->_currentFactory);
g_lingo->_indef = false; ;}
break;
- case 123:
-#line 523 "engines/director/lingo/lingo-gr.y"
+ case 139:
+#line 567 "engines/director/lingo/lingo-gr.y"
{ g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;}
break;
- case 124:
-#line 524 "engines/director/lingo/lingo-gr.y"
+ case 140:
+#line 568 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->_ignoreMe = true; ;}
+ break;
+
+ case 141:
+#line 568 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(0); // Push fake value on stack
g_lingo->code1(g_lingo->c_procret);
- g_lingo->define(*(yyvsp[(2) - (10)].s), (yyvsp[(4) - (10)].code), (yyvsp[(5) - (10)].narg));
+ g_lingo->define(*(yyvsp[(2) - (10)].s), (yyvsp[(4) - (10)].code), (yyvsp[(6) - (10)].narg));
g_lingo->_indef = false;
+ g_lingo->_ignoreMe = false;
- if (*(yyvsp[(2) - (10)].s) != *(yyvsp[(10) - (10)].s)) {
- yyerror("on vs end handler mismatch");
- }
+ checkEnd((yyvsp[(10) - (10)].s), (yyvsp[(2) - (10)].s)->c_str(), false);
;}
break;
- case 125:
-#line 535 "engines/director/lingo/lingo-gr.y"
+ case 142:
+#line 578 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 0; ;}
break;
- case 126:
-#line 536 "engines/director/lingo/lingo-gr.y"
+ case 143:
+#line 579 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;}
break;
- case 127:
-#line 537 "engines/director/lingo/lingo-gr.y"
+ case 144:
+#line 580 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;}
break;
- case 128:
-#line 538 "engines/director/lingo/lingo-gr.y"
+ case 145:
+#line 581 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;}
break;
- case 129:
-#line 540 "engines/director/lingo/lingo-gr.y"
+ case 146:
+#line 583 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArgStore(); ;}
break;
- case 130:
-#line 544 "engines/director/lingo/lingo-gr.y"
+ case 147:
+#line 587 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_call);
g_lingo->codeString((yyvsp[(1) - (3)].s)->c_str());
@@ -2609,24 +2893,24 @@ yyreduce:
g_lingo->code1(numpar); ;}
break;
- case 131:
-#line 552 "engines/director/lingo/lingo-gr.y"
+ case 148:
+#line 595 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 0; ;}
break;
- case 132:
-#line 553 "engines/director/lingo/lingo-gr.y"
+ case 149:
+#line 596 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 1; ;}
break;
- case 133:
-#line 554 "engines/director/lingo/lingo-gr.y"
+ case 150:
+#line 597 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;}
break;
/* Line 1267 of yacc.c. */
-#line 2630 "engines/director/lingo/lingo-gr.cpp"
+#line 2914 "engines/director/lingo/lingo-gr.cpp"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2840,6 +3124,6 @@ yyreturn:
}
-#line 557 "engines/director/lingo/lingo-gr.y"
+#line 600 "engines/director/lingo/lingo-gr.y"
diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h
index a580125403..37451f08f5 100644
--- a/engines/director/lingo/lingo-gr.h
+++ b/engines/director/lingo/lingo-gr.h
@@ -46,71 +46,77 @@
POINT = 262,
RECT = 263,
ARRAY = 264,
- SYMBOL = 265,
- OBJECT = 266,
- INT = 267,
- THEENTITY = 268,
- THEENTITYWITHID = 269,
- FLOAT = 270,
- BLTIN = 271,
- BLTINNOARGS = 272,
- BLTINNOARGSORONE = 273,
- BLTINONEARG = 274,
- BLTINARGLIST = 275,
+ OBJECT = 265,
+ INT = 266,
+ THEENTITY = 267,
+ THEENTITYWITHID = 268,
+ FLOAT = 269,
+ BLTIN = 270,
+ BLTINNOARGS = 271,
+ BLTINNOARGSORONE = 272,
+ BLTINONEARG = 273,
+ BLTINARGLIST = 274,
+ TWOWORDBUILTIN = 275,
ID = 276,
STRING = 277,
HANDLER = 278,
- tDOWN = 279,
- tELSE = 280,
- tNLELSIF = 281,
- tEND = 282,
- tEXIT = 283,
- tFRAME = 284,
- tGLOBAL = 285,
- tGO = 286,
- tIF = 287,
- tINTO = 288,
- tLOOP = 289,
- tMACRO = 290,
- tMOVIE = 291,
- tNEXT = 292,
- tOF = 293,
- tPREVIOUS = 294,
- tPUT = 295,
- tREPEAT = 296,
- tSET = 297,
- tTHEN = 298,
- tTO = 299,
- tWHEN = 300,
- tWITH = 301,
- tWHILE = 302,
- tNLELSE = 303,
- tFACTORY = 304,
- tMETHOD = 305,
- tOPEN = 306,
- tPLAY = 307,
- tDONE = 308,
- tPLAYACCEL = 309,
- tINSTANCE = 310,
- tGE = 311,
- tLE = 312,
- tGT = 313,
- tLT = 314,
- tEQ = 315,
- tNEQ = 316,
- tAND = 317,
- tOR = 318,
- tNOT = 319,
- tMOD = 320,
- tCONCAT = 321,
- tCONTAINS = 322,
- tSTARTS = 323,
- tSPRITE = 324,
- tINTERSECTS = 325,
- tWITHIN = 326,
- tON = 327,
- tME = 328,
- tSOUND = 329
+ SYMBOL = 279,
+ ENDCLAUSE = 280,
+ tDOWN = 281,
+ tELSE = 282,
+ tNLELSIF = 283,
+ tEXIT = 284,
+ tFRAME = 285,
+ tGLOBAL = 286,
+ tGO = 287,
+ tIF = 288,
+ tINTO = 289,
+ tLOOP = 290,
+ tMACRO = 291,
+ tMOVIE = 292,
+ tNEXT = 293,
+ tOF = 294,
+ tPREVIOUS = 295,
+ tPUT = 296,
+ tREPEAT = 297,
+ tSET = 298,
+ tTHEN = 299,
+ tTO = 300,
+ tWHEN = 301,
+ tWITH = 302,
+ tWHILE = 303,
+ tNLELSE = 304,
+ tFACTORY = 305,
+ tMETHOD = 306,
+ tOPEN = 307,
+ tPLAY = 308,
+ tDONE = 309,
+ tPLAYACCEL = 310,
+ tINSTANCE = 311,
+ tGE = 312,
+ tLE = 313,
+ tGT = 314,
+ tLT = 315,
+ tEQ = 316,
+ tNEQ = 317,
+ tAND = 318,
+ tOR = 319,
+ tNOT = 320,
+ tMOD = 321,
+ tAFTER = 322,
+ tBEFORE = 323,
+ tCONCAT = 324,
+ tCONTAINS = 325,
+ tSTARTS = 326,
+ tCHAR = 327,
+ tITEM = 328,
+ tLINE = 329,
+ tWORD = 330,
+ tSPRITE = 331,
+ tINTERSECTS = 332,
+ tWITHIN = 333,
+ tON = 334,
+ tME = 335
};
#endif
/* Tokens. */
@@ -121,78 +127,84 @@
#define POINT 262
#define RECT 263
#define ARRAY 264
-#define SYMBOL 265
-#define OBJECT 266
-#define INT 267
-#define THEENTITY 268
-#define THEENTITYWITHID 269
-#define FLOAT 270
-#define BLTIN 271
-#define BLTINNOARGS 272
-#define BLTINNOARGSORONE 273
-#define BLTINONEARG 274
-#define BLTINARGLIST 275
+#define OBJECT 265
+#define INT 266
+#define THEENTITY 267
+#define THEENTITYWITHID 268
+#define FLOAT 269
+#define BLTIN 270
+#define BLTINNOARGS 271
+#define BLTINNOARGSORONE 272
+#define BLTINONEARG 273
+#define BLTINARGLIST 274
+#define TWOWORDBUILTIN 275
#define ID 276
#define STRING 277
#define HANDLER 278
-#define tDOWN 279
-#define tELSE 280
-#define tNLELSIF 281
-#define tEND 282
-#define tEXIT 283
-#define tFRAME 284
-#define tGLOBAL 285
-#define tGO 286
-#define tIF 287
-#define tINTO 288
-#define tLOOP 289
-#define tMACRO 290
-#define tMOVIE 291
-#define tNEXT 292
-#define tOF 293
-#define tPREVIOUS 294
-#define tPUT 295
-#define tREPEAT 296
-#define tSET 297
-#define tTHEN 298
-#define tTO 299
-#define tWHEN 300
-#define tWITH 301
-#define tWHILE 302
-#define tNLELSE 303
-#define tFACTORY 304
-#define tMETHOD 305
-#define tOPEN 306
-#define tPLAY 307
-#define tDONE 308
-#define tPLAYACCEL 309
-#define tINSTANCE 310
-#define tGE 311
-#define tLE 312
-#define tGT 313
-#define tLT 314
-#define tEQ 315
-#define tNEQ 316
-#define tAND 317
-#define tOR 318
-#define tNOT 319
-#define tMOD 320
-#define tCONCAT 321
-#define tCONTAINS 322
-#define tSTARTS 323
-#define tSPRITE 324
-#define tINTERSECTS 325
-#define tWITHIN 326
-#define tON 327
-#define tME 328
-#define tSOUND 329
+#define SYMBOL 279
+#define ENDCLAUSE 280
+#define tDOWN 281
+#define tELSE 282
+#define tNLELSIF 283
+#define tEXIT 284
+#define tFRAME 285
+#define tGLOBAL 286
+#define tGO 287
+#define tIF 288
+#define tINTO 289
+#define tLOOP 290
+#define tMACRO 291
+#define tMOVIE 292
+#define tNEXT 293
+#define tOF 294
+#define tPREVIOUS 295
+#define tPUT 296
+#define tREPEAT 297
+#define tSET 298
+#define tTHEN 299
+#define tTO 300
+#define tWHEN 301
+#define tWITH 302
+#define tWHILE 303
+#define tNLELSE 304
+#define tFACTORY 305
+#define tMETHOD 306
+#define tOPEN 307
+#define tPLAY 308
+#define tDONE 309
+#define tPLAYACCEL 310
+#define tINSTANCE 311
+#define tGE 312
+#define tLE 313
+#define tGT 314
+#define tLT 315
+#define tEQ 316
+#define tNEQ 317
+#define tAND 318
+#define tOR 319
+#define tNOT 320
+#define tMOD 321
+#define tAFTER 322
+#define tBEFORE 323
+#define tCONCAT 324
+#define tCONTAINS 325
+#define tSTARTS 326
+#define tCHAR 327
+#define tITEM 328
+#define tLINE 329
+#define tWORD 330
+#define tSPRITE 331
+#define tINTERSECTS 332
+#define tWITHIN 333
+#define tON 334
+#define tME 335
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 69 "engines/director/lingo/lingo-gr.y"
+#line 79 "engines/director/lingo/lingo-gr.y"
{
Common::String *s;
int i;
@@ -203,7 +215,7 @@ typedef union YYSTYPE
Common::Array<double> *arr;
}
/* Line 1529 of yacc.c. */
-#line 207 "engines/director/lingo/lingo-gr.hpp"
+#line 219 "engines/director/lingo/lingo-gr.hpp"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y
index 3ad87e1f00..778496bf94 100644
--- a/engines/director/lingo/lingo-gr.y
+++ b/engines/director/lingo/lingo-gr.y
@@ -63,6 +63,16 @@ void yyerror(const char *s) {
warning("%s at line %d col %d", s, g_lingo->_linenumber, g_lingo->_colnumber);
}
+void checkEnd(Common::String *token, const char *expect, bool required) {
+ if (required) {
+ if (token->compareToIgnoreCase(expect)) {
+ Common::String err = Common::String::format("end mismatch. Expected %s but got %s", expect, token->c_str());
+ yyerror(err.c_str());
+ }
+ }
+
+ delete token;
+}
%}
@@ -77,19 +87,20 @@ void yyerror(const char *s) {
}
%token UNARY
-%token CASTREF VOID VAR POINT RECT ARRAY SYMBOL OBJECT
+%token CASTREF VOID VAR POINT RECT ARRAY OBJECT
%token<i> INT
%token<e> THEENTITY THEENTITYWITHID
%token<f> FLOAT
-%token<s> BLTIN BLTINNOARGS BLTINNOARGSORONE BLTINONEARG BLTINARGLIST
-%token<s> ID STRING HANDLER
-%token tDOWN tELSE tNLELSIF tEND tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO
+%token<s> BLTIN BLTINNOARGS BLTINNOARGSORONE BLTINONEARG BLTINARGLIST TWOWORDBUILTIN
+%token<s> ID STRING HANDLER SYMBOL
+%token<s> ENDCLAUSE
+%token tDOWN tELSE tNLELSIF tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO
%token tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO tWHEN
%token tWITH tWHILE tNLELSE tFACTORY tMETHOD tOPEN tPLAY tDONE tPLAYACCEL tINSTANCE
%token tGE tLE tGT tLT tEQ tNEQ tAND tOR tNOT tMOD
-%token tCONCAT tCONTAINS tSTARTS
+%token tAFTER tBEFORE tCONCAT tCONTAINS tSTARTS tCHAR tITEM tLINE tWORD
%token tSPRITE tINTERSECTS tWITHIN
-%token tON tME tSOUND
+%token tON tME
%type<code> asgn begin elseif elsestmtoneliner end expr if when repeatwhile repeatwith stmtlist
%type<narg> argdef arglist
@@ -127,6 +138,8 @@ asgn: tPUT expr tINTO ID {
g_lingo->code1(g_lingo->c_assign);
$$ = $2;
delete $4; }
+ | tPUT expr tAFTER expr { $$ = g_lingo->code1(g_lingo->c_after); } // D3
+ | tPUT expr tBEFORE expr { $$ = g_lingo->code1(g_lingo->c_before); } // D3
| tSET ID '=' expr {
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString($2->c_str());
@@ -181,18 +194,20 @@ stmt: stmtoneliner
// statements
// end repeat
//
- | repeatwhile '(' cond ')' stmtlist end tEND tREPEAT {
+ | repeatwhile '(' cond ')' stmtlist end ENDCLAUSE {
inst body = 0, end = 0;
WRITE_UINT32(&body, $5);
WRITE_UINT32(&end, $6);
(*g_lingo->_currentScript)[$1 + 1] = body; /* body of loop */
- (*g_lingo->_currentScript)[$1 + 2] = end; } /* end, if cond fails */
+ (*g_lingo->_currentScript)[$1 + 2] = end; /* end, if cond fails */
+
+ checkEnd($7, "repeat", true); }
;
// repeat with index = start to end
// statements
// end repeat
//
- | repeatwith '=' expr end tTO expr end stmtlist end tEND tREPEAT {
+ | repeatwith '=' expr end tTO expr end stmtlist end ENDCLAUSE {
inst init = 0, finish = 0, body = 0, end = 0, inc = 0;
WRITE_UINT32(&init, $3);
WRITE_UINT32(&finish, $6);
@@ -203,12 +218,14 @@ stmt: stmtoneliner
(*g_lingo->_currentScript)[$1 + 2] = finish;/* final count value */
(*g_lingo->_currentScript)[$1 + 3] = body; /* body of loop */
(*g_lingo->_currentScript)[$1 + 4] = inc; /* increment */
- (*g_lingo->_currentScript)[$1 + 5] = end; } /* end, if cond fails */
+ (*g_lingo->_currentScript)[$1 + 5] = end; /* end, if cond fails */
+
+ checkEnd($10, "repeat", true); }
// repeat with index = high down to low
// statements
// end repeat
//
- | repeatwith '=' expr end tDOWN tTO expr end stmtlist end tEND tREPEAT {
+ | repeatwith '=' expr end tDOWN tTO expr end stmtlist end ENDCLAUSE {
inst init = 0, finish = 0, body = 0, end = 0, inc = 0;
WRITE_UINT32(&init, $3);
WRITE_UINT32(&finish, $7);
@@ -219,7 +236,9 @@ stmt: stmtoneliner
(*g_lingo->_currentScript)[$1 + 2] = finish;/* final count value */
(*g_lingo->_currentScript)[$1 + 3] = body; /* body of loop */
(*g_lingo->_currentScript)[$1 + 4] = inc; /* increment */
- (*g_lingo->_currentScript)[$1 + 5] = end; } /* end, if cond fails */
+ (*g_lingo->_currentScript)[$1 + 5] = end; /* end, if cond fails */
+
+ checkEnd($11, "repeat", true); }
| when expr end {
inst end = 0;
WRITE_UINT32(&end, $3);
@@ -228,14 +247,17 @@ stmt: stmtoneliner
}
;
-ifstmt: if cond tTHEN nl stmtlist end tEND tIF {
+ifstmt: if cond tTHEN nl stmtlist end ENDCLAUSE {
inst then = 0, end = 0;
WRITE_UINT32(&then, $5);
WRITE_UINT32(&end, $6);
(*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */
(*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
+
+ checkEnd($7, "if", true);
+
g_lingo->processIf(0, 0); }
- | if cond tTHEN nl stmtlist end tNLELSE stmtlist end tEND tIF {
+ | if cond tTHEN nl stmtlist end tNLELSE stmtlist end ENDCLAUSE {
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, $5);
WRITE_UINT32(&else1, $8);
@@ -243,8 +265,11 @@ ifstmt: if cond tTHEN nl stmtlist end tEND tIF {
(*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */
(*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */
(*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
+
+ checkEnd($10, "if", true);
+
g_lingo->processIf(0, 0); }
- | if cond tTHEN nl stmtlist end begin elseifstmt end tEND tIF {
+ | if cond tTHEN nl stmtlist end begin elseifstmt end ENDCLAUSE {
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, $5);
WRITE_UINT32(&else1, $7);
@@ -252,6 +277,9 @@ ifstmt: if cond tTHEN nl stmtlist end tEND tIF {
(*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */
(*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */
(*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
+
+ checkEnd($10, "if", true);
+
g_lingo->processIf(0, $9); }
| if cond tTHEN begin stmtoneliner end {
inst then = 0, else1 = 0, end = 0;
@@ -357,11 +385,14 @@ expr: INT { $$ = g_lingo->codeConst($1); }
| FLOAT {
$$ = g_lingo->code1(g_lingo->c_fconstpush);
g_lingo->codeFloat($1); }
+ | SYMBOL { // D3
+ $$ = g_lingo->code1(g_lingo->c_symbolpush);
+ g_lingo->codeString($1->c_str()); }
| STRING {
$$ = g_lingo->code1(g_lingo->c_stringpush);
g_lingo->codeString($1->c_str()); }
| BLTINNOARGS {
- $$ = g_lingo->code1(g_lingo->_handlers[*$1]->u.func);
+ $$ = g_lingo->code1(g_lingo->_builtins[*$1]->u.func);
delete $1; }
| ID '(' arglist ')' {
$$ = g_lingo->codeFunc($1, $3);
@@ -398,14 +429,24 @@ expr: INT { $$ = g_lingo->codeConst($1); }
| expr tOR expr { g_lingo->code1(g_lingo->c_or); }
| tNOT expr %prec UNARY { g_lingo->code1(g_lingo->c_not); }
| expr '&' expr { g_lingo->code1(g_lingo->c_ampersand); }
+ | expr tAFTER expr { g_lingo->code1(g_lingo->c_after); }
| expr tCONCAT expr { g_lingo->code1(g_lingo->c_concat); }
| expr tCONTAINS expr { g_lingo->code1(g_lingo->c_contains); }
| expr tSTARTS expr { g_lingo->code1(g_lingo->c_starts); }
| '+' expr %prec UNARY { $$ = $2; }
| '-' expr %prec UNARY { $$ = $2; g_lingo->code1(g_lingo->c_negate); }
| '(' expr ')' { $$ = $2; }
+ | '[' arglist ']' { $$ = g_lingo->codeArray($2); }
| tSPRITE expr tINTERSECTS expr { g_lingo->code1(g_lingo->c_intersects); }
| tSPRITE expr tWITHIN expr { g_lingo->code1(g_lingo->c_within); }
+ | tCHAR expr tOF expr { g_lingo->code1(g_lingo->c_charOf); }
+ | tCHAR expr tTO expr tOF expr { g_lingo->code1(g_lingo->c_charToOf); }
+ | tITEM expr tOF expr { g_lingo->code1(g_lingo->c_itemOf); }
+ | tITEM expr tTO expr tOF expr { g_lingo->code1(g_lingo->c_itemToOf); }
+ | tLINE expr tOF expr { g_lingo->code1(g_lingo->c_lineOf); }
+ | tLINE expr tTO expr tOF expr { g_lingo->code1(g_lingo->c_lineToOf); }
+ | tWORD expr tOF expr { g_lingo->code1(g_lingo->c_wordOf); }
+ | tWORD expr tTO expr tOF expr { g_lingo->code1(g_lingo->c_wordToOf); }
;
func: tPUT expr { g_lingo->code1(g_lingo->c_printtop); }
@@ -417,18 +458,21 @@ func: tPUT expr { g_lingo->code1(g_lingo->c_printtop); }
| tGLOBAL globallist
| tINSTANCE instancelist
| BLTINONEARG expr {
- g_lingo->code1(g_lingo->_handlers[*$1]->u.func);
+ g_lingo->code1(g_lingo->_builtins[*$1]->u.func);
delete $1; }
| BLTINNOARGSORONE expr {
- g_lingo->code1(g_lingo->_handlers[*$1]->u.func);
+ g_lingo->code1(g_lingo->_builtins[*$1]->u.func);
delete $1; }
| BLTINNOARGSORONE {
- g_lingo->code2(g_lingo->c_voidpush, g_lingo->_handlers[*$1]->u.func);
+ g_lingo->code2(g_lingo->c_voidpush, g_lingo->_builtins[*$1]->u.func);
delete $1; }
+ | BLTINARGLIST '(' arglist ')' { g_lingo->codeFunc($1, $3); }
| BLTINARGLIST arglist { g_lingo->codeFunc($1, $2); }
+ | tME '(' ID ')' { g_lingo->codeMe($3, 0); }
+ | tME '(' ID ',' arglist ')' { g_lingo->codeMe($3, $5); }
| tOPEN expr tWITH expr { g_lingo->code1(g_lingo->c_open); }
| tOPEN expr { g_lingo->code2(g_lingo->c_voidpush, g_lingo->c_open); }
- | tSOUND ID arglist { Common::String s("sound-"); s += *$2; g_lingo->codeFunc(&s, $3); }
+ | TWOWORDBUILTIN ID arglist { Common::String s(*$1); s += '-'; s += *$2; g_lingo->codeFunc(&s, $3); }
;
globallist: ID { g_lingo->code1(g_lingo->c_global); g_lingo->codeString($1->c_str()); delete $1; }
@@ -520,16 +564,15 @@ defn: tMACRO ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); }
g_lingo->code1(g_lingo->c_procret);
g_lingo->define(*$2, $4, $5 + 1, &g_lingo->_currentFactory);
g_lingo->_indef = false; } ;
- | tON ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); }
- begin argdef nl argstore stmtlist tEND ID {
+ | tON ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); } // D3
+ begin { g_lingo->_ignoreMe = true; } argdef nl argstore stmtlist ENDCLAUSE {
g_lingo->codeConst(0); // Push fake value on stack
g_lingo->code1(g_lingo->c_procret);
- g_lingo->define(*$2, $4, $5);
+ g_lingo->define(*$2, $4, $6);
g_lingo->_indef = false;
+ g_lingo->_ignoreMe = false;
- if (*$2 != *$10) {
- yyerror("on vs end handler mismatch");
- }
+ checkEnd($10, $2->c_str(), false);
}
argdef: /* nothing */ { $$ = 0; }
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp
index 5197d002dd..922425048e 100644
--- a/engines/director/lingo/lingo-lex.cpp
+++ b/engines/director/lingo/lingo-lex.cpp
@@ -364,8 +364,8 @@ static void yy_fatal_error (yyconst char msg[] );
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 62
-#define YY_END_OF_BUFFER 63
+#define YY_NUM_RULES 68
+#define YY_END_OF_BUFFER 69
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -373,31 +373,35 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[211] =
+static yyconst flex_int16_t yy_accept[248] =
{ 0,
- 0, 0, 63, 61, 3, 59, 59, 61, 61, 58,
- 58, 58, 57, 58, 58, 55, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
- 55, 55, 2, 2, 3, 59, 0, 0, 0, 0,
- 0, 60, 54, 1, 56, 57, 53, 51, 52, 55,
- 55, 55, 55, 55, 55, 55, 55, 55, 55, 18,
- 8, 55, 55, 55, 24, 55, 55, 55, 30, 31,
- 55, 33, 55, 55, 55, 55, 55, 55, 55, 55,
- 55, 45, 55, 55, 2, 2, 0, 1, 56, 4,
- 55, 55, 55, 55, 12, 55, 55, 55, 55, 0,
-
- 55, 55, 55, 55, 55, 26, 55, 55, 29, 55,
- 55, 55, 36, 55, 38, 55, 55, 55, 55, 55,
- 55, 55, 0, 55, 6, 7, 11, 14, 55, 55,
- 55, 0, 55, 55, 21, 22, 55, 55, 55, 28,
- 32, 34, 55, 55, 55, 55, 55, 0, 44, 49,
- 55, 47, 10, 55, 55, 15, 55, 17, 55, 55,
- 23, 55, 27, 55, 55, 39, 55, 55, 43, 43,
- 50, 55, 0, 55, 55, 16, 55, 55, 25, 55,
- 37, 46, 40, 0, 43, 48, 0, 55, 13, 55,
- 55, 55, 0, 43, 9, 5, 19, 55, 35, 0,
-
- 43, 55, 0, 0, 20, 42, 0, 0, 41, 0
+ 0, 0, 69, 67, 3, 65, 65, 67, 67, 67,
+ 64, 64, 64, 63, 64, 64, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 2, 2, 3, 65, 0, 0,
+ 0, 0, 0, 66, 4, 60, 1, 62, 63, 59,
+ 57, 58, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 22, 12, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 35, 36, 61, 38,
+ 61, 61, 61, 61, 61, 61, 61, 61, 50, 61,
+ 61, 61, 2, 2, 0, 4, 1, 62, 61, 6,
+
+ 61, 61, 61, 61, 61, 61, 16, 61, 61, 61,
+ 61, 0, 61, 61, 61, 61, 61, 61, 61, 31,
+ 61, 61, 34, 61, 61, 61, 41, 61, 43, 61,
+ 61, 61, 61, 61, 61, 61, 0, 61, 61, 8,
+ 61, 10, 11, 15, 0, 16, 18, 61, 61, 61,
+ 0, 61, 61, 25, 26, 27, 28, 61, 61, 61,
+ 33, 37, 39, 61, 61, 61, 61, 0, 49, 54,
+ 61, 52, 56, 14, 5, 61, 61, 16, 16, 61,
+ 19, 61, 21, 61, 61, 29, 61, 32, 61, 61,
+ 61, 61, 48, 48, 55, 61, 0, 7, 61, 16,
+
+ 61, 20, 61, 61, 30, 61, 42, 51, 44, 0,
+ 0, 48, 53, 0, 61, 17, 61, 61, 61, 0,
+ 0, 0, 0, 48, 13, 9, 23, 61, 40, 0,
+ 0, 0, 48, 61, 0, 0, 0, 0, 24, 47,
+ 46, 47, 0, 0, 0, 45, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -405,17 +409,17 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 5, 1, 6, 1, 1, 7, 8, 1, 7,
- 7, 7, 7, 7, 9, 10, 7, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 7, 1, 12,
- 13, 14, 1, 1, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 24,
- 1, 1, 1, 7, 39, 1, 40, 41, 42, 43,
-
- 44, 45, 46, 47, 48, 24, 24, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 24, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 5, 1, 6, 7, 1, 8, 9, 1, 8,
+ 8, 8, 10, 8, 11, 12, 8, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 8, 1, 14,
+ 15, 16, 1, 1, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 26,
+ 8, 1, 8, 8, 41, 1, 42, 43, 44, 45,
+
+ 46, 47, 48, 49, 50, 26, 26, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 26, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -432,142 +436,164 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[63] =
+static yyconst flex_int32_t yy_meta[65] =
{ 0,
1, 2, 3, 3, 2, 1, 1, 1, 1, 1,
- 4, 1, 1, 1, 5, 5, 5, 5, 5, 5,
+ 1, 1, 4, 1, 1, 1, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 4, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 6, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5
+ 5, 5, 5, 5
} ;
-static yyconst flex_int16_t yy_base[216] =
+static yyconst flex_int16_t yy_base[259] =
{ 0,
- 0, 61, 205, 519, 65, 69, 73, 77, 179, 519,
- 143, 137, 54, 70, 118, 58, 0, 58, 59, 69,
- 74, 70, 70, 71, 88, 105, 107, 110, 81, 142,
- 117, 125, 151, 174, 178, 519, 185, 191, 198, 77,
- 102, 519, 519, 0, 82, 132, 519, 519, 519, 0,
- 94, 123, 170, 135, 166, 175, 187, 192, 164, 99,
- 0, 180, 186, 191, 182, 206, 182, 187, 0, 0,
- 203, 0, 210, 207, 195, 202, 201, 206, 214, 231,
- 229, 0, 234, 223, 257, 272, 231, 0, 80, 0,
- 233, 235, 240, 249, 0, 237, 239, 255, 267, 283,
-
- 253, 270, 266, 266, 262, 0, 269, 266, 0, 273,
- 263, 267, 0, 284, 0, 279, 281, 276, 310, 284,
- 293, 291, 301, 312, 0, 0, 0, 0, 304, 314,
- 319, 308, 324, 310, 0, 0, 315, 316, 327, 0,
- 0, 0, 324, 333, 331, 318, 320, 352, 0, 0,
- 336, 339, 161, 340, 335, 0, 344, 519, 343, 344,
- 0, 360, 0, 353, 349, 0, 360, 351, 384, 390,
- 0, 358, 394, 364, 359, 0, 381, 382, 0, 376,
- 0, 0, 0, 409, 414, 0, 382, 380, 0, 394,
- 401, 390, 404, 423, 519, 0, 0, 396, 0, 428,
-
- 430, 399, 445, 446, 0, 452, 419, 457, 458, 519,
- 498, 500, 505, 509, 513
+ 0, 63, 160, 637, 67, 71, 75, 79, 140, 0,
+ 637, 133, 126, 54, 70, 94, 65, 67, 65, 61,
+ 71, 87, 72, 0, 103, 81, 119, 109, 135, 118,
+ 82, 112, 146, 155, 194, 208, 212, 637, 216, 181,
+ 220, 121, 99, 637, 0, 637, 0, 88, 95, 637,
+ 637, 637, 0, 118, 96, 105, 142, 177, 197, 173,
+ 183, 183, 210, 215, 204, 88, 0, 202, 217, 211,
+ 213, 225, 211, 228, 208, 216, 0, 0, 228, 0,
+ 235, 232, 220, 225, 227, 235, 255, 255, 0, 260,
+ 248, 251, 291, 300, 253, 0, 0, 84, 267, 0,
+
+ 260, 258, 263, 278, 280, 279, 314, 277, 282, 290,
+ 302, 321, 293, 300, 301, 311, 300, 301, 311, 0,
+ 312, 304, 0, 311, 303, 307, 0, 326, 0, 323,
+ 317, 364, 322, 332, 337, 345, 349, 343, 344, 0,
+ 354, 0, 0, 0, 189, 0, 0, 348, 358, 364,
+ 354, 365, 352, 0, 0, 0, 0, 357, 358, 368,
+ 0, 0, 0, 366, 377, 362, 363, 408, 0, 0,
+ 378, 378, 0, 237, 0, 384, 390, 0, 0, 387,
+ 0, 396, 637, 396, 392, 0, 398, 0, 397, 394,
+ 410, 399, 436, 450, 0, 405, 434, 0, 408, 0,
+
+ 405, 0, 429, 433, 0, 426, 0, 0, 0, 463,
+ 443, 462, 0, 449, 436, 0, 453, 456, 443, 485,
+ 463, 463, 464, 502, 637, 0, 0, 457, 0, 462,
+ 430, 475, 518, 475, 490, 524, 492, 529, 0, 637,
+ 530, 637, 538, 503, 539, 540, 637, 592, 594, 597,
+ 600, 606, 611, 616, 619, 624, 626, 631
} ;
-static yyconst flex_int16_t yy_def[216] =
+static yyconst flex_int16_t yy_def[259] =
{ 0,
- 210, 1, 210, 210, 210, 210, 210, 210, 211, 210,
- 210, 210, 210, 210, 210, 212, 212, 212, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 210, 210, 210, 210, 210, 210, 210, 210,
- 211, 210, 210, 213, 210, 210, 210, 210, 210, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 212, 212, 210, 210, 210, 213, 210, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 212, 210,
-
- 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 210, 212, 212, 212, 212, 212, 212, 212,
- 212, 210, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 214, 212, 212,
- 212, 212, 210, 212, 212, 212, 212, 210, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 214, 214,
- 212, 212, 210, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 212, 210, 214, 212, 210, 212, 212, 212,
- 212, 212, 210, 214, 210, 212, 212, 212, 212, 210,
-
- 214, 212, 215, 210, 212, 215, 210, 210, 215, 0,
- 210, 210, 210, 210, 210
+ 247, 1, 247, 247, 247, 247, 247, 247, 248, 249,
+ 247, 247, 247, 247, 247, 247, 250, 250, 250, 250,
+ 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 250, 250, 247, 247, 247, 247, 247, 247,
+ 247, 247, 248, 247, 251, 247, 252, 247, 247, 247,
+ 247, 247, 250, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 247, 247, 247, 251, 252, 247, 250, 250,
+
+ 250, 250, 250, 250, 250, 250, 253, 250, 250, 250,
+ 250, 247, 250, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 250, 250, 250, 250, 247, 250, 250, 250,
+ 250, 250, 250, 250, 254, 255, 250, 250, 250, 250,
+ 247, 250, 250, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 250, 250, 250, 250, 250, 256, 250, 250,
+ 250, 250, 250, 247, 250, 250, 250, 257, 255, 250,
+ 250, 250, 247, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 256, 256, 250, 250, 247, 250, 250, 257,
+
+ 250, 250, 250, 250, 250, 250, 250, 250, 250, 247,
+ 247, 256, 250, 247, 250, 250, 250, 250, 250, 247,
+ 247, 247, 247, 256, 247, 250, 250, 250, 250, 247,
+ 247, 247, 256, 250, 247, 258, 247, 247, 250, 247,
+ 258, 247, 247, 247, 247, 258, 0, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247
} ;
-static yyconst flex_int16_t yy_nxt[582] =
+static yyconst flex_int16_t yy_nxt[702] =
{ 0,
- 4, 5, 6, 7, 8, 9, 10, 11, 12, 4,
- 13, 14, 10, 15, 16, 17, 18, 19, 20, 21,
- 22, 17, 23, 17, 24, 25, 26, 27, 28, 17,
- 29, 30, 31, 17, 17, 32, 17, 17, 17, 16,
- 17, 18, 19, 20, 21, 22, 17, 23, 24, 25,
- 26, 27, 28, 17, 29, 30, 31, 17, 17, 32,
- 17, 17, 33, 45, 46, 34, 35, 36, 36, 37,
- 38, 39, 39, 38, 38, 39, 39, 38, 37, 36,
- 36, 37, 47, 48, 51, 52, 53, 40, 57, 61,
- 89, 40, 89, 54, 59, 55, 62, 60, 63, 76,
-
- 100, 87, 64, 100, 58, 56, 65, 42, 51, 52,
- 53, 90, 40, 57, 61, 66, 40, 54, 59, 55,
- 62, 60, 63, 67, 76, 87, 69, 64, 58, 56,
- 49, 65, 68, 70, 73, 71, 90, 72, 81, 66,
- 74, 45, 46, 75, 82, 44, 83, 84, 67, 91,
- 43, 69, 85, 36, 36, 86, 68, 70, 73, 71,
- 77, 72, 173, 81, 74, 173, 94, 75, 82, 78,
- 79, 83, 84, 91, 80, 86, 36, 36, 86, 35,
- 36, 36, 37, 95, 42, 77, 37, 36, 36, 37,
- 94, 99, 38, 78, 79, 38, 92, 96, 80, 38,
-
- 39, 39, 38, 97, 210, 93, 98, 104, 95, 40,
- 210, 101, 102, 103, 105, 99, 40, 210, 108, 109,
- 92, 110, 96, 106, 111, 112, 210, 113, 97, 93,
- 114, 98, 104, 115, 40, 101, 102, 103, 105, 116,
- 107, 40, 108, 109, 117, 118, 110, 119, 106, 111,
- 112, 113, 120, 125, 114, 122, 121, 115, 85, 36,
- 36, 86, 123, 116, 107, 124, 126, 127, 117, 128,
- 118, 129, 119, 86, 36, 36, 86, 120, 125, 122,
- 130, 121, 131, 138, 100, 133, 123, 100, 134, 124,
- 126, 139, 127, 128, 136, 129, 137, 135, 140, 141,
-
- 142, 143, 144, 146, 130, 145, 147, 131, 138, 133,
- 150, 148, 152, 134, 148, 132, 139, 151, 136, 153,
- 137, 135, 140, 141, 142, 143, 154, 144, 146, 145,
- 147, 155, 156, 157, 150, 158, 149, 152, 159, 132,
- 160, 151, 161, 162, 153, 163, 164, 165, 166, 210,
- 167, 154, 168, 148, 171, 155, 148, 156, 157, 158,
- 149, 172, 174, 159, 160, 175, 161, 162, 176, 177,
- 163, 164, 165, 166, 167, 178, 168, 179, 182, 171,
- 180, 181, 183, 170, 186, 184, 172, 174, 184, 175,
- 188, 184, 176, 177, 184, 173, 189, 190, 173, 178,
-
- 191, 195, 179, 182, 180, 181, 183, 170, 186, 192,
- 184, 196, 197, 184, 188, 184, 187, 198, 184, 185,
- 189, 199, 190, 200, 184, 191, 195, 184, 202, 203,
- 205, 204, 203, 192, 204, 196, 193, 197, 208, 210,
- 210, 187, 198, 185, 194, 199, 203, 204, 200, 203,
- 204, 210, 202, 210, 205, 201, 210, 210, 209, 209,
- 193, 209, 209, 208, 210, 210, 210, 210, 194, 210,
- 210, 210, 210, 207, 210, 210, 210, 210, 210, 201,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 207, 41, 41,
-
- 210, 41, 41, 50, 50, 88, 88, 210, 88, 88,
- 169, 210, 210, 169, 206, 210, 210, 206, 3, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 11,
+ 13, 4, 14, 15, 11, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 24, 26, 27, 28, 29,
+ 30, 24, 31, 32, 33, 24, 24, 34, 24, 24,
+ 24, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 24, 31, 32, 33, 24,
+ 24, 34, 24, 24, 35, 48, 49, 36, 37, 38,
+ 38, 39, 40, 41, 41, 40, 40, 41, 41, 40,
+ 39, 38, 38, 39, 50, 51, 54, 56, 57, 112,
+ 59, 42, 112, 55, 58, 42, 98, 60, 65, 61,
+
+ 98, 66, 84, 63, 44, 70, 48, 49, 52, 62,
+ 71, 54, 56, 57, 59, 100, 42, 55, 58, 64,
+ 42, 60, 65, 61, 67, 66, 101, 84, 63, 75,
+ 70, 68, 85, 62, 71, 72, 47, 69, 76, 73,
+ 100, 46, 86, 64, 81, 44, 87, 95, 74, 67,
+ 82, 101, 99, 83, 75, 68, 77, 85, 102, 247,
+ 72, 69, 76, 78, 73, 79, 86, 80, 81, 88,
+ 87, 95, 74, 247, 82, 89, 99, 83, 90, 91,
+ 247, 77, 40, 102, 92, 40, 247, 78, 247, 79,
+ 145, 80, 247, 145, 88, 93, 38, 38, 94, 89,
+
+ 247, 42, 107, 90, 91, 103, 106, 108, 92, 94,
+ 38, 38, 94, 37, 38, 38, 39, 39, 38, 38,
+ 39, 40, 41, 41, 40, 104, 42, 107, 109, 103,
+ 106, 110, 108, 111, 105, 113, 114, 115, 197, 116,
+ 42, 197, 117, 118, 247, 119, 122, 120, 124, 104,
+ 123, 125, 126, 109, 127, 128, 110, 111, 105, 113,
+ 114, 129, 115, 116, 121, 42, 117, 130, 118, 119,
+ 122, 131, 120, 124, 123, 132, 125, 126, 127, 128,
+ 133, 247, 135, 136, 134, 129, 137, 138, 121, 139,
+ 140, 130, 93, 38, 38, 94, 131, 141, 142, 144,
+
+ 132, 94, 38, 38, 94, 133, 135, 136, 143, 134,
+ 137, 147, 138, 139, 140, 145, 148, 149, 145, 150,
+ 153, 141, 112, 142, 144, 112, 53, 152, 155, 154,
+ 157, 156, 143, 158, 159, 147, 160, 247, 161, 162,
+ 148, 149, 163, 164, 150, 153, 165, 166, 247, 167,
+ 170, 152, 155, 154, 157, 151, 156, 158, 171, 159,
+ 172, 160, 161, 162, 173, 168, 163, 164, 168, 174,
+ 177, 165, 166, 167, 170, 175, 176, 180, 181, 151,
+ 182, 184, 171, 183, 185, 172, 186, 187, 188, 173,
+ 189, 247, 169, 190, 174, 177, 191, 192, 195, 175,
+
+ 176, 180, 196, 181, 198, 182, 184, 183, 185, 168,
+ 186, 187, 168, 188, 199, 189, 169, 205, 190, 201,
+ 191, 192, 202, 195, 203, 204, 206, 196, 207, 198,
+ 208, 236, 209, 213, 236, 197, 215, 210, 197, 199,
+ 210, 194, 205, 201, 216, 211, 202, 217, 203, 204,
+ 206, 210, 207, 218, 210, 208, 209, 213, 214, 211,
+ 215, 219, 221, 210, 220, 194, 210, 220, 216, 226,
+ 225, 211, 217, 227, 228, 247, 229, 223, 218, 230,
+ 247, 212, 221, 214, 231, 219, 220, 221, 232, 220,
+ 247, 234, 222, 226, 224, 225, 235, 223, 227, 228,
+
+ 229, 223, 237, 210, 230, 212, 210, 221, 239, 231,
+ 240, 211, 242, 232, 222, 234, 222, 247, 224, 238,
+ 235, 223, 238, 247, 245, 236, 237, 211, 236, 247,
+ 243, 247, 239, 243, 247, 240, 233, 242, 222, 243,
+ 246, 246, 243, 246, 246, 247, 247, 247, 221, 245,
+ 247, 247, 247, 247, 247, 247, 247, 247, 244, 247,
+ 233, 247, 247, 223, 247, 247, 247, 244, 247, 247,
+ 247, 247, 247, 221, 247, 247, 247, 247, 247, 247,
+ 247, 247, 244, 247, 247, 247, 247, 223, 247, 247,
+ 247, 244, 43, 43, 247, 43, 43, 43, 45, 45,
+
+ 53, 53, 53, 96, 96, 96, 97, 97, 247, 97,
+ 97, 97, 146, 247, 146, 146, 146, 178, 247, 247,
+ 178, 178, 179, 179, 179, 193, 247, 247, 193, 200,
+ 200, 200, 241, 247, 247, 241, 3, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+
+ 247
} ;
-static yyconst flex_int16_t yy_chk[582] =
+static yyconst flex_int16_t yy_chk[702] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -575,64 +601,78 @@ static yyconst flex_int16_t yy_chk[582] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 13, 13, 2, 5, 5, 5, 5,
- 6, 6, 6, 6, 7, 7, 7, 7, 8, 8,
- 8, 8, 14, 14, 16, 18, 19, 6, 21, 23,
- 89, 7, 45, 20, 22, 20, 23, 22, 24, 29,
-
- 60, 40, 25, 60, 21, 20, 25, 41, 16, 18,
- 19, 51, 6, 21, 23, 25, 7, 20, 22, 20,
- 23, 22, 24, 26, 29, 40, 27, 25, 21, 20,
- 15, 25, 26, 27, 28, 27, 51, 27, 31, 25,
- 28, 46, 46, 28, 31, 12, 32, 32, 26, 52,
- 11, 27, 33, 33, 33, 33, 26, 27, 28, 27,
- 30, 27, 153, 31, 28, 153, 54, 28, 31, 30,
- 30, 32, 32, 52, 30, 34, 34, 34, 34, 35,
- 35, 35, 35, 55, 9, 30, 37, 37, 37, 37,
- 54, 59, 38, 30, 30, 38, 53, 56, 30, 39,
-
- 39, 39, 39, 57, 3, 53, 58, 64, 55, 38,
- 0, 62, 62, 63, 65, 59, 39, 0, 67, 68,
- 53, 71, 56, 66, 73, 74, 0, 75, 57, 53,
- 76, 58, 64, 77, 38, 62, 62, 63, 65, 78,
- 66, 39, 67, 68, 79, 80, 71, 81, 66, 73,
- 74, 75, 83, 92, 76, 84, 83, 77, 85, 85,
- 85, 85, 87, 78, 66, 91, 93, 94, 79, 96,
- 80, 97, 81, 86, 86, 86, 86, 83, 92, 84,
- 98, 83, 99, 105, 100, 101, 87, 100, 102, 91,
- 93, 107, 94, 96, 103, 97, 104, 102, 108, 110,
-
- 111, 112, 114, 117, 98, 116, 118, 99, 105, 101,
- 120, 119, 122, 102, 119, 100, 107, 121, 103, 123,
- 104, 102, 108, 110, 111, 112, 124, 114, 117, 116,
- 118, 129, 130, 131, 120, 132, 119, 122, 133, 100,
- 134, 121, 137, 138, 123, 139, 143, 144, 145, 0,
- 146, 124, 147, 148, 151, 129, 148, 130, 131, 132,
- 119, 152, 154, 133, 134, 155, 137, 138, 157, 159,
- 139, 143, 144, 145, 146, 160, 147, 162, 167, 151,
- 164, 165, 168, 148, 172, 169, 152, 154, 169, 155,
- 174, 170, 157, 159, 170, 173, 175, 177, 173, 160,
-
- 178, 187, 162, 167, 164, 165, 168, 148, 172, 180,
- 184, 188, 190, 184, 174, 185, 173, 191, 185, 170,
- 175, 192, 177, 193, 194, 178, 187, 194, 198, 200,
- 202, 201, 200, 180, 201, 188, 184, 190, 207, 0,
- 0, 173, 191, 170, 185, 192, 203, 204, 193, 203,
- 204, 0, 198, 206, 202, 194, 206, 0, 208, 209,
- 184, 208, 209, 207, 0, 0, 0, 0, 185, 0,
- 0, 0, 0, 204, 0, 0, 0, 0, 0, 194,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 204, 211, 211,
-
- 0, 211, 211, 212, 212, 213, 213, 0, 213, 213,
- 214, 0, 0, 214, 215, 0, 0, 215, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210
+ 1, 1, 1, 1, 2, 14, 14, 2, 5, 5,
+ 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
+ 8, 8, 8, 8, 15, 15, 17, 18, 19, 66,
+ 20, 6, 66, 17, 19, 7, 98, 21, 23, 21,
+
+ 48, 23, 31, 22, 43, 26, 49, 49, 16, 21,
+ 26, 17, 18, 19, 20, 55, 6, 17, 19, 22,
+ 7, 21, 23, 21, 25, 23, 56, 31, 22, 28,
+ 26, 25, 32, 21, 26, 27, 13, 25, 28, 27,
+ 55, 12, 32, 22, 30, 9, 32, 42, 27, 25,
+ 30, 56, 54, 30, 28, 25, 29, 32, 57, 3,
+ 27, 25, 28, 29, 27, 29, 32, 29, 30, 33,
+ 32, 42, 27, 0, 30, 33, 54, 30, 34, 34,
+ 0, 29, 40, 57, 34, 40, 0, 29, 0, 29,
+ 145, 29, 0, 145, 33, 35, 35, 35, 35, 33,
+
+ 0, 40, 61, 34, 34, 58, 60, 62, 34, 36,
+ 36, 36, 36, 37, 37, 37, 37, 39, 39, 39,
+ 39, 41, 41, 41, 41, 59, 40, 61, 63, 58,
+ 60, 64, 62, 65, 59, 68, 68, 69, 174, 70,
+ 41, 174, 71, 72, 0, 73, 75, 74, 79, 59,
+ 76, 81, 82, 63, 83, 84, 64, 65, 59, 68,
+ 68, 85, 69, 70, 74, 41, 71, 86, 72, 73,
+ 75, 87, 74, 79, 76, 88, 81, 82, 83, 84,
+ 90, 0, 91, 92, 90, 85, 95, 99, 74, 101,
+ 102, 86, 93, 93, 93, 93, 87, 103, 104, 106,
+
+ 88, 94, 94, 94, 94, 90, 91, 92, 105, 90,
+ 95, 108, 99, 101, 102, 107, 109, 110, 107, 111,
+ 114, 103, 112, 104, 106, 112, 107, 113, 115, 114,
+ 117, 116, 105, 118, 119, 108, 121, 0, 122, 124,
+ 109, 110, 125, 126, 111, 114, 128, 130, 0, 131,
+ 133, 113, 115, 114, 117, 112, 116, 118, 134, 119,
+ 135, 121, 122, 124, 136, 132, 125, 126, 132, 137,
+ 141, 128, 130, 131, 133, 138, 139, 148, 149, 112,
+ 150, 152, 134, 151, 153, 135, 158, 159, 160, 136,
+ 164, 0, 132, 165, 137, 141, 166, 167, 171, 138,
+
+ 139, 148, 172, 149, 176, 150, 152, 151, 153, 168,
+ 158, 159, 168, 160, 177, 164, 132, 187, 165, 180,
+ 166, 167, 182, 171, 184, 185, 189, 172, 190, 176,
+ 191, 231, 192, 196, 231, 197, 199, 193, 197, 177,
+ 193, 168, 187, 180, 201, 193, 182, 203, 184, 185,
+ 189, 194, 190, 204, 194, 191, 192, 196, 197, 194,
+ 199, 206, 211, 212, 210, 168, 212, 210, 201, 215,
+ 214, 212, 203, 217, 218, 0, 219, 211, 204, 221,
+ 0, 194, 210, 197, 222, 206, 220, 211, 223, 220,
+ 0, 228, 210, 215, 212, 214, 230, 210, 217, 218,
+
+ 219, 211, 232, 224, 221, 194, 224, 210, 234, 222,
+ 235, 224, 237, 223, 220, 228, 210, 0, 212, 233,
+ 230, 210, 233, 0, 244, 236, 232, 233, 236, 0,
+ 238, 241, 234, 238, 241, 235, 224, 237, 220, 243,
+ 245, 246, 243, 245, 246, 0, 0, 0, 238, 244,
+ 0, 0, 0, 0, 0, 0, 0, 0, 238, 0,
+ 224, 0, 0, 238, 0, 0, 0, 243, 0, 0,
+ 0, 0, 0, 238, 0, 0, 0, 0, 0, 0,
+ 0, 0, 238, 0, 0, 0, 0, 238, 0, 0,
+ 0, 243, 248, 248, 0, 248, 248, 248, 249, 249,
+
+ 250, 250, 250, 251, 251, 251, 252, 252, 0, 252,
+ 252, 252, 253, 0, 253, 253, 253, 254, 0, 0,
+ 254, 254, 255, 255, 255, 256, 0, 0, 256, 257,
+ 257, 257, 258, 0, 0, 258, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+
+ 247
} ;
static yy_state_type yy_last_accepting_state;
@@ -671,7 +711,8 @@ char *yytext;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-#line 25 "engines/director/lingo/lingo-lex.l"
+#define YY_NO_INPUT 1
+#line 28 "engines/director/lingo/lingo-lex.l"
#define FORBIDDEN_SYMBOL_ALLOW_ALL
@@ -706,7 +747,7 @@ static void countnl() {
g_lingo->_colnumber = strlen(p);
}
-#line 710 "engines/director/lingo/lingo-lex.cpp"
+#line 751 "engines/director/lingo/lingo-lex.cpp"
#define INITIAL 0
@@ -765,8 +806,6 @@ extern int yywrap (void );
#endif
#endif
- static void yyunput (int c,char *buf_ptr );
-
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -891,10 +930,10 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 69 "engines/director/lingo/lingo-lex.l"
+#line 72 "engines/director/lingo/lingo-lex.l"
-#line 898 "engines/director/lingo/lingo-lex.cpp"
+#line 937 "engines/director/lingo/lingo-lex.cpp"
if ( !(yy_init) )
{
@@ -948,13 +987,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 211 )
+ if ( yy_current_state >= 248 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 519 );
+ while ( yy_base[yy_current_state] != 637 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -980,209 +1019,239 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 71 "engines/director/lingo/lingo-lex.l"
+#line 74 "engines/director/lingo/lingo-lex.l"
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 72 "engines/director/lingo/lingo-lex.l"
+#line 75 "engines/director/lingo/lingo-lex.l"
{ count(); }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 73 "engines/director/lingo/lingo-lex.l"
+#line 76 "engines/director/lingo/lingo-lex.l"
{ count(); return ' '; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 75 "engines/director/lingo/lingo-lex.l"
-{ count(); return tAND; }
+#line 78 "engines/director/lingo/lingo-lex.l"
+{ count(); yylval.s = new Common::String(yytext); return SYMBOL; } // D3
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 76 "engines/director/lingo/lingo-lex.l"
-{ count(); return tCONTAINS; }
+#line 80 "engines/director/lingo/lingo-lex.l"
+{ count(); return tAFTER; } // D3
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 77 "engines/director/lingo/lingo-lex.l"
-{ count(); return tDONE; }
+#line 81 "engines/director/lingo/lingo-lex.l"
+{ count(); return tAND; }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 78 "engines/director/lingo/lingo-lex.l"
-{ count(); return tDOWN; }
+#line 82 "engines/director/lingo/lingo-lex.l"
+{ count(); return tBEFORE; } // D3
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 79 "engines/director/lingo/lingo-lex.l"
-{ count(); return tIF; }
+#line 83 "engines/director/lingo/lingo-lex.l"
+{ count(); return tCHAR; } // D3
YY_BREAK
case 9:
-/* rule 9 can match eol */
YY_RULE_SETUP
-#line 80 "engines/director/lingo/lingo-lex.l"
-{ countnl(); return tNLELSIF; }
+#line 84 "engines/director/lingo/lingo-lex.l"
+{ count(); return tCONTAINS; }
YY_BREAK
case 10:
-/* rule 10 can match eol */
YY_RULE_SETUP
-#line 81 "engines/director/lingo/lingo-lex.l"
-{ countnl(); return tNLELSE; }
+#line 85 "engines/director/lingo/lingo-lex.l"
+{ count(); return tDONE; }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 82 "engines/director/lingo/lingo-lex.l"
-{ count(); return tELSE; }
+#line 86 "engines/director/lingo/lingo-lex.l"
+{ count(); return tDOWN; }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 83 "engines/director/lingo/lingo-lex.l"
-{ count(); return tEND; }
+#line 87 "engines/director/lingo/lingo-lex.l"
+{ count(); return tIF; }
YY_BREAK
case 13:
+/* rule 13 can match eol */
YY_RULE_SETUP
-#line 84 "engines/director/lingo/lingo-lex.l"
-{ count(); return tFACTORY; }
+#line 88 "engines/director/lingo/lingo-lex.l"
+{ countnl(); return tNLELSIF; }
YY_BREAK
case 14:
+/* rule 14 can match eol */
YY_RULE_SETUP
-#line 85 "engines/director/lingo/lingo-lex.l"
-{ count(); return tEXIT; }
+#line 89 "engines/director/lingo/lingo-lex.l"
+{ countnl(); return tNLELSE; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 86 "engines/director/lingo/lingo-lex.l"
-{ count(); return tFRAME; }
+#line 90 "engines/director/lingo/lingo-lex.l"
+{ count(); return tELSE; }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 87 "engines/director/lingo/lingo-lex.l"
-{ count(); return tGLOBAL; }
+#line 91 "engines/director/lingo/lingo-lex.l"
+{
+ count();
+
+ const char *ptr = &yytext[4]; // Skip 'end '
+ while (*ptr == ' ' || *ptr == '\t')
+ ptr++;
+
+ yylval.s = new Common::String(ptr);
+
+ return ENDCLAUSE;
+ }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 88 "engines/director/lingo/lingo-lex.l"
-{ count(); return tGO; }
+#line 102 "engines/director/lingo/lingo-lex.l"
+{ count(); return tFACTORY; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 89 "engines/director/lingo/lingo-lex.l"
-{ count(); return tGO; }
+#line 103 "engines/director/lingo/lingo-lex.l"
+{ count(); return tEXIT; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 90 "engines/director/lingo/lingo-lex.l"
-{ count(); return tINSTANCE; }
+#line 104 "engines/director/lingo/lingo-lex.l"
+{ count(); return tFRAME; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 91 "engines/director/lingo/lingo-lex.l"
-{ count(); return tINTERSECTS; }
+#line 105 "engines/director/lingo/lingo-lex.l"
+{ count(); return tGLOBAL; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 92 "engines/director/lingo/lingo-lex.l"
-{ count(); return tINTO; }
+#line 106 "engines/director/lingo/lingo-lex.l"
+{ count(); return tGO; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 93 "engines/director/lingo/lingo-lex.l"
-{ count(); return tLOOP; }
+#line 107 "engines/director/lingo/lingo-lex.l"
+{ count(); return tGO; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 94 "engines/director/lingo/lingo-lex.l"
-{ count(); return tMACRO; }
+#line 108 "engines/director/lingo/lingo-lex.l"
+{ count(); return tINSTANCE; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 95 "engines/director/lingo/lingo-lex.l"
-{ count(); return tME; }
+#line 109 "engines/director/lingo/lingo-lex.l"
+{ count(); return tINTERSECTS; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 96 "engines/director/lingo/lingo-lex.l"
-{ count(); return tMETHOD; }
+#line 110 "engines/director/lingo/lingo-lex.l"
+{ count(); return tINTO; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 97 "engines/director/lingo/lingo-lex.l"
-{ count(); return tMOD; }
+#line 111 "engines/director/lingo/lingo-lex.l"
+{ count(); return tITEM; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 98 "engines/director/lingo/lingo-lex.l"
-{ count(); return tMOVIE; }
+#line 112 "engines/director/lingo/lingo-lex.l"
+{ count(); return tLINE; }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 99 "engines/director/lingo/lingo-lex.l"
-{ count(); return tNEXT; }
+#line 113 "engines/director/lingo/lingo-lex.l"
+{ count(); return tLOOP; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 100 "engines/director/lingo/lingo-lex.l"
-{ count(); return tNOT; }
+#line 114 "engines/director/lingo/lingo-lex.l"
+{ count(); return tMACRO; }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 101 "engines/director/lingo/lingo-lex.l"
-{ count(); return tOF; }
+#line 115 "engines/director/lingo/lingo-lex.l"
+{ count(); return tMETHOD; }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 102 "engines/director/lingo/lingo-lex.l"
-{ count(); return tON; }
+#line 116 "engines/director/lingo/lingo-lex.l"
+{ count(); return tMOD; }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 103 "engines/director/lingo/lingo-lex.l"
-{ count(); return tOPEN; }
+#line 117 "engines/director/lingo/lingo-lex.l"
+{ count(); return tMOVIE; }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 104 "engines/director/lingo/lingo-lex.l"
-{ count(); return tOR; }
+#line 118 "engines/director/lingo/lingo-lex.l"
+{ count(); return tNEXT; }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 105 "engines/director/lingo/lingo-lex.l"
-{ count(); return tPLAY; }
+#line 119 "engines/director/lingo/lingo-lex.l"
+{ count(); return tNOT; }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 106 "engines/director/lingo/lingo-lex.l"
-{ count(); return tPREVIOUS; }
+#line 120 "engines/director/lingo/lingo-lex.l"
+{ count(); return tOF; }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 107 "engines/director/lingo/lingo-lex.l"
-{ count(); return tPUT; }
+#line 121 "engines/director/lingo/lingo-lex.l"
+{ count(); return tON; } // D3
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 108 "engines/director/lingo/lingo-lex.l"
-{ count(); return tREPEAT; }
+#line 122 "engines/director/lingo/lingo-lex.l"
+{ count(); return tOPEN; }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 109 "engines/director/lingo/lingo-lex.l"
-{ count(); return tSET; }
+#line 123 "engines/director/lingo/lingo-lex.l"
+{ count(); return tOR; }
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 110 "engines/director/lingo/lingo-lex.l"
-{ count(); return tSOUND; }
+#line 124 "engines/director/lingo/lingo-lex.l"
+{ count(); return tPLAY; }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 111 "engines/director/lingo/lingo-lex.l"
-{ count(); return tSTARTS; }
+#line 125 "engines/director/lingo/lingo-lex.l"
+{ count(); return tPREVIOUS; }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 112 "engines/director/lingo/lingo-lex.l"
+#line 126 "engines/director/lingo/lingo-lex.l"
+{ count(); return tPUT; }
+ YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 127 "engines/director/lingo/lingo-lex.l"
+{ count(); return tREPEAT; }
+ YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 128 "engines/director/lingo/lingo-lex.l"
+{ count(); return tSET; }
+ YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 129 "engines/director/lingo/lingo-lex.l"
+{ count(); return tSTARTS; }
+ YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 130 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1192,9 +1261,9 @@ YY_RULE_SETUP
return THEENTITYWITHID;
}
YY_BREAK
-case 42:
+case 46:
YY_RULE_SETUP
-#line 120 "engines/director/lingo/lingo-lex.l"
+#line 138 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1236,9 +1305,44 @@ YY_RULE_SETUP
warning("Unhandled the entity %s", ptr);
}
YY_BREAK
-case 43:
+case 47:
YY_RULE_SETUP
-#line 160 "engines/director/lingo/lingo-lex.l"
+#line 178 "engines/director/lingo/lingo-lex.l"
+{
+ count();
+
+ const char *ptr = &yytext[4]; // Skip 'the '
+ while (*ptr == ' ' || *ptr == '\t')
+ ptr++;
+
+ Common::String field;
+ while (*ptr != ' ' && *ptr != '\t')
+ field += *ptr++;
+
+ while (*ptr == ' ' || *ptr == '\t')
+ ptr++;
+
+ field = Common::String::format("%d%s", g_lingo->_theEntities[ptr]->entity, field.c_str());
+
+ if (!g_lingo->_theEntityFields.contains(field)) {
+ error("Unhandled the field %s", ptr);
+ }
+
+ if (g_lingo->_theEntityFields[field]->entity != g_lingo->_theEntities[ptr]->entity)
+ error("Unsupported field '%s' for entity '%s'", field.c_str(), ptr);
+
+ yylval.e[0] = g_lingo->_theEntities[ptr]->entity;
+ yylval.e[1] = g_lingo->_theEntityFields[field]->field;
+
+ if (g_lingo->_theEntities[ptr]->hasId)
+ return THEENTITYWITHID;
+ else
+ return THEENTITY;
+ }
+ YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 209 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1259,81 +1363,98 @@ YY_RULE_SETUP
warning("Unhandled the entity %s", ptr);
}
YY_BREAK
-case 44:
+case 49:
YY_RULE_SETUP
-#line 179 "engines/director/lingo/lingo-lex.l"
+#line 228 "engines/director/lingo/lingo-lex.l"
{ count(); return tTHEN; }
YY_BREAK
-case 45:
+case 50:
YY_RULE_SETUP
-#line 180 "engines/director/lingo/lingo-lex.l"
+#line 229 "engines/director/lingo/lingo-lex.l"
{ count(); return tTO; }
YY_BREAK
-case 46:
+case 51:
YY_RULE_SETUP
-#line 181 "engines/director/lingo/lingo-lex.l"
+#line 230 "engines/director/lingo/lingo-lex.l"
{ count(); return tSPRITE; }
YY_BREAK
-case 47:
+case 52:
YY_RULE_SETUP
-#line 182 "engines/director/lingo/lingo-lex.l"
+#line 231 "engines/director/lingo/lingo-lex.l"
{ count(); return tWITH; }
YY_BREAK
-case 48:
+case 53:
YY_RULE_SETUP
-#line 183 "engines/director/lingo/lingo-lex.l"
+#line 232 "engines/director/lingo/lingo-lex.l"
{ count(); return tWITHIN; }
YY_BREAK
-case 49:
+case 54:
YY_RULE_SETUP
-#line 184 "engines/director/lingo/lingo-lex.l"
+#line 233 "engines/director/lingo/lingo-lex.l"
{ count(); return tWHEN; }
YY_BREAK
-case 50:
+case 55:
YY_RULE_SETUP
-#line 185 "engines/director/lingo/lingo-lex.l"
+#line 234 "engines/director/lingo/lingo-lex.l"
{ count(); return tWHILE; }
YY_BREAK
-case 51:
+case 56:
+YY_RULE_SETUP
+#line 235 "engines/director/lingo/lingo-lex.l"
+{ count(); return tWORD; }
+ YY_BREAK
+case 57:
YY_RULE_SETUP
-#line 187 "engines/director/lingo/lingo-lex.l"
+#line 237 "engines/director/lingo/lingo-lex.l"
{ count(); return tNEQ; }
YY_BREAK
-case 52:
+case 58:
YY_RULE_SETUP
-#line 188 "engines/director/lingo/lingo-lex.l"
+#line 238 "engines/director/lingo/lingo-lex.l"
{ count(); return tGE; }
YY_BREAK
-case 53:
+case 59:
YY_RULE_SETUP
-#line 189 "engines/director/lingo/lingo-lex.l"
+#line 239 "engines/director/lingo/lingo-lex.l"
{ count(); return tLE; }
YY_BREAK
-case 54:
+case 60:
YY_RULE_SETUP
-#line 190 "engines/director/lingo/lingo-lex.l"
+#line 240 "engines/director/lingo/lingo-lex.l"
{ count(); return tCONCAT; }
YY_BREAK
-case 55:
+case 61:
YY_RULE_SETUP
-#line 192 "engines/director/lingo/lingo-lex.l"
+#line 242 "engines/director/lingo/lingo-lex.l"
{
count();
yylval.s = new Common::String(yytext);
- if (g_lingo->_handlers.contains(yytext)) {
- if (g_lingo->_handlers[yytext]->type == BLTIN && g_lingo->_handlers[yytext]->parens == false) {
- if (g_lingo->_handlers[yytext]->nargs == 0) {
- if (g_lingo->_handlers[yytext]->maxArgs == 0)
+ if (g_lingo->_ignoreMe && yylval.s->equalsIgnoreCase("me"))
+ return ID;
+
+ if (g_lingo->_twoWordBuiltins.contains(yytext))
+ return TWOWORDBUILTIN;
+
+ // Special treatment of 'me'. First parameter is method name
+ if (!g_lingo->_currentFactory.empty()) {
+ if (yylval.s->equalsIgnoreCase("me"))
+ return tME;
+ }
+
+ if (g_lingo->_builtins.contains(yytext)) {
+ if (g_lingo->_builtins[yytext]->type == BLTIN && g_lingo->_builtins[yytext]->parens == false) {
+ if (g_lingo->_builtins[yytext]->nargs == 0) {
+ if (g_lingo->_builtins[yytext]->maxArgs == 0)
return BLTINNOARGS;
- else if (g_lingo->_handlers[yytext]->maxArgs == 1)
+ else if (g_lingo->_builtins[yytext]->maxArgs == 1)
return BLTINNOARGSORONE;
else
error("Incorrect setup for builtin: %s", yytext);
- } else if (g_lingo->_handlers[yytext]->nargs == 1 &&
- g_lingo->_handlers[yytext]->maxArgs == 1) {
+ } else if (g_lingo->_builtins[yytext]->nargs == 1 &&
+ g_lingo->_builtins[yytext]->maxArgs == 1) {
return BLTINONEARG;
- } else if (g_lingo->_handlers[yytext]->nargs == -1) {
+ } else if (g_lingo->_builtins[yytext]->nargs == -1) {
return BLTINARGLIST;
} else {
error("Incorrect setup for builtin: %s", yytext);
@@ -1344,43 +1465,43 @@ YY_RULE_SETUP
return ID;
}
YY_BREAK
-case 56:
+case 62:
YY_RULE_SETUP
-#line 218 "engines/director/lingo/lingo-lex.l"
+#line 280 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.f = atof(yytext); return FLOAT; }
YY_BREAK
-case 57:
+case 63:
YY_RULE_SETUP
-#line 219 "engines/director/lingo/lingo-lex.l"
+#line 281 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; }
YY_BREAK
-case 58:
+case 64:
YY_RULE_SETUP
-#line 220 "engines/director/lingo/lingo-lex.l"
+#line 282 "engines/director/lingo/lingo-lex.l"
{ count(); return *yytext; }
YY_BREAK
-case 59:
-/* rule 59 can match eol */
+case 65:
+/* rule 65 can match eol */
YY_RULE_SETUP
-#line 221 "engines/director/lingo/lingo-lex.l"
+#line 283 "engines/director/lingo/lingo-lex.l"
{ return '\n'; }
YY_BREAK
-case 60:
+case 66:
YY_RULE_SETUP
-#line 222 "engines/director/lingo/lingo-lex.l"
+#line 284 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
YY_BREAK
-case 61:
+case 67:
YY_RULE_SETUP
-#line 223 "engines/director/lingo/lingo-lex.l"
+#line 285 "engines/director/lingo/lingo-lex.l"
YY_BREAK
-case 62:
+case 68:
YY_RULE_SETUP
-#line 225 "engines/director/lingo/lingo-lex.l"
+#line 287 "engines/director/lingo/lingo-lex.l"
ECHO;
YY_BREAK
-#line 1384 "engines/director/lingo/lingo-lex.cpp"
+#line 1505 "engines/director/lingo/lingo-lex.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1673,7 +1794,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 211 )
+ if ( yy_current_state >= 248 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1701,52 +1822,15 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 211 )
+ if ( yy_current_state >= 248 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 210);
+ yy_is_jam = (yy_current_state == 247);
return yy_is_jam ? 0 : yy_current_state;
}
- static void yyunput (int c, register char * yy_bp )
-{
- register char *yy_cp;
-
- yy_cp = (yy_c_buf_p);
-
- /* undo effects of setting up yytext */
- *yy_cp = (yy_hold_char);
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register yy_size_t number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
- (yytext_ptr) = yy_bp;
- (yy_hold_char) = *yy_cp;
- (yy_c_buf_p) = yy_cp;
-}
-
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void)
@@ -2380,7 +2464,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 225 "engines/director/lingo/lingo-lex.l"
+#line 287 "engines/director/lingo/lingo-lex.l"
@@ -2391,7 +2475,7 @@ namespace Director {
int Lingo::parse(const char *code) {
YY_BUFFER_STATE bp;
- if (debugChannelSet(10, kDebugLingoCompile))
+ if (debugChannelSet(-1, kDebugLingoCompile))
yydebug = 1;
else
yydebug = 0;
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index 882e06d0f8..5afe926913 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -21,6 +21,9 @@
*/
%option noyywrap
+%option nounput
+%option noinput
+
%{
#define FORBIDDEN_SYMBOL_ALLOW_ALL
@@ -62,7 +65,7 @@ identifier [_[:alpha:]][_[:alnum:]]*
constfloat [[:digit:]]+\.[[:digit:]]*
constinteger [[:digit:]]+
conststring \"[^\"\r\n]*\"
-operator [-+*/%=^:,()><&]
+operator [-+*/%=^:,()><&\[\]]
newline [ \t]*[\n\r]
whitespace [\t ]
@@ -72,7 +75,12 @@ whitespace [\t ]
^{whitespace}+ { count(); }
[\t]+ { count(); return ' '; }
+[#]{identifier} { count(); yylval.s = new Common::String(yytext); return SYMBOL; } // D3
+
+(?i:after) { count(); return tAFTER; } // D3
(?i:and) { count(); return tAND; }
+(?i:before) { count(); return tBEFORE; } // D3
+(?i:char) { count(); return tCHAR; } // D3
(?i:contains) { count(); return tCONTAINS; }
(?i:done) { count(); return tDONE; }
(?i:down) { count(); return tDOWN; }
@@ -80,7 +88,17 @@ whitespace [\t ]
(?i:[\n\r]+[\t ]*else[\t ]+if) { countnl(); return tNLELSIF; }
(?i:[\n\r]+[\t ]*else) { countnl(); return tNLELSE; }
(?i:else) { count(); return tELSE; }
-(?i:end) { count(); return tEND; }
+(?i:end)([\t ]*{identifier})? {
+ count();
+
+ const char *ptr = &yytext[4]; // Skip 'end '
+ while (*ptr == ' ' || *ptr == '\t')
+ ptr++;
+
+ yylval.s = new Common::String(ptr);
+
+ return ENDCLAUSE;
+ }
(?i:factory) { count(); return tFACTORY; }
(?i:exit) { count(); return tEXIT; }
(?i:frame) { count(); return tFRAME; }
@@ -90,16 +108,17 @@ whitespace [\t ]
(?i:instance) { count(); return tINSTANCE; }
(?i:intersects) { count(); return tINTERSECTS; }
(?i:into) { count(); return tINTO; }
+(?i:item) { count(); return tITEM; }
+(?i:line) { count(); return tLINE; }
(?i:loop) { count(); return tLOOP; }
(?i:macro) { count(); return tMACRO; }
-(?i:me) { count(); return tME; }
(?i:method) { count(); return tMETHOD; }
(?i:mod) { count(); return tMOD; }
(?i:movie) { count(); return tMOVIE; }
(?i:next) { count(); return tNEXT; }
(?i:not) { count(); return tNOT; }
(?i:of) { count(); return tOF; }
-(?i:on) { count(); return tON; }
+(?i:on) { count(); return tON; } // D3
(?i:open) { count(); return tOPEN; }
(?i:or) { count(); return tOR; }
(?i:play) { count(); return tPLAY; }
@@ -107,7 +126,6 @@ whitespace [\t ]
(?i:put) { count(); return tPUT; }
(?i:repeat) { count(); return tREPEAT; }
(?i:set) { count(); return tSET; }
-(?i:sound) { count(); return tSOUND; }
(?i:starts) { count(); return tSTARTS; }
(?i:the[ \t]+sqrt[\t ]+of[\t ]+) {
count();
@@ -157,6 +175,37 @@ whitespace [\t ]
warning("Unhandled the entity %s", ptr);
}
+(?i:the[ \t]+[[:alpha:]]+[ \t+](date|time)) {
+ count();
+
+ const char *ptr = &yytext[4]; // Skip 'the '
+ while (*ptr == ' ' || *ptr == '\t')
+ ptr++;
+
+ Common::String field;
+ while (*ptr != ' ' && *ptr != '\t')
+ field += *ptr++;
+
+ while (*ptr == ' ' || *ptr == '\t')
+ ptr++;
+
+ field = Common::String::format("%d%s", g_lingo->_theEntities[ptr]->entity, field.c_str());
+
+ if (!g_lingo->_theEntityFields.contains(field)) {
+ error("Unhandled the field %s", ptr);
+ }
+
+ if (g_lingo->_theEntityFields[field]->entity != g_lingo->_theEntities[ptr]->entity)
+ error("Unsupported field '%s' for entity '%s'", field.c_str(), ptr);
+
+ yylval.e[0] = g_lingo->_theEntities[ptr]->entity;
+ yylval.e[1] = g_lingo->_theEntityFields[field]->field;
+
+ if (g_lingo->_theEntities[ptr]->hasId)
+ return THEENTITYWITHID;
+ else
+ return THEENTITY;
+ }
(?i:the[ \t]+[[:alpha:]]+) {
count();
@@ -183,6 +232,7 @@ whitespace [\t ]
(?i:within) { count(); return tWITHIN; }
(?i:when) { count(); return tWHEN; }
(?i:while) { count(); return tWHILE; }
+(?i:word) { count(); return tWORD; }
[<][>] { count(); return tNEQ; }
[>][=] { count(); return tGE; }
@@ -193,19 +243,31 @@ whitespace [\t ]
count();
yylval.s = new Common::String(yytext);
- if (g_lingo->_handlers.contains(yytext)) {
- if (g_lingo->_handlers[yytext]->type == BLTIN && g_lingo->_handlers[yytext]->parens == false) {
- if (g_lingo->_handlers[yytext]->nargs == 0) {
- if (g_lingo->_handlers[yytext]->maxArgs == 0)
+ if (g_lingo->_ignoreMe && yylval.s->equalsIgnoreCase("me"))
+ return ID;
+
+ if (g_lingo->_twoWordBuiltins.contains(yytext))
+ return TWOWORDBUILTIN;
+
+ // Special treatment of 'me'. First parameter is method name
+ if (!g_lingo->_currentFactory.empty()) {
+ if (yylval.s->equalsIgnoreCase("me"))
+ return tME;
+ }
+
+ if (g_lingo->_builtins.contains(yytext)) {
+ if (g_lingo->_builtins[yytext]->type == BLTIN && g_lingo->_builtins[yytext]->parens == false) {
+ if (g_lingo->_builtins[yytext]->nargs == 0) {
+ if (g_lingo->_builtins[yytext]->maxArgs == 0)
return BLTINNOARGS;
- else if (g_lingo->_handlers[yytext]->maxArgs == 1)
+ else if (g_lingo->_builtins[yytext]->maxArgs == 1)
return BLTINNOARGSORONE;
else
error("Incorrect setup for builtin: %s", yytext);
- } else if (g_lingo->_handlers[yytext]->nargs == 1 &&
- g_lingo->_handlers[yytext]->maxArgs == 1) {
+ } else if (g_lingo->_builtins[yytext]->nargs == 1 &&
+ g_lingo->_builtins[yytext]->maxArgs == 1) {
return BLTINONEARG;
- } else if (g_lingo->_handlers[yytext]->nargs == -1) {
+ } else if (g_lingo->_builtins[yytext]->nargs == -1) {
return BLTINARGLIST;
} else {
error("Incorrect setup for builtin: %s", yytext);
@@ -231,7 +293,7 @@ namespace Director {
int Lingo::parse(const char *code) {
YY_BUFFER_STATE bp;
- if (debugChannelSet(10, kDebugLingoCompile))
+ if (debugChannelSet(-1, kDebugLingoCompile))
yydebug = 1;
else
yydebug = 0;
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 208ef059bc..81dc490897 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -29,11 +29,13 @@ namespace Director {
class Sprite;
TheEntity entities[] = {
+ { kTheActorList, "actorList", false }, // D4 property
{ kTheBeepOn, "beepOn", false }, // D2 property
{ kTheButtonStyle, "buttonStyle", false }, // D2 p
{ kTheCast, "cast", true }, // D3
- { kTheCastMembers, "castmembers", true }, // D3
+ { kTheCastMembers, "castmembers", false }, // D3
{ kTheCenterStage, "centerStage", false }, // D2 p
+ { kTheChars, "chars", false }, // D3
{ kTheCheckBoxAccess, "checkBoxAccess", false }, // D2 p
{ kTheCheckBoxType, "checkBoxType", false }, // D2 p
{ kTheClickOn, "clickOn", false }, // D2 function
@@ -41,36 +43,46 @@ TheEntity entities[] = {
{ kTheColorQD, "colorQD", false }, // D2 f
{ kTheCommandDown, "commandDown", false }, // D2 f
{ kTheControlDown, "controlDown", false }, // D2 f
+ { kTheDate, "date", false }, // D3
{ kTheDoubleClick, "doubleClick", false }, // D2 f
{ kTheExitLock, "exitLock", false }, // D2 p
+ { kTheField, "field", true }, // D3
{ kTheFixStageSize, "fixStageSize", false }, // D2 p
- { kTheFloatPrecision, "floatPrecision", false },
+ { kTheFloatPrecision, "floatPrecision", false }, // D3 p
{ kTheFrame, "frame", false }, // D2 f
{ kTheFreeBlock, "freeBlock", false }, // D2 f
{ kTheFreeBytes, "freeBytes", false }, // D2 f
{ kTheFullColorPermit, "fullColorPermit", false }, // D2 p
{ kTheImageDirect, "imageDirect", false }, // D2 p
+ { kTheItems, "items", false }, // D3
{ kTheItemDelimiter, "itemDelimiter", false },
{ kTheKey, "key", false }, // D2 f
{ kTheKeyCode, "keyCode", false }, // D2 f
{ kTheKeyDownScript, "keyDownScript", false }, // D2 p
+ { kTheLabelList, "labelList", false }, // D3 f
{ kTheLastClick, "lastClick", false }, // D2 f
{ kTheLastEvent, "lastEvent", false }, // D2 f
{ kTheLastFrame, "lastFrame", false },
{ kTheLastKey, "lastKey", false }, // D2 f
{ kTheLastRoll, "lastRoll", false }, // D2 f
+ { kTheLines, "lines", false }, // D3
{ kTheMachineType, "machineType", false }, // D2 f
{ kTheMemorySize, "memorySize", false }, // D2 f
{ kTheMenu, "menu", true },
{ kTheMenus, "menus", false },
{ kTheMenuItem, "menuitem", true },
{ kTheMenuItems, "menuitems", false },
+ { kTheMouseCast, "mouseCast", false }, // D3 f
+ { kTheMouseChar, "mouseChar", false }, // D3 f
{ kTheMouseDown, "mouseDown", false }, // D2 f
{ kTheMouseDownScript, "mouseDownScript", false }, // D2 p
{ kTheMouseH, "mouseH", false }, // D2 f
+ { kTheMouseItem, "mouseItem", false }, // D3 f
+ { kTheMouseLine, "mouseLine", false }, // D3 f
{ kTheMouseUp, "mouseUp", false }, // D2 f
{ kTheMouseUpScript, "mouseUpScript", false }, // D2 p
{ kTheMouseV, "mouseV", false }, // D2 f
+ { kTheMouseWord, "mouseWord", false }, // D3 f
{ kTheMovie, "movie", false }, // D2 f
{ kTheMultiSound, "multiSound", false },
{ kTheOptionDown, "optionDown", false }, // D2 f
@@ -83,13 +95,16 @@ TheEntity entities[] = {
{ kTheRightMouseUp, "rightMouseUp", false },
{ kTheRomanLingo, "romanLingo", false },
{ kTheSelection, "selection", false }, // D2 f
+ { kTheSelEnd, "selEnd", false }, // D2 p
+ { kTheSelStart, "selStart", false }, // D2 p
{ kTheShiftDown, "shiftDown", false }, // D2 f
{ kTheSoundEnabled, "soundEnabled", false }, // D2 p
{ kTheSoundLevel, "soundLevel", false }, // D2 p
- { kTheSprite, "sprite", true },
+ { kTheSprite, "sprite", true }, // D4
{ kTheSqrt, "sqrt", false }, // D2 f
{ kTheStage, "stage", false },
{ kTheStageBottom, "stageBottom", false }, // D2 f
+ { kTheStageColor, "stageColor", false }, // D3 p
{ kTheStageLeft, "stageLeft", false }, // D2 f
{ kTheStageRight, "stageRight", false }, // D2 f
{ kTheStageTop, "stageTop", false }, // D2 f
@@ -102,8 +117,10 @@ TheEntity entities[] = {
{ kTheTimeoutMouse, "timeoutMouse", false }, // D2 p
{ kTheTimeoutPlay, "timeoutPlay", false }, // D2 p
{ kTheTimeoutScript, "timeoutScript", false }, // D2 p
+ { kTheTime, "time", false }, // D3 f
{ kTheTimer, "timer", false }, // D2 p
{ kTheWindow, "window", false },
+ { kTheWords, "words", false }, // D3
{ kTheNOEntity, NULL, false }
};
@@ -144,7 +161,7 @@ TheEntityField fields[] = {
{ kTheCastMembers, "number", kTheNumber }, // D3 p
// Common cast fields
- { kTheCast, "castType", kTheCastType },
+ { kTheCast, "castType", kTheCastType }, // D4 p
{ kTheCast, "filename", kTheFilename },
{ kTheCast, "height", kTheHeight },
{ kTheCast, "loaded", kTheLoaded },
@@ -177,11 +194,16 @@ TheEntityField fields[] = {
// TextCast fields
{ kTheCast, "hilite", kTheHilite }, // D2 p
- { kTheCast, "selEnd", kTheSelEnd }, // D2 p
- { kTheCast, "selStart", kTheSelStart }, // D2 p
{ kTheCast, "size", kTheSize },
{ kTheCast, "text", kTheText }, // D2 p
+ // Field fields
+ { kTheField, "textAlign", kTheTextAlign }, // D3 p
+ { kTheField, "textFont", kTheTextFont }, // D3 p
+ { kTheField, "textHeight", kTheTextheight }, // D3 p
+ { kTheField, "textSize", kTheTextSize }, // D3 p
+ { kTheField, "textStyle", kTheTextStyle }, // D3 p
+
{ kTheWindow, "drawRect", kTheDrawRect },
{ kTheWindow, "filename", kTheFilename },
{ kTheWindow, "sourceRect", kTheSourceRect },
@@ -194,8 +216,23 @@ TheEntityField fields[] = {
{ kTheMenu, "name", kTheName }, // D3 p
+ { kTheChars, "number", kTheNumber }, // D3 p
+ { kTheItems, "number", kTheNumber }, // D3 p
+ { kTheLines, "number", kTheNumber }, // D3 p
{ kTheMenuItems,"number", kTheNumber }, // D3 p
{ kTheMenus, "number", kTheNumber }, // D3 p
+ { kTheWords, "number", kTheNumber }, // D3 p
+
+ { kTheDate, "short", kTheShort }, // D3 f
+ { kTheDate, "long", kTheLong }, // D3 f
+ { kTheDate, "abbreviated", kTheAbbr }, // D3 f
+ { kTheDate, "abbrev", kTheAbbr }, // D3 f
+ { kTheDate, "abbr", kTheAbbr }, // D3 f
+ { kTheTime, "short", kTheShort }, // D3 f
+ { kTheTime, "long", kTheLong }, // D3 f
+ { kTheTime, "abbreviated", kTheAbbr }, // D3 f
+ { kTheTime, "abbrev", kTheAbbr }, // D3 f
+ { kTheTime, "abbr", kTheAbbr }, // D3 f
{ kTheNOEntity, NULL, kTheNOField }
};
diff --git a/engines/director/lingo/lingo-the.h b/engines/director/lingo/lingo-the.h
index 4f09f677fa..82b679ee99 100644
--- a/engines/director/lingo/lingo-the.h
+++ b/engines/director/lingo/lingo-the.h
@@ -27,89 +27,104 @@ namespace Director {
enum TheEntityType {
kTheNOEntity = 0,
- kTheFrame = 1,
- kTheFreeBlock,
- kTheFreeBytes,
- kThePathName,
- kTheMenu,
- kTheMenuItem,
- kTheMenuItems,
- kTheMenus,
- kTheMovie,
- kTheMouseH,
- kTheMouseV,
- kTheMouseDownScript,
- kTheMouseUpScript,
-
- kTheSprite,
- kTheCast,
- kTheCastMembers,
- kThePerFrameHook,
- kTheTicks,
- kTheTimer,
- kTheTimeoutKeydown,
- kTheTimeoutLapsed,
- kTheTimeoutLength,
- kTheTimeoutMouse,
- kTheTimeoutPlay,
- kTheTimeoutScript,
- kTheWindow,
-
+ kTheActorList = 1,
kTheBeepOn,
kTheButtonStyle,
+ kTheCast,
+ kTheCastMembers,
kTheCenterStage,
+ kTheChars,
kTheCheckBoxAccess,
kTheCheckBoxType,
kTheClickOn,
- kTheControlDown,
+ kTheColorDepth,
+ kTheColorQD,
kTheCommandDown,
+ kTheControlDown,
+ kTheDate,
kTheDoubleClick,
+ kTheExitLock,
+ kTheField,
kTheFixStageSize,
+ kTheFloatPrecision,
+ kTheFrame,
+ kTheFreeBlock,
+ kTheFreeBytes,
kTheFullColorPermit,
kTheImageDirect,
+ kTheItemDelimiter,
+ kTheItems,
kTheKey,
- kTheKeyDownScript,
kTheKeyCode,
+ kTheKeyDownScript,
+ kTheLabelList,
kTheLastClick,
kTheLastEvent,
kTheLastFrame,
kTheLastKey,
kTheLastRoll,
+ kTheLines,
kTheMachineType,
kTheMemorySize,
+ kTheMenu,
+ kTheMenuItem,
+ kTheMenuItems,
+ kTheMenus,
+ kTheMouseCast,
+ kTheMouseChar,
kTheMouseDown,
+ kTheMouseDownScript,
+ kTheMouseH,
+ kTheMouseItem,
+ kTheMouseLine,
kTheMouseUp,
+ kTheMouseUpScript,
+ kTheMouseV,
+ kTheMouseWord,
+ kTheMovie,
+ kTheMultiSound,
kTheOptionDown,
+ kThePathName,
kThePauseState,
- kTheRightMouseUp,
- kTheRightMouseDown,
- kTheSoundEnabled,
- kTheSoundLevel,
- kTheStillDown,
- kTheSwitchColorDepth,
+ kThePerFrameHook,
+ kThePreloadEventAbort,
kTheResult,
+ kTheRightMouseDown,
+ kTheRightMouseUp,
+ kTheRomanLingo,
kTheSelection,
+ kTheSelEnd,
+ kTheSelStart,
kTheShiftDown,
+ kTheSoundEnabled,
+ kTheSoundLevel,
+ kTheSprite,
kTheSqrt,
-
- kTheColorDepth,
- kTheColorQD,
- kTheExitLock,
- kTheFloatPrecision,
- kTheItemDelimiter,
- kTheMultiSound,
- kThePreloadEventAbort,
- kTheRomanLingo,
kTheStage,
kTheStageBottom,
+ kTheStageColor,
kTheStageLeft,
kTheStageRight,
- kTheStageTop
+ kTheStageTop,
+ kTheStillDown,
+ kTheSwitchColorDepth,
+ kTheTicks,
+ kTheTime,
+ kTheTimeoutKeydown,
+ kTheTimeoutLapsed,
+ kTheTimeoutLength,
+ kTheTimeoutMouse,
+ kTheTimeoutPlay,
+ kTheTimeoutScript,
+ kTheTimer,
+ kTheWindow,
+ kTheWords
};
enum TheFieldType {
kTheNOField = 0,
- kTheCastNum = 1,
+ kTheAbbr = 1,
+ kTheCastNum,
kTheCastType,
kTheCheckMark,
kTheController,
@@ -134,6 +149,7 @@ enum TheFieldType {
kTheInk,
kTheLeft,
kTheLineSize,
+ kTheLong,
kTheLoop,
kTheLoaded,
kTheModified,
@@ -152,19 +168,23 @@ enum TheFieldType {
kTheRect,
kTheRegPoint,
kTheRight,
+ kTheShort,
kTheStopTime,
kTheStretch,
kTheStartTime,
kTheScript,
kTheScriptNum,
kTheScriptText,
- kTheSelEnd,
- kTheSelStart,
kTheSize,
kTheStrech,
kTheSound,
kTheSourceRect,
kTheText,
+ kTheTextAlign,
+ kTheTextFont,
+ kTheTextheight,
+ kTheTextSize,
+ kTheTextStyle,
kTheTop,
kTheTrails,
kTheType,
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 9c6b586234..e6b4e11d49 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -34,7 +34,7 @@ Lingo *g_lingo;
struct EventHandlerType {
LEvent handler;
const char *name;
-} static const eventHanlerDescs[] = {
+} static const eventHandlerDescs[] = {
{ kEventPrepareMovie, "prepareMovie" },
{ kEventStartMovie, "startMovie" },
{ kEventStopMovie, "stopMovie" },
@@ -86,8 +86,10 @@ Symbol::Symbol() {
Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
g_lingo = this;
- for (const EventHandlerType *t = &eventHanlerDescs[0]; t->handler != kEventNone; ++t)
+ for (const EventHandlerType *t = &eventHandlerDescs[0]; t->handler != kEventNone; ++t) {
+ _eventHandlerTypeIds[t->name] = t->handler;
_eventHandlerTypes[t->handler] = t->name;
+ }
initBuiltIns();
initFuncs();
@@ -98,6 +100,7 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
_pc = 0;
_returning = false;
_indef = false;
+ _ignoreMe = false;
_linenumber = _colnumber = 0;
@@ -160,6 +163,7 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) {
_currentScript = new ScriptData;
_currentScriptType = type;
_scripts[type][id] = _currentScript;
+ _currentEntityId = id;
_linenumber = _colnumber = 1;
_hadError = false;
@@ -267,17 +271,31 @@ ScriptType Lingo::event2script(LEvent ev) {
return kNoneScript;
}
-void Lingo::processEvent(LEvent event, int entityId) {
+Symbol *Lingo::getHandler(Common::String &name) {
+ if (!_eventHandlerTypeIds.contains(name))
+ return NULL;
+
+ uint32 entityIndex = ENTITY_INDEX(_eventHandlerTypeIds[name], _currentEntityId);
+ if (!_handlers.contains(entityIndex))
+ return NULL;
+
+ return _handlers[entityIndex];
+}
+
+void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
+ if (entityId <= 0)
+ return;
+
+ _currentEntityId = entityId;
+
if (!_eventHandlerTypes.contains(event))
error("processEvent: Unknown event %d for entity %d", event, entityId);
- ScriptType st = event2script(event);
-
- if (st != kNoneScript) {
- executeScript(st, entityId + 1);
- } else if (_handlers.contains(_eventHandlerTypes[event])) {
- call(_eventHandlerTypes[event], 0);
+ if (_handlers.contains(ENTITY_INDEX(event, entityId))) {
+ call(_eventHandlerTypes[event], 0); //D4+ Events
pop();
+ } else if (_scripts[st].contains(entityId)) {
+ executeScript(st, entityId + 1); //D3 list of scripts.
} else {
debugC(8, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
}
@@ -455,7 +473,7 @@ void Lingo::runTests() {
stream->read(script, size);
- debugC(2, kDebugLingoCompile, "Compiling file %s of size %d, id: %d", fileList[i].c_str(), size, counter);
+ debug(">> Compiling file %s of size %d, id: %d", fileList[i].c_str(), size, counter);
_hadError = false;
addCode(script, kMovieScript, counter);
@@ -463,7 +481,7 @@ void Lingo::runTests() {
if (!_hadError)
executeScript(kMovieScript, counter);
else
- debugC(2, kDebugLingoCompile, "Skipping execution");
+ debug(">> Skipping execution");
free(script);
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 5e7242abe6..5d6c29b915 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -73,6 +73,7 @@ enum LEvent {
typedef void (*inst)(void);
#define STOP (inst)0
+#define ENTITY_INDEX(t,id) ((t) * 100000 + (id))
typedef Common::Array<inst> ScriptData;
typedef Common::Array<double> FloatArray;
@@ -178,8 +179,9 @@ public:
Common::String decodeInstruction(uint pc, uint *newPC = NULL);
ScriptType event2script(LEvent ev);
+ Symbol *getHandler(Common::String &name);
- void processEvent(LEvent event, int entityId);
+ void processEvent(LEvent event, ScriptType st, int entityId);
void initBuiltIns();
void initFuncs();
@@ -209,6 +211,7 @@ public:
int codeString(const char *s);
void codeLabel(int label);
int codeConst(int val);
+ int codeArray(int arraySize);
int calcStringAlignment(const char *s) {
return calcCodeAlignment(strlen(s) + 1);
@@ -221,6 +224,7 @@ public:
void codeArg(Common::String *s);
void codeArgStore();
int codeFunc(Common::String *s, int numpar);
+ int codeMe(Common::String *method, int numpar);
int codeFloat(double f);
void codeFactory(Common::String &s);
@@ -241,18 +245,30 @@ public:
static void c_not();
static void c_ampersand();
+ static void c_after();
+ static void c_before();
static void c_concat();
static void c_contains();
static void c_starts();
static void c_intersects();
static void c_within();
+ static void c_charOf();
+ static void c_charToOf();
+ static void c_itemOf();
+ static void c_itemToOf();
+ static void c_lineOf();
+ static void c_lineToOf();
+ static void c_wordOf();
+ static void c_wordToOf();
static void c_constpush();
static void c_voidpush();
static void c_fconstpush();
static void c_stringpush();
+ static void c_symbolpush();
static void c_varpush();
+ static void c_arraypush();
static void c_assign();
bool verify(Symbol *s);
static void c_eval();
@@ -314,11 +330,38 @@ public:
static void b_chars(int nargs);
static void b_charToNum(int nargs);
+ static void b_delete(int nargs);
+ static void b_hilite(int nargs);
static void b_length(int nargs);
static void b_numToChar(int nargs);
static void b_offset(int nargs);
static void b_string(int nargs);
+ static void b_add(int nargs);
+ static void b_addAt(int nargs);
+ static void b_addProp(int nargs);
+ static void b_append(int nargs);
+ static void b_count(int nargs);
+ static void b_deleteAt(int nargs);
+ static void b_deleteProp(int nargs);
+ static void b_findPos(int nargs);
+ static void b_findPosNear(int nargs);
+ static void b_getaProp(int nargs);
+ static void b_getAt(int nargs);
+ static void b_getLast(int nargs);
+ static void b_getOne(int nargs);
+ static void b_getPos(int nargs);
+ static void b_getProp(int nargs);
+ static void b_getPropAt(int nargs);
+ static void b_list(int nargs);
+ static void b_listP(int nargs);
+ static void b_max(int nargs);
+ static void b_min(int nargs);
+ static void b_setaProp(int nargs);
+ static void b_setAt(int nargs);
+ static void b_setProp(int nargs);
+ static void b_sort(int nargs);
+
static void b_floatP(int nargs);
static void b_ilk(int nargs);
static void b_integerp(int nargs);
@@ -328,6 +371,8 @@ public:
static void b_alert(int nargs);
static void b_cursor(int nargs);
+ static void b_framesToHMS(int nargs);
+ static void b_HMStoFrames(int nargs);
static void b_printFrom(int nargs);
static void b_showGlobals(int nargs);
static void b_showLocals(int nargs);
@@ -335,7 +380,9 @@ public:
static void b_constrainH(int nargs);
static void b_constrainV(int nargs);
+ static void b_duplicateCast(int nargs);
static void b_editableText(int nargs);
+ static void b_eraseCast(int nargs);
static void b_installMenu(int nargs);
static void b_label(int nargs);
static void b_marker(int nargs);
@@ -350,6 +397,7 @@ public:
static void b_updateStage(int nargs);
static void b_zoomBox(int nargs);
+ static void b_abort(int nargs);
static void b_continue(int nargs);
static void b_dontPassEvent(int nargs);
static void b_delay(int nargs);
@@ -357,6 +405,8 @@ public:
static void b_nothing(int nargs);
static void b_pause(int nargs);
static void b_playAccel(int nargs);
+ static void b_preLoad(int nargs);
+ static void b_preLoadCast(int nargs);
static void b_quit(int nargs);
static void b_restart(int nargs);
static void b_shutDown(int nargs);
@@ -392,6 +442,7 @@ public:
static void b_return(int nargs);
static void b_tab(int nargs);
static void b_true(int nargs);
+ static void b_version(int nargs);
static void b_factory(int nargs);
void factoryCall(Common::String &name, int nargs);
@@ -401,10 +452,12 @@ public:
void func_mci(Common::String &s);
void func_mciwait(Common::String &s);
+ void func_beep(int repeats);
void func_goto(Datum &frame, Datum &movie);
void func_gotoloop();
void func_gotonext();
void func_gotoprevious();
+ void func_cursor(int c);
public:
void setTheEntity(int entity, Datum &id, int field, Datum &d);
@@ -417,8 +470,10 @@ public:
public:
ScriptData *_currentScript;
ScriptType _currentScriptType;
+ uint16 _currentEntityId;
bool _returning;
bool _indef;
+ bool _ignoreMe;
Common::Array<CFrame *> _callstack;
Common::Array<Common::String *> _argstack;
@@ -426,7 +481,9 @@ public:
TheEntityFieldHash _theEntityFields;
Common::Array<int> _labelstack;
- SymbolHash _handlers;
+ SymbolHash _builtins;
+ Common::HashMap<Common::String, bool> _twoWordBuiltins;
+ Common::HashMap<uint32, Symbol *> _handlers;
int _linenumber;
int _colnumber;
@@ -440,6 +497,8 @@ public:
bool _exitRepeat;
+ bool _cursorOnStack;
+
private:
int parse(const char *code);
void parseMenu(const char *code);
@@ -448,6 +507,7 @@ private:
Datum pop(void);
Common::HashMap<uint32, const char *> _eventHandlerTypes;
+ Common::HashMap<Common::String, uint32> _eventHandlerTypeIds;
Common::HashMap<Common::String, Audio::AudioStream *> _audioAliases;
ScriptHash _scripts[kMaxScriptType + 1];
diff --git a/engines/director/lingo/tests/arrays.lingo b/engines/director/lingo/tests/arrays.lingo
new file mode 100644
index 0000000000..2d1c9ef93d
--- /dev/null
+++ b/engines/director/lingo/tests/arrays.lingo
@@ -0,0 +1,2 @@
+set a to [1, 2, 3]
+put a
diff --git a/engines/director/lingo/tests/events.lingo b/engines/director/lingo/tests/events.lingo
index 5a6d6c7d98..a04a12da07 100644
--- a/engines/director/lingo/tests/events.lingo
+++ b/engines/director/lingo/tests/events.lingo
@@ -4,7 +4,7 @@ end exitFrame
on enterFrame me
beep
-end enterFrame
+end
on annoy howMuch
beep random(howMuch)
diff --git a/engines/director/lingo/tests/the.lingo b/engines/director/lingo/tests/the.lingo
index 65c0d6ea5c..f728fb7938 100644
--- a/engines/director/lingo/tests/the.lingo
+++ b/engines/director/lingo/tests/the.lingo
@@ -4,3 +4,8 @@ put 1.0 / 3
put the loch of sprite 4
set the loch of sprite 5 to 10
set the castnum of sprite 8 to the number of cast "A Blank Castmember"
+
+put the date
+put the long date
+put the abbreviated time
+put the short time
diff --git a/engines/director/module.mk b/engines/director/module.mk
index 38e3cfea4a..e947af4be7 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -6,6 +6,7 @@ MODULE_OBJS = \
detection.o \
director.o \
frame.o \
+ graphics.o \
images.o \
movie.o \
resource.o \
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 2f8ef3e432..da7f3b69b0 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -56,7 +56,7 @@ void DirectorEngine::loadEXE() {
if (!exeStream)
error("Failed to open EXE '%s'", getEXEName().c_str());
- _lingo->processEvent(kEventStart, 0);
+ _lingo->processEvent(kEventStart, kMovieScript, 0);
exeStream->seek(-4, SEEK_END);
exeStream->seek(exeStream->readUint32LE());
@@ -217,7 +217,7 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
Common::Array<uint16> cast = shardcst->getResourceIDList(MKTAG('C','A','S','t'));
if (cast.size() > 0) {
for (Common::Array<uint16>::iterator iterator = cast.begin(); iterator != cast.end(); ++iterator)
- castScore->loadCastData(*shardcst->getResource(MKTAG('C','A','S','t'), *iterator), *iterator);
+ castScore->loadCastData(*shardcst->getResource(MKTAG('C','A','S','t'), *iterator), *iterator, NULL);
}
castScore->setSpriteCasts();
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 8a80e30765..979d29dba2 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -143,7 +143,7 @@ Score::Score(DirectorEngine *vm, Archive *archive) {
_movieArchive = archive;
_lingo = _vm->getLingo();
_soundManager = _vm->getSoundManager();
- _lingo->processEvent(kEventPrepareMovie, 0);
+ _lingo->processEvent(kEventPrepareMovie, kMovieScript, 0);
_movieScriptCount = 0;
_labels = NULL;
_font = NULL;
@@ -216,16 +216,19 @@ void Score::loadArchive() {
Common::Array<uint16> cast = _movieArchive->getResourceIDList(MKTAG('C','A','S','t'));
if (cast.size() > 0) {
- for (Common::Array<uint16>::iterator iterator = cast.begin(); iterator != cast.end(); ++iterator)
- loadCastData(*_movieArchive->getResource(MKTAG('C','A','S','t'), *iterator), *iterator);
+ for (Common::Array<uint16>::iterator iterator = cast.begin(); iterator != cast.end(); ++iterator) {
+ Common::SeekableSubReadStreamEndian *stream = _movieArchive->getResource(MKTAG('C', 'A', 'S', 't'), *iterator);
+ Resource res = _movieArchive->getResourceDetail(MKTAG('C', 'A', 'S', 't'), *iterator);
+ loadCastData(*stream, *iterator, &res);
+ }
}
setSpriteCasts();
- Common::Array<uint16> stxt = _movieArchive->getResourceIDList(MKTAG('S','T','X','T'));
- if (stxt.size() > 0) {
- loadScriptText(*_movieArchive->getResource(MKTAG('S','T','X','T'), *stxt.begin()));
- }
+ //Common::Array<uint16> stxt = _movieArchive->getResourceIDList(MKTAG('S','T','X','T'));
+ //if (stxt.size() > 0) {
+ // loadScriptText(*_movieArchive->getResource(MKTAG('S','T','X','T'), *stxt.begin()));
+ //}
}
Score::~Score() {
@@ -320,6 +323,7 @@ void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) {
}
Common::MemoryReadStreamEndian *str = new Common::MemoryReadStreamEndian(channelData, ARRAYSIZE(channelData), stream.isBE());
+ //Common::hexdump(channelData, ARRAYSIZE(channelData));
frame->readChannels(str);
delete str;
@@ -397,7 +401,7 @@ void Score::setSpriteCasts() {
}
}
-void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id) {
+void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id, Resource *res) {
// d4+ variant
if (stream.size() == 0)
return;
@@ -415,7 +419,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
uint32 size1, size2, size3, castType;
byte unk1 = 0, unk2 = 0, unk3 = 0;
- if (_vm->getVersion() < 5) {
+ if (_vm->getVersion() < 4) {
size1 = stream.readUint16();
size2 = stream.readUint32();
size3 = 0;
@@ -423,6 +427,12 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
unk1 = stream.readByte();
unk2 = stream.readByte();
unk3 = stream.readByte();
+ } else if (_vm->getVersion() < 5) {
+ size1 = stream.readUint16() + 2;
+ size2 = stream.readUint32();
+ size3 = 0;
+ castType = stream.readByte();
+ unk1 = stream.readByte();
} else {
// FIXME: only the cast type and the strings are good
castType = stream.readUint32();
@@ -436,7 +446,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
debugC(3, kDebugLoading, "CASt: id: %d type: %x size1: %d size2: %d (%x) size3: %d unk1: %d unk2: %d unk3: %d",
id, castType, size1, size2, size2, size3, unk1, unk2, unk3);
- byte *data = (byte *)calloc(size1, 1); // 16 is for bounding rects
+ byte *data = (byte *)calloc(size1 + 16, 1); // 16 is for bounding rects
stream.read(data, size1 + 16);
Common::MemoryReadStreamEndian castStream(data, size1 + 16, stream.isBE());
@@ -468,15 +478,23 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
_casts[id] = new ButtonCast(castStream, _vm->getVersion());
_casts[id]->type = kCastButton;
break;
- case kCastScript:
+ case kCastLingoScript:
+ warning("CASt: Script");
+ Common::hexdump(data, size1 + 16);
+
_casts[id] = new ScriptCast(castStream, _vm->getVersion());
- _casts[id]->type = kCastScript;
+ _casts[id]->type = kCastLingoScript;
break;
default:
warning("Score::loadCastData(): Unhandled cast type: %d", castType);
break;
}
+ if (res != NULL) {
+ for (uint child = 0; child < res->children.size(); child++)
+ _casts[id]->children.push_back(res->children[child]);
+ }
+
free(data);
if (size2) {
@@ -494,11 +512,21 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
CastInfo *ci = new CastInfo();
- ci->script = castStrings[0];
- ci->name = castStrings[1];
- ci->directory = castStrings[2];
- ci->fileName = castStrings[3];
- ci->type = castStrings[4];
+ if (castStrings.size() >= 5) {
+ ci->script = castStrings[0];
+ ci->name = castStrings[1];
+ ci->directory = castStrings[2];
+ ci->fileName = castStrings[3];
+ ci->type = castStrings[4];
+
+ if (!ci->script.empty()) {
+ //the script type here could be wrong!
+ if (ConfMan.getBool("dump_scripts"))
+ dumpScript(ci->script.c_str(), kCastScript, id);
+
+ _lingo->addCode(ci->script.c_str(), kCastScript, id);
+ }
+ }
_castsInfo[id] = ci;
}
@@ -650,6 +678,9 @@ void Score::dumpScript(const char *script, ScriptType type, uint16 id) {
case kSpriteScript:
typeName = "sprite";
break;
+ case kCastScript:
+ typeName = "cast";
+ break;
}
sprintf(buf, "./dumps/%s-%s-%d.txt", _macName.c_str(), typeName.c_str(), id);
@@ -802,7 +833,7 @@ Common::Array<Common::String> Score::loadStrings(Common::SeekableSubReadStreamEn
byte *data = (byte *)malloc(entries[count - 1]);
stream.read(data, entries[count - 1]);
- for (uint i = 0; i < count - 1; i++) {
+ for (uint16 i = 0; i < count - 1; i++) {
Common::String entryString;
for (uint j = entries[i]; j < entries[i + 1]; j++)
@@ -821,6 +852,9 @@ Common::Array<Common::String> Score::loadStrings(Common::SeekableSubReadStreamEn
}
void Score::loadFontMap(Common::SeekableSubReadStreamEndian &stream) {
+ if (stream.size() == 0)
+ return;
+
uint16 count = stream.readUint16();
uint32 offset = (count * 2) + 2;
uint16 currentRawPosition = offset;
@@ -870,10 +904,10 @@ void Score::startLoop() {
_stopPlay = false;
_nextFrameTime = 0;
- _lingo->processEvent(kEventStartMovie, 0);
+ _lingo->processEvent(kEventStartMovie, kMovieScript, 0);
_frames[_currentFrame]->prepareFrame(this);
- while (!_stopPlay && _currentFrame < _frames.size() - 2) {
+ while (!_stopPlay && _currentFrame < _frames.size()) {
debugC(1, kDebugImages, "Current frame: %d", _currentFrame);
update();
processEvents();
@@ -888,32 +922,36 @@ void Score::update() {
_surface->copyFrom(*_trailSurface);
// Enter and exit from previous frame (Director 4)
- _lingo->processEvent(kEventEnterFrame, _frames[_currentFrame]->_actionId);
- _lingo->processEvent(kEventExitFrame, _frames[_currentFrame]->_actionId);
+ _lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId);
+ _lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId);
// TODO Director 6 - another order
// TODO Director 6 step: send beginSprite event to any sprites whose span begin in the upcoming frame
if (_vm->getVersion() >= 6) {
for (uint16 i = 0; i < CHANNEL_COUNT; i++) {
if (_frames[_currentFrame]->_sprites[i]->_enabled) {
- _lingo->processEvent(kEventBeginSprite, i);
+ //TODO: Check if this is also possibly a kSpriteScript?
+ _lingo->processEvent(kEventBeginSprite, kCastScript, _frames[_currentFrame]->_sprites[i]->_scriptId);
}
}
}
// TODO Director 6 step: send prepareFrame event to all sprites and the script channel in upcoming frame
if (_vm->getVersion() >= 6)
- _lingo->processEvent(kEventPrepareFrame, _currentFrame);
-
- _currentFrame++;
+ _lingo->processEvent(kEventPrepareFrame, kFrameScript, _currentFrame);
Common::SortedArray<Label *>::iterator i;
- for (i = _labels->begin(); i != _labels->end(); ++i) {
- if ((*i)->number == _currentFrame) {
- _currentLabel = (*i)->name;
+ if (_labels != NULL) {
+ for (i = _labels->begin(); i != _labels->end(); ++i) {
+ if ((*i)->number == _currentFrame) {
+ _currentLabel = (*i)->name;
+ }
}
}
+ _currentFrame++;
+ if (_currentFrame >= _frames.size()) return;
+
_frames[_currentFrame]->prepareFrame(this);
// Stage is drawn between the prepareFrame and enterFrame events (Lingo in a Nutshell)
@@ -951,8 +989,9 @@ void Score::update() {
}
void Score::processEvents() {
- if (_currentFrame > 0)
- _lingo->processEvent(kEventIdle, _currentFrame - 1);
+ //TODO: re-instate when we know which script to run.
+ //if (_currentFrame > 0)
+ // _lingo->processEvent(kEventIdle, _currentFrame - 1);
Common::Event event;
@@ -966,14 +1005,27 @@ void Score::processEvents() {
if (event.type == Common::EVENT_LBUTTONDOWN) {
Common::Point pos = g_system->getEventManager()->getMousePos();
- // TODO there is dont send frame id
- _lingo->processEvent(kEventMouseDown, _frames[_currentFrame]->getSpriteIDFromPos(pos));
+ //D3 doesn't have both mouse up and down.
+ if (_vm->getVersion() > 3) {
+ //TODO: check that this is the order of script execution!
+ uint16 spriteId = _frames[_currentFrame]->getSpriteIDFromPos(pos);
+ _lingo->processEvent(kEventMouseDown, kCastScript, _frames[_currentFrame]->_sprites[spriteId]->_castId);
+ _lingo->processEvent(kEventMouseDown, kSpriteScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId);
+ }
}
if (event.type == Common::EVENT_LBUTTONUP) {
Common::Point pos = g_system->getEventManager()->getMousePos();
- _lingo->processEvent(kEventMouseUp, _frames[_currentFrame]->getSpriteIDFromPos(pos));
+ uint16 spriteId = _frames[_currentFrame]->getSpriteIDFromPos(pos);
+ if (_vm->getVersion() > 3) {
+ //TODO: check that this is the order of script execution!
+ _lingo->processEvent(kEventMouseUp, kCastScript, _frames[_currentFrame]->_sprites[spriteId]->_castId);
+ _lingo->processEvent(kEventMouseUp, kSpriteScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId);
+ } else {
+ //D3 doesn't have cast member or sprite scripts. Just Frame Scripts.
+ _lingo->processEvent(kEventMouseUp, kFrameScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId);
+ }
}
if (event.type == Common::EVENT_KEYDOWN) {
@@ -997,7 +1049,8 @@ void Score::processEvents() {
warning("Keycode: %d", _vm->_keyCode);
}
- _lingo->processEvent(kEventKeyDown, 0);
+ //TODO: is movie script correct? Can this be elsewhere?
+ _lingo->processEvent(kEventKeyDown, kMovieScript, 0);
}
}
diff --git a/engines/director/score.h b/engines/director/score.h
index 49e4f357b0..9b92e48f93 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -25,6 +25,7 @@
#include "common/substream.h"
#include "common/rect.h"
+#include "director/archive.h"
namespace Graphics {
class ManagedSurface;
@@ -46,8 +47,9 @@ enum ScriptType {
kMovieScript = 0,
kSpriteScript = 1,
kFrameScript = 2,
+ kCastScript = 3,
kNoneScript = -1,
- kMaxScriptType = 2
+ kMaxScriptType = 3
};
class Score {
@@ -67,12 +69,13 @@ public:
Archive *getArchive() const { return _movieArchive; };
void loadConfig(Common::SeekableSubReadStreamEndian &stream);
void loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream);
- void loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id);
+ void loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id, Resource *res);
void setCurrentFrame(uint16 frameId) { _currentFrame = frameId; }
int getCurrentFrame() { return _currentFrame; }
Common::String getMacName() const { return _macName; }
Sprite *getSpriteById(uint16 id);
void setSpriteCasts();
+ Graphics::ManagedSurface *getSurface() { return _surface; }
private:
void update();
diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index 1bd70d257d..0fc1a43666 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -34,6 +34,11 @@ DirectorSound::DirectorSound() {
_sound2 = new Audio::SoundHandle();
_scriptSound = new Audio::SoundHandle();
_mixer = g_system->getMixer();
+
+ _speaker = new Audio::PCSpeaker();
+ _pcSpeakerHandle = new Audio::SoundHandle();
+ _mixer->playStream(Audio::Mixer::kSFXSoundType,
+ _pcSpeakerHandle, _speaker, -1, 50, 0, DisposeAfterUse::NO, true);
}
DirectorSound::~DirectorSound() {
@@ -100,6 +105,11 @@ bool DirectorSound::isChannelActive(uint8 channelID) {
void DirectorSound::stopSound() {
_mixer->stopHandle(*_sound1);
_mixer->stopHandle(*_sound2);
+ _mixer->stopHandle(*_pcSpeakerHandle);
+}
+
+void DirectorSound::systemBeep() {
+ _speaker->play(Audio::PCSpeaker::kWaveFormSquare, 500, 150);
}
} // End of namespace Director
diff --git a/engines/director/sound.h b/engines/director/sound.h
index 0472da0ef7..6a770314a3 100644
--- a/engines/director/sound.h
+++ b/engines/director/sound.h
@@ -22,6 +22,7 @@
#include "audio/audiostream.h"
#include "audio/mixer.h"
+#include "audio/softsynth/pcspk.h"
#ifndef DIRECTOR_SOUND_H
#define DIRECTOR_SOUND_H
@@ -35,6 +36,8 @@ private:
Audio::SoundHandle *_sound2;
Audio::SoundHandle *_scriptSound;
Audio::Mixer *_mixer;
+ Audio::PCSpeaker *_speaker;
+ Audio::SoundHandle *_pcSpeakerHandle;
public:
DirectorSound();
@@ -43,6 +46,7 @@ public:
void playWAV(Common::String filename, uint8 channelID);
void playAIFF(Common::String filename, uint8 channelID);
void playMCI(Audio::AudioStream &stream, uint32 from, uint32 to);
+ void systemBeep();
bool isChannelActive(uint8 channelID);
void stopSound();
};
diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index a59313ad33..62897ed6e6 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -38,7 +38,7 @@ Sprite::Sprite() {
_constraint = 0;
_moveable = 0;
_castId = 0;
- _backColor = 0;
+ _backColor = 255;
_foreColor = 0;
_left = 0;
_right = 0;
diff --git a/engines/director/sprite.h b/engines/director/sprite.h
index d248036693..d9b7729a87 100644
--- a/engines/director/sprite.h
+++ b/engines/director/sprite.h
@@ -106,7 +106,8 @@ public:
uint32 _unk3;
bool _enabled;
- byte _castId;
+ uint16 _castId;
+ byte _spriteType;
InkType _ink;
uint16 _trails;
Cast *_cast;
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 3b7c3a244b..87d51619d8 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -335,7 +335,7 @@ WindowReference Gui::createInventoryWindow(ObjID objRef) {
Graphics::MacWindow *newWindow = _wm.addWindow(true, true, true);
WindowData newData;
GlobalSettings settings = _engine->getGlobalSettings();
- newData.refcon = (WindowReference)ABS(_inventoryWindows.size() + kInventoryStart); // This is a HACK
+ newData.refcon = (WindowReference)(_inventoryWindows.size() + kInventoryStart); // This is a HACK
if (_windowData->back().refcon < 0x80) { // There is already another inventory window
newData.bounds = _windowData->back().bounds; // Inventory windows are always last
diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index 79d5256c1c..f5748116ad 100644
--- a/engines/mads/screen.cpp
+++ b/engines/mads/screen.cpp
@@ -155,7 +155,7 @@ void DirtyArea::setUISlot(const UISlot *slot) {
/*------------------------------------------------------------------------*/
-DirtyAreas::DirtyAreas(MADSEngine *vm) : _vm(vm) {
+DirtyAreas::DirtyAreas(MADSEngine *vm) /* : _vm(vm) */ {
DirtyArea::_vm = vm;
for (int i = 0; i < DIRTY_AREAS_SIZE; ++i) {
diff --git a/engines/mads/screen.h b/engines/mads/screen.h
index 15436942fe..92cd5bc0a2 100644
--- a/engines/mads/screen.h
+++ b/engines/mads/screen.h
@@ -96,8 +96,8 @@ public:
};
class DirtyAreas : public Common::Array<DirtyArea> {
-private:
- MADSEngine *_vm;
+//private:
+// MADSEngine *_vm;
public:
DirtyAreas(MADSEngine *vm);
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 98dab7b176..90b9412b9a 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -183,7 +183,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "9dd015e79cac4f91e7de805448f39775", 1912},
{"resource.000", 0, "e4efcd042f86679dd4e1834bb3a38edb", 3770943},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO3(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO7(GUIO_NOSUBTITLES, GUIO_NOMUSIC, GUIO_NOSPEECH, GUIO_NOSFX, GUIO_NOMIDI, GUIO_NOLAUNCHLOAD, GUIO_NOASPECT) },
#endif
// Christmas Card 1988 - English DOS
@@ -722,14 +722,10 @@ static const struct ADGameDescription SciGameDescriptions[] = {
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
-#define GUIO_GK1_FLOPPY GUIO4(GUIO_NOSPEECH, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_GK1_CD GUIO4(GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_HIGH_RESOLUTION_GRAPHICS, \
- GAMEOPTION_FB01_MIDI)
+#define GUIO_GK1_FLOPPY GUIO2(GUIO_NOSPEECH, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
+#define GUIO_GK1_CD GUIO2(GAMEOPTION_ORIGINAL_SAVELOAD, \
+ GAMEOPTION_HIGH_RESOLUTION_GRAPHICS)
#define GUIO_GK1_MAC GUIO_GK1_FLOPPY
// Gabriel Knight - English DOS Floppy
@@ -840,12 +836,21 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO_GK1_MAC },
-#define GUIO_GK2_DEMO GUIO3(GUIO_NOSPEECH, \
+#undef GUIO_GK1_FLOPPY
+#undef GUIO_GK1_CD
+#undef GUIO_GK1_MAC
+
+#define GUIO_GK2_DEMO GUIO6(GUIO_NOSUBTITLES, \
+ GUIO_NOMUSIC, \
+ GUIO_NOSPEECH, \
+ GUIO_NOMIDI, \
+ GUIO_NOLAUNCHLOAD, \
+ GUIO_NOASPECT)
+#define GUIO_GK2 GUIO5(GUIO_NOSUBTITLES, \
+ GUIO_NOMIDI, \
GUIO_NOASPECT, \
- GAMEOPTION_ORIGINAL_SAVELOAD)
-#define GUIO_GK2 GUIO3(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
- GUIO_NOASPECT, \
- GAMEOPTION_ORIGINAL_SAVELOAD)
+ GAMEOPTION_ORIGINAL_SAVELOAD, \
+ GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
#define GUIO_GK2_MAC GUIO_GK2
// Gabriel Knight 2 - English Windows Non-Interactive Demo
@@ -912,6 +917,10 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_CD | ADGF_UNSTABLE, GUIO_GK2_MAC },
+#undef GUIO_GK2_DEMO
+#undef GUIO_GK2
+#undef GUIO_GK2_MAC
+
#endif // ENABLE_SCI32
// Hoyle 1 - English DOS (supplied by ssburnout in bug report #3049193)
@@ -1125,9 +1134,9 @@ static const struct ADGameDescription SciGameDescriptions[] = {
Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
-#define GUIO_HOYLE5 GUIO3(GUIO_NOSPEECH, \
- GUIO_NOASPECT, \
- GUIO_NOLAUNCHLOAD)
+#define GUIO_HOYLE5 GUIO3(GUIO_NOMIDI, \
+ GUIO_NOLAUNCHLOAD, \
+ GUIO_NOASPECT)
// Hoyle 5 (Hoyle Classic Games) - Windows demo
{"hoyle5", "Demo", {
@@ -1176,6 +1185,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_HOYLE5 },
+#undef GUIO_HOYLE5
+
#endif // ENABLE_SCI32
// ImagiNation Network (INN) Demo
@@ -1792,15 +1803,12 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_KQ7_DEMO GUIO5(GUIO_NOSPEECH, \
- GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_KQ7 GUIO4(GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
+#define GUIO_KQ7_DEMO GUIO4(GUIO_NOSUBTITLES, \
+ GUIO_NOSPEECH, \
+ GUIO_NOLAUNCHLOAD, \
+ GUIO_NOASPECT)
+#define GUIO_KQ7 GUIO2(GUIO_NOASPECT, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
// King's Quest 7 - English Windows (from the King's Quest Collection)
// Executable scanning reports "2.100.002", VERSION file reports "1.4"
@@ -1877,13 +1885,16 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE | ADGF_CD, GUIO_KQ7_DEMO },
+#undef GUIO_KQ7_DEMO
+#undef GUIO_KQ7
+
// King's Questions mini-game from the King's Quest Collection
// SCI interpreter version 2.000.000
{"kquestions", "", {
{"resource.000", 0, "9b1cddecd4f0720d83661ba7aed28891", 162697},
{"resource.map", 0, "93a2251fa64e729d7a7d2fe56b217c8e", 502},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO3(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO6(GUIO_NOSUBTITLES, GUIO_NOMUSIC, GUIO_NOSPEECH, GUIO_NOSFX, GUIO_NOMIDI, GUIO_NOLAUNCHLOAD) },
#endif // ENABLE_SCI32
@@ -2580,10 +2591,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_LSL6HIRES GUIO4(GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
+#define GUIO_LSL6HIRES GUIO2(GUIO_NOASPECT, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
// Larry 6 - English/German DOS CD - HIRES
// SCI interpreter version 2.100.002
@@ -2609,16 +2618,17 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::FR_FRA, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO_LSL6HIRES },
-#define GUIO_LSL7_DEMO GUIO5(GUIO_NOSPEECH, \
- GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_LSL7 GUIO5(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
+#undef GUIO_LSL6HIRES
+
+// TODO: Correct GUIOs
+#define GUIO_LSL7_DEMO GUIO4(GUIO_NOASPECT, \
+ GUIO_NOMIDI, \
+ GUIO_NOLAUNCHLOAD, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
+#define GUIO_LSL7 GUIO4(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
+ GUIO_NOMIDI, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
// Larry 7 - English DOS Demo (provided by richiefs in bug report #2670691)
// SCI interpreter version 2.100.002
@@ -2668,23 +2678,23 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "32792f9bc1bf3633a88b382bb3f6e40d", 67071418},
AD_LISTEND},
Common::ES_ESP, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO_LSL7 },
+
+#undef GUIO_LSL7_DEMO
+#undef GUIO_LSL7
+
#endif
-#define GUIO_LIGHTHOUSE_DEMO GUIO5(GUIO_NOSPEECH, \
+// TODO: Correct GUIOs
+#define GUIO_LIGHTHOUSE_DEMO GUIO3(GUIO_NOSPEECH, \
GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_LIGHTHOUSE GUIO6(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
- GUIO_NOSPEECH, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
+#define GUIO_LIGHTHOUSE GUIO3(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
+ GAMEOPTION_ORIGINAL_SAVELOAD)
// Lighthouse - English Windows Demo (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "1.00"
- {"lighthouse", "Demo", {
+ {"lighthouse", "Non-interactive Demo", {
{"resource.map", 0, "543124606352bfa5e07696ddf2a669be", 64},
{"resource.000", 0, "5d7714416b612463d750fb9c5690c859", 28952},
AD_LISTEND},
@@ -2728,6 +2738,10 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.002", 0, "3c8d627c555b0e3e4f1d9955bc0f0df4", 94631127},
AD_LISTEND},
Common::ES_ESP, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO_LIGHTHOUSE },
+
+#undef GUIO_LIGHTHOUSE_DEMO
+#undef GUIO_LIGHTHOUSE
+
#endif // ENABLE_SCI3_GAMES
#endif // ENABLE_SCI32
@@ -2850,10 +2864,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_MOTHERGOOSEHIRES GUIO4(GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
+#define GUIO_MOTHERGOOSEHIRES GUIO2(GUIO_NOASPECT, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
// Mixed-Up Mother Goose Deluxe - English Windows/DOS CD (supplied by markcoolio in bug report #2723810)
// Executable scanning reports "2.100.002"
@@ -2870,6 +2882,9 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "227685bc59d90821978d330713e44a7a", 17205800},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO_MOTHERGOOSEHIRES },
+
+#undef GUIO_MOTHERGOOSEHIRES
+
#endif // ENABLE_SCI32
// Ms. Astro Chicken - English DOS
@@ -2882,18 +2897,12 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_PHANTASMAGORIA_DEMO GUIO6(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
- GUIO_NOSPEECH, \
+#define GUIO_PHANTASMAGORIA_DEMO GUIO4(GUIO_NOSUBTITLES, \
GUIO_NOASPECT, \
GUIO_NOLAUNCHLOAD, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_FB01_MIDI)
+ GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
#define GUIO_PHANTASMAGORIA GUIO_PHANTASMAGORIA_DEMO
-#define GUIO_PHANTASMAGORIA_MAC GUIO5(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
- GUIO_NOASPECT, \
- GUIO_NOLAUNCHLOAD, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_FB01_MIDI)
+#define GUIO_PHANTASMAGORIA_MAC GUIO_PHANTASMAGORIA_DEMO
// Phantasmagoria - English DOS/Windows (from csnover)
// Windows executable scanning reports "2.100.002" - "Aug 06 1995"
@@ -3014,10 +3023,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformMacintosh, ADGF_CD | ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO_PHANTASMAGORIA_MAC },
+#undef GUIO_PHANTASMAGORIA_DEMO
+#undef GUIO_PHANTASMAGORIA
+#undef GUIO_PHANTASMAGORIA_MAC
+
#ifdef ENABLE_SCI3_GAMES
-#define GUIO_PHANTASMAGORIA2 GUIO5(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
- GUIO_NOSPEECH, \
+// TODO: Correct GUIOs
+#define GUIO_PHANTASMAGORIA2 GUIO4(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
GUIO_NOASPECT, \
GUIO_NOMIDI, \
GAMEOPTION_ORIGINAL_SAVELOAD)
@@ -3305,14 +3318,10 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_PQ4_FLOPPY GUIO4(GUIO_NOSPEECH, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_PQ4_CD GUIO4(GAMEOPTION_HIGH_RESOLUTION_GRAPHICS, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
+#define GUIO_PQ4_FLOPPY GUIO2(GUIO_NOSPEECH, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
+#define GUIO_PQ4_CD GUIO2(GAMEOPTION_HIGH_RESOLUTION_GRAPHICS, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
// Police Quest 4 - English DOS CD (from the Police Quest Collection)
// Executable scanning reports "2.100.002", VERSION file reports "1.100.000"
@@ -3354,16 +3363,17 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO_PQ4_FLOPPY },
-#define GUIO_PQSWAT_DEMO GUIO5(GUIO_NOSPEECH, \
+#undef GUIO_PQ4_FLOPPY
+#undef GUIO_PQ4_CD
+
+#define GUIO_PQSWAT_DEMO GUIO4(GUIO_NOSUBTITLES, \
+ GUIO_NOSPEECH, \
GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_PQSWAT GUIO5(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
+ GUIO_NOLAUNCHLOAD)
+#define GUIO_PQSWAT GUIO4(GUIO_NOMIDI, \
GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
+ GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
// Police Quest: SWAT - English DOS/Windows Demo (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "0.001.200"
@@ -3395,6 +3405,10 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.004", 0, "b7e619e6ecf62fe65d5116a3a422e5f0", 46223872},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_PQSWAT },
+
+#undef GUIO_PQSWAT_DEMO
+#undef GUIO_PQSWAT
+
#endif // ENABLE_SCI32
// Quest for Glory 1 / Hero's Quest - English DOS 3.5" Floppy (supplied by merkur in bug report #2718784)
@@ -3753,13 +3767,9 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_QFG4_FLOPPY GUIO4(GUIO_NOSPEECH, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_QFG4_CD GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
+#define GUIO_QFG4_FLOPPY GUIO2(GUIO_NOSPEECH, \
+ GAMEOPTION_ORIGINAL_SAVELOAD)
+#define GUIO_QFG4_CD GUIO1(GAMEOPTION_ORIGINAL_SAVELOAD)
// Quest for Glory 4 1.1 Floppy - English DOS (supplied by markcool in bug report #2723852)
// SCI interpreter version 2.000.000 (a guess?)
@@ -3801,12 +3811,18 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_QFG4_CD },
-#define GUIO_RAMA_DEMO GUIO5(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
+#undef GUIO_QFG4_FLOPPY
+#undef GUIO_QFG4_CD
+
+// TODO: Correct GUIOs
+#define GUIO_RAMA_DEMO GUIO4(GUIO_NOMIDI, \
+ GUIO_NOLAUNCHLOAD, \
+ GUIO_NOASPECT, \
+ GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
+#define GUIO_RAMA GUIO4(GUIO_NOMIDI, \
GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_RAMA GUIO_RAMA_DEMO
+ GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
// RAMA - English DOS/Windows Demo
// Executable scanning reports "2.100.002", VERSION file reports "000.000.008"
@@ -3858,13 +3874,21 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.001", 0, "70ba2ff04a2b7fb2c52420ba7fbd47c2", 8338},
AD_LISTEND},
Common::IT_ITA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_RAMA },
+
+#undef GUIO_RAMA_DEMO
+#undef GUIO_RAMA
+
#endif // ENABLE_SCI3_GAMES
-#define GUIO_SHIVERS_DEMO GUIO4(GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
+#define GUIO_SHIVERS_DEMO GUIO5(GUIO_NOSUBTITLES, \
+ GUIO_NOSPEECH, \
+ GUIO_NOMIDI, \
+ GUIO_NOLAUNCHLOAD, \
+ GUIO_NOASPECT)
+#define GUIO_SHIVERS GUIO4(GUIO_NOMIDI, \
+ GUIO_NOASPECT, \
GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_SHIVERS GUIO_SHIVERS_DEMO
+ GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
// Shivers - English Windows (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "1.02"
@@ -3889,6 +3913,9 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_SHIVERS },
+#undef GUIO_SHIVERS_DEMO
+#undef GUIO_SHIVERS
+
// Shivers 2 doesn't contain SCI scripts. The whole game logic has
// been reimplemented from SCI in native code placed in DLL files.
// Each room has its own DLL file, and some SCI functions have been
@@ -4460,16 +4487,11 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_SQ6_DEMO GUIO5(GUIO_NOSPEECH, \
- GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
- GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
-#define GUIO_SQ6 GUIO5(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
- GUIO_NOASPECT, \
- GAMEOPTION_PREFER_DIGITAL_SFX, \
+#define GUIO_SQ6_DEMO GUIO2(GUIO_NOLAUNCHLOAD, \
+ GUIO_NOASPECT)
+#define GUIO_SQ6 GUIO3(GUIO_NOASPECT, \
GAMEOPTION_ORIGINAL_SAVELOAD, \
- GAMEOPTION_FB01_MIDI)
+ GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
// Space Quest 6 - English DOS/Win3.11 CD (from the Space Quest Collection)
// Executable scanning reports "2.100.002", VERSION file reports "1.0"
@@ -4510,6 +4532,10 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "ab12724e078dea34b624e0d2a38dcd7c", 2272050},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO_SQ6_DEMO },
+
+#undef GUIO_SQ6_DEMO
+#undef GUIO_SQ6
+
#endif // ENABLE_SCI32
// The Island of Dr. Brain - English DOS CD (from jvprat)
@@ -4538,13 +4564,13 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#ifdef ENABLE_SCI32
-#define GUIO_TORIN_DEMO GUIO3(GUIO_NOASPECT, \
- GUIO_NOMIDI, \
- GAMEOPTION_ORIGINAL_SAVELOAD)
-#define GUIO_TORIN GUIO4(GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \
+#define GUIO_TORIN_DEMO GUIO3(GUIO_NOMIDI, \
+ GUIO_NOLAUNCHLOAD, \
+ GUIO_NOASPECT)
+#define GUIO_TORIN GUIO4(GUIO_NOMIDI, \
GUIO_NOASPECT, \
- GUIO_NOMIDI, \
- GAMEOPTION_ORIGINAL_SAVELOAD)
+ GAMEOPTION_ORIGINAL_SAVELOAD, \
+ GAMEOPTION_ENABLE_BLACK_LINED_VIDEO)
#define GUIO_TORIN_MAC GUIO_TORIN
// Torin's Passage - English Windows Interactive Demo
@@ -4634,6 +4660,11 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"Data7", 0, "2afd9b5434102b89610916b904c3f73a", 7627374},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE | ADGF_CD, GUIO_TORIN_MAC },
+
+#undef GUIO_TORIN_DEMO
+#undef GUIO_TORIN
+#undef GUIO_TORIN_MAC
+
#endif // ENABLE_SCI32
// SCI Fanmade Games
diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h
index ee978be033..8f84bbacad 100644
--- a/engines/sci/engine/features.h
+++ b/engines/sci/engine/features.h
@@ -132,6 +132,19 @@ public:
inline bool usesAlternateSelectors() const {
return g_sci->getGameId() == GID_PHANTASMAGORIA2;
}
+
+ inline bool hasEmptyScaleDrawHack() const {
+ // Yes: KQ7 (all), PQ4CD, QFG4CD, SQ6, Phant1
+ // No: All SCI2, all SCI3, GK2, LSL6hires, PQ:SWAT, Torin
+ // Unknown: Hoyle5, MGDX, Shivers
+ const SciGameId &gid = g_sci->getGameId();
+ return getSciVersion() > SCI_VERSION_2 &&
+ getSciVersion() < SCI_VERSION_2_1_LATE &&
+ gid != GID_LSL6HIRES &&
+ gid != GID_GK2 &&
+ gid != GID_PQSWAT &&
+ gid != GID_TORIN;
+ }
#endif
/**
diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp
index da1d00f3bf..75aa4fa2ca 100644
--- a/engines/sci/engine/file.cpp
+++ b/engines/sci/engine/file.cpp
@@ -200,6 +200,15 @@ reg_t file_open(EngineState *s, const Common::String &filename, kFileOpenMode mo
if (s->currentRoomNumber() == 52)
isCompressed = false;
break;
+#ifdef ENABLE_SCI32
+ // Phantasmagoria game scripts create their own save files, so they are
+ // interoperable with the original interpreter just by renaming them as long
+ // as they are not compressed. They are also never larger than a couple
+ // hundred bytes, so compression does not do much here anyway
+ case GID_PHANTASMAGORIA:
+ isCompressed = false;
+ break;
+#endif
default:
break;
}
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 85cad99226..1845ecaac5 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -989,10 +989,8 @@ void script_adjust_opcode_formats() {
}
if (getSciVersion() >= SCI_VERSION_3) {
- // TODO: There are also opcodes in
- // here to get the superclass, and possibly the species too.
- g_sci->_opcode_formats[0x4d/2][0] = Script_None;
- g_sci->_opcode_formats[0x4e/2][0] = Script_None;
+ g_sci->_opcode_formats[op_info][0] = Script_None;
+ g_sci->_opcode_formats[op_superP][0] = Script_None;
}
#endif
}
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 5fb1ab6c66..335fec06ad 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -637,7 +637,12 @@ reg_t kMessageBox(EngineState *s, int argc, reg_t *argv);
reg_t kGetConfig(EngineState *s, int argc, reg_t *argv);
reg_t kGetSierraProfileInt(EngineState *s, int argc, reg_t *argv);
reg_t kPrintDebug(EngineState *s, int argc, reg_t *argv);
+
reg_t kCelInfo(EngineState *s, int argc, reg_t *argv);
+reg_t kCelInfoGetOriginX(EngineState *s, int argc, reg_t *argv);
+reg_t kCelInfoGetOriginY(EngineState *s, int argc, reg_t *argv);
+reg_t kCelInfoGetPixel(EngineState *s, int argc, reg_t *argv);
+
reg_t kSetLanguage(EngineState *s, int argc, reg_t *argv);
reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv);
reg_t kSetFontHeight(EngineState *s, int argc, reg_t *argv);
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 2db3c59e64..ac4987e603 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -287,7 +287,7 @@ static const SciKernelMapSubEntry kPalVary_subops[] = {
{ SIG_SCI32, 6, MAP_CALL(PalVaryPauseResume), "i", NULL },
{ SIG_SCI32, 7, MAP_CALL(PalVarySetTarget), "i", NULL },
{ SIG_SCI32, 8, MAP_CALL(PalVarySetStart), "i", NULL },
- { SIG_SCI32, 9, MAP_CALL(PalVaryMergeStart), "i", NULL },
+ { SIG_SCI32, 9, MAP_CALL(PalVaryMergeStart), "i", kPalVaryMergeStart_workarounds },
#endif
SCI_SUBOPENTRY_TERMINATOR
};
@@ -511,8 +511,8 @@ static const SciKernelMapSubEntry kArray_subops[] = {
{ SIG_SCI32, 1, MAP_CALL(ArrayGetSize), "r", NULL },
{ SIG_SCI32, 2, MAP_CALL(ArrayGetElement), "ri", NULL },
{ SIG_SCI32, 3, MAP_CALL(ArraySetElements), "ri(.*)", kArraySetElements_workarounds },
- { SIG_SCI32, 4, MAP_CALL(ArrayFree), "r", NULL },
- { SIG_SCI32, 5, MAP_CALL(ArrayFill), "riii", NULL },
+ { SIG_SCI32, 4, MAP_CALL(ArrayFree), "[0r]", NULL },
+ { SIG_SCI32, 5, MAP_CALL(ArrayFill), "riii", kArrayFill_workarounds },
{ SIG_SCI32, 6, MAP_CALL(ArrayCopy), "ririi", NULL },
// there is no subop 7
{ SIG_SCI32, 8, MAP_CALL(ArrayDuplicate), "r", NULL },
@@ -531,7 +531,7 @@ static const SciKernelMapSubEntry kString_subops[] = {
{ SIG_THRU_SCI21MID, 2, MAP_CALL(StringGetChar), "ri", NULL },
{ SIG_THRU_SCI21MID, 3, MAP_CALL(ArraySetElements), "ri(i*)", kArraySetElements_workarounds },
{ SIG_THRU_SCI21MID, 4, MAP_CALL(StringFree), "[0r]", NULL },
- { SIG_THRU_SCI21MID, 5, MAP_CALL(ArrayFill), "rii", NULL },
+ { SIG_THRU_SCI21MID, 5, MAP_CALL(ArrayFill), "rii", kArrayFill_workarounds },
{ SIG_THRU_SCI21MID, 6, MAP_CALL(ArrayCopy), "ririi", NULL },
{ SIG_SCI32, 7, MAP_CALL(StringCompare), "rr(i)", NULL },
@@ -560,6 +560,16 @@ static const SciKernelMapSubEntry kString_subops[] = {
};
// version, subId, function-mapping, signature, workarounds
+static const SciKernelMapSubEntry kCelInfo_subops[] = {
+ { SIG_SINCE_SCI21MID, 0, MAP_CALL(CelInfoGetOriginX), "iii", NULL },
+ { SIG_SINCE_SCI21MID, 1, MAP_CALL(CelInfoGetOriginY), "iii", NULL },
+ { SIG_SINCE_SCI21MID, 2, MAP_EMPTY(CelInfo), "iii", NULL },
+ { SIG_SINCE_SCI21MID, 3, MAP_EMPTY(CelInfo), "iii", NULL },
+ { SIG_SINCE_SCI21MID, 4, MAP_CALL(CelInfoGetPixel), "iiiii", NULL },
+ SCI_SUBOPENTRY_TERMINATOR
+};
+
+// version, subId, function-mapping, signature, workarounds
static const SciKernelMapSubEntry kScrollWindow_subops[] = {
{ SIG_SCI32, 0, MAP_CALL(ScrollWindowCreate), "oi", NULL },
{ SIG_SCI32, 1, MAP_CALL(ScrollWindowAdd), "iriii(i)", kScrollWindowAdd_workarounds },
@@ -850,7 +860,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(DeletePlane), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(DeleteScreenItem), SIG_EVERYWHERE, "o", NULL, NULL },
{ "DisposeTextBitmap", kBitmapDestroy, SIG_SCI2, SIGFOR_ALL, "[r!]", NULL, NULL },
- { MAP_CALL(FrameOut), SIG_EVERYWHERE, "(i)", NULL, NULL },
+ { MAP_CALL(FrameOut), SIG_EVERYWHERE, "(i)", NULL, kFrameOut_workarounds },
{ MAP_CALL(GetHighPlanePri), SIG_EVERYWHERE, "", NULL, NULL },
{ MAP_CALL(InPolygon), SIG_EVERYWHERE, "iio", NULL, NULL },
{ MAP_CALL(IsHiRes), SIG_EVERYWHERE, "", NULL, NULL },
@@ -868,7 +878,8 @@ static SciKernelMapEntry s_kernelMap[] = {
// our own memory manager and garbage collector, thus we simply call FlushResources, which in turn invokes
// our garbage collector (i.e. the SCI0-SCI1.1 semantics).
{ "Purge", kFlushResources, SIG_EVERYWHERE, "i", NULL, NULL },
- { MAP_CALL(SetShowStyle), SIG_EVERYWHERE, "ioiiiii([ri])(i)", NULL, NULL },
+ { MAP_CALL(SetShowStyle), SIG_THRU_SCI21MID, SIGFOR_ALL, "ioiiiii([ri])(i)", NULL, NULL },
+ { MAP_CALL(SetShowStyle), SIG_SINCE_SCI21LATE, SIGFOR_ALL, "ioiiiiii(r)(i)", NULL, NULL },
{ MAP_CALL(String), SIG_EVERYWHERE, "(.*)", kString_subops, NULL },
{ MAP_CALL(UpdatePlane), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(UpdateScreenItem), SIG_EVERYWHERE, "o", NULL, NULL },
@@ -932,7 +943,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(WinHelp), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_CALL(GetConfig), SIG_EVERYWHERE, "ro", NULL, NULL },
{ MAP_CALL(GetSierraProfileInt), SIG_EVERYWHERE, "rri", NULL, NULL },
- { MAP_CALL(CelInfo), SIG_SINCE_SCI21MID, SIGFOR_ALL, "iiiiii", NULL, NULL },
+ { MAP_CALL(CelInfo), SIG_SINCE_SCI21MID, SIGFOR_ALL, "(.*)", kCelInfo_subops, NULL },
{ MAP_CALL(SetLanguage), SIG_SINCE_SCI21MID, SIGFOR_ALL, "r", NULL, NULL },
{ MAP_CALL(ScrollWindow), SIG_EVERYWHERE, "i(.*)", kScrollWindow_subops, NULL },
{ MAP_CALL(SetFontRes), SIG_SCI21EARLY, SIGFOR_ALL, "ii", NULL, NULL },
@@ -986,11 +997,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_DUMMY(GetSaveCDisc), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_DUMMY(TestPoly), SIG_EVERYWHERE, "(.*)", NULL, NULL },
- // SCI2.1 unmapped functions - TODO!
-
- // SetHotRectangles - used by Phantasmagoria 1, script 64981 (used in the chase scene)
- // <lskovlun> The idea, if I understand correctly, is that the engine generates events
- // of a special HotRect type continuously when the mouse is on that rectangle
+ // Used by Phantasmagoria 1, script 64981 (used in the chase scene)
{ MAP_CALL(SetHotRectangles), SIG_SINCE_SCI21MID, SIGFOR_ALL, "i(r)", NULL, NULL },
// Used by SQ6 to scroll through the inventory via the up/down buttons
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 796eb08450..7bc3c2d212 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -427,6 +427,13 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) {
return make_reg(0, handle);
}
}
+ } else if (g_sci->getGameId() == GID_PQSWAT) {
+ // PQSWAT tries to create subdirectories for each game profile
+ for (Common::String::iterator it = name.begin(); it != name.end(); ++it) {
+ if (*it == '\\') {
+ *it = '_';
+ }
+ }
}
// See kMakeSaveCatName
@@ -526,7 +533,6 @@ reg_t kFileIOWriteRaw(EngineState *s, int argc, reg_t *argv) {
uint bytesWritten = 0;
bool success = false;
s->_segMan->memcpy((byte *)buf, argv[1], size);
- debugC(kDebugLevelFile, "kFileIO(writeRaw): %d, %d", handle, size);
FileHandle *f = getFileFromHandle(s, handle);
if (f) {
@@ -534,6 +540,8 @@ reg_t kFileIOWriteRaw(EngineState *s, int argc, reg_t *argv) {
success = !f->_out->err();
}
+ debugC(kDebugLevelFile, "kFileIO(writeRaw): %d, %d (%d, %d)", handle, size, bytesWritten, success);
+
delete[] buf;
#ifdef ENABLE_SCI32
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index a3f7e4fbd3..f6aeeb7f9e 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -389,13 +389,13 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
pFadeArray = NULL_REG;
divisions = argc > 7 ? argv[7].toSint16() : -1;
}
- // SCI 2.1mid–2.1late
- else if (getSciVersion() < SCI_VERSION_3) {
+ // SCI 2.1mid
+ else if (getSciVersion() < SCI_VERSION_2_1_LATE) {
blackScreen = 0;
pFadeArray = argc > 7 ? argv[7] : NULL_REG;
divisions = argc > 8 ? argv[8].toSint16() : -1;
}
- // SCI 3
+ // SCI 2.1late-3
else {
blackScreen = argv[7].toSint16();
pFadeArray = argc > 8 ? argv[8] : NULL_REG;
@@ -406,14 +406,6 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
error("Illegal show style %d for plane %04x:%04x", type, PRINT_REG(planeObj));
}
-// TODO: Reuse later for SCI2 and SCI3 implementation and then discard
-// warning("kSetShowStyle: effect %d, plane: %04x:%04x (%s), sec: %d, "
-// "dir: %d, prio: %d, animate: %d, ref frame: %d, black screen: %d, "
-// "pFadeArray: %04x:%04x (%s), divisions: %d",
-// type, PRINT_REG(planeObj), s->_segMan->getObjectName(planeObj), seconds,
-// back, priority, animate, refFrame, blackScreen,
-// PRINT_REG(pFadeArray), s->_segMan->getObjectName(pFadeArray), divisions);
-
// NOTE: The order of planeObj and showStyle are reversed
// because this is how SCI3 called the corresponding method
// on the KernelMgr
@@ -438,31 +430,28 @@ reg_t kCelWide32(EngineState *s, int argc, reg_t *argv) {
return make_reg(0, mulru(celObj._width, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth, celObj._xResolution)));
}
+// Used by Shivers 1, room 23601 to determine what blocks on the red door
+// puzzle board are occupied by pieces already, and by Phantasmagoria 2 when
+// saving the game from the in-game UI
reg_t kCelInfo(EngineState *s, int argc, reg_t *argv) {
- // Used by Shivers 1, room 23601 to determine what blocks on the red door puzzle board
- // are occupied by pieces already
-
- CelObjView view(argv[1].toUint16(), argv[2].toSint16(), argv[3].toSint16());
+ if (!s)
+ return make_reg(0, getSciVersion());
+ error("not supposed to call this");
+}
- int16 result = 0;
+reg_t kCelInfoGetOriginX(EngineState *s, int argc, reg_t *argv) {
+ CelObjView view(argv[0].toUint16(), argv[1].toSint16(), argv[2].toSint16());
+ return make_reg(0, view._origin.x);
+}
- switch (argv[0].toUint16()) {
- case 0:
- result = view._origin.x;
- break;
- case 1:
- result = view._origin.y;
- break;
- case 2:
- case 3:
- // null operation
- break;
- case 4:
- result = view.readPixel(argv[4].toSint16(), argv[5].toSint16(), view._mirrorX);
- break;
- }
+reg_t kCelInfoGetOriginY(EngineState *s, int argc, reg_t *argv) {
+ CelObjView view(argv[0].toUint16(), argv[1].toSint16(), argv[2].toSint16());
+ return make_reg(0, view._origin.y);
+}
- return make_reg(0, result);
+reg_t kCelInfoGetPixel(EngineState *s, int argc, reg_t *argv) {
+ CelObjView view(argv[0].toUint16(), argv[1].toSint16(), argv[2].toSint16());
+ return make_reg(0, view.readPixel(argv[4].toSint16(), argv[5].toSint16(), view._mirrorX));
}
reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) {
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index ed53b8d52f..4a5e4f3df6 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -493,10 +493,8 @@ reg_t kSetLanguage(EngineState *s, int argc, reg_t *argv) {
// Basically, it instructs the interpreter to switch the audio resources
// (resource.aud and associated map files) and load them from the "Spanish"
// subdirectory instead.
- Common::String audioDirectory = s->_segMan->getString(argv[0]);
- //warning("SetLanguage: set audio resource directory to '%s'", audioDirectory.c_str());
+ const Common::String audioDirectory = s->_segMan->getString(argv[0]);
g_sci->getResMan()->changeAudioDirectory(audioDirectory);
-
return s->r_acc;
}
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index ab1f0210e7..ae91ef088a 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -663,9 +663,7 @@ reg_t kStringGetChar(EngineState *s, int argc, reg_t *argv) {
}
reg_t kStringFree(EngineState *s, int argc, reg_t *argv) {
- if (!argv[0].isNull()) {
- s->_segMan->freeArray(argv[0]);
- }
+ s->_segMan->freeArray(argv[0]);
return s->r_acc;
}
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 0c4f0da959..b2d66d0170 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -105,6 +105,7 @@ static const char *const selectorNameTable[] = {
"setLoop", // Laura Bow 1 Colonel's Bequest
#ifdef ENABLE_SCI32
"newWith", // SCI2 array script
+ "scrollSelections", // GK2
#endif
NULL
};
@@ -137,7 +138,8 @@ enum ScriptPatcherSelectors {
SELECTOR_setLoop
#ifdef ENABLE_SCI32
,
- SELECTOR_newWith
+ SELECTOR_newWith,
+ SELECTOR_scrollSelections
#endif
};
@@ -1012,11 +1014,40 @@ static const SciScriptPatcherEntry gk1Signatures[] = {
#pragma mark -
#pragma mark Gabriel Knight 2
-// script, description, signature patch
+// The down scroll button in GK2 jumps up a pixel on mousedown because there is
+// a send to scrollSelections using an immediate value 1, which means to scroll
+// up by 1 pixel. This patch fixes the send to scrollSelections by passing the
+// button's delta instead of 1.
+//
+// Applies to at least: English CD 1.00, English Steam 1.01
+// Responsible method: ScrollButton::track
+static const uint16 gk2InvScrollSignature[] = {
+ 0x7e, SIG_ADDTOOFFSET(2), // line whatever
+ SIG_MAGICDWORD,
+ 0x38, SIG_SELECTOR16(scrollSelections), // pushi $2c3
+ 0x78, // push1
+ 0x78, // push1
+ 0x63, 0x98, // pToa $98
+ 0x4a, SIG_UINT16(0x06), // send $6
+ SIG_END
+};
+
+static const uint16 gk2InvScrollPatch[] = {
+ 0x38, PATCH_SELECTOR16(scrollSelections), // pushi $2c3
+ 0x78, // push1
+ 0x67, 0x9a, // pTos $9a (delta)
+ 0x63, 0x98, // pToa $98
+ 0x4a, PATCH_UINT16(0x06), // send $6
+ 0x18, 0x18, // waste bytes
+ PATCH_END
+};
+
+// script, description, signature patch
static const SciScriptPatcherEntry gk2Signatures[] = {
- { true, 64990, "increase number of save games", 1, sci2NumSavesSignature1, sci2NumSavesPatch1 },
- { true, 64990, "increase number of save games", 1, sci2NumSavesSignature2, sci2NumSavesPatch2 },
- { true, 64990, "disable change directory button", 1, sci2ChangeDirSignature, sci2ChangeDirPatch },
+ { true, 64990, "increase number of save games", 1, sci2NumSavesSignature1, sci2NumSavesPatch1 },
+ { true, 64990, "increase number of save games", 1, sci2NumSavesSignature2, sci2NumSavesPatch2 },
+ { true, 64990, "disable change directory button", 1, sci2ChangeDirSignature, sci2ChangeDirPatch },
+ { true, 23, "inventory starts scroll down in the wrong direction", 1, gk2InvScrollSignature, gk2InvScrollPatch },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -2864,6 +2895,43 @@ static const SciScriptPatcherEntry mothergoose256Signatures[] = {
#ifdef ENABLE_SCI32
#pragma mark -
+#pragma mark Mixed-up Mother Goose Deluxe
+
+// The game uses pic 10005 to render the Sierra logo, but then it also
+// initialises a logo object with view 502 on the same priority as the pic. In
+// the original interpreter, it is dumb luck which is drawn first (based on the
+// order of the memory IDs), though usually the pic is drawn first because not
+// many objects have been created at the start of the game. In ScummVM, the
+// renderer guarantees a sort order based on the creation order of screen items,
+// and since the view is created after the pic, it wins and is drawn on top.
+// This patch stops the view object from being created at all.
+//
+// Applies to at least: English CD from King's Quest Collection
+// Responsible method: sShowLogo::changeState
+static const uint16 mothergooseHiresSignatureLogo[] = {
+ 0x38, SIG_UINT16(0x8e), // pushi $8e
+ SIG_MAGICDWORD,
+ 0x76, // push0
+ 0x72, SIG_UINT16(0x82), // lofsa logo[82]
+ 0x4a, SIG_UINT16(0x04), // send $4
+ SIG_END
+};
+
+static const uint16 mothergooseHiresPatchLogo[] = {
+ 0x18, 0x18, 0x18, // waste bytes
+ 0x18, // waste bytes
+ 0x18, 0x18, 0x18, // waste bytes
+ 0x18, 0x18, 0x18, // waste bytes
+ PATCH_END
+};
+
+// script, description, signature patch
+static const SciScriptPatcherEntry mothergooseHiresSignatures[] = {
+ { true, 108, "bad logo rendering", 1, mothergooseHiresSignatureLogo, mothergooseHiresPatchLogo },
+ SCI_SIGNATUREENTRY_TERMINATOR
+};
+
+#pragma mark -
#pragma mark Phantasmagoria
// script, description, signature patch
@@ -5147,6 +5215,10 @@ void ScriptPatcher::processScript(uint16 scriptNr, byte *scriptData, const uint3
signatureTable = mothergoose256Signatures;
break;
#ifdef ENABLE_SCI32
+ case GID_MOTHERGOOSEHIRES:
+ signatureTable = mothergooseHiresSignatures;
+ break;
+
case GID_PHANTASMAGORIA:
signatureTable = phantasmagoriaSignatures;
break;
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 159d3170f8..23d1942dd3 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -892,6 +892,11 @@ SciArray *SegManager::lookupArray(reg_t addr) {
}
void SegManager::freeArray(reg_t addr) {
+ // SSCI memory manager ignores attempts to free null handles
+ if (addr.isNull()) {
+ return;
+ }
+
if (_heap[addr.getSegment()]->getType() != SEG_TYPE_ARRAY)
error("Attempt to use non-array %04x:%04x as array", PRINT_REG(addr));
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 8e407a6ab9..74a2841521 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1043,7 +1043,7 @@ void run_vm(EngineState *s) {
break;
- case op_infoToa: // (38)
+ case op_info: // (38)
if (getSciVersion() < SCI_VERSION_3)
error("Dummy opcode 0x%x called", opcode); // should never happen
@@ -1053,7 +1053,7 @@ void run_vm(EngineState *s) {
PUSH32(obj->getInfoSelector());
break;
- case op_superToa: // (39)
+ case op_superP: // (39)
if (getSciVersion() < SCI_VERSION_3)
error("Dummy opcode 0x%x called", opcode); // should never happen
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 13f60fd49c..18549e3a0e 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -198,8 +198,8 @@ enum SciOpcodes {
op_calle = 0x23, // 035
op_ret = 0x24, // 036
op_send = 0x25, // 037
- op_infoToa = 0x26, // 038
- op_superToa = 0x27, // 039
+ op_info = 0x26, // 038
+ op_superP = 0x27, // 039
op_class = 0x28, // 040
// dummy 0x29, // 041
op_self = 0x2a, // 042
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index f3e22b7c51..560a383e24 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -342,6 +342,7 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
{ GID_LSL6HIRES, -1, 85, 0, "LL6Inv", "init", NULL, 0, { WORKAROUND_FAKE, 0 } }, // when creating a new game
{ GID_LSL6HIRES, -1, 64950, 1, "Feature", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // at least when entering swimming pool area
{ GID_LSL6HIRES, -1, 64964, 0, "DPath", "init", NULL, 1, { WORKAROUND_FAKE, 0 } }, // during the game
+ { GID_LSL7, -1, 64017, 0, "oFlags", "clear", NULL, 0, { WORKAROUND_FAKE, 0 } }, // demo version, when it starts, and whenever the player chooses to go to the "Strip Liar's Dice" mini game
{ GID_MOTHERGOOSE256, -1, 0, 0, "MG", "doit", NULL, 5, { WORKAROUND_FAKE, 0 } }, // SCI1.1: When moving the cursor all the way to the left during the game - bug #5224
{ GID_MOTHERGOOSE256, -1, 992, 0, "AIPath", "init", NULL, 0, { WORKAROUND_FAKE, 0 } }, // Happens in the demo and full version. In the demo, it happens when walking two screens from mother goose's house to the north. In the full version, it happens in rooms 7 and 23 - bug #5269
{ GID_MOTHERGOOSE256, 90, 90, 0, "introScript", "changeState", NULL, 65, { WORKAROUND_FAKE, 0 } }, // SCI1(CD): At the very end, after the game is completed and restarted - bug #5626
@@ -351,7 +352,11 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
{ GID_PEPPER, -1, 894, 0, "Package", "doVerb", NULL, 3, { WORKAROUND_FAKE, 0 } }, // using the hand on the book in the inventory - bug #5154
{ GID_PEPPER, 150, 928, 0, "Narrator", "startText", NULL, 0, { WORKAROUND_FAKE, 0 } }, // happens during the non-interactive demo of Pepper
{ GID_PQ4, -1, 25, 0, "iconToggle", "select", NULL, 1, { WORKAROUND_FAKE, 0 } }, // when toggling the icon bar to auto-hide or not
+ { GID_PQ4, 275, 64964, -1, "DPath", "init", NULL, 1, { WORKAROUND_FAKE, 0 } }, // when Sherry walks out of the morgue on day 3
+ { GID_PQ4, 240, 64964, -1, "DPath", "init", NULL, 1, { WORKAROUND_FAKE, 0 } }, // when encountering Sherry and the reporter outside the morgue at the end of day 3
{ GID_PQSWAT, -1, 64950, 0, NULL, "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // Using any menus in-game
+ { GID_PQSWAT, -1, 73, 0, "theLashInterface", "transmit", NULL, 0, { WORKAROUND_FAKE, 0 } }, // Clicking the transmit button in LASH
+ { GID_PQSWAT, 2990, 2990, 0, "talkToSchienbly", "changeState", NULL, 1, { WORKAROUND_FAKE, 0 } }, // When the video of Schienbly talking for the first time ends
{ GID_QFG1, -1, 210, 0, "Encounter", "init", sig_uninitread_qfg1_1, 0, { WORKAROUND_FAKE, 0 } }, // qfg1/hq1: going to the brigands hideout
{ GID_QFG1VGA, 16, 16, 0, "lassoFailed", "changeState", NULL, -1, { WORKAROUND_FAKE, 0 } }, // qfg1vga: casting the "fetch" spell in the screen with the flowers, temps 0 and 1 - bug #5309
{ GID_QFG1VGA, -1, 210, 0, "Encounter", "init", sig_uninitread_qfg1vga_1, 0, { WORKAROUND_FAKE, 0 } }, // qfg1vga: going to the brigands hideout - bug #5515
@@ -377,9 +382,8 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
{ GID_QFG4, -1, 64917, -1, "Plane", "setBitmap", NULL, 3, { WORKAROUND_FAKE, 0 } }, // floppy version, happens sometimes in fight scenes
{ GID_QFG4, 520, 64950, 0, "fLake2", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // CD version, at the lake, when meeting the Rusalka and attempting to leave
{ GID_QFG4, 800, 64950, 0, "View", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // CD version, in the room with the spider pillar, when climbing on the pillar
- { GID_RAMA, 12, 64950, -1, "InterfaceFeature", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // Demo, right when it starts
- { GID_RAMA, 12, 64950, -1, "hiliteOptText", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // Demo, right when it starts
- { GID_RAMA, 12, 64950, -1, "View", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // Demo, right when it starts
+ { GID_RAMA, -1, 64950, -1, "InterfaceFeature", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // When clicking on the main game interface
+ { GID_RAMA, -1, 64950, -1, "View", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // When clicking on main menu buttons
{ GID_SHIVERS, -1, 952, 0, "SoundManager", "stop", NULL, 2, { WORKAROUND_FAKE, 0 } }, // Just after Sierra logo
{ GID_SHIVERS, -1, 64950, 0, "Feature", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // When clicking on the locked door at the beginning
{ GID_SHIVERS, -1, 64950, 0, "View", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // When clicking on the gargoyle eye at the beginning
@@ -426,6 +430,12 @@ const SciWorkaroundEntry kArraySetElements_workarounds[] = {
};
// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
+const SciWorkaroundEntry kArrayFill_workarounds[] = {
+ { GID_PQ4, 540, 64918, 0, "Str", "callKernel", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // when clicking on Hate Crimes in the computer on day 2
+ SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
+// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
const SciWorkaroundEntry kCelHigh_workarounds[] = {
{ GID_KQ5, -1, 255, 0, "deathIcon", "setSize", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #5049
{ GID_PQ2, -1, 255, 0, "DIcon", "setSize", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
@@ -553,7 +563,9 @@ const SciWorkaroundEntry kDoSoundPlay_workarounds[] = {
{ GID_QFG4, -1, 64989, 0, NULL, "play", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
{ GID_PQ4, -1, 64989, 0, NULL, "play", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
{ GID_KQ7, -1, 64989, 0, NULL, "play", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
+ { GID_SQ6, -1, 0, 0, NULL, "play", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // Demo passes an extra null argument on startup
{ GID_GK1, -1, 64989, 0, NULL, "play", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // Mac version always passes an extra null argument
+ { GID_GK2, -1, 64989, 0, NULL, "play", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // Demo passes an extra null argument when clicking on buttons
SCI_WORKAROUNDENTRY_TERMINATOR
};
@@ -578,6 +590,7 @@ const SciWorkaroundEntry kGetAngle_workarounds[] = {
// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
const SciWorkaroundEntry kFileIOOpen_workarounds[] = {
{ GID_TORIN, 61000, 61000, 0, "roSierraLogo", "init", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when the game checks for autosave.cat after the Sierra logo
+ { GID_TORIN, 61100, 61100, 0, "roPickAChapter", "init", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when the game checks for autosave.cat after the Sierra logo in the demo
SCI_WORKAROUNDENTRY_TERMINATOR
};
@@ -588,6 +601,17 @@ const SciWorkaroundEntry kFindKey_workarounds[] = {
SCI_WORKAROUNDENTRY_TERMINATOR
};
+// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
+const SciWorkaroundEntry kFrameOut_workarounds[] = {
+ { GID_PQ4, 360, 360, 0, "copCarInset", "init", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When clicking hand on the impounded police car on day 3
+ { GID_PQ4, 360, 360, 0, "copCarInset", "dispose", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the impounded police car on day 3
+ { GID_PQ4, 275, 275, 0, "checkSherry", "changeState", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When encountering Sherry and Sam in the morgue on day 3
+ { GID_PQ4, 725, 725, 0, "fridgeInset", "init", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When opening the refrigerator at the end of day 4
+ { GID_PQ4, 725, 725, 0, "fridgeInset", "dispose", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the refrigerator at the end of day 4
+ { GID_PQ4, 735, 735, 0, "medInset", "dispose", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the medicine cabinet at the end of day 4
+ SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
const SciWorkaroundEntry kGraphDrawLine_workarounds[] = {
{ GID_ISLANDBRAIN, 300, 300, 0, "dudeViewer", "show", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // when looking at the gene explanation chart, gets called with 1 extra parameter
@@ -720,6 +744,12 @@ const SciWorkaroundEntry kPalVarySetPercent_workarounds[] = {
};
// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
+const SciWorkaroundEntry kPalVaryMergeStart_workarounds[] = {
+ { GID_PQ4, 170, 170, 0, "getHit", "changeState", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // Three extra parameters passed during the gunfight at the end of day 1
+ SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
+// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
const SciWorkaroundEntry kPlatform32_workarounds[] = {
{ GID_HOYLE5, -1, 0, 0, "hoyle4", "newRoom", NULL, 0, { WORKAROUND_FAKE, 1 } }, // at the start of the game, incorrectly uses SCI16 calling convention for kPlatform
SCI_WORKAROUNDENTRY_TERMINATOR
@@ -842,15 +872,6 @@ const SciWorkaroundEntry kScrollWindowAdd_workarounds[] = {
};
SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroundEntry *workaroundList, SciCallOrigin *trackOrigin) {
- // HACK for SCI3: Temporarily ignore this
- if (getSciVersion() == SCI_VERSION_3) {
- warning("SCI3 HACK: trackOriginAndFindWorkaround() called, ignoring");
- SciWorkaroundSolution sci3IgnoreForNow;
- sci3IgnoreForNow.type = WORKAROUND_FAKE;
- sci3IgnoreForNow.value = 0;
- return sci3IgnoreForNow;
- }
-
const EngineState *state = g_sci->getEngineState();
ExecStack *lastCall = state->xs;
const SciGameId gameId = g_sci->getGameId();
diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h
index 86b4ee2902..cb928faf09 100644
--- a/engines/sci/engine/workarounds.h
+++ b/engines/sci/engine/workarounds.h
@@ -72,6 +72,7 @@ extern const SciWorkaroundEntry kDoSoundPlay_workarounds[];
extern const SciWorkaroundEntry kDoSoundFade_workarounds[];
extern const SciWorkaroundEntry kFileIOOpen_workarounds[];
extern const SciWorkaroundEntry kFindKey_workarounds[];
+extern const SciWorkaroundEntry kFrameOut_workarounds[];
extern const SciWorkaroundEntry kDeleteKey_workarounds[];
extern const SciWorkaroundEntry kGetAngle_workarounds[];
extern const SciWorkaroundEntry kGraphDrawLine_workarounds[];
@@ -87,6 +88,7 @@ extern const SciWorkaroundEntry kMemory_workarounds[];
extern const SciWorkaroundEntry kMoveCursor_workarounds[];
extern const SciWorkaroundEntry kNewWindow_workarounds[];
extern const SciWorkaroundEntry kPalVarySetPercent_workarounds[];
+extern const SciWorkaroundEntry kPalVaryMergeStart_workarounds[];
extern const SciWorkaroundEntry kPlatform32_workarounds[];
extern const SciWorkaroundEntry kRandom_workarounds[];
extern const SciWorkaroundEntry kReadNumber_workarounds[];
@@ -94,6 +96,7 @@ extern const SciWorkaroundEntry kResCheck_workarounds[];
extern const SciWorkaroundEntry kPaletteUnsetFlag_workarounds[];
extern const SciWorkaroundEntry kSetCursor_workarounds[];
extern const SciWorkaroundEntry kArraySetElements_workarounds[];
+extern const SciWorkaroundEntry kArrayFill_workarounds[];
extern const SciWorkaroundEntry kSetPort_workarounds[];
extern const SciWorkaroundEntry kStrAt_workarounds[];
extern const SciWorkaroundEntry kStrCpy_workarounds[];
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index fe0fbf7cc4..8540b636fc 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -176,6 +176,10 @@ struct SCALER_Scale {
// so just always make the reader decompress an entire
// line of source data when scaling
_reader(celObj, celObj._width) {
+#ifndef NDEBUG
+ assert(_minX <= _maxX);
+#endif
+
// In order for scaling ratios to apply equally across objects that
// start at different positions on the screen (like the cels of a
// picture), the pixels that are read from the source bitmap must all
@@ -773,6 +777,14 @@ void CelObj::drawUncompHzFlipNoMDNoSkip(Buffer &target, const Common::Rect &targ
}
void CelObj::scaleDrawNoMD(Buffer &target, const Ratio &scaleX, const Ratio &scaleY, const Common::Rect &targetRect, const Common::Point &scaledPosition) const {
+ // In SSCI the checks are > because their rects are BR-inclusive;
+ // our checks are >= because our rects are BR-exclusive
+ if (g_sci->_features->hasEmptyScaleDrawHack() &&
+ (targetRect.left >= targetRect.right ||
+ targetRect.top >= targetRect.bottom)) {
+ return;
+ }
+
if (_drawMirrored)
render<MAPPER_NoMD, SCALER_Scale<true, READER_Compressed> >(target, targetRect, scaledPosition, scaleX, scaleY);
else
@@ -780,6 +792,14 @@ void CelObj::scaleDrawNoMD(Buffer &target, const Ratio &scaleX, const Ratio &sca
}
void CelObj::scaleDrawUncompNoMD(Buffer &target, const Ratio &scaleX, const Ratio &scaleY, const Common::Rect &targetRect, const Common::Point &scaledPosition) const {
+ // In SSCI the checks are > because their rects are BR-inclusive;
+ // our checks are >= because our rects are BR-exclusive
+ if (g_sci->_features->hasEmptyScaleDrawHack() &&
+ (targetRect.left >= targetRect.right ||
+ targetRect.top >= targetRect.bottom)) {
+ return;
+ }
+
if (_drawMirrored) {
render<MAPPER_NoMD, SCALER_Scale<true, READER_Uncompressed> >(target, targetRect, scaledPosition, scaleX, scaleY);
} else {
diff --git a/engines/sci/graphics/cursor32.cpp b/engines/sci/graphics/cursor32.cpp
index 2f2611c769..6bb1323cac 100644
--- a/engines/sci/graphics/cursor32.cpp
+++ b/engines/sci/graphics/cursor32.cpp
@@ -278,6 +278,7 @@ void GfxCursor32::setView(const GuiResourceId viewId, const int16 loopNo, const
}
_cursorBack.data = (byte *)realloc(_cursorBack.data, _width * _height);
+ memset(_cursorBack.data, 0, _width * _height);
_drawBuff1.data = (byte *)realloc(_drawBuff1.data, _width * _height);
_drawBuff2.data = (byte *)realloc(_drawBuff2.data, _width * _height * 4);
_savedVmapRegion.data = (byte *)realloc(_savedVmapRegion.data, _width * _height);
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index fe43c75e5a..464b28a2ba 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -35,6 +35,7 @@
#include "sci/sci.h"
#include "sci/console.h"
+#include "sci/event.h"
#include "sci/engine/features.h"
#include "sci/engine/kernel.h"
#include "sci/engine/state.h"
@@ -85,16 +86,21 @@ GfxFrameout::GfxFrameout(SegManager *segMan, GfxPalette32 *palette, GfxTransitio
switch (g_sci->getGameId()) {
case GID_HOYLE5:
- case GID_GK2:
case GID_LIGHTHOUSE:
case GID_LSL7:
case GID_PHANTASMAGORIA2:
- case GID_PQSWAT:
case GID_TORIN:
case GID_RAMA:
_currentBuffer.scriptWidth = 640;
_currentBuffer.scriptHeight = 480;
break;
+ case GID_GK2:
+ case GID_PQSWAT:
+ if (!g_sci->isDemo()) {
+ _currentBuffer.scriptWidth = 640;
+ _currentBuffer.scriptHeight = 480;
+ }
+ break;
default:
// default script width for other games is 320x200
break;
@@ -502,6 +508,14 @@ void GfxFrameout::kernelAddPicAt(const reg_t planeObject, const GuiResourceId pi
#pragma mark Rendering
void GfxFrameout::frameOut(const bool shouldShowBits, const Common::Rect &eraseRect) {
+ // In SSCI, mouse events were received via hardware interrupt, so the mouse
+ // cursor would always get updated whenever the user moved the mouse. Since
+ // we must poll for mouse events instead, poll here so that the mouse gets
+ // updated with its current position at render time. If we do not do this,
+ // the mouse gets "stuck" during loops that do not make calls to kGetEvent,
+ // like transitions and the benchmarking loop at the start of every game.
+ g_sci->getEventManager()->getSciEvent(SCI_EVENT_PEEK);
+
RobotDecoder &robotPlayer = g_sci->_video32->getRobotPlayer();
const bool robotIsActive = robotPlayer.getStatus() != RobotDecoder::kRobotStatusUninitialized;
@@ -1154,10 +1168,13 @@ void GfxFrameout::showBits() {
byte *sourceBuffer = (byte *)_currentBuffer.getPixels() + rounded.top * _currentBuffer.screenWidth + rounded.left;
- // TODO: Sometimes transition screen items generate zero-dimension
- // show rectangles. Is this a bug?
+ // Sometimes screen items (especially from SCI2.1early transitions, like
+ // in the asteroids minigame in PQ4) generate zero-dimension show
+ // rectangles. In SSCI, zero-dimension rectangles are OK (they just
+ // result in no copy), but OSystem::copyRectToScreen will assert on
+ // them, so we need to check for zero-dimensions rectangles and ignore
+ // them explicitly
if (rounded.width() == 0 || rounded.height() == 0) {
- warning("Zero-dimension show rectangle ignored");
continue;
}
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp
index bf7c73623e..8a63365f03 100644
--- a/engines/sci/graphics/paint32.cpp
+++ b/engines/sci/graphics/paint32.cpp
@@ -121,7 +121,7 @@ void GfxPaint32::plotter(int x, int y, int color, void *data) {
reg_t GfxPaint32::makeLineBitmap(const Common::Point &startPoint, const Common::Point &endPoint, const int16 priority, const uint8 color, const LineStyle style, uint16 pattern, uint8 thickness, Common::Rect &outRect) {
const uint8 skipColor = color != kDefaultSkipColor ? kDefaultSkipColor : 0;
- // Line thickness is expected to be 2 * thickness + 1
+ // Line thickness is expected to be 2n + 1
thickness = (MAX<uint8>(1, thickness) - 1) | 1;
const uint8 halfThickness = thickness >> 1;
@@ -130,8 +130,8 @@ reg_t GfxPaint32::makeLineBitmap(const Common::Point &startPoint, const Common::
outRect.left = MIN<int16>(startPoint.x, endPoint.x);
outRect.top = MIN<int16>(startPoint.y, endPoint.y);
- outRect.right = MAX<int16>(startPoint.x, endPoint.x) + 1 + 1; // rect lower edge + thickness offset
- outRect.bottom = MAX<int16>(startPoint.y, endPoint.y) + 1 + 1; // rect lower edge + thickness offset
+ outRect.right = MAX<int16>(startPoint.x, endPoint.x) + 1;
+ outRect.bottom = MAX<int16>(startPoint.y, endPoint.y) + 1;
outRect.grow(halfThickness);
outRect.clip(Common::Rect(scriptWidth, scriptHeight));
diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp
index f7239c33bb..4757770dc0 100644
--- a/engines/sci/graphics/screen_item32.cpp
+++ b/engines/sci/graphics/screen_item32.cpp
@@ -455,7 +455,11 @@ void ScreenItem::calcRects(const Plane &plane) {
_screenRect = _screenItemRect;
- if (_screenRect.intersects(plane._screenRect)) {
+ // PQ4CD creates screen items with invalid rects; SSCI does not care
+ // about this, but `Common::Rect::clip` does, so we need to check
+ // whether or not the rect is actually valid before clipping and only
+ // clip valid rects
+ if (_screenRect.intersects(plane._screenRect) && _screenRect.isValidRect()) {
_screenRect.clip(plane._screenRect);
} else {
_screenRect.right = 0;
diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp
index a1ae352b6c..bc2825ba77 100644
--- a/engines/sci/graphics/transitions32.cpp
+++ b/engines/sci/graphics/transitions32.cpp
@@ -319,16 +319,20 @@ void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeOb
if (createNewEntry) {
if (getSciVersion() <= SCI_VERSION_2_1_EARLY) {
switch (entry->type) {
+ case kShowStyleWipeLeft:
+ case kShowStyleWipeRight:
+ configure21EarlyHorizontalWipe(*entry, priority);
+ break;
case kShowStyleIrisOut:
case kShowStyleIrisIn:
configure21EarlyIris(*entry, priority);
- break;
+ break;
case kShowStyleDissolve:
configure21EarlyDissolve(*entry, priority, plane->_gameRect);
- break;
+ break;
default:
// do nothing
- break;
+ break;
}
}
@@ -377,6 +381,8 @@ ShowStyleList::iterator GfxTransitions32::deleteShowStyle(const ShowStyleList::i
g_sci->_gfxFrameout->deleteScreenItem(*showStyle->bitmapScreenItem);
}
break;
+ case kShowStyleWipeLeft:
+ case kShowStyleWipeRight:
case kShowStyleIrisOut:
case kShowStyleIrisIn:
if (getSciVersion() <= SCI_VERSION_2_1_EARLY) {
@@ -406,6 +412,33 @@ ShowStyleList::iterator GfxTransitions32::deleteShowStyle(const ShowStyleList::i
return _showStyles.erase(showStyle);
}
+void GfxTransitions32::configure21EarlyHorizontalWipe(PlaneShowStyle &showStyle, const int16 priority) {
+ showStyle.numEdges = 1;
+ const int divisions = showStyle.divisions;
+ showStyle.screenItems.reserve(divisions);
+
+ CelInfo32 celInfo;
+ celInfo.type = kCelTypeColor;
+ celInfo.color = showStyle.color;
+
+ for (int i = 0; i < divisions; ++i) {
+ Common::Rect rect;
+ rect.left = showStyle.width * i / divisions;
+ rect.top = 0;
+ rect.right = showStyle.width * (i + 1) / divisions;
+ rect.bottom = showStyle.height;
+ showStyle.screenItems.push_back(new ScreenItem(showStyle.plane, celInfo, rect));
+ showStyle.screenItems.back()->_priority = priority;
+ showStyle.screenItems.back()->_fixedPriority = true;
+ }
+
+ if (showStyle.fadeUp) {
+ for (int i = 0; i < divisions; ++i) {
+ g_sci->_gfxFrameout->addScreenItem(*showStyle.screenItems[i]);
+ }
+ }
+}
+
void GfxTransitions32::configure21EarlyIris(PlaneShowStyle &showStyle, const int16 priority) {
showStyle.numEdges = 4;
const int numScreenItems = showStyle.numEdges * showStyle.divisions;
@@ -506,13 +539,23 @@ bool GfxTransitions32::processShowStyle(PlaneShowStyle &showStyle, uint32 now) {
case kShowStyleHShutterIn:
case kShowStyleVShutterOut:
case kShowStyleVShutterIn:
- case kShowStyleWipeLeft:
- case kShowStyleWipeRight:
case kShowStyleWipeUp:
case kShowStyleWipeDown:
case kShowStyleDissolveNoMorph:
case kShowStyleMorph:
return processMorph(showStyle);
+ case kShowStyleWipeLeft:
+ if (getSciVersion() > SCI_VERSION_2_1_EARLY) {
+ return processMorph(showStyle);
+ } else {
+ return processWipe(-1, showStyle);
+ }
+ case kShowStyleWipeRight:
+ if (getSciVersion() > SCI_VERSION_2_1_EARLY) {
+ return processMorph(showStyle);
+ } else {
+ return processWipe(1, showStyle);
+ }
case kShowStyleDissolve:
if (getSciVersion() > SCI_VERSION_2_1_EARLY) {
return processMorph(showStyle);
@@ -608,11 +651,15 @@ void GfxTransitions32::processVShutterIn(PlaneShowStyle &showStyle) {
}
void GfxTransitions32::processWipeLeft(PlaneShowStyle &showStyle) {
- error("WipeLeft is not known to be used by any game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!");
+ if (getSciVersion() > SCI_VERSION_2_1_EARLY) {
+ error("WipeLeft is not known to be used by any SCI2.1mid+ game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!");
+ }
}
void GfxTransitions32::processWipeRight(PlaneShowStyle &showStyle) {
- error("WipeRight is not known to be used by any game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!");
+ if (getSciVersion() > SCI_VERSION_2_1_EARLY) {
+ error("WipeRight is not known to be used by any SCI2.1mid+ game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!");
+ }
}
void GfxTransitions32::processWipeUp(PlaneShowStyle &showStyle) {
diff --git a/engines/sci/graphics/transitions32.h b/engines/sci/graphics/transitions32.h
index 0c828a20f7..685012fada 100644
--- a/engines/sci/graphics/transitions32.h
+++ b/engines/sci/graphics/transitions32.h
@@ -331,6 +331,12 @@ private:
ShowStyleList::iterator deleteShowStyle(const ShowStyleList::iterator &showStyle);
/**
+ * Initializes the given PlaneShowStyle for a
+ * horizontal wipe effect for SCI2 to 2.1early.
+ */
+ void configure21EarlyHorizontalWipe(PlaneShowStyle &showStyle, const int16 priority);
+
+ /**
* Initializes the given PlaneShowStyle for an
* iris effect for SCI2 to 2.1early.
*/
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index 4af1e76ed9..f4eb2c2da0 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -140,6 +140,7 @@ AVIPlayer::AVIPlayer(SegManager *segMan, EventManager *eventMan) :
_scaleBuffer(nullptr),
_plane(nullptr),
_screenItem(nullptr),
+ _bitmap(NULL_REG),
_status(kAVINotOpen) {}
AVIPlayer::~AVIPlayer() {
@@ -327,8 +328,10 @@ AVIPlayer::IOStatus AVIPlayer::close() {
_decoder->close();
_status = kAVINotOpen;
- _segMan->freeBitmap(_bitmap);
- _bitmap = NULL_REG;
+ if (_bitmap != NULL_REG) {
+ _segMan->freeBitmap(_bitmap);
+ _bitmap = NULL_REG;
+ }
g_sci->_gfxFrameout->deletePlane(*_plane);
_plane = nullptr;
_screenItem = nullptr;
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 364ea2a0ac..77c3d4e637 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1507,7 +1507,7 @@ void ResourceManager::readResourcePatchesBase36() {
// The S/T prefixes often conflict with non-patch files and generate
// spurious warnings about invalid patches
- if (name.hasSuffix(".DLL") || name.hasSuffix(".EXE") || name.hasSuffix(".TXT")) {
+ if (name.hasSuffix(".DLL") || name.hasSuffix(".EXE") || name.hasSuffix(".TXT") || name.hasSuffix(".OLD")) {
continue;
}
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index e601a1c434..5589129553 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -372,7 +372,7 @@ public:
void setAudioLanguage(int language);
int getAudioLanguage() const;
- void changeAudioDirectory(Common::String path);
+ void changeAudioDirectory(const Common::String &path);
bool isGMTrackIncluded();
bool isSci11Mac() const { return _volVersion == kResVersionSci11Mac; }
ViewType getViewType() const { return _viewType; }
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 7757445bc1..f17a684cc9 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -964,33 +964,50 @@ bool ResourceManager::addAudioSources() {
return true;
}
-void ResourceManager::changeAudioDirectory(Common::String path) {
- // TODO: This implementation is broken.
- return;
-
-#if 0
- // Remove all of the audio map resource sources, as well as the audio resource sources
- for (Common::List<ResourceSource *>::iterator it = _sources.begin(); it != _sources.end();) {
- ResourceSource *source = *it;
- ResSourceType sourceType = source->getSourceType();
-
- // Remove the resource source, if it's an audio map or an audio file
- if (sourceType == kSourceIntMap || sourceType == kSourceAudioVolume) {
- // Don't remove 65535.map (the SFX map) or resource.sfx
- if (source->_volumeNumber == 65535 || source->getLocationName() == "RESOURCE.SFX") {
- ++it;
+void ResourceManager::changeAudioDirectory(const Common::String &path) {
+ // Resources must be cleared before ResourceSources because the destructor
+ // of a Resource accesses its own ResourceSource
+ ResourceMap::iterator resIt = _resMap.begin();
+ while (resIt != _resMap.end()) {
+ Resource *resource = resIt->_value;
+ ResourceType type = resource->getType();
+ if (type == kResourceTypeMap ||
+ type == kResourceTypeAudio36 ||
+ type == kResourceTypeSync36) {
+
+ if (type == kResourceTypeMap && resource->getNumber() == 65535) {
+ ++resIt;
continue;
}
- // erase() will move the iterator to the next element
- it = _sources.erase(it);
+ if (resource->_status == kResStatusLocked) {
+ resource->_lockers = 1;
+ unlockResource(resource);
+ }
+ if (resource->_status == kResStatusEnqueued) {
+ removeFromLRU(resource);
+ }
+ delete resource;
+ _resMap.erase(resIt);
+ }
+
+ ++resIt;
+ }
+
+ Common::List<ResourceSource *>::iterator sourceIt = _sources.begin();
+ while (sourceIt != _sources.end()) {
+ ResourceSource *source = *sourceIt;
+ ResSourceType sourceType = source->getSourceType();
+ if ((sourceType == kSourceIntMap && source->_volumeNumber != 65535) ||
+ (sourceType == kSourceAudioVolume && source->getLocationName() != "RESOURCE.SFX")) {
+
+ sourceIt = _sources.erase(sourceIt);
delete source;
} else {
- ++it;
+ ++sourceIt;
}
}
- // Now, readd the audio resource sources
Common::String mapName = "MAP";
Common::String audioResourceName = "RESOURCE.AUD";
if (!path.empty()) {
@@ -1002,16 +1019,14 @@ void ResourceManager::changeAudioDirectory(Common::String path) {
Common::List<ResourceId>::iterator it;
for (it = resources.begin(); it != resources.end(); ++it) {
// Don't readd 65535.map or resource.sfx
- if ((it->getNumber() == 65535))
+ if (it->getNumber() == 65535)
continue;
ResourceSource *src = addSource(new IntMapResourceSource(mapName, 0, it->getNumber()));
addSource(new AudioVolumeResourceSource(this, audioResourceName, src, 0));
}
- // Rescan the newly added resources
scanNewSources();
-#endif
}
} // End of namespace Sci
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index a36ae001f4..b3ec3259a6 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -226,7 +226,7 @@ enum SciVersion {
SCI_VERSION_1_1, // Dr. Brain 2, EcoQuest 1 CD, EcoQuest 2, KQ6, QFG3, SQ4CD, XMAS 1992 and many more
SCI_VERSION_2, // GK1, PQ4 floppy, QFG4 floppy
SCI_VERSION_2_1_EARLY, // GK2 demo, KQ7 1.4/1.51, LSL6 hires, PQ4CD, QFG4CD
- SCI_VERSION_2_1_MIDDLE, // GK2, KQ7 2.00b, MUMG Deluxe, Phantasmagoria 1, PQ:SWAT, Shivers 1, SQ6, Torin
+ SCI_VERSION_2_1_MIDDLE, // GK2, Hoyle 5, KQ7 2.00b, MUMG Deluxe, Phantasmagoria 1, PQ:SWAT, Shivers 1, SQ6, Torin
SCI_VERSION_2_1_LATE, // demos of LSL7, Lighthouse, RAMA
SCI_VERSION_3 // LSL7, Lighthouse, RAMA, Phantasmagoria 2
};
diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp
index d5a7ae14b8..ca2402c859 100644
--- a/engines/sci/sound/audio32.cpp
+++ b/engines/sci/sound/audio32.cpp
@@ -159,9 +159,7 @@ int Audio32::writeAudioInternal(Audio::AudioStream *const sourceStream, Audio::R
// mono, in which case we need to request half
// as many samples from the mono stream and let
// the converter double them for stereo output
- if (!sourceStream->isStereo()) {
- samplesToRead >>= 1;
- }
+ samplesToRead >>= 1;
int samplesWritten = 0;
@@ -182,12 +180,10 @@ int Audio32::writeAudioInternal(Audio::AudioStream *const sourceStream, Audio::R
samplesToRead -= loopSamplesWritten;
samplesWritten += loopSamplesWritten;
- targetBuffer += loopSamplesWritten << 1;
+ targetBuffer += loopSamplesWritten << (sourceStream->isStereo() ? 0 : 1);
} while (loop && samplesToRead > 0);
- if (!sourceStream->isStereo()) {
- samplesWritten <<= 1;
- }
+ samplesWritten <<= 1;
return samplesWritten;
}
diff --git a/engines/sci/sound/decoders/sol.cpp b/engines/sci/sound/decoders/sol.cpp
index ee1ba35406..2dbe98c9e0 100644
--- a/engines/sci/sound/decoders/sol.cpp
+++ b/engines/sci/sound/decoders/sol.cpp
@@ -50,32 +50,42 @@ static const uint16 tableDPCM16[128] = {
static const byte tableDPCM8[8] = { 0, 1, 2, 3, 6, 10, 15, 21 };
/**
+ * Decompresses one channel of 16-bit DPCM compressed audio.
+ */
+static void deDPCM16Channel(int16 *out, int16 &sample, uint8 delta) {
+ if (delta & 0x80) {
+ sample -= tableDPCM16[delta & 0x7f];
+ } else {
+ sample += tableDPCM16[delta];
+ }
+ sample = CLIP<int16>(sample, -32768, 32767);
+ *out = TO_LE_16(sample);
+}
+
+/**
* Decompresses 16-bit DPCM compressed audio. Each byte read
* outputs one sample into the decompression buffer.
*/
-static void deDPCM16(int16 *out, Common::ReadStream &audioStream, const uint32 numBytes, int16 &sample) {
+static void deDPCM16Mono(int16 *out, Common::ReadStream &audioStream, const uint32 numBytes, int16 &sample) {
for (uint32 i = 0; i < numBytes; ++i) {
const uint8 delta = audioStream.readByte();
- if (delta & 0x80) {
- sample -= tableDPCM16[delta & 0x7f];
- } else {
- sample += tableDPCM16[delta];
- }
- sample = CLIP<int16>(sample, -32768, 32767);
- *out++ = TO_LE_16(sample);
+ deDPCM16Channel(out++, sample, delta);
}
}
-void deDPCM16(int16 *out, const byte *in, const uint32 numBytes, int16 &sample) {
+// Used by Robot
+void deDPCM16Mono(int16 *out, const byte *in, const uint32 numBytes, int16 &sample) {
for (uint32 i = 0; i < numBytes; ++i) {
const uint8 delta = *in++;
- if (delta & 0x80) {
- sample -= tableDPCM16[delta & 0x7f];
- } else {
- sample += tableDPCM16[delta];
- }
- sample = CLIP<int16>(sample, -32768, 32767);
- *out++ = TO_LE_16(sample);
+ deDPCM16Channel(out++, sample, delta);
+ }
+}
+
+static void deDPCM16Stereo(int16 *out, Common::ReadStream &audioStream, const uint32 numBytes, int16 &sampleL, int16 &sampleR) {
+ assert((numBytes % 2) == 0);
+ for (uint32 i = 0; i < numBytes / 2; ++i) {
+ deDPCM16Channel(out++, sampleL, audioStream.readByte());
+ deDPCM16Channel(out++, sampleR, audioStream.readByte());
}
}
@@ -98,7 +108,7 @@ static void deDPCM8Nibble(int16 *out, uint8 &sample, uint8 delta) {
* Decompresses 8-bit DPCM compressed audio. Each byte read
* outputs two samples into the decompression buffer.
*/
-static void deDPCM8(int16 *out, Common::ReadStream &audioStream, uint32 numBytes, uint8 &sample) {
+static void deDPCM8Mono(int16 *out, Common::ReadStream &audioStream, uint32 numBytes, uint8 &sample) {
for (uint32 i = 0; i < numBytes; ++i) {
const uint8 delta = audioStream.readByte();
deDPCM8Nibble(out++, sample, delta >> 4);
@@ -106,6 +116,14 @@ static void deDPCM8(int16 *out, Common::ReadStream &audioStream, uint32 numBytes
}
}
+static void deDPCM8Stereo(int16 *out, Common::ReadStream &audioStream, uint32 numBytes, uint8 &sampleL, uint8 &sampleR) {
+ for (uint32 i = 0; i < numBytes; ++i) {
+ const uint8 delta = audioStream.readByte();
+ deDPCM8Nibble(out++, sampleL, delta >> 4);
+ deDPCM8Nibble(out++, sampleR, delta & 0xf);
+ }
+}
+
# pragma mark -
template<bool STEREO, bool S16BIT>
@@ -120,9 +138,9 @@ SOLStream<STEREO, S16BIT>::SOLStream(Common::SeekableReadStream *stream, const D
// carried values for each channel separately. See
// 60900.aud from Lighthouse for an example stereo file
if (S16BIT) {
- _dpcmCarry16 = 0;
+ _dpcmCarry16.l = _dpcmCarry16.r = 0;
} else {
- _dpcmCarry8 = 0x80;
+ _dpcmCarry8.l = _dpcmCarry8.r = 0x80;
}
const uint8 compressionRatio = 2;
@@ -143,9 +161,9 @@ bool SOLStream<STEREO, S16BIT>::seek(const Audio::Timestamp &where) {
}
if (S16BIT) {
- _dpcmCarry16 = 0;
+ _dpcmCarry16.l = _dpcmCarry16.r = 0;
} else {
- _dpcmCarry8 = 0x80;
+ _dpcmCarry8.l = _dpcmCarry8.r = 0x80;
}
return _stream->seek(_dataOffset, SEEK_SET);
@@ -171,9 +189,17 @@ int SOLStream<STEREO, S16BIT>::readBuffer(int16 *buffer, const int numSamples) {
}
if (S16BIT) {
- deDPCM16(buffer, *_stream, bytesToRead, _dpcmCarry16);
+ if (STEREO) {
+ deDPCM16Stereo(buffer, *_stream, bytesToRead, _dpcmCarry16.l, _dpcmCarry16.r);
+ } else {
+ deDPCM16Mono(buffer, *_stream, bytesToRead, _dpcmCarry16.l);
+ }
} else {
- deDPCM8(buffer, *_stream, bytesToRead, _dpcmCarry8);
+ if (STEREO) {
+ deDPCM8Stereo(buffer, *_stream, bytesToRead, _dpcmCarry8.l, _dpcmCarry8.r);
+ } else {
+ deDPCM8Mono(buffer, *_stream, bytesToRead, _dpcmCarry8.l);
+ }
}
const int samplesRead = bytesToRead * samplesPerByte;
diff --git a/engines/sci/sound/decoders/sol.h b/engines/sci/sound/decoders/sol.h
index 1046d0b213..31914c0926 100644
--- a/engines/sci/sound/decoders/sol.h
+++ b/engines/sci/sound/decoders/sol.h
@@ -61,8 +61,8 @@ private:
* The last sample from the previous DPCM decode.
*/
union {
- int16 _dpcmCarry16;
- uint8 _dpcmCarry8;
+ struct { int16 l; int16 r; } _dpcmCarry16;
+ struct { uint8 l; uint8 r; } _dpcmCarry8;
};
/**
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 487d30e840..488bd0360c 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -127,7 +127,8 @@ void SciMusic::init() {
_pMidiDrv->setTimerCallback(this, &miditimerCallback);
_dwTempo = _pMidiDrv->getBaseTempo();
} else {
- if (g_sci->getGameId() == GID_FUNSEEKER) {
+ if (g_sci->getGameId() == GID_FUNSEEKER ||
+ (g_sci->getGameId() == GID_GK2 && g_sci->isDemo())) {
// HACK: The Fun Seeker's Guide demo doesn't have patch 3 and the version
// of the Adlib driver (adl.drv) that it includes is unsupported. That demo
// doesn't have any sound anyway, so this shouldn't be fatal.
diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index 446b986581..0cb4831159 100644
--- a/engines/sci/video/robot_decoder.cpp
+++ b/engines/sci/video/robot_decoder.cpp
@@ -43,7 +43,7 @@ namespace Sci {
#pragma mark RobotAudioStream
-extern void deDPCM16(int16 *out, const byte *in, const uint32 numBytes, int16 &sample);
+extern void deDPCM16Mono(int16 *out, const byte *in, const uint32 numBytes, int16 &sample);
RobotAudioStream::RobotAudioStream(const int32 bufferSize) :
_loopBuffer((byte *)malloc(bufferSize)),
@@ -181,7 +181,7 @@ void RobotAudioStream::fillRobotBuffer(const RobotAudioPacket &packet, const int
}
int16 carry = 0;
- deDPCM16((int16 *)_decompressionBuffer, packet.data, packet.dataSize, carry);
+ deDPCM16Mono((int16 *)_decompressionBuffer, packet.data, packet.dataSize, carry);
_decompressionBufferPosition = packet.position;
}
@@ -1436,6 +1436,14 @@ void RobotDecoder::doVersion5(const bool shouldSubmitAudio) {
_screenItemList[i] = nullptr;
}
}
+
+ if (screenItemCount < oldScreenItemCount) {
+ _screenItemList.resize(screenItemCount);
+ _screenItemX.resize(screenItemCount);
+ _screenItemY.resize(screenItemCount);
+ _originalScreenItemX.resize(screenItemCount);
+ _originalScreenItemY.resize(screenItemCount);
+ }
}
void RobotDecoder::createCels5(const byte *rawVideoData, const int16 numCels, const bool usePalette) {
diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index 1f77247e93..5105ea81b4 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -84,7 +84,7 @@ void CArm::load(SimpleFile *file) {
bool CArm::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
_field138 = 0;
- _fieldE0 = 1;
+ _canTake = true;
CString name = getName();
if (name == "Arm1") {
@@ -137,7 +137,7 @@ bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
}
bool CArm::MouseDragStartMsg(CMouseDragStartMsg *msg) {
- if (!_fieldE0) {
+ if (!_canTake) {
CShowTextMsg textMsg(YOU_CANT_GET_THIS);
textMsg.execute("PET");
} else if (checkStartDragging(msg)) {
@@ -178,7 +178,7 @@ bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
}
_field158 = 1;
- _fieldE0 = 1;
+ _canTake = true;
return true;
}
diff --git a/engines/titanic/carry/auditory_centre.cpp b/engines/titanic/carry/auditory_centre.cpp
index 0bda975a36..5d6fd1437e 100644
--- a/engines/titanic/carry/auditory_centre.cpp
+++ b/engines/titanic/carry/auditory_centre.cpp
@@ -39,7 +39,7 @@ void CAuditoryCentre::load(SimpleFile *file) {
}
bool CAuditoryCentre::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
- _fieldE0 = 1;
+ _canTake = true;
setVisible(true);
return true;
}
diff --git a/engines/titanic/carry/bowl_ear.cpp b/engines/titanic/carry/bowl_ear.cpp
index 852a77899a..ac28439de4 100644
--- a/engines/titanic/carry/bowl_ear.cpp
+++ b/engines/titanic/carry/bowl_ear.cpp
@@ -55,7 +55,7 @@ bool CBowlEar::ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg) {
bool CBowlEar::NutPuzzleMsg(CNutPuzzleMsg *msg) {
if (msg->_value == "BowlUnlocked")
- _fieldE0 = 1;
+ _canTake = true;
return true;
}
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index 075b2b32b3..f6403b18b9 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -44,7 +44,7 @@ BEGIN_MESSAGE_MAP(CCarry, CGameObject)
ON_MESSAGE(PassOnDragStartMsg)
END_MESSAGE_MAP()
-CCarry::CCarry() : CGameObject(), _fieldDC(0), _fieldE0(1),
+CCarry::CCarry() : CGameObject(), _fieldDC(0), _canTake(true),
_field100(0), _field104(0), _field108(0), _field10C(0),
_itemFrame(0), _enterFrame(0), _enterFrameSet(false), _visibleFrame(0),
_string1("None"),
@@ -59,7 +59,7 @@ void CCarry::save(SimpleFile *file, int indent) {
file->writePoint(_origPos, indent);
file->writeQuotedLine(_fullViewName, indent);
file->writeNumberLine(_fieldDC, indent);
- file->writeNumberLine(_fieldE0, indent);
+ file->writeNumberLine(_canTake, indent);
file->writeQuotedLine(_string3, indent);
file->writeQuotedLine(_string4, indent);
file->writePoint(_tempPos, indent);
@@ -81,7 +81,7 @@ void CCarry::load(SimpleFile *file) {
_origPos = file->readPoint();
_fullViewName = file->readString();
_fieldDC = file->readNumber();
- _fieldE0 = file->readNumber();
+ _canTake = file->readNumber();
_string3 = file->readString();
_string4 = file->readString();
_tempPos = file->readPoint();
@@ -101,7 +101,7 @@ bool CCarry::MouseDragStartMsg(CMouseDragStartMsg *msg) {
CString name = getName();
debugC(ERROR_BASIC, kDebugScripts, "MosueDragStartMsg - %s", name.c_str());
- if (_fieldE0) {
+ if (_canTake) {
if (checkStartDragging(msg)) {
CPassOnDragStartMsg startMsg(msg->_mousePos);
startMsg.execute(this);
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 06e446a1b5..cb53df47a5 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -59,7 +59,7 @@ protected:
int _visibleFrame;
public:
CString _string1;
- int _fieldE0;
+ bool _canTake;
Point _origPos;
CString _fullViewName;
public:
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index 8b332610e2..c97adc080c 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -93,7 +93,7 @@ bool CCarryParrot::IsParrotPresentMsg(CIsParrotPresentMsg *msg) {
bool CCarryParrot::LeaveViewMsg(CLeaveViewMsg *msg) {
if (_visible) {
setVisible(false);
- _fieldE0 = 0;
+ _canTake = false;
CParrot::_state = PARROT_ESCAPED;
}
@@ -109,7 +109,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
if (msg->_mousePos.x >= 75 && msg->_mousePos.x <= 565 &&
!CParrot::_v2 && !CCage::_open) {
setVisible(false);
- _fieldE0 = 0;
+ _canTake = false;
CTreeItem *perchedParrot = findUnder(getRoot(), "PerchedParrot");
detach();
addUnder(perchedParrot);
@@ -119,7 +119,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
backMsg.execute(perchedParrot);
} else {
setVisible(false);
- _fieldE0 = 0;
+ _canTake = false;
CParrot::_state = PARROT_ESCAPED;
playSound("z#475.wav");
sound8(true);
@@ -135,7 +135,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
charMsg.execute(this, nullptr, 0);
} else {
setVisible(false);
- _fieldE0 = 0;
+ _canTake = false;
playSound("z#475.wav");
sound8(true);
moveUnder(findRoom());
@@ -168,7 +168,7 @@ bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
if (npc)
startTalking(npc, 0x446BF);
- _fieldE0 = 0;
+ _canTake = false;
playSound("z#475.wav");
moveUnder(findRoom());
CParrot::_state = PARROT_ESCAPED;
@@ -181,7 +181,7 @@ bool CCarryParrot::PreEnterViewMsg(CPreEnterViewMsg *msg) {
loadSurface();
CCarryParrot *parrot = dynamic_cast<CCarryParrot *>(getRoot()->findByName("CarryParrot"));
if (parrot)
- parrot->_fieldE0 = 0;
+ parrot->_canTake = false;
return true;
}
@@ -201,7 +201,7 @@ bool CCarryParrot::ActMsg(CActMsg *msg) {
startTalking(npc, 0x446BF);
setVisible(false);
- _fieldE0 = 0;
+ _canTake = false;
if (CParrot::_state == PARROT_4) {
playSound("z#475.wav");
diff --git a/engines/titanic/carry/crushed_tv.cpp b/engines/titanic/carry/crushed_tv.cpp
index 486537d28e..17d9bab9f1 100644
--- a/engines/titanic/carry/crushed_tv.cpp
+++ b/engines/titanic/carry/crushed_tv.cpp
@@ -47,7 +47,7 @@ void CCrushedTV::load(SimpleFile *file) {
bool CCrushedTV::ActMsg(CActMsg *msg) {
if (msg->_action == "SmashTV") {
setVisible(true);
- _fieldE0 = 1;
+ _canTake = true;
}
return true;
diff --git a/engines/titanic/carry/ear.cpp b/engines/titanic/carry/ear.cpp
index a2234bc6dc..580ebd662f 100644
--- a/engines/titanic/carry/ear.cpp
+++ b/engines/titanic/carry/ear.cpp
@@ -45,7 +45,7 @@ void CEar::load(SimpleFile *file) {
bool CEar::ActMsg(CActMsg *msg) {
if (msg->_action == "MusicSolved")
- _fieldE0 = true;
+ _canTake = true;
return true;
}
diff --git a/engines/titanic/carry/fruit.cpp b/engines/titanic/carry/fruit.cpp
index 68f3af7229..a2d1d91cb0 100644
--- a/engines/titanic/carry/fruit.cpp
+++ b/engines/titanic/carry/fruit.cpp
@@ -60,7 +60,7 @@ bool CFruit::UseWithCharMsg(CUseWithCharMsg *msg) {
if (msg->_character->isEquals("Barbot") && msg->_character->_visible) {
CActMsg actMsg("Fruit");
actMsg.execute(msg->_character);
- _fieldE0 = 0;
+ _canTake = false;
setVisible(false);
return true;
} else {
diff --git a/engines/titanic/carry/hammer.cpp b/engines/titanic/carry/hammer.cpp
index 88c766d564..e62b61d7d4 100644
--- a/engines/titanic/carry/hammer.cpp
+++ b/engines/titanic/carry/hammer.cpp
@@ -43,7 +43,7 @@ void CHammer::load(SimpleFile *file) {
}
bool CHammer::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
- _fieldE0 = 1;
+ _canTake = true;
return true;
}
diff --git a/engines/titanic/carry/head_piece.cpp b/engines/titanic/carry/head_piece.cpp
index 34850488a7..1ce1d5ba1e 100644
--- a/engines/titanic/carry/head_piece.cpp
+++ b/engines/titanic/carry/head_piece.cpp
@@ -70,7 +70,7 @@ bool CHeadPiece::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
bool CHeadPiece::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!checkPoint(msg->_mousePos, false, true)) {
return false;
- } else if (!_fieldE0) {
+ } else if (!_canTake) {
return true;
}
diff --git a/engines/titanic/carry/key.cpp b/engines/titanic/carry/key.cpp
index 187ff1b6c3..e8c144139a 100644
--- a/engines/titanic/carry/key.cpp
+++ b/engines/titanic/carry/key.cpp
@@ -43,7 +43,7 @@ void CKey::load(SimpleFile *file) {
}
bool CKey::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
- _fieldE0 = 1;
+ _canTake = true;
setVisible(true);
return true;
}
diff --git a/engines/titanic/carry/long_stick.cpp b/engines/titanic/carry/long_stick.cpp
index 16cd69e373..77f888b6d8 100644
--- a/engines/titanic/carry/long_stick.cpp
+++ b/engines/titanic/carry/long_stick.cpp
@@ -60,7 +60,7 @@ bool CLongStick::UseWithOtherMsg(CUseWithOtherMsg *msg) {
}
bool CLongStick::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
- _fieldE0 = 1;
+ _canTake = true;
return true;
}
diff --git a/engines/titanic/carry/maitred_right_arm.cpp b/engines/titanic/carry/maitred_right_arm.cpp
index 5cec6be9bd..e61a711197 100644
--- a/engines/titanic/carry/maitred_right_arm.cpp
+++ b/engines/titanic/carry/maitred_right_arm.cpp
@@ -42,7 +42,7 @@ bool CMaitreDRightArm::DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg) {
CActMsg actMsg("LoseArm");
actMsg.execute("MaitreDBody");
actMsg.execute("MaitreD Arm Holder");
- _fieldE0 = 1;
+ _canTake = true;
return true;
}
diff --git a/engines/titanic/carry/phonograph_ear.cpp b/engines/titanic/carry/phonograph_ear.cpp
index 95297a77a1..df0445d164 100644
--- a/engines/titanic/carry/phonograph_ear.cpp
+++ b/engines/titanic/carry/phonograph_ear.cpp
@@ -43,7 +43,7 @@ void CPhonographEar::load(SimpleFile *file) {
}
bool CPhonographEar::CorrectMusicPlayedMsg(CCorrectMusicPlayedMsg *msg) {
- _fieldE0 = true;
+ _canTake = true;
return true;
}
diff --git a/engines/titanic/carry/photograph.cpp b/engines/titanic/carry/photograph.cpp
index 039efd0252..76487cae12 100644
--- a/engines/titanic/carry/photograph.cpp
+++ b/engines/titanic/carry/photograph.cpp
@@ -93,7 +93,7 @@ bool CPhotograph::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
bool CPhotograph::ActMsg(CActMsg *msg) {
if (msg->_action == "BecomeGettable") {
- _fieldE0 = 1;
+ _canTake = true;
_cursorId = CURSOR_HAND;
}
diff --git a/engines/titanic/carry/speech_centre.cpp b/engines/titanic/carry/speech_centre.cpp
index 29ced484a5..859d70c304 100644
--- a/engines/titanic/carry/speech_centre.cpp
+++ b/engines/titanic/carry/speech_centre.cpp
@@ -51,7 +51,7 @@ void CSpeechCentre::load(SimpleFile *file) {
bool CSpeechCentre::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
if (_field13C == 1 && _season == "Autumn")
- _fieldE0 = true;
+ _canTake = true;
return true;
}
diff --git a/engines/titanic/carry/vision_centre.cpp b/engines/titanic/carry/vision_centre.cpp
index f81e35fa4f..7e3afb5046 100644
--- a/engines/titanic/carry/vision_centre.cpp
+++ b/engines/titanic/carry/vision_centre.cpp
@@ -41,12 +41,12 @@ void CVisionCentre::load(SimpleFile *file) {
}
bool CVisionCentre::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
- _fieldE0 = true;
+ _canTake = true;
return true;
}
bool CVisionCentre::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- if (_fieldE0) {
+ if (_canTake) {
return CBrain::MouseButtonDownMsg(msg);
} else {
petDisplayMessage(1, NICE_IF_TAKE_BUT_CANT);
@@ -55,7 +55,7 @@ bool CVisionCentre::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
}
bool CVisionCentre::MouseDragStartMsg(CMouseDragStartMsg *msg) {
- if (_fieldE0) {
+ if (_canTake) {
return CBrain::MouseDragStartMsg(msg);
} else {
petDisplayMessage(1, NICE_IF_TAKE_BUT_CANT);
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 0a0b3b1c42..3e1cb0858c 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -548,6 +548,10 @@ void CGameObject::sound8(bool flag) const {
}
void CGameObject::setVisible(bool val) {
+ if (_name.contains("ylinder")) {
+ warning("TODO");
+ }
+
if (val != _visible) {
_visible = val;
makeDirty();
diff --git a/engines/titanic/game/music_system_lock.cpp b/engines/titanic/game/music_system_lock.cpp
index 074864e7c3..e28882f600 100644
--- a/engines/titanic/game/music_system_lock.cpp
+++ b/engines/titanic/game/music_system_lock.cpp
@@ -50,14 +50,16 @@ bool CMusicSystemLock::DropObjectMsg(CDropObjectMsg *msg) {
playMovie(MOVIE_NOTIFY_OBJECT);
}
- return true;
+ return false;
}
bool CMusicSystemLock::MovieEndMsg(CMovieEndMsg *msg) {
CTreeItem *phonograph = findRoom()->findByName("Restaurant Phonograph");
+
+ // Toggle the locked status of the music system
CQueryPhonographState queryMsg;
queryMsg.execute(phonograph);
- CLockPhonographMsg lockMsg(queryMsg._value);
+ CLockPhonographMsg lockMsg(!queryMsg._value);
lockMsg.execute(phonograph, nullptr, MSGFLAG_SCAN);
setVisible(false);
diff --git a/engines/titanic/game/phonograph_lid.cpp b/engines/titanic/game/phonograph_lid.cpp
index d1ab478f3d..e4e5f4882c 100644
--- a/engines/titanic/game/phonograph_lid.cpp
+++ b/engines/titanic/game/phonograph_lid.cpp
@@ -47,18 +47,18 @@ bool CPhonographLid::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CQueryPhonographState stateMsg;
stateMsg.execute(getParent(), nullptr, MSGFLAG_SCAN);
if (stateMsg._value) {
+ petDisplayMessage(0, LOCKED_MUSIC_SYSTEM);
+ } else {
if (_open) {
+ playMovie(27, 55, 0);
+ } else {
CGameObject *lock = dynamic_cast<CGameObject *>(findByName("Music System Lock"));
if (lock)
lock->setVisible(false);
playMovie(0, 27, 0);
- } else {
- playMovie(27, 55, 0);
}
_open = !_open;
- } else {
- petDisplayMessage(0, LOCKED_MUSIC_SYSTEM);
}
return true;
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 481224141d..cb1e3c9c68 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -132,7 +132,7 @@ void CInputHandler::processMessage(CMessage *msg) {
if (_dragItem) {
CMouseDragMoveMsg moveMsg(_dragStartPos);
- dispatchMessage(&moveMsg);
+ moveMsg.execute(_dragItem);
}
_dragging = true;
diff --git a/engines/titanic/moves/restaurant_pan_handler.cpp b/engines/titanic/moves/restaurant_pan_handler.cpp
index d93e331254..58305fd6b8 100644
--- a/engines/titanic/moves/restaurant_pan_handler.cpp
+++ b/engines/titanic/moves/restaurant_pan_handler.cpp
@@ -55,8 +55,8 @@ bool CRestaurantPanHandler::ArmPickedUpFromTableMsg(CArmPickedUpFromTableMsg *ms
}
bool CRestaurantPanHandler::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- _destination = _armPickedUp ? _armDestination : _armlessDestination;
- changeView(_destination);
+ CString clipName = _armPickedUp ? _armDestination : _armlessDestination;
+ changeView(_destination, clipName);
return true;
}
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index e039b15dfe..9e6366ace2 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -388,7 +388,7 @@ bool CParrot::MouseDragStartMsg(CMouseDragStartMsg *msg) {
CCarry *item = dynamic_cast<CCarry *>(getRoot()->findByName(_string2));
if (item) {
- item->_fieldE0 = 1;
+ item->_canTake = true;
CPassOnDragStartMsg passMsg;
passMsg._mousePos = msg->_mousePos;
passMsg.execute(item);
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index ad10f5a57f..d79ebedf4d 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -748,7 +748,7 @@ done:
return 2;
}
- addResponse(getDialogueId(250082 + getRandomNumber(100) <= 89 ? 128 : 0));
+ addResponse(getDialogueId(250082 + (getRandomNumber(100) <= 89 ? 128 : 0)));
}
}
@@ -776,7 +776,7 @@ ScriptChangedResult BarbotScript::scriptChanged(const TTroomScript *roomScript,
resetFlags();
} else {
if (!getValue(28) || !fn10(true)) {
- addResponse(getDialogueId(251627 + getValue(28) ? -1034 : 0));
+ addResponse(getDialogueId(251627 + (getValue(28) ? -1034 : 0)));
applyResponse();
}
@@ -1009,7 +1009,7 @@ uint BarbotScript::getDialsBitset() const {
bits = 1;
if (!getDialRegion(1))
bits |= 2;
- if (!getDialRegion(2))
+ if (getDialRegion(2))
bits |= 4;
return bits;
@@ -1147,9 +1147,10 @@ int BarbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScrip
if (id) {
addResponse(getDialogueId(id));
applyResponse();
+ return 2;
}
- return 2;
+ return 0;
}
void BarbotScript::setDialRegion(int dialNum, int region) {
diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index 5a21d73a9b..60c506e8cd 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -25,7 +25,8 @@
namespace Titanic {
-TTstringNode::TTstringNode() : TTnode() {
+TTstringNode::TTstringNode() : TTnode(), _file(HANDLE_STDIN),
+ _mode(0), _field1C(0) {
}
void TTstringNode::initialize(int mode) {
diff --git a/engines/titanic/true_talk/tt_synonym.cpp b/engines/titanic/true_talk/tt_synonym.cpp
index bb78e734ca..4629351f12 100644
--- a/engines/titanic/true_talk/tt_synonym.cpp
+++ b/engines/titanic/true_talk/tt_synonym.cpp
@@ -24,19 +24,17 @@
namespace Titanic {
-TTsynonym::TTsynonym() : TTstringNode(), _file(HANDLE_STDIN),
- _mode(0), _field1C(0) {
+TTsynonym::TTsynonym() : TTstringNode() {
}
-TTsynonym::TTsynonym(const TTsynonym *src) : TTstringNode(),
- _mode(0), _field1C(0) {
+TTsynonym::TTsynonym(const TTsynonym *src) : TTstringNode() {
_string = src->_string;
initialize(src->_mode);
_file = src->_file;
}
TTsynonym::TTsynonym(int mode, const char *str, FileHandle file) :
- TTstringNode(), _mode(0), _field1C(0) {
+ TTstringNode() {
_string = str;
initialize(mode);
_file = file;
diff --git a/engines/titanic/true_talk/tt_synonym.h b/engines/titanic/true_talk/tt_synonym.h
index d5dc2be09e..09f4617cf1 100644
--- a/engines/titanic/true_talk/tt_synonym.h
+++ b/engines/titanic/true_talk/tt_synonym.h
@@ -30,11 +30,6 @@ namespace Titanic {
class TTsynonym : public TTstringNode {
public:
- TTstring _string;
- FileHandle _file;
- int _mode;
- int _field1C;
-public:
TTsynonym();
TTsynonym(const TTsynonym *src);
TTsynonym(int mode, const char *str, FileHandle file);
diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.cpp b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
index 32209a766b..82a7d7c0ca 100644
--- a/engines/xeen/worldofxeen/clouds_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
@@ -391,7 +391,8 @@ bool CloudsCutscenes::showCloudsEnding() {
prec.clear();
// Show swirling vortex
- SpriteResource vort[21], cast[6], darkLord[4];
+ // TODO? SpriteResource vort[21];
+ SpriteResource cast[6], darkLord[4];
for (int idx = 1; idx < 7; ++idx)
cast[idx - 1].load(Common::String::format("cast%02u.end", idx));
for (int idx = 1; idx < 4; ++idx)
diff --git a/graphics/macgui/macfontmanager.h b/graphics/macgui/macfontmanager.h
index 09fd0aeaca..61c050b1cf 100644
--- a/graphics/macgui/macfontmanager.h
+++ b/graphics/macgui/macfontmanager.h
@@ -48,8 +48,13 @@ enum {
enum {
kMacFontRegular,
- kMacFontBold,
- kMacFontItalic
+ kMacFontBold = 1,
+ kMacFontItalic = 2,
+ kMacFontUnderline = 4,
+ kMacFontOutline = 8,
+ kMacFontShadow = 16,
+ kMacFontCondense = 32,
+ kMacFontExtend = 64
};
class BdfFont;
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 06354457f2..abf1e4fc38 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -116,7 +116,7 @@ void MacText::render(int from, int to) {
// Clear the screen
_surface->fillRect(Common::Rect(0, y, _surface->w, to * lineH), _bgcolor);
- for (uint i = from; i < to; i++) {
+ for (int i = from; i < to; i++) {
_font->drawString(_surface, _text[i], 0, y, _textMaxWidth, _fgcolor);
y += _font->getFontHeight() + _interLinear;
diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp
index 42cab7cf8e..77f22a191d 100644
--- a/graphics/macgui/macwindowmanager.cpp
+++ b/graphics/macgui/macwindowmanager.cpp
@@ -88,6 +88,60 @@ static const byte macCursorBeam[] = {
3, 3, 0, 3, 0, 3, 3, 3, 3, 3, 3,
0, 0, 3, 3, 3, 0, 0, 3, 3, 3, 3,
};
+static const byte macCursorCrossHair[] = {
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const byte macCursorWatch[] = {
+ 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+ 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1,
+ 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
+ 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
+ 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+};
+static const byte macCursorCrossBar[] = {
+ 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
+ 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0,
+ 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1,
+ 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1,
+ 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
MacWindowManager::MacWindowManager() {
_screen = 0;
@@ -163,18 +217,8 @@ void MacWindowManager::removeWindow(MacWindow *target) {
_needsRemoval = true;
}
-struct PlotData {
- Graphics::ManagedSurface *surface;
- MacPatterns *patterns;
- uint fillType;
- int thickness;
-
- PlotData(Graphics::ManagedSurface *s, MacPatterns *p, int f, int t) :
- surface(s), patterns(p), fillType(f), thickness(t) {}
-};
-
-static void drawPixel(int x, int y, int color, void *data) {
- PlotData *p = (PlotData *)data;
+void macDrawPixel(int x, int y, int color, void *data) {
+ MacPlotData *p = (MacPlotData *)data;
if (p->fillType > p->patterns->size())
return;
@@ -188,7 +232,7 @@ static void drawPixel(int x, int y, int color, void *data) {
*((byte *)p->surface->getBasePtr(xu, yu)) =
(pat[yu % 8] & (1 << (7 - xu % 8))) ?
- color : kColorWhite;
+ color : p->bgColor;
}
} else {
int x1 = x;
@@ -203,7 +247,7 @@ static void drawPixel(int x, int y, int color, void *data) {
uint yu = (uint)y;
*((byte *)p->surface->getBasePtr(xu, yu)) =
(pat[yu % 8] & (1 << (7 - xu % 8))) ?
- color : kColorWhite;
+ color : p->bgColor;
}
}
}
@@ -211,9 +255,9 @@ static void drawPixel(int x, int y, int color, void *data) {
void MacWindowManager::drawDesktop() {
Common::Rect r(_screen->getBounds());
- PlotData pd(_screen, &_patterns, kPatternCheckers, 1);
+ MacPlotData pd(_screen, &_patterns, kPatternCheckers, 1);
- Graphics::drawRoundRect(r, kDesktopArc, kColorBlack, true, drawPixel, &pd);
+ Graphics::drawRoundRect(r, kDesktopArc, kColorBlack, true, macDrawPixel, &pd);
g_system->copyRectToScreen(_screen->getPixels(), _screen->pitch, 0, 0, _screen->w, _screen->h);
}
@@ -327,6 +371,22 @@ void MacWindowManager::pushArrowCursor() {
CursorMan.pushCursor(macCursorArrow, 11, 16, 1, 1, 3);
}
+void MacWindowManager::pushBeamCursor() {
+ CursorMan.pushCursor(macCursorBeam, 11, 16, 1, 1, 3);
+}
+
+void MacWindowManager::pushCrossHairCursor() {
+ CursorMan.pushCursor(macCursorCrossHair, 11, 16, 1, 1, 3);
+}
+
+void MacWindowManager::pushCrossBarCursor() {
+ CursorMan.pushCursor(macCursorCrossBar, 11, 16, 1, 1, 3);
+}
+
+void MacWindowManager::pushWatchCursor() {
+ CursorMan.pushCursor(macCursorWatch, 11, 16, 1, 1, 3);
+}
+
void MacWindowManager::popCursor() {
CursorMan.popCursor();
}
diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h
index 3449ab13c2..8f04861b68 100644
--- a/graphics/macgui/macwindowmanager.h
+++ b/graphics/macgui/macwindowmanager.h
@@ -65,6 +65,20 @@ class MacFontManager;
typedef Common::Array<byte *> MacPatterns;
+struct MacPlotData {
+ Graphics::ManagedSurface *surface;
+ MacPatterns *patterns;
+ uint fillType;
+ int thickness;
+ uint bgColor;
+
+ MacPlotData(Graphics::ManagedSurface *s, MacPatterns *p, int f, int t, uint bg = kColorWhite) :
+ surface(s), patterns(p), fillType(f), thickness(t), bgColor(bg) {
+ }
+};
+
+void macDrawPixel(int x, int y, int color, void *data);
+
/**
* A manager class to handle window creation, destruction,
* drawing, moving and event handling.
@@ -143,9 +157,12 @@ public:
* @return A MacPatterns object reference with the patterns.
*/
MacPatterns &getPatterns() { return _patterns; }
- void drawFilledRoundRect(ManagedSurface *surface, Common::Rect &rect, int arc, int color);
void pushArrowCursor();
+ void pushBeamCursor();
+ void pushCrossHairCursor();
+ void pushCrossBarCursor();
+ void pushWatchCursor();
void popCursor();
public:
diff --git a/gui/KeysDialog.cpp b/gui/KeysDialog.cpp
index 7adb20a379..fcf9201877 100644
--- a/gui/KeysDialog.cpp
+++ b/gui/KeysDialog.cpp
@@ -68,7 +68,7 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
case kListSelectionChangedCmd:
if (_actionsList->getSelected() >= 0) {
- char selection[100];
+ Common::String selection;
uint16 key = Actions::Instance()->getMapping(_actionsList->getSelected());
#ifdef __SYMBIAN32__
@@ -77,9 +77,9 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
key = key - Common::ASCII_F1 + SDLK_F1;
#endif
if (key != 0)
- sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key));
+ selection = Common::String::format(_("Associated key : %s"), SDL_GetKeyName((SDLKey)key));
else
- sprintf(selection, _("Associated key : none"));
+ selection = Common::String::format(_("Associated key : none"));
_keyMapping->setLabel(selection);
_keyMapping->draw();
@@ -89,7 +89,7 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
if (_actionsList->getSelected() < 0) {
_actionTitle->setLabel(_("Please select an action"));
} else {
- char selection[100];
+ Common::String selection;
_actionSelected = _actionsList->getSelected();
uint16 key = Actions::Instance()->getMapping(_actionSelected);
@@ -99,9 +99,9 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
key = key - Common::ASCII_F1 + SDLK_F1;
#endif
if (key != 0)
- sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key));
+ selection = Common::String::format(_("Associated key : %s"), SDL_GetKeyName((SDLKey)key));
else
- sprintf(selection, _("Associated key : none"));
+ selection = Common::String::format(_("Associated key : none"));
_actionTitle->setLabel(_("Press the key to associate"));
_keyMapping->setLabel(selection);
@@ -133,14 +133,14 @@ void KeysDialog::handleKeyUp(Common::KeyState state) {
#else
if (state.flags == 0xff && Actions::Instance()->mappingActive()) { // GAPI key was selected
#endif
- char selection[100];
+ Common::String selection;
Actions::Instance()->setMapping((ActionType)_actionSelected, state.ascii);
if (state.ascii != 0)
- sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey) state.keycode));
+ selection = Common::String::format(_("Associated key : %s"), SDL_GetKeyName((SDLKey) state.keycode));
else
- sprintf(selection, _("Associated key : none"));
+ selection = Common::String::format(_("Associated key : none"));
_actionTitle->setLabel(_("Choose an action to map"));
_keyMapping->setLabel(selection);
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 96108bccce..d859a88da5 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -810,7 +810,9 @@ bool ThemeEngine::addAlphaBitmap(const Common::String &filename) {
if (surf)
return true;
+#ifdef USE_PNG
const Graphics::TransparentSurface *srcSurface = 0;
+#endif
if (filename.hasSuffix(".png")) {
// Maybe it is PNG?
diff --git a/gui/options.cpp b/gui/options.cpp
index 3f6fc5aa2c..371a949c35 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2120,8 +2120,10 @@ void GlobalOptionsDialog::setupCloudTab() {
#else // USE_SDL_NET
if (_runServerButton)
_runServerButton->setVisible(false);
- if (_serverInfoLabel)
+ if (_serverInfoLabel) {
+ _serverInfoLabel->setPos(_serverInfoLabel->getRelX(), serverLabelPosition); // Prevent compiler warning from serverLabelPosition being unused.
_serverInfoLabel->setVisible(false);
+ }
if (_rootPathButton)
_rootPathButton->setVisible(false);
if (_rootPath)
diff --git a/image/codecs/codec.cpp b/image/codecs/codec.cpp
index 7d6d3cbe9b..048d52dc86 100644
--- a/image/codecs/codec.cpp
+++ b/image/codecs/codec.cpp
@@ -210,7 +210,7 @@ Codec *createBitmapCodec(uint32 tag, int width, int height, int bitsPerPixel) {
case MKTAG('c','v','i','d'):
return new CinepakDecoder(bitsPerPixel);
case MKTAG('I','V','3','2'):
- return new Indeo3Decoder(width, height);
+ return new Indeo3Decoder(width, height, bitsPerPixel);
case MKTAG('I', 'V', '4', '1'):
case MKTAG('I', 'V', '4', '2'):
return new Indeo4Decoder(width, height, bitsPerPixel);
diff --git a/image/codecs/indeo3.cpp b/image/codecs/indeo3.cpp
index 560658d1f5..d862d5352b 100644
--- a/image/codecs/indeo3.cpp
+++ b/image/codecs/indeo3.cpp
@@ -40,11 +40,24 @@
namespace Image {
-Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height) : _ModPred(0), _corrector_type(0) {
+Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height, uint bitsPerPixel) : _ModPred(0), _corrector_type(0) {
_iv_frame[0].the_buf = 0;
_iv_frame[1].the_buf = 0;
- _pixelFormat = g_system->getScreenFormat();
+ switch (bitsPerPixel) {
+ case 16:
+ _pixelFormat = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
+ break;
+ case 24:
+ _pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 0, 16, 8, 0, 0);
+ break;
+ case 32:
+ _pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+ break;
+ default:
+ error("Invalid color depth");
+ break;
+ }
_surface = new Graphics::Surface;
_surface->create(width, height, _pixelFormat);
diff --git a/image/codecs/indeo3.h b/image/codecs/indeo3.h
index 0ff0265250..ad12bb7825 100644
--- a/image/codecs/indeo3.h
+++ b/image/codecs/indeo3.h
@@ -46,7 +46,7 @@ namespace Image {
*/
class Indeo3Decoder : public Codec {
public:
- Indeo3Decoder(uint16 width, uint16 height);
+ Indeo3Decoder(uint16 width, uint16 height, uint bitsPerPixel = 24);
~Indeo3Decoder();
const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream);
diff --git a/image/codecs/indeo4.cpp b/image/codecs/indeo4.cpp
index 8dc67d5501..b6ac0882e7 100644
--- a/image/codecs/indeo4.cpp
+++ b/image/codecs/indeo4.cpp
@@ -601,7 +601,7 @@ void Indeo4Decoder::decodeTransparency() {
// and mark the range of pixels of that color from the start and end of
// each line as transparent
assert(_surface->format.bytesPerPixel == 4);
- byte r, g, b, a;
+ byte r, g, b;
if (_surface->format.aBits() == 0) {
// Surface is 4 bytes per pixel, but only RGB. So promote the
diff --git a/po/be_BY.po b/po/be_BY.po
index 6f4a91ee9f..820c695f2f 100644
--- a/po/be_BY.po
+++ b/po/be_BY.po
@@ -7,17 +7,17 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-31 15:15+0000\n"
"Last-Translator: Ivan Lukyanov <lid-gr@tut.by>\n"
-"Language-Team: Belarusian "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/be/>\n"
+"Language-Team: Belarusian <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/be/>\n"
"Language: be_BY\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-5\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<="
-"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 2.9\n"
"X-Language-name: Belarusian\n"
@@ -577,7 +577,6 @@ msgid "Associated key : %s"
msgstr "¿àë×ÝÐçÐÝÐï ÚÛÐÒöèÐ : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "¿àë×ÝÐçÐÝÐï ÚÛÐÒöèÐ : ÝïÜÐ"
@@ -1336,7 +1335,7 @@ msgstr "ÁßëÝöæì áÕàÒÕà"
msgid "Stop local webserver"
msgstr "ÁßëÝïÕ ÛÐÚÐÛìÝë ÒíÑ-áÕàÒÕà"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1803,7 +1802,7 @@ msgstr "³~Ð~ÛÞþÝÐÕ ÜÕÝî"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1824,7 +1823,7 @@ msgstr "·ÐåÐÒÐæì ÓãÛìÝî:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2856,8 +2855,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2869,8 +2868,8 @@ msgstr "Ã×ÝÐÒöæì ÓãÛìÝî:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/ca_ES.po b/po/ca_ES.po
index 56f73ae845..edd9138a7c 100644
--- a/po/ca_ES.po
+++ b/po/ca_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.6.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-04 15:46+0000\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Catalan <https://translations.scummvm.org/projects/scummvm/"
@@ -573,7 +573,6 @@ msgid "Associated key : %s"
msgstr "Tecla associada : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Tecla associada : cap"
@@ -1347,7 +1346,7 @@ msgstr "Servidor:"
msgid "Stop local webserver"
msgstr ""
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1816,7 +1815,7 @@ msgstr "~R~etorna al Llançador"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1837,7 +1836,7 @@ msgstr "Desa la partida:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2866,8 +2865,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2879,8 +2878,8 @@ msgstr "Recupera la partida:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/cs_CZ.po b/po/cs_CZ.po
index f1238bc515..f397c22b28 100644
--- a/po/cs_CZ.po
+++ b/po/cs_CZ.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.7.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-04 15:43+0000\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Czech <https://translations.scummvm.org/projects/scummvm/"
@@ -578,7 +578,6 @@ msgid "Associated key : %s"
msgstr "Pøiøazená klávesa: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Pøiøazená klávesa: ¾ádná"
@@ -1336,7 +1335,7 @@ msgstr "Zastavit server"
msgid "Stop local webserver"
msgstr "Zastavit místní internetový server"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1804,7 +1803,7 @@ msgstr "~N~ávrat do Spou¹tìèe"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1825,7 +1824,7 @@ msgstr "Ulo¾it hru:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2855,8 +2854,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2868,8 +2867,8 @@ msgstr "Obnovit hru:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/da_DK.po b/po/da_DK.po
index 4c46d1fd31..85273bf5ae 100644
--- a/po/da_DK.po
+++ b/po/da_DK.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-29 07:29+0000\n"
"Last-Translator: poulsen93 <poulsen93@gmail.com>\n"
-"Language-Team: Danish "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/da/>\n"
+"Language-Team: Danish <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/da/>\n"
"Language: da_DK\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -571,7 +571,6 @@ msgid "Associated key : %s"
msgstr "Tilknyttet tast : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Tilknyttet tast : ingen"
@@ -1333,7 +1332,7 @@ msgstr "Server:"
msgid "Stop local webserver"
msgstr ""
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1796,7 +1795,7 @@ msgstr "~R~etur til oversigt"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1817,7 +1816,7 @@ msgstr "Gemmer:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2846,8 +2845,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2859,8 +2858,8 @@ msgstr "Gendan spil:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/de_DE.po b/po/de_DE.po
index 069602d3d6..18c300bb37 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.10.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-27 09:55+0000\n"
"Last-Translator: Lothar Serra Mari <rootfather@scummvm.org>\n"
-"Language-Team: German "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/de/>\n"
+"Language-Team: German <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/de/>\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -582,7 +582,6 @@ msgid "Associated key : %s"
msgstr "Zugewiesene Taste: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Zugewiesene Taste: keine"
@@ -1356,7 +1355,7 @@ msgstr "Server anhalten"
msgid "Stop local webserver"
msgstr "Lokalen Webserver anhalten"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1828,7 +1827,7 @@ msgstr "Zur Spiele~l~iste"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1849,7 +1848,7 @@ msgstr "Speichern:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2883,8 +2882,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2896,8 +2895,8 @@ msgstr "Spiel laden:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/el.po b/po/el.po
index 73f1e9e6bb..bbbf804a62 100644
--- a/po/el.po
+++ b/po/el.po
@@ -6,11 +6,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.10.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2017-01-07 02:29+0000\n"
"Last-Translator: Filippos Karapetis <bluegr@gmail.com>\n"
-"Language-Team: Greek "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/el/>\n"
+"Language-Team: Greek <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/el/>\n"
"Language: el\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-7\n"
@@ -583,7 +583,6 @@ msgid "Associated key : %s"
msgstr "Óõó÷åôéóìÝíï êëåéäß : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Óõó÷åôéóìÝíï êëåéäß: êáíÝíá"
@@ -1362,7 +1361,7 @@ msgstr "ÄéáêïðÞ åîõðçñåôçôÞ"
msgid "Stop local webserver"
msgstr "ÄéáêïðÞ ôïðéêïý åîõðçñåôçôÞ web"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1835,7 +1834,7 @@ msgstr "Åðéó~ô~ñ. óôïí ÏäçãçôÞ"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1856,7 +1855,7 @@ msgstr "ÁðïèÞêåõóç ðáé÷íéäéïý:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2891,8 +2890,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2904,8 +2903,8 @@ msgstr "ÅðáíáöïñÜ ðáé÷íéäéïý:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
@@ -3226,8 +3225,8 @@ msgid ""
msgstr ""
"%d ðñùôüôõðá áðïèçêåõìÝíá áñ÷åßá ðáé÷íéäéïý åéóÞ÷èçóáí åðéôõ÷þò óôï\n"
"ScummVM. Áí áñãüôåñá èåëÞóåôå íá åéóÜãåôå ðñùôüôõðá áðïèçêåõìÝíá áñ÷åßá \n"
-"ðáé÷íéäéïý ÷åéñïêßíçôá, èá ÷ñåéáóôåß íá áíïéîåôå ôï ôåñìáôéêü áðïóöáëìÜôùóçò "
-"\n"
+"ðáé÷íéäéïý ÷åéñïêßíçôá, èá ÷ñåéáóôåß íá áíïéîåôå ôï ôåñìáôéêü "
+"áðïóöáëìÜôùóçò \n"
"(debug console) ôïõ ScummVM êáé íá ÷ñçóéìïðïéÞóåôå ôçí åíôïëÞ "
"'import_savefile'.\n"
diff --git a/po/es_ES.po b/po/es_ES.po
index d7a0bf71dd..a00e7fb9ae 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.4.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-30 20:22+0000\n"
"Last-Translator: Luis <luissagasta@gmail.com>\n"
-"Language-Team: Spanish "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/es/>\n"
+"Language-Team: Spanish <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/es/>\n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -578,7 +578,6 @@ msgid "Associated key : %s"
msgstr "Tecla asociada: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Tecla asociada: ninguna"
@@ -1346,7 +1345,7 @@ msgstr "Detener servidor"
msgid "Stop local webserver"
msgstr "Detener el servidor local"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1813,7 +1812,7 @@ msgstr "~V~olver al lanzador"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1834,7 +1833,7 @@ msgstr "Guardar partida:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2861,8 +2860,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2874,8 +2873,8 @@ msgstr "Cargar partida:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/eu.po b/po/eu.po
index 3201ad3cf2..b6592a4327 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.5.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-04 13:27+0000\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Basque <https://translations.scummvm.org/projects/scummvm/"
@@ -568,7 +568,6 @@ msgid "Associated key : %s"
msgstr "Esleituriko tekla: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Esleituriko tekla: bat ere ez"
@@ -1338,7 +1337,7 @@ msgstr "Zerbitzaria:"
msgid "Stop local webserver"
msgstr ""
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1800,7 +1799,7 @@ msgstr "It~z~uli abiarazlera"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1821,7 +1820,7 @@ msgstr "Gorde jokoa:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2850,8 +2849,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2863,8 +2862,8 @@ msgstr "Jokoa kargatu:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/fi_FI.po b/po/fi_FI.po
index bb5167332f..192a4ee78d 100644
--- a/po/fi_FI.po
+++ b/po/fi_FI.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.6.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2017-01-06 16:03+0000\n"
"Last-Translator: Timo Mikkolainen <tmikkola@gmail.com>\n"
-"Language-Team: Finnish "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/fi/>\n"
+"Language-Team: Finnish <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/fi/>\n"
"Language: fi_FI\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -575,7 +575,6 @@ msgid "Associated key : %s"
msgstr "Nykyinen näppäin : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Nykyinen näppäin : ei mikään"
@@ -1335,7 +1334,7 @@ msgstr "Pysäytä palvelin"
msgid "Stop local webserver"
msgstr "Pysäytä paikallinen webpalvelin"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1802,7 +1801,7 @@ msgstr "Palaa p~e~livalitsimeen"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1823,7 +1822,7 @@ msgstr "Tallenna peli:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2767,8 +2766,8 @@ msgid ""
"Incorrect version of the '%s' engine data file found. Expected %d.%d but got "
"%d.%d."
msgstr ""
-"\"%s\" pelimoottorin datatiedostosta löytyi väärä versio. Odotettu versio "
-"%d.%d, löytynyt versio %d.%d."
+"\"%s\" pelimoottorin datatiedostosta löytyi väärä versio. Odotettu versio %d."
+"%d, löytynyt versio %d.%d."
#: engines/adl/detection.cpp:45 engines/adl/detection.cpp:55
msgid "Color mode"
@@ -2849,8 +2848,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2862,8 +2861,8 @@ msgstr "Lataa pelitallenne:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
@@ -3242,8 +3241,8 @@ msgid ""
"You're missing a Riven executable. The Windows executable is 'riven.exe' or "
"'rivendmo.exe'. "
msgstr ""
-"Sinulta puuttuu Riven ohjelmatiedosto. WIndowsissa tiedosto on nimeltään \""
-"riven.exe\" tai \"rivendmo.exe\". "
+"Sinulta puuttuu Riven ohjelmatiedosto. WIndowsissa tiedosto on nimeltään "
+"\"riven.exe\" tai \"rivendmo.exe\". "
#: engines/mohawk/riven.cpp:151
msgid ""
@@ -3425,7 +3424,8 @@ msgstr "Käytä mustia vuoroviivoja videoissa"
#: engines/sci/detection.cpp:411
msgid "Draw black lines over videos to increase their apparent sharpness"
-msgstr "Piirrä mustia vuoroviivoja videoihin jotta ne näyttäisivät terävämmiltä"
+msgstr ""
+"Piirrä mustia vuoroviivoja videoihin jotta ne näyttäisivät terävämmiltä"
#: engines/sci/detection.cpp:420
msgid "Prefer digital sound effects"
@@ -4239,7 +4239,8 @@ msgstr "Liu'uta dialogit ruudulle"
#: engines/sherlock/detection.cpp:112
msgid "Slide UI dialogs into view, rather than simply showing them immediately"
-msgstr "Liu'uta dialogit ruudulle sen sijaan että ne näytettäisiin välittömästi"
+msgstr ""
+"Liu'uta dialogit ruudulle sen sijaan että ne näytettäisiin välittömästi"
#: engines/sherlock/detection.cpp:121
msgid "Transparent windows"
diff --git a/po/fr_FR.po b/po/fr_FR.po
index bbaacffae7..0aea2ec110 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2017-01-03 19:44+0000\n"
"Last-Translator: Thierry Crozat <criezy@scummvm.org>\n"
-"Language-Team: French "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/fr/>\n"
+"Language-Team: French <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/fr/>\n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -578,7 +578,6 @@ msgid "Associated key : %s"
msgstr "Touche associée: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Touche associée : aucune"
@@ -1348,7 +1347,7 @@ msgstr "Arrêter serveur"
msgid "Stop local webserver"
msgstr "Arrêter le serveur"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1820,7 +1819,7 @@ msgstr "Retour au ~L~anceur"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1841,7 +1840,7 @@ msgstr "Sauvegarde :"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2872,8 +2871,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2885,8 +2884,8 @@ msgstr "Charger le jeu :"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/gl_ES.po b/po/gl_ES.po
index a7af9cf2b1..3a885d245f 100644
--- a/po/gl_ES.po
+++ b/po/gl_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-11-28 15:51+0000\n"
"Last-Translator: Santiago G. Sanz <santiagogarciasanz@gmail.com>\n"
"Language-Team: Galician <https://translations.scummvm.org/projects/scummvm/"
@@ -578,7 +578,6 @@ msgid "Associated key : %s"
msgstr "Tecla asociada: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Tecla asociada: ningunha"
@@ -1339,7 +1338,7 @@ msgstr "Deter servidor"
msgid "Stop local webserver"
msgstr "Deter servidor web local"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1808,7 +1807,7 @@ msgstr "~V~olver ao Iniciador"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1829,7 +1828,7 @@ msgstr "Gardar partida:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2855,8 +2854,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2868,8 +2867,8 @@ msgstr "Restaurar xogo:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/hu_HU.po b/po/hu_HU.po
index b85cce2bf6..bce6b19d66 100644
--- a/po/hu_HU.po
+++ b/po/hu_HU.po
@@ -6,11 +6,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2017-01-08 06:09+0000\n"
"Last-Translator: George Kormendi <grubycza@hotmail.com>\n"
-"Language-Team: Hungarian "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/hu/>\n"
+"Language-Team: Hungarian <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/hu/>\n"
"Language: hu_HU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-2\n"
@@ -575,7 +575,6 @@ msgid "Associated key : %s"
msgstr "Társított billentyû: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Társított billentyû: nincs"
@@ -1328,7 +1327,7 @@ msgstr "Szerver leállítás"
msgid "Stop local webserver"
msgstr "Helyi webszerver leállítása"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1795,7 +1794,7 @@ msgstr "Visszatérés az indítóba"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1816,7 +1815,7 @@ msgstr "Játék mentése:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2755,8 +2754,8 @@ msgid ""
"Incorrect version of the '%s' engine data file found. Expected %d.%d but got "
"%d.%d."
msgstr ""
-"Hibás verziójú '%s' motor adatfájlt találtam. Elvárt %d.%d helyett ez van "
-"%d.%d."
+"Hibás verziójú '%s' motor adatfájlt találtam. Elvárt %d.%d helyett ez van %d."
+"%d."
#: engines/adl/detection.cpp:45 engines/adl/detection.cpp:55
msgid "Color mode"
@@ -2838,8 +2837,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2851,8 +2850,8 @@ msgstr "Játékmenet visszaállítása:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/it_IT.po b/po/it_IT.po
index e29bbef32d..5e56e255c7 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2017-01-06 21:05+0000\n"
"Last-Translator: Walter Agazzi <tag2015@gmail.com>\n"
-"Language-Team: Italian "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/it/>\n"
+"Language-Team: Italian <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/it/>\n"
"Language: it_IT\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -579,7 +579,6 @@ msgid "Associated key : %s"
msgstr "Tasto associato: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Tasto associato: nessuno"
@@ -1342,7 +1341,7 @@ msgstr "Arresta server"
msgid "Stop local webserver"
msgstr "Arresta webserver locale"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1815,7 +1814,7 @@ msgstr "~V~ai a elenco giochi"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1836,7 +1835,7 @@ msgstr "Salva gioco:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2865,8 +2864,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2878,8 +2877,8 @@ msgstr "Ripristina partita:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/nb_NO.po b/po/nb_NO.po
index 18bba2e9d7..ad7aca7b8f 100644
--- a/po/nb_NO.po
+++ b/po/nb_NO.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-26 17:36+0000\n"
"Last-Translator: Einar Johan Trøan Sømåen <einarjohants@gmail.com>\n"
-"Language-Team: Norwegian Bokmål "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/nb_NO/>\n"
+"Language-Team: Norwegian Bokmål <https://translations.scummvm.org/projects/"
+"scummvm/scummvm/nb_NO/>\n"
"Language: nb_NO\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -578,7 +578,6 @@ msgid "Associated key : %s"
msgstr "Koblet tast : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Koblet tast: ingen"
@@ -1332,7 +1331,7 @@ msgstr "Stopp server"
msgid "Stop local webserver"
msgstr "Stopp lokal webserver"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1797,7 +1796,7 @@ msgstr "~T~ilbake til oppstarter"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1818,7 +1817,7 @@ msgstr "Lagret spill:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2841,8 +2840,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2854,8 +2853,8 @@ msgstr "Gjennopprett spill:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/nl_NL.po b/po/nl_NL.po
index 5fe5dffa24..015a027b3d 100644
--- a/po/nl_NL.po
+++ b/po/nl_NL.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.9.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2017-01-02 18:38+0000\n"
"Last-Translator: Ben Castricum <github@bencastricum.nl>\n"
-"Language-Team: Dutch "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/nl/>\n"
+"Language-Team: Dutch <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/nl/>\n"
"Language: nl_NL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -577,7 +577,6 @@ msgid "Associated key : %s"
msgstr "geassocieerde toets : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "geassocieerde toets : geen"
@@ -1340,7 +1339,7 @@ msgstr "Stop server"
msgid "Stop local webserver"
msgstr "Stop lokale webserver"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1805,7 +1804,7 @@ msgstr "S~t~artmenu"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1826,7 +1825,7 @@ msgstr "Spel opslaan:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2860,8 +2859,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2873,8 +2872,8 @@ msgstr "Laad opgeslagen spel:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/nn_NO.po b/po/nn_NO.po
index 694412c320..c170ca8bb6 100644
--- a/po/nn_NO.po
+++ b/po/nn_NO.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-18 18:23+0000\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Norwegian Nynorsk <https://translations.scummvm.org/projects/"
@@ -571,7 +571,6 @@ msgid "Associated key : %s"
msgstr "Kopla tast : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Kopla tast: ingen"
@@ -1331,7 +1330,7 @@ msgstr "Teinar:"
msgid "Stop local webserver"
msgstr ""
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1794,7 +1793,7 @@ msgstr "Tilbake til Oppsta~r~tar"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1815,7 +1814,7 @@ msgstr "Lagra spel:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2837,8 +2836,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2850,8 +2849,8 @@ msgstr "Gjenopprett spel:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/pl_PL.po b/po/pl_PL.po
index 85b121693c..94413b3ed7 100644
--- a/po/pl_PL.po
+++ b/po/pl_PL.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2017-01-06 10:37+0000\n"
"Last-Translator: Rafa³ Rzepecki <divided.mind@gmail.com>\n"
-"Language-Team: Polish "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/pl/>\n"
+"Language-Team: Polish <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/pl/>\n"
"Language: pl_PL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-2\n"
@@ -580,7 +580,6 @@ msgid "Associated key : %s"
msgstr "Przypisany klawisz: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Przypisany klawisz: brak"
@@ -1335,7 +1334,7 @@ msgstr "Zatrzymaj serwer"
msgid "Stop local webserver"
msgstr "Zatrzymuje lokalny serwer WWW"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1798,7 +1797,7 @@ msgstr "~P~owrót do launchera"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1819,7 +1818,7 @@ msgstr "Zapis:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2841,8 +2840,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2854,8 +2853,8 @@ msgstr "Wznów grê:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 5b42e795ee..e62fcadc67 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-22 21:50+0000\n"
"Last-Translator: Alexandre Folle de Menezes <afmenez@terra.com.br>\n"
"Language-Team: Portuguese (Brazil) <https://translations.scummvm.org/"
@@ -581,7 +581,6 @@ msgid "Associated key : %s"
msgstr "Tecla associada: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Tecla associada: nenhuma"
@@ -1355,7 +1354,7 @@ msgstr "Servidor:"
msgid "Stop local webserver"
msgstr ""
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1831,7 +1830,7 @@ msgstr "~V~oltar ao menu"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1852,7 +1851,7 @@ msgstr "Salvar jogo:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2884,8 +2883,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2897,8 +2896,8 @@ msgstr "Restaurar jogo:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/pt_PT.po b/po/pt_PT.po
index 0773e99203..5287fb3503 100644
--- a/po/pt_PT.po
+++ b/po/pt_PT.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.10.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-14 00:22+0000\n"
"Last-Translator: Fernando Sarmento <nando_sarmento@hotmail.com>\n"
"Language-Team: Portuguese (Portugal) <https://translations.scummvm.org/"
@@ -581,7 +581,6 @@ msgid "Associated key : %s"
msgstr "Teclas associadas : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Teclas associadas : nenhuma"
@@ -1332,7 +1331,7 @@ msgstr ""
msgid "Stop local webserver"
msgstr ""
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1788,7 +1787,7 @@ msgstr ""
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1809,7 +1808,7 @@ msgstr ""
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2791,8 +2790,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2804,8 +2803,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/ru_RU.po b/po/ru_RU.po
index e404ee228f..c7a2e37a11 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -7,17 +7,17 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-31 21:04+0000\n"
"Last-Translator: Ivan Lukyanov <lid-gr@tut.by>\n"
-"Language-Team: Russian "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/ru/>\n"
+"Language-Team: Russian <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/ru/>\n"
"Language: ru_RU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-5\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<="
-"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 2.9\n"
"X-Language-name: Russian\n"
@@ -579,7 +579,6 @@ msgid "Associated key : %s"
msgstr "½Ð×ÝÐçÕÝÝÐï ÚÛÐÒØèÐ : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "½Ð×ÝÐçÕÝÝÐï ÚÛÐÒØèÐ : ÝÕâ"
@@ -1339,7 +1338,7 @@ msgstr "¾áâÐÝÞÒØâì áÕàÒÕà"
msgid "Stop local webserver"
msgstr "¾áâÐÝÐÒÛØÒÐÕâ ÛÞÚÐÛìÝëÙ ÒÕÑ-áÕàÒÕà"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1806,7 +1805,7 @@ msgstr "~²~ ÓÛÐÒÝÞÕ ÜÕÝî"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1827,7 +1826,7 @@ msgstr "ÁÞåàÐÝØâì ØÓàã:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2855,8 +2854,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2868,8 +2867,8 @@ msgstr "²ÞááâÐÝÞÒØâì ØÓàã:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/scummvm.pot b/po/scummvm.pot
index 9e98951584..d7d707890c 100644
--- a/po/scummvm.pot
+++ b/po/scummvm.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.10.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -561,7 +561,6 @@ msgid "Associated key : %s"
msgstr ""
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr ""
@@ -1300,7 +1299,7 @@ msgstr ""
msgid "Stop local webserver"
msgstr ""
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1756,7 +1755,7 @@ msgstr ""
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1777,7 +1776,7 @@ msgstr ""
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2759,8 +2758,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2772,8 +2771,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/sv_SE.po b/po/sv_SE.po
index f671ec9d2a..e4cb850476 100644
--- a/po/sv_SE.po
+++ b/po/sv_SE.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.5.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2017-01-06 09:18+0000\n"
"Last-Translator: Petter Sjölund <ignalina@mac.com>\n"
-"Language-Team: Swedish "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/sv/>\n"
+"Language-Team: Swedish <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/sv/>\n"
"Language: sv_SE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -580,7 +580,6 @@ msgid "Associated key : %s"
msgstr "Inställd tangent: %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Inställd tangent: Ingen"
@@ -1337,7 +1336,7 @@ msgstr "Stoppa server"
msgid "Stop local webserver"
msgstr "Stoppa lokal webbserver"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1806,7 +1805,7 @@ msgstr "Åte~r~vänd till launcher"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1827,7 +1826,7 @@ msgstr "Spara spelet:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2769,8 +2768,8 @@ msgid ""
"Incorrect version of the '%s' engine data file found. Expected %d.%d but got "
"%d.%d."
msgstr ""
-"Felaktig version av datafilen '%s' hittades. Version %d.%d krävs, hittade "
-"%d.%d."
+"Felaktig version av datafilen '%s' hittades. Version %d.%d krävs, hittade %d."
+"%d."
#: engines/adl/detection.cpp:45 engines/adl/detection.cpp:55
msgid "Color mode"
@@ -2853,8 +2852,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2866,8 +2865,8 @@ msgstr "Ladda sparfil:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/uk_UA.po b/po/uk_UA.po
index 230c798004..748f457c21 100644
--- a/po/uk_UA.po
+++ b/po/uk_UA.po
@@ -8,17 +8,17 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.9.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2017-01-01 00:02+0000\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
-"Language-Team: Ukrainian "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/uk/>\n"
+"Language-Team: Ukrainian <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/uk/>\n"
"Language: uk_UA\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-5\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<="
-"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 2.9\n"
"X-Language-name: Ukrainian\n"
@@ -581,7 +581,6 @@ msgid "Associated key : %s"
msgstr "¿àØ×ÝÐçÕÝÐ ÚÛÐÒöèÐ : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "¿àØ×ÝÐçÕÝÐ ÚÛÐÒöèÐ : ÝÕÜÐô"
@@ -1340,7 +1339,7 @@ msgstr "²ØÜÚÝãâØ áÕàÒÕà"
msgid "Stop local webserver"
msgstr "²ØÜÚÝãâØ ÛÞÚÐÛìÝØÙ ÒÕÑ-áÕàÒÕà"
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1807,7 +1806,7 @@ msgstr "~¿~ÞÒÕà.Ò ÓÞÛÞÒÝÕ ÜÕÝî"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1828,7 +1827,7 @@ msgstr "·ÑÕàÕÓâØ Óàã:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2856,8 +2855,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2869,8 +2868,8 @@ msgstr "²öÔÝÞÒØâØ Óàã:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/po/zh-Latn_CN.po b/po/zh-Latn_CN.po
index ffcf999c85..3f86255ba9 100644
--- a/po/zh-Latn_CN.po
+++ b/po/zh-Latn_CN.po
@@ -7,11 +7,11 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.9.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
-"POT-Creation-Date: 2016-12-26 16:14+0100\n"
+"POT-Creation-Date: 2017-01-12 10:39+0100\n"
"PO-Revision-Date: 2016-12-26 19:38+0000\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
-"Language-Team: Chinese "
-"<https://translations.scummvm.org/projects/scummvm/scummvm/zh_LATN@cn/>\n"
+"Language-Team: Chinese <https://translations.scummvm.org/projects/scummvm/"
+"scummvm/zh_LATN@cn/>\n"
"Language: zh-Latn_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
@@ -568,7 +568,6 @@ msgid "Associated key : %s"
msgstr "Guanlian Anjian : %s"
#: gui/KeysDialog.cpp:82 gui/KeysDialog.cpp:104 gui/KeysDialog.cpp:143
-#, c-format
msgid "Associated key : none"
msgstr "Guanlian Anjian : Wu"
@@ -1331,7 +1330,7 @@ msgstr "Fuwuqi:"
msgid "Stop local webserver"
msgstr ""
-#: gui/options.cpp:2163
+#: gui/options.cpp:2165
msgid ""
"Request failed.\n"
"Check your Internet connection."
@@ -1793,7 +1792,7 @@ msgstr "~R~Fanhui Qidongqi"
#: engines/gnap/menu.cpp:464 engines/hugo/file.cpp:298
#: engines/mads/nebular/dialogs_nebular.cpp:350 engines/mohawk/dialogs.cpp:104
#: engines/neverhood/menumodule.cpp:880 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -1814,7 +1813,7 @@ msgstr "Baocun Youxi:"
#: engines/hugo/file.cpp:298 engines/mads/nebular/dialogs_nebular.cpp:350
#: engines/mohawk/dialogs.cpp:104 engines/neverhood/menumodule.cpp:880
#: engines/parallaction/saveload.cpp:209 engines/pegasus/pegasus.cpp:377
-#: engines/sci/engine/kfile.cpp:891 engines/sci/engine/kfile.cpp:1167
+#: engines/sci/engine/kfile.cpp:899 engines/sci/engine/kfile.cpp:1175
#: engines/scumm/dialogs.cpp:184 engines/sherlock/scalpel/scalpel.cpp:1250
#: engines/sherlock/tattoo/widget_files.cpp:75 engines/toltecs/menu.cpp:291
#: engines/toon/toon.cpp:3340 engines/tsage/scenes.cpp:599
@@ -2837,8 +2836,8 @@ msgstr ""
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore game:"
@@ -2850,8 +2849,8 @@ msgstr "Huifu Youxi:"
#: engines/dm/loadsave.cpp:184 engines/drascula/saveload.cpp:377
#: engines/dreamweb/saveload.cpp:170 engines/gnap/menu.cpp:473
#: engines/hugo/file.cpp:400 engines/mads/nebular/dialogs_nebular.cpp:377
-#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1010
-#: engines/sci/engine/kfile.cpp:1239 engines/sherlock/scalpel/scalpel.cpp:1263
+#: engines/neverhood/menumodule.cpp:893 engines/sci/engine/kfile.cpp:1018
+#: engines/sci/engine/kfile.cpp:1247 engines/sherlock/scalpel/scalpel.cpp:1263
#: engines/sherlock/tattoo/widget_files.cpp:94 engines/toltecs/menu.cpp:266
#: engines/toon/toon.cpp:3432 engines/zvision/file/save_manager.cpp:62
msgid "Restore"
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index 32aa9f9044..ae30ec0636 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -738,9 +738,9 @@ bool AVIDecoder::seekIntern(const Audio::Timestamp &time) {
chunk = _fileStream->readStream(entry->size);
videoTrack2->decodeFrame(chunk);
- if (indexFrame < frame) {
+ if (indexFrame < (int)frame) {
TrackStatus &status = _videoTracks.back();
- while (status.chunkSearchOffset < _movieListEnd && indexFrame++ < frame) {
+ while (status.chunkSearchOffset < _movieListEnd && indexFrame++ < (int)frame) {
// There was no index entry for the desired frame, so an earlier one was decoded.
// We now have to sequentially decode frames until we get to the desired frame
handleNextPacket(status);
diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp
index 4e05499065..4c9ef67702 100644
--- a/video/coktel_decoder.cpp
+++ b/video/coktel_decoder.cpp
@@ -1691,7 +1691,7 @@ bool VMDDecoder::openExternalCodec() {
if (_videoCodec == kVideoCodecIndeo3) {
_isPaletted = false;
- _codec = new Image::Indeo3Decoder(_width, _height);
+ _codec = new Image::Indeo3Decoder(_width, _height, g_system->getScreenFormat().bpp());
} else {
warning("VMDDecoder::openExternalCodec(): Unknown video codec FourCC \"%s\"",