aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcraigsc2020-01-11 12:08:21 -0800
committercraigsc2020-01-11 12:08:21 -0800
commit3dd4fb16f017a8eab5c6c11fd119a397b457866e (patch)
tree5b80b5c5038d8577c2d674a5a4742b335deca515
parentf9f81ea9baecb714f26cf1c17a1b0ae58431467b (diff)
parent5893672b80f00fced33c42e63471d68ba47d7dd4 (diff)
downloadscummvm-rg350-3dd4fb16f017a8eab5c6c11fd119a397b457866e.tar.gz
scummvm-rg350-3dd4fb16f017a8eab5c6c11fd119a397b457866e.tar.bz2
scummvm-rg350-3dd4fb16f017a8eab5c6c11fd119a397b457866e.zip
Merge remote-tracking branch 'upstream/master'
-rw-r--r--NEWS.md78
-rw-r--r--backends/graphics/windowed.h6
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java23
-rw-r--r--common/str.cpp6
-rw-r--r--common/winexe.cpp105
-rw-r--r--common/winexe.h42
-rw-r--r--common/winexe_ne.cpp82
-rw-r--r--common/winexe_ne.h7
-rw-r--r--common/winexe_pe.cpp49
-rw-r--r--common/winexe_pe.h22
-rw-r--r--devtools/create_prince/en.po101
-rw-r--r--devtools/create_prince/ru.po4
-rw-r--r--devtools/create_titanic/winexe.cpp14
-rw-r--r--devtools/create_titanic/winexe.h35
-rw-r--r--devtools/create_titanic/winexe_pe.cpp46
-rw-r--r--devtools/create_titanic/winexe_pe.h22
-rwxr-xr-xdevtools/encode-macbinary.sh8
-rw-r--r--dists/macosx/Info.plist2
-rw-r--r--dists/macosx/Info.plist.in2
-rw-r--r--engines/bbvs/bbvs.h2
-rw-r--r--engines/director/cast.cpp69
-rw-r--r--engines/director/cast.h10
-rw-r--r--engines/director/detection.cpp1
-rw-r--r--engines/director/detection_tables.h18
-rw-r--r--engines/director/director.cpp72
-rw-r--r--engines/director/director.h19
-rw-r--r--engines/director/frame.cpp107
-rw-r--r--engines/director/frame.h56
-rw-r--r--engines/director/graphics.cpp505
-rw-r--r--engines/director/images.cpp1
-rw-r--r--engines/director/lingo/lingo-builtins.cpp16
-rw-r--r--engines/director/lingo/lingo-bytecode.cpp170
-rw-r--r--engines/director/lingo/lingo-codegen.cpp7
-rw-r--r--engines/director/lingo/lingo-events.cpp24
-rw-r--r--engines/director/lingo/lingo-gr.cpp654
-rw-r--r--engines/director/lingo/lingo-gr.y4
-rw-r--r--engines/director/lingo/lingo-lex.cpp579
-rw-r--r--engines/director/lingo/lingo-lex.l10
-rw-r--r--engines/director/lingo/lingo-the.cpp54
-rw-r--r--engines/director/lingo/lingo-the.h1
-rw-r--r--engines/director/lingo/lingo.cpp12
-rw-r--r--engines/director/lingo/tests/lingotests (renamed from engines/director/lingo/tests/lingotests.lingo)0
-rw-r--r--engines/director/lingo/tests/the.lingo2
-rw-r--r--engines/director/resource.cpp28
-rw-r--r--engines/director/score.cpp107
-rw-r--r--engines/director/score.h2
-rw-r--r--engines/director/sprite.cpp3
-rw-r--r--engines/director/types.h67
-rw-r--r--engines/gnap/gnap.cpp5
-rw-r--r--engines/gnap/gnap.h7
-rw-r--r--engines/gob/inter_v7.cpp3
-rw-r--r--engines/griffon/dialogs.cpp1
-rw-r--r--engines/griffon/engine.cpp2
-rw-r--r--engines/griffon/input.cpp5
-rw-r--r--engines/griffon/resources.cpp6
-rw-r--r--engines/hdb/gfx.cpp1
-rw-r--r--engines/illusions/illusions.h2
-rw-r--r--engines/kyra/engine/kyra_v1.cpp13
-rw-r--r--engines/kyra/graphics/screen.cpp42
-rw-r--r--engines/kyra/gui/gui_lok.cpp2
-rw-r--r--engines/kyra/script/script_lok.cpp13
-rw-r--r--engines/kyra/script/script_v1.cpp2
-rw-r--r--engines/kyra/sound/drivers/mlalf98.cpp4
-rw-r--r--engines/mohawk/cursors.cpp68
-rw-r--r--engines/mohawk/cursors.h37
-rw-r--r--engines/pink/cursor_mgr.h2
-rw-r--r--engines/pink/director.h4
-rw-r--r--engines/pink/gui.cpp2
-rw-r--r--engines/pink/pink.cpp14
-rw-r--r--engines/pink/pink.h13
-rw-r--r--engines/sci/engine/script_patches.cpp122
-rw-r--r--engines/sci/engine/scriptdebug.cpp84
-rw-r--r--engines/sci/engine/scriptdebug.h4
-rw-r--r--engines/sci/engine/selector.cpp17
-rw-r--r--engines/sci/engine/vm.cpp16
-rw-r--r--engines/sci/engine/workarounds.cpp3
-rw-r--r--engines/sci/graphics/video32.cpp4
-rw-r--r--engines/sci/resource.cpp5
-rw-r--r--engines/sci/resource_audio.cpp41
-rw-r--r--engines/scumm/he/moonbase/moonbase.cpp5
-rw-r--r--engines/scumm/he/moonbase/moonbase.h6
-rw-r--r--engines/scumm/he/moonbase/moonbase_fow.cpp5
-rw-r--r--engines/scumm/he/resource_he.cpp8
-rw-r--r--engines/scumm/he/resource_he.h9
-rw-r--r--engines/titanic/true_talk/title_engine.h1
-rw-r--r--engines/wintermute/ad/ad_actor.cpp52
-rw-r--r--engines/wintermute/ad/ad_entity.cpp79
-rw-r--r--engines/wintermute/ad/ad_entity.h10
-rw-r--r--engines/wintermute/ad/ad_game.cpp13
-rw-r--r--engines/wintermute/ad/ad_item.cpp34
-rw-r--r--engines/wintermute/ad/ad_response_box.cpp29
-rw-r--r--engines/wintermute/base/base_engine.h15
-rw-r--r--engines/wintermute/base/base_file_manager.cpp15
-rw-r--r--engines/wintermute/base/base_file_manager.h3
-rw-r--r--engines/wintermute/base/base_frame.cpp8
-rw-r--r--engines/wintermute/base/base_game.cpp310
-rw-r--r--engines/wintermute/base/base_keyboard_state.cpp605
-rw-r--r--engines/wintermute/base/base_keyboard_state.h12
-rw-r--r--engines/wintermute/base/base_persistence_manager.h1
-rw-r--r--engines/wintermute/base/base_sub_frame.cpp59
-rw-r--r--engines/wintermute/base/file/base_package.cpp2
-rw-r--r--engines/wintermute/base/file/base_package.h3
-rw-r--r--engines/wintermute/base/font/base_font_bitmap.cpp47
-rw-r--r--engines/wintermute/base/gfx/base_renderer.cpp29
-rw-r--r--engines/wintermute/base/gfx/base_renderer.h3
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp10
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.h1
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.h11
-rw-r--r--engines/wintermute/base/saveload.cpp32
-rw-r--r--engines/wintermute/base/saveload.h3
-rw-r--r--engines/wintermute/base/scriptables/script.cpp9
-rw-r--r--engines/wintermute/base/scriptables/script_ext_array.cpp34
-rw-r--r--engines/wintermute/configure.engine3
-rw-r--r--engines/wintermute/detection_tables.h274
-rw-r--r--engines/wintermute/wintermute.cpp15
-rw-r--r--engines/xeen/map.cpp25
-rw-r--r--graphics/fonts/bdf.cpp6
-rw-r--r--graphics/fonts/macfont.cpp205
-rw-r--r--graphics/fonts/macfont.h2
-rw-r--r--graphics/fonts/winfont.cpp55
-rw-r--r--graphics/fonts/winfont.h4
-rw-r--r--graphics/macgui/macfontmanager.cpp51
-rw-r--r--graphics/macgui/macmenu.cpp5
-rw-r--r--graphics/macgui/macmenu.h4
-rw-r--r--graphics/macgui/mactext.cpp16
-rw-r--r--graphics/macgui/macwindowmanager.cpp6
-rw-r--r--graphics/macgui/macwindowmanager.h6
-rw-r--r--graphics/primitives.cpp4
-rw-r--r--graphics/transparent_surface.cpp13
-rw-r--r--graphics/wincursor.cpp64
-rw-r--r--graphics/wincursor.h8
-rw-r--r--gui/ThemeLayout.cpp2
-rw-r--r--gui/editgamedialog.cpp4
-rw-r--r--gui/saveload-dialog.cpp20
-rw-r--r--gui/saveload-dialog.h1
-rw-r--r--image/png.cpp8
-rw-r--r--po/he.po56
137 files changed, 4067 insertions, 2051 deletions
diff --git a/NEWS.md b/NEWS.md
index 4e46c0db63..c859ad7d46 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -6,8 +6,84 @@ For a more comprehensive changelog of the latest experimental code, see:
Kyra:
- Added support for the PC-98 version of Eye of the Beholder I.
+
+#### 2.1.1 (2020-01-31)
+
+ General:
+ - Fixed crash when switching certain languages in GUI.
+ - Fixed ESC erroneously saving the changes in the options dialog.
+ - Improvements in FM-TOWNS/PC-98 audio.
+
+ Bladerunner:
+ - Fixed buggy savestate in some scenes.
+
+ Kyra:
+ - Fixed EOB1-Amiga ending sequence (which would play only if you achieved all bonus quests).
+ - Fixed monster random item drop chance in EOB1.
+ - Added handling for the secret potion in the Legend of Kyrandia 2.
+ - Fixed sound issues in the Legend of Kyrandia 2.
+ - Fixed minor graphics glitches in Legend of Kyrandia 1, EOB1 and EOB2-FM-TOWNS.
+
+Queen:
+ - Fixed regression with the display of the bellboy dialogue.
+
+ SCI:
+ - Numerous game script fixes in CAMELOT, ECO2, GK1, GK2,
+ KQ7, PHANT1, PQ1VGA, QFG3, QFG4, SQ5 and SQ6.
+ - Added support for Phantasmagoria 1 censored mode.
+ - Added support for Polish LSL7.
+ - Added support for Italian GK2.
+ - Added support for Russian KQ7.
+ - Added support for Russian SQ1VGA.
+ - Added support for GK2 fan-made subtitle patches.
+
+ SCUMM:
+ - Added support for Pajama2 (UK release).
+
+ Supernova:
+ - Hooked F5 to the Main Menu.
+
+ Toltecs:
+ - Added Czech version support.
+
+ Wintermute:
+ - Added several missing game variants and demos to the detection tables.
+ - Fixed regression with stack handling.
+ - Fixed the behavior of edit boxes.
+ - Improved support for Chinese language game variants.
+
Xeen:
- - Fix display of gold and gem amounts on the Switch
+ - Fixed display of gold and gem amounts on the Switch.
+ - Fixed tavern exit locations in Swords of Xeen.
+ - Fixed crash loading Deep Mine Alpha in World of Xeen CD.
+
+ GUI:
+ - MIDI setting tabs are no longer shown if a game has no music at all.
+
+ All ports:
+ - Fixed screen filling in non-paletted screen modes.
+
+ 3DS port:
+ - Major improvements.
+
+ AmigaOS4 port:
+ - Minor tweaks (stack cookie, build automation).
+
+ Android port:
+ - Improved filesystem navigation.
+
+ IOS port:
+ - The home indicator is now automatically hidden on iPhone X and later models.
+
+ NETWORKING:
+ - Improved error handling.
+
+ Switch port:
+ - Added cloud integration.
+
+ Windows:
+ - Improvements to Text-to-Speech support.
+
#### 2.1.0 "Electric Sheep" (2019-10-11)
diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h
index 40fbe8baf7..99115275de 100644
--- a/backends/graphics/windowed.h
+++ b/backends/graphics/windowed.h
@@ -405,9 +405,9 @@ private:
width = fracToInt(height * displayAspect);
}
}
-
- drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset;
- drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset;
+
+ drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * width / getWidth();
+ drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * height / getHeight();
drawRect.setWidth(width);
drawRect.setHeight(height);
}
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index f55639f60b..20fa482b66 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -21,6 +21,7 @@ import android.view.View;
import android.view.SurfaceView;
import android.view.SurfaceHolder;
import android.view.MotionEvent;
+import android.view.PointerIcon;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.Toast;
@@ -403,13 +404,19 @@ public class ScummVMActivity extends Activity {
}
private void showMouseCursor(boolean show) {
- /* Currently hiding the system mouse cursor is only
- supported on OUYA. If other systems provide similar
- intents, please add them here as well */
- Intent intent =
- new Intent(show?
- "tv.ouya.controller.action.SHOW_CURSOR" :
- "tv.ouya.controller.action.HIDE_CURSOR");
- sendBroadcast(intent);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ SurfaceView main_surface = (SurfaceView)findViewById(R.id.main_surface);
+ int type = show ? PointerIcon.TYPE_DEFAULT : PointerIcon.TYPE_NULL;
+ main_surface.setPointerIcon(PointerIcon.getSystemIcon(this, type));
+ } else {
+ /* Currently hiding the system mouse cursor is only
+ supported on OUYA. If other systems provide similar
+ intents, please add them here as well */
+ Intent intent =
+ new Intent(show?
+ "tv.ouya.controller.action.SHOW_CURSOR" :
+ "tv.ouya.controller.action.HIDE_CURSOR");
+ sendBroadcast(intent);
+ }
}
}
diff --git a/common/str.cpp b/common/str.cpp
index 0082dc1bec..ad9e17806e 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -1097,7 +1097,7 @@ size_t strnlen(const char *src, size_t maxSize) {
String toPrintable(const String &in, bool keepNewLines) {
Common::String res;
- const char *tr = "\x01\x02\x03\x04\x05\x06" "a"
+ const char *tr = "\x01\x01\x02\x03\x04\x05\x06" "a"
//"\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f";
"b" "t" "n" "v" "f" "r\x0e\x0f"
"\x10\x11\x12\x13\x14\x15\x16\x17"
@@ -1117,10 +1117,10 @@ String toPrintable(const String &in, bool keepNewLines) {
res += '\\';
if (*p < 0x20) {
- if (tr[*p + 1] < 0x20)
+ if (tr[*p] < 0x20)
res += Common::String::format("x%02x", *p);
else
- res += tr[*p + 1];
+ res += tr[*p];
} else {
res += *p; // We will escape it
}
diff --git a/common/winexe.cpp b/common/winexe.cpp
index fc389f6ea6..ad6ff96505 100644
--- a/common/winexe.cpp
+++ b/common/winexe.cpp
@@ -20,8 +20,12 @@
*
*/
+#include "common/file.h"
+#include "common/memstream.h"
#include "common/str.h"
#include "common/winexe.h"
+#include "common/winexe_ne.h"
+#include "common/winexe_pe.h"
namespace Common {
@@ -78,4 +82,105 @@ String WinResourceID::toString() const {
return "";
}
+bool WinResources::loadFromEXE(const String &fileName) {
+ if (fileName.empty())
+ return false;
+
+ File *file = new File();
+
+ if (!file->open(fileName)) {
+ delete file;
+ return false;
+ }
+
+ return loadFromEXE(file);
+}
+
+bool WinResources::loadFromCompressedEXE(const String &fileName) {
+ // Based on http://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html
+
+ // TODO: Merge this with with loadFromEXE() so the handling of the compressed
+ // EXE's is transparent
+
+ File file;
+
+ if (!file.open(fileName))
+ return false;
+
+ // First part of the signature
+ if (file.readUint32BE() != MKTAG('S','Z','D','D'))
+ return false;
+
+ // Second part of the signature
+ if (file.readUint32BE() != 0x88F02733)
+ return false;
+
+ // Compression mode must be 'A'
+ if (file.readByte() != 'A')
+ return false;
+
+ file.readByte(); // file name character change
+ uint32 unpackedLength = file.readUint32LE();
+
+ byte *window = new byte[0x1000];
+ int pos = 0x1000 - 16;
+ memset(window, 0x20, 0x1000); // Initialize to all spaces
+
+ byte *unpackedData = (byte *)malloc(unpackedLength);
+ assert(unpackedData);
+ byte *dataPos = unpackedData;
+
+ // Apply simple LZSS decompression
+ for (;;) {
+ byte controlByte = file.readByte();
+
+ if (file.eos())
+ break;
+
+ for (byte i = 0; i < 8; i++) {
+ if (controlByte & (1 << i)) {
+ *dataPos++ = window[pos++] = file.readByte();
+ pos &= 0xFFF;
+ } else {
+ int matchPos = file.readByte();
+ int matchLen = file.readByte();
+ matchPos |= (matchLen & 0xF0) << 4;
+ matchLen = (matchLen & 0xF) + 3;
+ while (matchLen--) {
+ *dataPos++ = window[pos++] = window[matchPos++];
+ pos &= 0xFFF;
+ matchPos &= 0xFFF;
+ }
+ }
+
+ }
+ }
+
+ delete[] window;
+ SeekableReadStream *stream = new MemoryReadStream(unpackedData, unpackedLength);
+
+ return loadFromEXE(stream);
+}
+
+
+WinResources *WinResources::createFromEXE(const String &fileName) {
+ WinResources *exe;
+
+ // First try loading via the NE code
+ exe = new Common::NEResources();
+ if (exe->loadFromEXE(fileName)) {
+ return exe;
+ }
+ delete exe;
+
+ // Then try loading via the PE code
+ exe = new Common::PEResources();
+ if (exe->loadFromEXE(fileName)) {
+ return exe;
+ }
+ delete exe;
+
+ return nullptr;
+}
+
} // End of namespace Common
diff --git a/common/winexe.h b/common/winexe.h
index 9aeea379ed..2b81a33261 100644
--- a/common/winexe.h
+++ b/common/winexe.h
@@ -28,6 +28,8 @@
namespace Common {
+class SeekableReadStream;
+
/** The default Windows resources. */
enum WinResourceType {
kWinCursor = 0x01,
@@ -90,6 +92,46 @@ struct WinResourceID_EqualTo {
bool operator()(const WinResourceID &id1, const WinResourceID &id2) const { return id1 == id2; }
};
+/**
+ * A class able to load resources from a Windows Executable, such
+ * as cursors, bitmaps, and sounds.
+ */
+class WinResources {
+public:
+ virtual ~WinResources() {};
+
+ /** Clear all information. */
+ virtual void clear() = 0;
+
+ /** Load from an EXE file. */
+ virtual bool loadFromEXE(const String &fileName);
+
+ /** Load from a Windows compressed EXE file. */
+ virtual bool loadFromCompressedEXE(const String &fileName);
+
+ /** Load from a stream. */
+ virtual bool loadFromEXE(SeekableReadStream *stream) = 0;
+
+ /** Return a list of IDs for a given type. */
+ virtual const Array<WinResourceID> getIDList(const WinResourceID &type) const = 0;
+
+ /** Return a list of languages for a given type and ID. */
+ virtual const Array<WinResourceID> getLangList(const WinResourceID &type, const WinResourceID &id) const {
+ Array<WinResourceID> array;
+ return array;
+ }
+
+ /** Return a stream to the specified resource, taking the first language found (or 0 if non-existent). */
+ virtual SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &id) = 0;
+
+ /** Return a stream to the specified resource (or 0 if non-existent). */
+ virtual SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &id, const WinResourceID &lang) {
+ return getResource(type, id);
+ }
+
+ static WinResources *createFromEXE(const String &fileName);
+};
+
} // End of namespace Common
#endif
diff --git a/common/winexe_ne.cpp b/common/winexe_ne.cpp
index 2d46cb2554..66b5e0911a 100644
--- a/common/winexe_ne.cpp
+++ b/common/winexe_ne.cpp
@@ -21,8 +21,6 @@
*/
#include "common/debug.h"
-#include "common/file.h"
-#include "common/memstream.h"
#include "common/str.h"
#include "common/stream.h"
#include "common/winexe_ne.h"
@@ -46,20 +44,6 @@ void NEResources::clear() {
_resources.clear();
}
-bool NEResources::loadFromEXE(const String &fileName) {
- if (fileName.empty())
- return false;
-
- File *file = new File();
-
- if (!file->open(fileName)) {
- delete file;
- return false;
- }
-
- return loadFromEXE(file);
-}
-
bool NEResources::loadFromEXE(SeekableReadStream *stream) {
clear();
@@ -80,72 +64,6 @@ bool NEResources::loadFromEXE(SeekableReadStream *stream) {
return true;
}
-bool NEResources::loadFromCompressedEXE(const String &fileName) {
- // Based on http://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html
-
- // TODO: Merge this with with loadFromEXE() so the handling of the compressed
- // EXE's is transparent
-
- File file;
-
- if (!file.open(fileName))
- return false;
-
- // First part of the signature
- if (file.readUint32BE() != MKTAG('S','Z','D','D'))
- return false;
-
- // Second part of the signature
- if (file.readUint32BE() != 0x88F02733)
- return false;
-
- // Compression mode must be 'A'
- if (file.readByte() != 'A')
- return false;
-
- file.readByte(); // file name character change
- uint32 unpackedLength = file.readUint32LE();
-
- byte *window = new byte[0x1000];
- int pos = 0x1000 - 16;
- memset(window, 0x20, 0x1000); // Initialize to all spaces
-
- byte *unpackedData = (byte *)malloc(unpackedLength);
- assert(unpackedData);
- byte *dataPos = unpackedData;
-
- // Apply simple LZSS decompression
- for (;;) {
- byte controlByte = file.readByte();
-
- if (file.eos())
- break;
-
- for (byte i = 0; i < 8; i++) {
- if (controlByte & (1 << i)) {
- *dataPos++ = window[pos++] = file.readByte();
- pos &= 0xFFF;
- } else {
- int matchPos = file.readByte();
- int matchLen = file.readByte();
- matchPos |= (matchLen & 0xF0) << 4;
- matchLen = (matchLen & 0xF) + 3;
- while (matchLen--) {
- *dataPos++ = window[pos++] = window[matchPos++];
- pos &= 0xFFF;
- matchPos &= 0xFFF;
- }
- }
-
- }
- }
-
- delete[] window;
- SeekableReadStream *stream = new MemoryReadStream(unpackedData, unpackedLength);
-
- return loadFromEXE(stream);
-}
-
uint32 NEResources::getResourceTableOffset() {
if (!_exe)
return 0xFFFFFFFF;
diff --git a/common/winexe_ne.h b/common/winexe_ne.h
index 1a845864b2..118629abe1 100644
--- a/common/winexe_ne.h
+++ b/common/winexe_ne.h
@@ -38,7 +38,7 @@ class SeekableReadStream;
*
* See http://en.wikipedia.org/wiki/New_Executable for more info.
*/
-class NEResources {
+class NEResources : public WinResources {
public:
NEResources();
~NEResources();
@@ -47,10 +47,7 @@ public:
void clear();
/** Load from an EXE file. */
- bool loadFromEXE(const String &fileName);
-
- /** Load from a Windows compressed EXE file. */
- bool loadFromCompressedEXE(const String &fileName);
+ using WinResources::loadFromEXE;
/** Load from a stream. */
bool loadFromEXE(SeekableReadStream *stream);
diff --git a/common/winexe_pe.cpp b/common/winexe_pe.cpp
index 042c347c47..5e962dd139 100644
--- a/common/winexe_pe.cpp
+++ b/common/winexe_pe.cpp
@@ -23,7 +23,6 @@
#include "common/array.h"
#include "common/debug.h"
#include "common/endian.h"
-#include "common/file.h"
#include "common/str.h"
#include "common/stream.h"
#include "common/winexe_pe.h"
@@ -44,20 +43,6 @@ void PEResources::clear() {
delete _exe; _exe = nullptr;
}
-bool PEResources::loadFromEXE(const String &fileName) {
- if (fileName.empty())
- return false;
-
- File *file = new File();
-
- if (!file->open(fileName)) {
- delete file;
- return false;
- }
-
- return loadFromEXE(file);
-}
-
bool PEResources::loadFromEXE(SeekableReadStream *stream) {
clear();
@@ -151,7 +136,7 @@ void PEResources::parseResourceLevel(Section &section, uint32 offset, int level)
if (level == 0)
_curType = id;
else if (level == 1)
- _curName = id;
+ _curID = id;
else if (level == 2)
_curLang = id;
@@ -166,9 +151,9 @@ void PEResources::parseResourceLevel(Section &section, uint32 offset, int level)
resource.size = _exe->readUint32LE();
debug(4, "Found resource '%s' '%s' '%s' at %d of size %d", _curType.toString().c_str(),
- _curName.toString().c_str(), _curLang.toString().c_str(), resource.offset, resource.size);
+ _curID.toString().c_str(), _curLang.toString().c_str(), resource.offset, resource.size);
- _resources[_curType][_curName][_curLang] = resource;
+ _resources[_curType][_curID][_curLang] = resource;
}
_exe->seek(lastOffset);
@@ -187,32 +172,32 @@ const Array<WinResourceID> PEResources::getTypeList() const {
return array;
}
-const Array<WinResourceID> PEResources::getNameList(const WinResourceID &type) const {
+const Array<WinResourceID> PEResources::getIDList(const WinResourceID &type) const {
Array<WinResourceID> array;
if (!_exe || !_resources.contains(type))
return array;
- const NameMap &nameMap = _resources[type];
+ const IDMap &idMap = _resources[type];
- for (NameMap::const_iterator it = nameMap.begin(); it != nameMap.end(); it++)
+ for (IDMap::const_iterator it = idMap.begin(); it != idMap.end(); it++)
array.push_back(it->_key);
return array;
}
-const Array<WinResourceID> PEResources::getLangList(const WinResourceID &type, const WinResourceID &name) const {
+const Array<WinResourceID> PEResources::getLangList(const WinResourceID &type, const WinResourceID &id) const {
Array<WinResourceID> array;
if (!_exe || !_resources.contains(type))
return array;
- const NameMap &nameMap = _resources[type];
+ const IDMap &idMap = _resources[type];
- if (!nameMap.contains(name))
+ if (!idMap.contains(id))
return array;
- const LangMap &langMap = nameMap[name];
+ const LangMap &langMap = idMap[id];
for (LangMap::const_iterator it = langMap.begin(); it != langMap.end(); it++)
array.push_back(it->_key);
@@ -220,27 +205,27 @@ const Array<WinResourceID> PEResources::getLangList(const WinResourceID &type, c
return array;
}
-SeekableReadStream *PEResources::getResource(const WinResourceID &type, const WinResourceID &name) {
- Array<WinResourceID> langList = getLangList(type, name);
+SeekableReadStream *PEResources::getResource(const WinResourceID &type, const WinResourceID &id) {
+ Array<WinResourceID> langList = getLangList(type, id);
if (langList.empty())
return nullptr;
- const Resource &resource = _resources[type][name][langList[0]];
+ const Resource &resource = _resources[type][id][langList[0]];
_exe->seek(resource.offset);
return _exe->readStream(resource.size);
}
-SeekableReadStream *PEResources::getResource(const WinResourceID &type, const WinResourceID &name, const WinResourceID &lang) {
+SeekableReadStream *PEResources::getResource(const WinResourceID &type, const WinResourceID &id, const WinResourceID &lang) {
if (!_exe || !_resources.contains(type))
return nullptr;
- const NameMap &nameMap = _resources[type];
+ const IDMap &idMap = _resources[type];
- if (!nameMap.contains(name))
+ if (!idMap.contains(id))
return nullptr;
- const LangMap &langMap = nameMap[name];
+ const LangMap &langMap = idMap[id];
if (!langMap.contains(lang))
return nullptr;
diff --git a/common/winexe_pe.h b/common/winexe_pe.h
index 6f92cde6dc..79b913043a 100644
--- a/common/winexe_pe.h
+++ b/common/winexe_pe.h
@@ -37,7 +37,7 @@ class SeekableReadStream;
* A class able to load resources from a Windows Portable Executable, such
* as cursors, bitmaps, and sounds.
*/
-class PEResources {
+class PEResources : public WinResources {
public:
PEResources();
~PEResources();
@@ -46,7 +46,7 @@ public:
void clear();
/** Load from an EXE file. */
- bool loadFromEXE(const String &fileName);
+ using WinResources::loadFromEXE;
/** Load from a stream. */
bool loadFromEXE(SeekableReadStream *stream);
@@ -54,17 +54,17 @@ public:
/** Return a list of resource types. */
const Array<WinResourceID> getTypeList() const;
- /** Return a list of names for a given type. */
- const Array<WinResourceID> getNameList(const WinResourceID &type) const;
+ /** Return a list of IDs for a given type. */
+ const Array<WinResourceID> getIDList(const WinResourceID &type) const;
- /** Return a list of languages for a given type and name. */
- const Array<WinResourceID> getLangList(const WinResourceID &type, const WinResourceID &name) const;
+ /** Return a list of languages for a given type and ID. */
+ const Array<WinResourceID> getLangList(const WinResourceID &type, const WinResourceID &id) const;
/** Return a stream to the specified resource, taking the first language found (or 0 if non-existent). */
- SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &name);
+ SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &id);
/** Return a stream to the specified resource (or 0 if non-existent). */
- SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &name, const WinResourceID &lang);
+ SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &id, const WinResourceID &lang);
private:
struct Section {
@@ -78,7 +78,7 @@ private:
SeekableReadStream *_exe;
void parseResourceLevel(Section &section, uint32 offset, int level);
- WinResourceID _curType, _curName, _curLang;
+ WinResourceID _curType, _curID, _curLang;
struct Resource {
uint32 offset;
@@ -86,8 +86,8 @@ private:
};
typedef HashMap<WinResourceID, Resource, WinResourceID_Hash, WinResourceID_EqualTo> LangMap;
- typedef HashMap<WinResourceID, LangMap, WinResourceID_Hash, WinResourceID_EqualTo> NameMap;
- typedef HashMap<WinResourceID, NameMap, WinResourceID_Hash, WinResourceID_EqualTo> TypeMap;
+ typedef HashMap<WinResourceID, LangMap, WinResourceID_Hash, WinResourceID_EqualTo> IDMap;
+ typedef HashMap<WinResourceID, IDMap, WinResourceID_Hash, WinResourceID_EqualTo> TypeMap;
TypeMap _resources;
};
diff --git a/devtools/create_prince/en.po b/devtools/create_prince/en.po
index 4a025148c1..62c42bc36e 100644
--- a/devtools/create_prince/en.po
+++ b/devtools/create_prince/en.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Prince\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
"POT-Creation-Date: 2018-04-17 19:53+0100\n"
-"PO-Revision-Date: 2020-01-04 01:01+0000\n"
+"PO-Revision-Date: 2020-01-09 15:27+0000\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: English <https://translations.scummvm.org/projects/prince/"
"prince/en/>\n"
@@ -8465,23 +8465,23 @@ msgstr "$6: That's dirty!"
#: dialog0263.txt:208
msgid "$7: Zostaֵ‚a wyrzִ…dzona nam straszna krzywda!"
-msgstr ""
+msgstr "$7: Terrible harm was done to us!"
#: dialog0263.txt:309
msgid "$8: ֵ»ִ…damy surowego ukarania winnych!"
-msgstr ""
+msgstr "$8: We demand severe punishment for the guilty!"
#: dialog0263.txt:310
msgid "$9: Chcִ™ odzyskaִ‡ swoje ciaֵ‚o!"
-msgstr ""
+msgstr "$9: I want to recover my body!"
#: dialog0263.txt:311
msgid "$10: I trzeba coֵ› z tym fantem zrobiִ‡!"
-msgstr ""
+msgstr "$10: And you have to do something about it!"
#: dialog0263.txt:312
msgid "$11: Chcemy zemsty!"
-msgstr ""
+msgstr "$11: We want revenge!"
#: dialog0263.txt:413
msgid "$12: Halo?!"
@@ -8489,11 +8489,11 @@ msgstr "$12: Hello?!"
#: dialog0263.txt:414
msgid "$13: Ktoֵ› nas w ogֳ³le sֵ‚ucha?!"
-msgstr ""
+msgstr "$13: Is anyone listening to us at all?!"
#: dialog0263.txt:415
msgid "$14: Do licha ciִ™ֵ¼kiego, co za ignorancja!"
-msgstr ""
+msgstr "$14: What's the hell, such a disregard!"
#: dialog0263.txt:416
msgid "$15: Sֵ‚yszysz nas, Lucyferze?!"
@@ -8578,86 +8578,93 @@ msgstr "OTHER: Tell it all again..."
#: dialog0265.txt:1
msgid "OTHER: W miarִ™ trwania opowieֵ›ci Lucyfer byֵ‚ coraz|mniej ֵ›piִ…cy, lecz za to coraz bardziej|zdumiony."
msgstr ""
+"OTHER: As the story progressed, Lucifer was less|and less dormant, but more "
+"and more|astonished."
#: dialog0266.txt:1
msgid "HERO: To wֵ‚aֵ›nie on!"
-msgstr ""
+msgstr "HERO: It's him!"
#: dialog0267.txt:1
msgid "OTHER: To wֵ‚aֵ›nie on!"
-msgstr ""
+msgstr "OTHER: It's him!"
#: dialog0268.txt:1
msgid "HERO: Ten sam demon byֵ‚ przyczynִ… naszych|nieszczִ™ֵ›ִ‡?"
-msgstr ""
+msgstr "HERO: The same demon was the cause of our|misfortunes?"
#: dialog0268.txt:2
msgid "OTHER: Poznajִ™ go!"
-msgstr ""
+msgstr "OTHER: I recognized him!"
#: dialog0268.txt:3
msgid "OTHER: A my mamy wiִ™cej wspֳ³lnego niֵ¼ myֵ›laֵ‚am..."
-msgstr ""
+msgstr "OTHER: And we have more in common than I thought..."
#: dialog0269.txt:1
msgid "OTHER: Tak, mֳ³j panie?"
-msgstr ""
+msgstr "OTHER: Yes my lord?"
#: dialog0270.txt:1
msgid "OTHER: Rozpoczִ…ֵ‚ siִ™ iֵ›cie piekielny ogieֵ„ pytaֵ„."
-msgstr ""
+msgstr "OTHER: And the truly hellish flow of questions began."
#: dialog0271.txt:1
msgid "OTHER: Jesteֵ› najbardziej nikczemnym, zuchwaֵ‚ym|i zepsutym diabֵ‚em w ostatnich latach."
-msgstr ""
+msgstr "OTHER: You are the most wicked, bold and corrupt devil in recent years."
#: dialog0271.txt:2
msgid "OTHER: Przebijasz nawet Belzebuba."
-msgstr ""
+msgstr "OTHER: You even beat Beelzebub."
#: dialog0271.txt:3
msgid "OTHER2: Wszystko dla twojej chwaֵ‚y,|mֳ³j panie."
-msgstr ""
+msgstr "OTHER2: Everything for your glory,|my lord."
#: dialog0271.txt:4
msgid "OTHER2: Mֳ³wiֵ‚em, ֵ¼e moje nowoczesne metody|przyniosִ… rezultat i dotrzymujִ™|sֵ‚owa."
msgstr ""
+"OTHER2: I said that my modern methods will bring results|and I keep my word."
#: dialog0271.txt:5
msgid "OTHER2: Zasady sִ… po to, by je ֵ‚amaִ‡!"
-msgstr ""
+msgstr "OTHER2: The rules are there to break!"
#: dialog0271.txt:6
msgid "OTHER2: Postִ™p musi skruszyִ‡ zmurszaֵ‚e|i przestarzaֵ‚e prawo!"
-msgstr ""
+msgstr "OTHER2: Progress must break the old and|outdated law!"
#: dialog0271.txt:7
msgid "OTHER: I za to naleֵ¼y ci siִ™ nagroda, a tym dwֳ³m|idiotom jakaֵ› specjalna kara, moֵ¼e maֵ‚e|przypalanko, moֵ¼e..."
msgstr ""
+"OTHER: And for that, you deserve a reward, and for|these two idiots some "
+"special punishment,|maybe a small burn, maybe..."
#: dialog0272.txt:1
msgid "P#OTHER: Z drugiej jednak strony..."
-msgstr ""
+msgstr "P#OTHER: On the other hand, however..."
#: dialog0272.txt:2
msgid "P#OTHER: ...nie moֵ¼na tolerowaִ‡ narobionych|przez ciebie kֵ‚opotֳ³w."
-msgstr ""
+msgstr "P#OTHER: ...you can't ignore the trouble you|have caused."
#: dialog0272.txt:3
msgid "OTHER: I tego, ֵ¼e do Piekֵ‚a dostali siִ™|zwykli ֵ›miertelnicy, a ten na gֳ³rze|znowu mnie upokarza."
msgstr ""
+"OTHER: And the fact that ordinary mortals|got to Hell, and the dude from the "
+"top|humiliates me again."
#: dialog0272.txt:4
msgid "OTHER: Jeֵ›li nie odkrִ™cisz tego w 5 sekund,|ja odkrִ™cִ™ ci ֵ‚eb."
-msgstr ""
+msgstr "OTHER: If you don't unscrew it in 5 seconds,|I'll unscrew your head."
#: dialog0272.txt:5
msgid "OTHER: A potem spokojnie porozmawiamy sobie o|ֵAMANIU, KRUSZENIU I WYPALANIU."
-msgstr ""
+msgstr "OTHER: And then we'll calmly talk about|BREAKING, CRUSHING AND BURNING."
#: dialog0272.txt:6
msgid "OTHER: I to bִ™dzie dֵ‚uga rozmowa."
-msgstr ""
+msgstr "OTHER: And it will be a long conversation."
#: dialog0273.txt:1
msgid "HERO: ֵadna dzisiaj pogoda."
@@ -8746,26 +8753,28 @@ msgstr "OTHER: Marosthittem chodj les uji|nioklamcom."
#: dialog0283.txt:1
msgid "HERO: Pewnie nic nie rozumiesz z tego, co|mֳ³wiִ™, ty tִ™py osiֵ‚ku."
msgstr ""
+"HERO: You apparently don't understand anything|from what I'm saying,|you "
+"blunt musclehead."
#: dialog0284.txt:1
msgid "HERO: Co za zadziwiajִ…cy ֵ›wiat, majִ… tu takie|tresowane maֵ‚py jak ty."
-msgstr ""
+msgstr "HERO: What an amazing world, having such trained|monkeys as you here."
#: dialog0285.txt:1
msgid "HERO: Ha, ha! Mogִ™ do ciebie gadaִ‡ co chcִ™,|a ty i tak mi nic nie zrobisz."
-msgstr ""
+msgstr "HERO: Haha! I can tell you what I want|and you won't do anything to me."
#: dialog0286.txt:1
msgid "HERO: Arivaldzie! Juֵ¼ czas! Juֵ¼ czas!|Zabierz mnie stִ…d!"
-msgstr ""
+msgstr "HERO: Arivald! It's time! It's time!|Take me out of here!"
#: dialog0287.txt:1
msgid "HERO: A kim do licha jest Sheila?..."
-msgstr ""
+msgstr "HERO: Who the hell is Sheila?..."
#: dialog0288.txt:1
msgid "HERO: ֵlepa to maֵ‚o powiedziane..."
-msgstr ""
+msgstr "HERO: Blind is an understatement..."
#: dialog0289.txt:1
msgid "OTHER: Nareszcie chwila rozrywki!"
@@ -8773,67 +8782,67 @@ msgstr "OTHER: Finally a minute break!"
#: dialog0290.txt:1
msgid "OTHER: Czas siִ™ odegraִ‡!"
-msgstr ""
+msgstr "OTHER: Time to play back!"
#: dialog0291.txt:1
msgid "OTHER: ֵapy aֵ¼ zatrzeszczִ…!"
-msgstr ""
+msgstr "OTHER: My paws are crackling up!"
#: dialog0292.txt:1
msgid "OTHER: Rִ…czki do gֳ³ry!"
-msgstr ""
+msgstr "OTHER: Hands up!"
#: dialog0293.txt:1
msgid "OTHER: Nadchodzi godzina zapֵ‚aty!"
-msgstr ""
+msgstr "OTHER: The hour of payback is coming!"
#: dialog0294.txt:1
msgid "OTHER: To oznacza wojnִ™!"
-msgstr ""
+msgstr "OTHER: It means war!"
#: dialog0295.txt:1
msgid "OTHER: Siִ™ robi, ksiִ…ֵ¼ִ™!"
-msgstr ""
+msgstr "OTHER: Consider it done, prince!"
#: dialog0296.txt:1
msgid "OTHER: O nie, ksiִ…ֵ¼ִ™, jak tak dalej pֳ³jdzie,|to zbankrutujִ™."
-msgstr ""
+msgstr "OTHER: Oh no, prince, if this continues,|I will go bankrupt."
#: dialog0296.txt:2
msgid "OTHER: Myֵ›lִ™, ֵ¼e starczy na dzisiaj."
-msgstr ""
+msgstr "OTHER: I think that's enough for today."
#: dialog0297.txt:1
msgid "OTHER: Ty atakujesz, ksiִ…ֵ¼ִ™."
-msgstr ""
+msgstr "OTHER: Your turn to attack, prince."
#: dialog0298.txt:1
msgid "OTHER: Broֵ„ siִ™, ksiִ…ֵ¼ִ™."
-msgstr ""
+msgstr "OTHER: Defend yourself, prince."
#: dialog0299.txt:1
msgid "OTHER: Dobra nasza, teraz ja atakujִ™!"
-msgstr ""
+msgstr "OTHER: We are good, I'm attacking now!"
#: dialog0300.txt:1
msgid "OTHER: Ha, i tak siִ™ obroniִ™!"
-msgstr ""
+msgstr "OTHER: Ha, I will defend myself anyway!"
#: dialog0301.txt:1
msgid "OTHER: Zֵ‚ocisz dla ciebie, ksiִ…ֵ¼ִ™..."
-msgstr ""
+msgstr "OTHER: Some gold for you, prince..."
#: dialog0302.txt:1
msgid "OTHER: Poproszִ™ o zֵ‚ocisza, ksiִ…ֵ¼ִ™..."
-msgstr ""
+msgstr "OTHER: Please, give me some gold, prince..."
#: dialog0303.txt:1
msgid "OTHER: Nie masz zֵ‚ociszy?"
-msgstr ""
+msgstr "OTHER: Got no gold?"
#: dialog0303.txt:2
msgid "OTHER: Ech, ksiִ…ֵ¼ִ™..."
-msgstr ""
+msgstr "OTHER: Ugh, prince..."
#: dialog0303.txt:3
msgid "OTHER: Ale przynajmniej miaֵ‚em chwilִ™ radoֵ›ci."
diff --git a/devtools/create_prince/ru.po b/devtools/create_prince/ru.po
index 3fb80002f9..63b67b6f21 100644
--- a/devtools/create_prince/ru.po
+++ b/devtools/create_prince/ru.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Prince\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
"POT-Creation-Date: 2018-04-17 19:53+0100\n"
-"PO-Revision-Date: 2020-01-04 01:01+0000\n"
+"PO-Revision-Date: 2020-01-06 00:26+0000\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Russian <https://translations.scummvm.org/projects/prince/"
"prince/ru/>\n"
@@ -8135,7 +8135,7 @@ msgstr "$10: ׀§ׁ‚׀¾-ׁ‚׀¾ ׀´׀¾׀»׀¶׀½׀¾ ׀¿ׁ€׀¾׀¸׀·׀¾׀¹ׁ‚׀¸!"
#: dialog0263.txt:312
msgid "$11: Chcemy zemsty!"
-msgstr "$11: ׀ׁ‹ ׁ…׀¾ׁ‚׀¸׀¼ ׀÷ׁƒׁ€׀¸ׁ‚ׁ!"
+msgstr "$11: ׀ׁ‹ ׁ…׀¾ׁ‚׀¸׀¼ ׀¼׀µׁׁ‚׀¸!"
#: dialog0263.txt:413
msgid "$12: Halo?!"
diff --git a/devtools/create_titanic/winexe.cpp b/devtools/create_titanic/winexe.cpp
index c23bd84a89..49be23dbd4 100644
--- a/devtools/create_titanic/winexe.cpp
+++ b/devtools/create_titanic/winexe.cpp
@@ -80,4 +80,18 @@ String WinResourceID::toString() const {
return "";
}
+bool WinResources::loadFromEXE(const String &fileName) {
+ if (fileName.empty())
+ return false;
+
+ File *file = new File();
+
+ if (!file->open(fileName.c_str())) {
+ delete file;
+ return false;
+ }
+
+ return loadFromEXE(file);
+}
+
} // End of namespace Common
diff --git a/devtools/create_titanic/winexe.h b/devtools/create_titanic/winexe.h
index 102f1494fd..6bfe2a25a0 100644
--- a/devtools/create_titanic/winexe.h
+++ b/devtools/create_titanic/winexe.h
@@ -23,6 +23,7 @@
#ifndef COMMON_WINEXE_H
#define COMMON_WINEXE_H
+#include "file.h"
#include "hash-str.h"
#include "str.h"
@@ -90,6 +91,40 @@ struct WinResourceID_EqualTo {
bool operator()(const WinResourceID &id1, const WinResourceID &id2) const { return id1 == id2; }
};
+/**
+ * A class able to load resources from a Windows Executable, such
+ * as cursors, bitmaps, and sounds.
+ */
+class WinResources {
+public:
+ virtual ~WinResources() {}
+
+ /** Clear all information. */
+ virtual void clear() = 0;
+
+ /** Load from an EXE file. */
+ virtual bool loadFromEXE(const String &fileName);
+
+ virtual bool loadFromEXE(File *stream) = 0;
+
+ /** Return a list of IDs for a given type. */
+ virtual const Array<WinResourceID> getIDList(const WinResourceID &type) const = 0;
+
+ /** Return a list of languages for a given type and ID. */
+ virtual const Array<WinResourceID> getLangList(const WinResourceID &type, const WinResourceID &id) const {
+ Array<WinResourceID> array;
+ return array;
+ };
+
+ /** Return a stream to the specified resource, taking the first language found (or 0 if non-existent). */
+ virtual File *getResource(const WinResourceID &type, const WinResourceID &id) = 0;
+
+ /** Return a stream to the specified resource (or 0 if non-existent). */
+ virtual File *getResource(const WinResourceID &type, const WinResourceID &id, const WinResourceID &lang) {
+ return getResource(type, id);
+ }
+};
+
} // End of namespace Common
#endif
diff --git a/devtools/create_titanic/winexe_pe.cpp b/devtools/create_titanic/winexe_pe.cpp
index 16ad16ab63..f55740f692 100644
--- a/devtools/create_titanic/winexe_pe.cpp
+++ b/devtools/create_titanic/winexe_pe.cpp
@@ -44,20 +44,6 @@ void PEResources::clear() {
delete _exe; _exe = 0;
}
-bool PEResources::loadFromEXE(const String &fileName) {
- if (fileName.empty())
- return false;
-
- File *file = new File();
-
- if (!file->open(fileName.c_str())) {
- delete file;
- return false;
- }
-
- return loadFromEXE(file);
-}
-
bool PEResources::loadFromEXE(File *stream) {
clear();
@@ -151,7 +137,7 @@ void PEResources::parseResourceLevel(Section &section, uint32 offset, int level)
if (level == 0)
_curType = id;
else if (level == 1)
- _curName = id;
+ _curID = id;
else if (level == 2)
_curLang = id;
@@ -165,7 +151,7 @@ void PEResources::parseResourceLevel(Section &section, uint32 offset, int level)
resource.offset = _exe->readUint32LE() + section.offset - section.virtualAddress;
resource.size = _exe->readUint32LE();
- _resources[_curType][_curName][_curLang] = resource;
+ _resources[_curType][_curID][_curLang] = resource;
}
_exe->seek(lastOffset);
@@ -184,32 +170,32 @@ const Array<WinResourceID> PEResources::getTypeList() const {
return array;
}
-const Array<WinResourceID> PEResources::getNameList(const WinResourceID &type) const {
+const Array<WinResourceID> PEResources::getIDList(const WinResourceID &type) const {
Array<WinResourceID> array;
if (!_exe || !_resources.contains(type))
return array;
- const NameMap &nameMap = _resources[type];
+ const IDMap &idMap = _resources[type];
- for (NameMap::const_iterator it = nameMap.begin(); it != nameMap.end(); it++)
+ for (IDMap::const_iterator it = idMap.begin(); it != idMap.end(); it++)
array.push_back(it->_key);
return array;
}
-const Array<WinResourceID> PEResources::getLangList(const WinResourceID &type, const WinResourceID &name) const {
+const Array<WinResourceID> PEResources::getLangList(const WinResourceID &type, const WinResourceID &id) const {
Array<WinResourceID> array;
if (!_exe || !_resources.contains(type))
return array;
- const NameMap &nameMap = _resources[type];
+ const IDMap &idMap = _resources[type];
- if (!nameMap.contains(name))
+ if (!idMap.contains(id))
return array;
- const LangMap &langMap = nameMap[name];
+ const LangMap &langMap = idMap[id];
for (LangMap::const_iterator it = langMap.begin(); it != langMap.end(); it++)
array.push_back(it->_key);
@@ -217,13 +203,13 @@ const Array<WinResourceID> PEResources::getLangList(const WinResourceID &type, c
return array;
}
-File *PEResources::getResource(const WinResourceID &type, const WinResourceID &name) {
- Array<WinResourceID> langList = getLangList(type, name);
+File *PEResources::getResource(const WinResourceID &type, const WinResourceID &id) {
+ Array<WinResourceID> langList = getLangList(type, id);
if (langList.empty())
return 0;
- const Resource &resource = _resources[type][name][langList[0]];
+ const Resource &resource = _resources[type][id][langList[0]];
byte *data = (byte *)malloc(resource.size);
_exe->seek(resource.offset);
_exe->read(data, resource.size);
@@ -233,16 +219,16 @@ File *PEResources::getResource(const WinResourceID &type, const WinResourceID &n
return file;
}
-File *PEResources::getResource(const WinResourceID &type, const WinResourceID &name, const WinResourceID &lang) {
+File *PEResources::getResource(const WinResourceID &type, const WinResourceID &id, const WinResourceID &lang) {
if (!_exe || !_resources.contains(type))
return 0;
- const NameMap &nameMap = _resources[type];
+ const IDMap &idMap = _resources[type];
- if (!nameMap.contains(name))
+ if (!idMap.contains(id))
return 0;
- const LangMap &langMap = nameMap[name];
+ const LangMap &langMap = idMap[id];
if (!langMap.contains(lang))
return 0;
diff --git a/devtools/create_titanic/winexe_pe.h b/devtools/create_titanic/winexe_pe.h
index 3c960053b2..6ab7ae847a 100644
--- a/devtools/create_titanic/winexe_pe.h
+++ b/devtools/create_titanic/winexe_pe.h
@@ -38,7 +38,7 @@ class SeekableReadStream;
* A class able to load resources from a Windows Portable Executable, such
* as cursors, bitmaps, and sounds.
*/
-class PEResources {
+class PEResources : WinResources {
public:
PEResources();
~PEResources();
@@ -47,24 +47,24 @@ public:
void clear();
/** Load from an EXE file. */
- bool loadFromEXE(const String &fileName);
+ using WinResources::loadFromEXE;
bool loadFromEXE(File *stream);
/** Return a list of resource types. */
const Array<WinResourceID> getTypeList() const;
- /** Return a list of names for a given type. */
- const Array<WinResourceID> getNameList(const WinResourceID &type) const;
+ /** Return a list of IDs for a given type. */
+ const Array<WinResourceID> getIDList(const WinResourceID &type) const;
- /** Return a list of languages for a given type and name. */
- const Array<WinResourceID> getLangList(const WinResourceID &type, const WinResourceID &name) const;
+ /** Return a list of languages for a given type and ID. */
+ const Array<WinResourceID> getLangList(const WinResourceID &type, const WinResourceID &id) const;
/** Return a stream to the specified resource, taking the first language found (or 0 if non-existent). */
- File *getResource(const WinResourceID &type, const WinResourceID &name);
+ File *getResource(const WinResourceID &type, const WinResourceID &id);
/** Return a stream to the specified resource (or 0 if non-existent). */
- File *getResource(const WinResourceID &type, const WinResourceID &name, const WinResourceID &lang);
+ File *getResource(const WinResourceID &type, const WinResourceID &id, const WinResourceID &lang);
/** Returns true if the resources is empty */
bool empty() const { return _sections.empty(); }
@@ -80,7 +80,7 @@ private:
File *_exe;
void parseResourceLevel(Section &section, uint32 offset, int level);
- WinResourceID _curType, _curName, _curLang;
+ WinResourceID _curType, _curID, _curLang;
struct Resource {
uint32 offset;
@@ -88,8 +88,8 @@ private:
};
typedef HashMap<WinResourceID, Resource, WinResourceID_Hash, WinResourceID_EqualTo> LangMap;
- typedef HashMap<WinResourceID, LangMap, WinResourceID_Hash, WinResourceID_EqualTo> NameMap;
- typedef HashMap<WinResourceID, NameMap, WinResourceID_Hash, WinResourceID_EqualTo> TypeMap;
+ typedef HashMap<WinResourceID, LangMap, WinResourceID_Hash, WinResourceID_EqualTo> IDMap;
+ typedef HashMap<WinResourceID, IDMap, WinResourceID_Hash, WinResourceID_EqualTo> TypeMap;
TypeMap _resources;
};
diff --git a/devtools/encode-macbinary.sh b/devtools/encode-macbinary.sh
index 235dd860a4..0655fc9242 100755
--- a/devtools/encode-macbinary.sh
+++ b/devtools/encode-macbinary.sh
@@ -7,10 +7,12 @@ for i in *
do
if test -d "$i" ; then
cd "$i"
- bash $0 "$1/$i"
+ if [ "$(ls -A .)" ] ; then # directory is not empty
+ bash $0 "$1/$i"
+ fi
cd ..
else
- echo -n $1/$i ; echo -ne "... \r"
+ echo -ne "$1/$i... \r"
macbinary encode "$i"
touch -r "$i" "$i.bin"
mv "$i.bin" "$i"
@@ -18,6 +20,6 @@ do
done
# on the top level we want to print a new line
-if test -z $1 ; then
+if test -z "$1" ; then
echo
fi
diff --git a/dists/macosx/Info.plist b/dists/macosx/Info.plist
index bb0abce40c..8de6a147f2 100644
--- a/dists/macosx/Info.plist
+++ b/dists/macosx/Info.plist
@@ -72,6 +72,8 @@
<string>faYfM+DGPgJCrRzpxSHoFD0rzHa6ZnnEXuzz2E7ZRUk=</string>
<key>NSDockTilePlugIn</key>
<string>scummvm.docktileplugin</string>
+ <key>NSRequiresAquaSystemAppearance</key>
+ <false/>
<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>
</dict>
diff --git a/dists/macosx/Info.plist.in b/dists/macosx/Info.plist.in
index 4a8545dcb4..780191885f 100644
--- a/dists/macosx/Info.plist.in
+++ b/dists/macosx/Info.plist.in
@@ -72,6 +72,8 @@
<string>faYfM+DGPgJCrRzpxSHoFD0rzHa6ZnnEXuzz2E7ZRUk=</string>
<key>NSDockTilePlugIn</key>
<string>scummvm.docktileplugin</string>
+ <key>NSRequiresAquaSystemAppearance</key>
+ <false/>
<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>
</dict>
diff --git a/engines/bbvs/bbvs.h b/engines/bbvs/bbvs.h
index a9d37c2551..cfa7abf6e8 100644
--- a/engines/bbvs/bbvs.h
+++ b/engines/bbvs/bbvs.h
@@ -32,8 +32,6 @@
#include "common/str.h"
#include "common/substream.h"
#include "common/system.h"
-#include "common/winexe.h"
-#include "common/winexe_pe.h"
#include "engines/engine.h"
struct ADGameDescription;
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 8ec151cb1b..8e547f0471 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -21,6 +21,7 @@
*/
#include "common/substream.h"
+#include "graphics/surface.h"
#include "director/director.h"
#include "director/cachedmactext.h"
@@ -30,6 +31,17 @@
namespace Director {
+Cast::Cast() {
+ _type = kCastTypeNull;
+ _surface = nullptr;
+
+ _modified = true;
+}
+
+Cast::~Cast() {
+ delete _surface;
+}
+
BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version) {
_type = kCastBitmap;
@@ -63,13 +75,16 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16
_initialRect = Score::readRect(stream);
_boundingRect = Score::readRect(stream);
- _regX = stream.readUint16();
_regY = stream.readUint16();
+ _regX = stream.readUint16();
_bitsPerPixel = stream.readUint16();
if (_bitsPerPixel == 0)
_bitsPerPixel = 1;
+ if (_bitsPerPixel == 1)
+ _pitch *= 8;
+
int tail = 0;
while (!stream.eos()) {
@@ -103,7 +118,6 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16
stream.readUint32();
}
- _modified = 0;
_tag = castTag;
}
@@ -114,7 +128,8 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
_gutterSize = kSizeNone;
_boxShadow = kSizeNone;
- _flags1 = 0;
+ _flags = 0;
+ _textFlags = 0;
_fontId = 0;
_fontSize = 12;
_textType = kTextTypeFixed;
@@ -124,7 +139,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
_palinfo1 = _palinfo2 = _palinfo3 = 0;
if (version <= 3) {
- _flags1 = stream.readByte(); // region: 0 - auto, 1 - matte, 2 - disabled
+ _flags = stream.readByte(); // region: 0 - auto, 1 - matte, 2 - disabled
_borderSize = static_cast<SizeType>(stream.readByte());
_gutterSize = static_cast<SizeType>(stream.readByte());
_boxShadow = static_cast<SizeType>(stream.readByte());
@@ -138,7 +153,6 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
uint16 pad3;
uint16 pad4 = 0;
uint16 totalTextHeight;
- byte flags = 0;
if (version == 2) {
pad2 = stream.readUint16();
@@ -150,15 +164,9 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
pad3 = stream.readUint16();
_textShadow = static_cast<SizeType>(stream.readByte());
- flags = stream.readByte();
- if (flags & 0x1)
- _textFlags.push_back(kTextFlagEditable);
- if (flags & 0x2)
- _textFlags.push_back(kTextFlagAutoTab);
- if (flags & 0x4)
- _textFlags.push_back(kTextFlagDoNotWrap);
- if (flags & 0xf8)
- warning("Unprocessed text cast flags: %x", flags & 0xf8);
+ _textFlags = stream.readByte();
+ if (_textFlags & 0xf8)
+ warning("Unprocessed text cast flags: %x", _textFlags & 0xf8);
totalTextHeight = stream.readUint16();
} else {
@@ -170,9 +178,9 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
}
debugC(2, kDebugLoading, "TextCast(): flags1: %d, border: %d gutter: %d shadow: %d pad1: %x align: %04x",
- _flags1, _borderSize, _gutterSize, _boxShadow, pad1, _textAlign);
+ _flags, _borderSize, _gutterSize, _boxShadow, pad1, _textAlign);
debugC(2, kDebugLoading, "TextCast(): rgb: 0x%04x 0x%04x 0x%04x, pad2: %x pad3: %d pad4: %d shadow: %d flags: %d totHeight: %d",
- _palinfo1, _palinfo2, _palinfo3, pad2, pad3, pad4, _textShadow, flags, totalTextHeight);
+ _palinfo1, _palinfo2, _palinfo3, pad2, pad3, pad4, _textShadow, _textFlags, totalTextHeight);
if (debugChannelSet(2, kDebugLoading)) {
_initialRect.debugPrint(2, "TextCast(): rect:");
}
@@ -226,10 +234,10 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
stream.readUint16();
}
- _modified = 0;
-
_cachedMacText = new CachedMacText(this, version, -1, g_director->_wm);
// TODO Destroy me
+
+ _modified = false;
}
void TextCast::importStxt(const Stxt *stxt) {
@@ -276,8 +284,8 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
_shapeType = static_cast<ShapeType>(stream.readByte());
_initialRect = Score::readRect(stream);
_pattern = stream.readUint16BE();
- _fgCol = 0xff - (uint8)stream.readByte();
- _bgCol = 0xff - (uint8)stream.readByte();
+ _fgCol = (127 - stream.readByte()) & 0xff; // -128 -> 0, 127 -> 256
+ _bgCol = (127 - stream.readByte()) & 0xff;
_fillType = stream.readByte();
_ink = static_cast<InkType>(_fillType & 0x3f);
_lineThickness = stream.readByte();
@@ -308,7 +316,7 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
_lineThickness = 1;
_lineDirection = 0;
}
- _modified = 0;
+ _modified = false;
debugC(3, kDebugLoading, "ShapeCast: fl: %x unk1: %x type: %d pat: %d fg: %d bg: %d fill: %d thick: %d dir: %d",
flags, unk1, _shapeType, _pattern, _fgCol, _bgCol, _fillType, _lineThickness, _lineDirection);
@@ -332,7 +340,6 @@ ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextC
_buttonType = static_cast<ButtonType>(stream.readUint16BE());
}
- _modified = 0;
}
ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
@@ -341,15 +348,26 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
if (version < 4) {
error("Unhandled Script cast");
} else if (version == 4) {
- stream.readByte();
- stream.readByte();
+ byte unk1 = stream.readByte();
+ byte type = stream.readByte();
+
+ switch (type) {
+ case 1:
+ _scriptType = kScoreScript;
+ break;
+ case 3:
+ _scriptType = kMovieScript;
+ break;
+ default:
+ error("ScriptCast: Unprocessed script type: %d", type);
+ }
_initialRect = Score::readRect(stream);
_boundingRect = Score::readRect(stream);
_id = stream.readUint32();
- debugC(4, kDebugLoading, "CASt: Script id: %d", _id);
+ debugC(4, kDebugLoading, "CASt: Script id: %d type: %s (%d) unk1: %d", _id, scriptType2str(_scriptType), type, unk1);
stream.readByte(); // There should be no more data
assert(stream.eos());
@@ -366,7 +384,6 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
// WIP need to complete this!
}
- _modified = 0;
}
RTECast::RTECast(Common::ReadStreamEndian &stream, uint16 version) : TextCast(stream, version) {
diff --git a/engines/director/cast.h b/engines/director/cast.h
index 03767ecea2..5123ef8034 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -42,6 +42,9 @@ class CachedMacText;
class Cast {
public:
+ Cast();
+ virtual ~Cast();
+
CastType _type;
Common::Rect _initialRect;
Common::Rect _boundingRect;
@@ -49,7 +52,7 @@ public:
const Graphics::Surface *_surface;
- byte _modified;
+ bool _modified;
};
class BitmapCast : public Cast {
@@ -92,14 +95,14 @@ public:
SizeType _gutterSize;
SizeType _boxShadow;
- byte _flags1;
+ byte _flags;
uint32 _fontId;
uint16 _fontSize;
TextType _textType;
TextAlignType _textAlign;
SizeType _textShadow;
byte _textSlant;
- Common::Array<TextFlag> _textFlags;
+ byte _textFlags;
uint16 _palinfo1, _palinfo2, _palinfo3;
Common::String _ftext;
@@ -121,6 +124,7 @@ public:
ScriptCast(Common::ReadStreamEndian &stream, uint16 version);
uint32 _id;
+ ScriptType _scriptType;
};
class RTECast : public TextCast {
diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp
index f282bddd6d..378c287e0e 100644
--- a/engines/director/detection.cpp
+++ b/engines/director/detection.cpp
@@ -71,6 +71,7 @@ bool DirectorEngine::hasFeature(EngineFeature f) const {
static const PlainGameDescriptor directorGames[] = {
{ "director", "Macromedia Director Game" },
{ "directortest", "Macromedia Director Test Target" },
+ { "directortest-all", "Macromedia Director All Movies Test Target" },
{ "theapartment", "The Apartment, Interactive demo" },
{ "gundam0079", "Gundam 0079: The War for Earth" },
{ "jewels", "Jewels of the Oracle" },
diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index 3458a2c5e3..8ca09a45f6 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -33,11 +33,12 @@ namespace Director {
#define WINDEMO(t,e,f,m,s,v) GENGAME_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_DEMO,v)
static const DirectorGameDescription gameDescriptions[] = {
+ // Execute all *.lingo files in game directory
{
{
"directortest",
"",
- AD_ENTRY1("lingotests.lingo", 0),
+ AD_ENTRY1("lingotests", 0),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
@@ -47,6 +48,21 @@ static const DirectorGameDescription gameDescriptions[] = {
4
},
+ // Executa all movies in directory
+ {
+ {
+ "directortest-all",
+ "",
+ AD_ENTRY1("lingotests-all", 0),
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_NO_FLAGS,
+ GUIO1(GUIO_NOASPECT)
+ },
+ GID_TESTALL,
+ 4
+ },
+
// Generic D3 Mac entry
MACGAME("director", "", "D3-mac", 0, -1, 3),
// Generic D4 Mac entry
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 464b24c7a4..e82088e877 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -61,6 +61,9 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
// Setup mixer
syncSoundSettings();
+ // Load Palettes
+ loadPalettes();
+
// Load Patterns
loadPatterns();
@@ -145,6 +148,8 @@ Common::Error DirectorEngine::run() {
_lingo->runTests();
return Common::kNoError;
+ } else if (getGameID() == GID_TESTALL) {
+ enqueueAllMovies();
}
// FIXME
@@ -171,19 +176,28 @@ Common::Error DirectorEngine::run() {
loadSharedCastsFrom(_currentPath + _sharedCastFile);
debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\nObtaining score name\n");
- loadInitialMovie(getEXEName());
+
+ if (getGameID() == GID_TESTALL) {
+ _nextMovie = getNextMovieFromQueue();
+ loadInitialMovie(_nextMovie.movie);
+ } else {
+ loadInitialMovie(getEXEName());
+ }
_currentScore->setArchive(_mainArchive);
- debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
- debug(0, "@@@@ Score name '%s'", _currentScore->getMacName().c_str());
- debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
bool loop = true;
while (loop) {
loop = false;
- _currentScore->loadArchive();
+ if (_currentScore) {
+ debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ debug(0, "@@@@ Score name '%s'", _currentScore->getMacName().c_str());
+ debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+
+ _currentScore->loadArchive();
+ }
// If we came in a loop, then skip as requested
if (!_nextMovie.frameS.empty()) {
@@ -196,17 +210,24 @@ Common::Error DirectorEngine::run() {
_nextMovie.frameI = -1;
}
- debugC(1, kDebugEvents, "Starting playback of score '%s'", _currentScore->getMacName().c_str());
+ if (!debugChannelSet(-1, kDebugLingoCompileOnly) && _currentScore) {
+ debugC(1, kDebugEvents, "Starting playback of score '%s'", _currentScore->getMacName().c_str());
- _currentScore->startLoop();
+ _currentScore->startLoop();
- debugC(1, kDebugEvents, "Finished playback of score '%s'", _currentScore->getMacName().c_str());
+ debugC(1, kDebugEvents, "Finished playback of score '%s'", _currentScore->getMacName().c_str());
+ }
+
+ if (getGameID() == GID_TESTALL) {
+ _nextMovie = getNextMovieFromQueue();
+ }
// If a loop was requested, do it
if (!_nextMovie.movie.empty()) {
_lingo->restartLingo();
delete _currentScore;
+ _currentScore = nullptr;
_currentPath = getPath(_nextMovie.movie, _currentPath);
@@ -217,6 +238,11 @@ Common::Error DirectorEngine::run() {
if (!mov) {
warning("nextMovie: No score is loaded");
+ if (getGameID() == GID_TESTALL) {
+ loop = true;
+ continue;
+ }
+
return Common::kNoError;
}
@@ -273,4 +299,34 @@ Common::HashMap<Common::String, Score *> *DirectorEngine::scanMovies(const Commo
return nameMap;
}
+void DirectorEngine::enqueueAllMovies() {
+ Common::FSNode dir(ConfMan.get("path"));
+ Common::FSList files;
+ dir.getChildren(files, Common::FSNode::kListFilesOnly);
+
+ for (Common::FSList::const_iterator file = files.begin(); file != files.end(); ++file)
+ _movieQueue.push_back((*file).getName());
+
+ Common::sort(_movieQueue.begin(), _movieQueue.end());
+
+ debug(1, "=========> Enqueued %d movies", _movieQueue.size());
+}
+
+MovieReference DirectorEngine::getNextMovieFromQueue() {
+ MovieReference res;
+
+ if (_movieQueue.empty())
+ return res;
+
+ res.movie = _movieQueue.front();
+
+ debug(0, "=======================================");
+ debug(0, "=========> Next movie is %s", res.movie.c_str());
+ debug(0, "=======================================");
+
+ _movieQueue.remove_at(0);
+
+ return res;
+}
+
} // End of namespace Director
diff --git a/engines/director/director.h b/engines/director/director.h
index 344d53a84f..0648d1c1d6 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -25,6 +25,7 @@
#include "common/random.h"
#include "common/rect.h"
+#include "common/str-array.h"
#include "common/hashmap.h"
#include "engines/engine.h"
@@ -47,7 +48,8 @@ namespace Director {
enum DirectorGameID {
GID_GENERIC,
- GID_TEST
+ GID_TEST,
+ GID_TESTALL
};
class Archive;
@@ -80,7 +82,11 @@ struct MovieReference {
MovieReference() { frameI = -1; }
};
-extern byte defaultPalette[768];
+struct PaletteV4 {
+ int id;
+ byte *palette;
+ int length;
+};
class DirectorEngine : public ::Engine {
public:
@@ -101,8 +107,10 @@ public:
Score *getCurrentScore() const { return _currentScore; }
Score *getSharedScore() const { return _sharedScore; }
Common::String getCurrentPath() const { return _currentPath; }
+ void setPalette(int id);
void setPalette(byte *palette, uint16 count);
bool hasFeature(EngineFeature f) const;
+ void loadPalettes();
const byte *getPalette() const { return _currentPalette; }
uint16 getPaletteColorCount() const { return _currentPaletteLength; }
void loadSharedCastsFrom(Common::String filename);
@@ -172,15 +180,22 @@ private:
Graphics::MacPatterns _director3Patterns;
Graphics::MacPatterns _director3QuickDrawPatterns;
+ Common::HashMap<int, PaletteV4 *> _director4Palettes;
+
Common::String _sharedCastFile;
bool _draggingSprite;
uint16 _draggingSpriteId;
Common::Point _draggingSpritePos;
+ Common::StringArray _movieQueue;
+
private:
void testFontScaling();
void testFonts();
+
+ void enqueueAllMovies();
+ MovieReference getNextMovieFromQueue();
};
extern DirectorEngine *g_director;
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 24a0be8f00..880842f20a 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -197,8 +197,13 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
sprite._scriptId = stream->readByte();
sprite._spriteType = stream->readByte();
sprite._enabled = sprite._spriteType != 0;
- sprite._foreColor = 0xff - (uint8)stream->readByte();
- sprite._backColor = 0xff - (uint8)stream->readByte();
+ if (_vm->getVersion() >= 4) {
+ sprite._foreColor = 0xff - (uint8)stream->readByte();
+ sprite._backColor = 0xff - (uint8)stream->readByte();
+ } else {
+ sprite._foreColor = (127 - stream->readByte()) & 0xff; // -128 -> 0, 127 -> 256
+ sprite._backColor = (127 - stream->readByte()) & 0xff;
+ }
sprite._flags = stream->readUint16();
sprite._ink = static_cast<InkType>(sprite._flags & 0x3f);
@@ -208,7 +213,7 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
else
sprite._trails = 0;
- sprite._lineSize = (sprite._flags >> 8) & 0x03;
+ sprite._lineSize = ((sprite._flags >> 8) & 0x07);
sprite._castId = stream->readUint16();
sprite._startPoint.y = stream->readUint16();
@@ -605,7 +610,7 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
}
} else {
if (!_vm->getCurrentScore()->_loadedCast->contains(_sprites[i]->_castId)) {
- if (!_vm->getSharedScore()->_loadedCast->contains(_sprites[i]->_castId)) {
+ if (!_vm->getSharedScore() || !_vm->getSharedScore()->_loadedCast->contains(_sprites[i]->_castId)) {
debugC(1, kDebugImages, "Frame::renderSprites(): Cast id %d not found", _sprites[i]->_castId);
continue;
} else {
@@ -664,7 +669,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
byte spriteType = sp->_spriteType;
byte foreColor = sp->_foreColor;
byte backColor = sp->_backColor;
- int lineSize = sp->_lineSize - 1;
+ int lineSize = sp->_lineSize;
if (spriteType == kCastMemberSprite && sp->_cast != NULL) {
switch (sp->_cast->_type) {
case kCastShape:
@@ -688,7 +693,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
}
foreColor = sc->_fgCol;
backColor = sc->_bgCol;
- lineSize = sc->_lineThickness - 1;
+ lineSize = sc->_lineThickness;
ink = sc->_ink;
// shapes should be rendered with transparency by default
if (ink == kInkTypeCopy) {
@@ -702,6 +707,9 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
}
}
+ // for outlined shapes, line thickness of 1 means invisible.
+ lineSize -= 1;
+
Common::Rect shapeRect = Common::Rect(sp->_startPoint.x,
sp->_startPoint.y,
sp->_startPoint.x + sp->_width,
@@ -711,42 +719,55 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
tmpSurface.create(shapeRect.width(), shapeRect.height(), Graphics::PixelFormat::createFormatCLUT8());
tmpSurface.clear(255);
- // No minus one on the pattern here! MacPlotData will do that for us!
- //Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), 1, 1, sp->_backColor);
- Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), sp->getPattern(), lineSize, backColor);
- Common::Rect fillRect(MAX((int)shapeRect.width() - lineSize, 0), MAX((int)shapeRect.height() - lineSize, 0));
+ // Draw fill
+ Common::Rect fillRect((int)shapeRect.width(), (int)shapeRect.height());
+ Graphics::MacPlotData plotFill(&tmpSurface, &_vm->getPatterns(), sp->getPattern(), -shapeRect.left, -shapeRect.top, 1, backColor);
switch (spriteType) {
case kRectangleSprite:
- Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &plotFill);
break;
case kRoundedRectangleSprite:
- Graphics::drawRoundRect(fillRect, 4, foreColor, true, Graphics::macDrawPixel, &pd);
+ Graphics::drawRoundRect(fillRect, 12, foreColor, true, Graphics::macDrawPixel, &plotFill);
break;
case kOvalSprite:
- Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, true, Graphics::macDrawPixel, &pd);
+ Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, true, Graphics::macDrawPixel, &plotFill);
+ break;
+ case kCastMemberSprite: // Face kit D3
+ Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &plotFill);
+ break;
+ default:
break;
+ }
+
+ // Draw stroke
+ Common::Rect strokeRect(MAX((int)shapeRect.width() - lineSize, 0), MAX((int)shapeRect.height() - lineSize, 0));
+ Graphics::MacPlotData plotStroke(&tmpSurface, &_vm->getPatterns(), 1, -shapeRect.left, -shapeRect.top, lineSize, backColor);
+ switch (spriteType) {
case kLineTopBottomSprite:
- Graphics::drawLine(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawLine(strokeRect.left, strokeRect.top, strokeRect.right, strokeRect.bottom, foreColor, Graphics::macDrawPixel, &plotStroke);
break;
case kLineBottomTopSprite:
- Graphics::drawLine(fillRect.left, fillRect.bottom, fillRect.right, fillRect.top, foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawLine(strokeRect.left, strokeRect.bottom, strokeRect.right, strokeRect.top, foreColor, Graphics::macDrawPixel, &plotStroke);
break;
+ case kRectangleSprite:
+ // fall through
case kOutlinedRectangleSprite: // this is actually a mouse-over shape? I don't think it's a real button.
- //Graphics::drawRect(fillRect, sp->_foreColor, Graphics::macDrawPixel, &pd);
- tmpSurface.fillRect(Common::Rect(shapeRect.width(), shapeRect.height()), (_vm->getCurrentScore()->_currentMouseDownSpriteId == spriteId ? 0 : 0xff));
+ Graphics::drawRect(strokeRect, foreColor, Graphics::macDrawPixel, &plotStroke);
+ //tmpSurface.fillRect(Common::Rect(shapeRect.width(), shapeRect.height()), (_vm->getCurrentScore()->_currentMouseDownSpriteId == spriteId ? 0 : 0xff));
break;
+ case kRoundedRectangleSprite:
+ // fall through
case kOutlinedRoundedRectangleSprite:
- Graphics::drawRoundRect(fillRect, 4, foreColor, false, Graphics::macDrawPixel, &pd);
+ Graphics::drawRoundRect(strokeRect, 12, foreColor, false, Graphics::macDrawPixel, &plotStroke);
break;
+ case kOvalSprite:
+ // fall through
case kOutlinedOvalSprite:
- Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, false, Graphics::macDrawPixel, &pd);
- break;
- case kCastMemberSprite: // Face kit D3
- Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawEllipse(strokeRect.left, strokeRect.top, strokeRect.right, strokeRect.bottom, foreColor, false, Graphics::macDrawPixel, &plotStroke);
break;
default:
- warning("Frame::renderShape(): Unhandled sprite type: %d", sp->_spriteType);
+ break;
}
addDrawRect(spriteId, shapeRect);
@@ -766,9 +787,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
int height = button->_initialRect.height();
int width = button->_initialRect.width() + 3;
- Common::Rect textRect(0, 0, width, height);
- // pass the rect of the button into the label.
- renderText(surface, spriteId, &textRect);
+ bool invert = spriteId == _vm->getCurrentScore()->_currentMouseDownSpriteId;
// TODO: review all cases to confirm if we should use text height.
// height = textRect.height();
@@ -784,8 +803,9 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
break;
case kTypeButton: {
_rect = Common::Rect(x, y, x + width, y + height + 3);
- Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 1, Graphics::kColorWhite);
- Graphics::drawRoundRect(_rect, 4, 0, false, Graphics::macDrawPixel, &pd);
+ Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 0, 0, 1, invert ? Graphics::kColorBlack : Graphics::kColorWhite);
+
+ Graphics::drawRoundRect(_rect, 4, 0, invert, Graphics::macDrawPixel, &pd);
addDrawRect(spriteId, _rect);
}
break;
@@ -796,9 +816,13 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
warning("renderButton: Unknown buttonType");
break;
}
+
+ Common::Rect textRect(0, 0, width, height);
+ // pass the rect of the button into the label.
+ renderText(surface, spriteId, &textRect);
}
-void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textSize) {
+void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textRect) {
TextCast *textCast = (TextCast*)_sprites[spriteId]->_cast;
int x = _sprites[spriteId]->_startPoint.x; // +rectLeft;
@@ -807,10 +831,10 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
int width;
if (_vm->getVersion() >= 4) {
- if (textSize == NULL)
+ if (textRect == NULL)
width = textCast->_initialRect.right;
else {
- width = textSize->width();
+ width = textRect->width();
}
} else {
width = textCast->_initialRect.width(); //_sprites[spriteId]->_width;
@@ -829,11 +853,11 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
Graphics::MacFont *macFont = new Graphics::MacFont(textCast->_fontId, textCast->_fontSize, textCast->_textSlant);
- debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s' text: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont).c_str(), Common::toPrintable(textCast->_ftext).c_str());
+ debugC(3, kDebugText, "renderText: sprite: %d x: %d y: %d w: %d h: %d font: '%s' text: '%s'", spriteId, x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont).c_str(), Common::toPrintable(textCast->_ftext).c_str());
uint16 boxShadow = (uint16)textCast->_boxShadow;
uint16 borderSize = (uint16)textCast->_borderSize;
- if (textSize != NULL)
+ if (textRect != NULL)
borderSize = 0;
uint16 padding = (uint16)textCast->_gutterSize;
uint16 textShadow = (uint16)textCast->_textShadow;
@@ -848,14 +872,14 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
return;
height = textSurface->h;
- if (textSize != NULL) {
+ if (textRect != NULL) {
// TODO: this offset could be due to incorrect fonts loaded!
- textSize->bottom = height + textCast->_cachedMacText->getLineCount();
+ textRect->bottom = height + textCast->_cachedMacText->getLineCount();
}
uint16 textX = 0, textY = 0;
- if (textSize == NULL) {
+ if (textRect == NULL) {
if (borderSize > 0) {
if (_vm->getVersion() <= 3)
height++;
@@ -901,11 +925,11 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
Graphics::ManagedSurface textWithFeatures(width + (borderSize * 2) + boxShadow + textShadow, height + borderSize + boxShadow + textShadow);
textWithFeatures.fillRect(Common::Rect(textWithFeatures.w, textWithFeatures.h), 0xff);
- if (textSize == NULL && boxShadow > 0) {
+ if (textRect == NULL && boxShadow > 0) {
textWithFeatures.fillRect(Common::Rect(boxShadow, boxShadow, textWithFeatures.w + boxShadow, textWithFeatures.h), 0);
}
- if (textSize == NULL && borderSize != kSizeNone) {
+ if (textRect == NULL && borderSize != kSizeNone) {
for (int bb = 0; bb < borderSize; bb++) {
Common::Rect borderRect(bb, bb, textWithFeatures.w - bb - boxShadow - textShadow, textWithFeatures.h - bb - boxShadow - textShadow);
textWithFeatures.fillRect(borderRect, 0xff);
@@ -918,7 +942,12 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
textWithFeatures.transBlitFrom(textSurface->rawSurface(), Common::Point(textX, textY), 0xff);
- inkBasedBlit(surface, textWithFeatures, _sprites[spriteId]->_ink, Common::Rect(x, y, x + width, y + height));
+ InkType ink = _sprites[spriteId]->_ink;
+
+ if (spriteId == _vm->getCurrentScore()->_currentMouseDownSpriteId)
+ ink = kInkTypeReverse;
+
+ inkBasedBlit(surface, textWithFeatures, ink, Common::Rect(x, y, x + width, y + height));
}
void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics::Surface &spriteSurface, InkType ink, Common::Rect drawRect) {
diff --git a/engines/director/frame.h b/engines/director/frame.h
index 25192af05e..970e8a4cc2 100644
--- a/engines/director/frame.h
+++ b/engines/director/frame.h
@@ -46,62 +46,6 @@ enum {
kChannelDataSize = (25 * 50)
};
-enum TransitionType {
- kTransNone,
- kTransWipeRight,
- kTransWipeLeft,
- kTransWipeDown,
- kTransWipeUp,
- kTransCenterOutHorizontal,
- kTransEdgesInHorizontal,
- kTransCenterOutVertical,
- kTransEdgesInVertical,
- kTransCenterOutSquare,
- kTransEdgesInSquare,
- kTransPushLeft,
- kTransPushRight,
- kTransPushDown,
- kTransPushUp,
- kTransRevealUp,
- kTransRevealUpRight,
- kTransRevealRight,
- kTransRevealDown,
- kTransRevealDownRight,
- kTransRevealDownLeft,
- kTransRevealLeft,
- kTransRevealUpLeft,
- kTransDissolvePixelsFast,
- kTransDissolveBoxyRects,
- kTransDissolveBoxySquares,
- kTransDissolvePatterns,
- kTransRandomRows,
- kTransRandomColumns,
- kTransCoverDown,
- kTransCoverDownLeft,
- kTransCoverDownRight,
- kTransCoverLeft,
- kTransCoverRight,
- kTransCoverUp,
- kTransCoverUpLeft,
- kTransCoverUpRight,
- kTransTypeVenitianBlind,
- kTransTypeCheckerboard,
- kTransTypeStripsBottomBuildLeft,
- kTransTypeStripsBottomBuildRight,
- kTransTypeStripsLeftBuildDown,
- kTransTypeStripsLeftBuildUp,
- kTransTypeStripsRightBuildDown,
- kTransTypeStripsRightBuildUp,
- kTransTypeStripsTopBuildLeft,
- kTransTypeStripsTopBuildRight,
- kTransZoomOpen,
- kTransZoomClose,
- kTransVerticalBinds,
- kTransDissolveBitsTrans,
- kTransDissolvePixels,
- kTransDissolveBits
-};
-
struct PaletteInfo {
uint8 firstColor;
uint8 lastColor;
diff --git a/engines/director/graphics.cpp b/engines/director/graphics.cpp
index b1030d09ce..0ee1928b8d 100644
--- a/engines/director/graphics.cpp
+++ b/engines/director/graphics.cpp
@@ -31,8 +31,7 @@
namespace Director {
-// Referred as extern
-byte defaultPalette[768] = {
+static byte macPalette[768] = {
0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, // 0 (0x00)
0x55, 0x55, 0x55, 0x77, 0x77, 0x77, 0x88, 0x88, 0x88, 0xaa, 0xaa, 0xaa, // 4 (0x04)
0xbb, 0xbb, 0xbb, 0xdd, 0xdd, 0xdd, 0xee, 0xee, 0xee, 0x00, 0x00, 0x11, // 8 (0x08)
@@ -99,6 +98,488 @@ byte defaultPalette[768] = {
0xff, 0xff, 0x66, 0xff, 0xff, 0x99, 0xff, 0xff, 0xcc, 0xff, 0xff, 0xff // 252 (0xfc)
};
+static byte rainbowPalette[768] = {
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x30, 0x30, 0x30, // 0 (0x00)
+ 0x40, 0x40, 0x40, 0x50, 0x50, 0x50, 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, // 4 (0x04)
+ 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, 0xb0, // 8 (0x08)
+ 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xd0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, // 12 (0x0c)
+ 0x00, 0x72, 0xff, 0x00, 0x79, 0xff, 0x00, 0x7f, 0xff, 0x00, 0x85, 0xff, // 16 (0x10)
+ 0x00, 0x8c, 0xff, 0x00, 0x92, 0xff, 0x00, 0x99, 0xff, 0x00, 0x9f, 0xff, // 20 (0x14)
+ 0x00, 0xa5, 0xff, 0x00, 0xac, 0xff, 0x00, 0xb2, 0xff, 0x00, 0xb8, 0xff, // 24 (0x18)
+ 0x00, 0xbf, 0xff, 0x00, 0xc5, 0xff, 0x00, 0xcc, 0xff, 0x00, 0xd2, 0xff, // 28 (0x1c)
+ 0x00, 0xd8, 0xff, 0x00, 0xdf, 0xff, 0x00, 0xe5, 0xff, 0x00, 0xeb, 0xff, // 32 (0x20)
+ 0x00, 0xf2, 0xff, 0x00, 0xf8, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xf8, // 36 (0x24)
+ 0x00, 0xff, 0xf2, 0x00, 0xff, 0xeb, 0x00, 0xff, 0xe5, 0x00, 0xff, 0xdf, // 40 (0x28)
+ 0x00, 0xff, 0xd8, 0x00, 0xff, 0xd2, 0x00, 0xff, 0xcc, 0x00, 0xff, 0xc5, // 44 (0x2c)
+ 0x00, 0xff, 0xbf, 0x00, 0xff, 0xb8, 0x00, 0xff, 0xb2, 0x00, 0xff, 0xac, // 48 (0x30)
+ 0x00, 0xff, 0xa5, 0x00, 0xff, 0x9f, 0x00, 0xff, 0x99, 0x00, 0xff, 0x92, // 52 (0x34)
+ 0x00, 0xff, 0x8c, 0x00, 0xff, 0x85, 0x00, 0xff, 0x7f, 0x00, 0xff, 0x79, // 56 (0x38)
+ 0x00, 0xff, 0x72, 0x00, 0xff, 0x6c, 0x00, 0xff, 0x66, 0x00, 0xff, 0x5f, // 60 (0x3c)
+ 0x00, 0xff, 0x59, 0x00, 0xff, 0x52, 0x00, 0xff, 0x4c, 0x00, 0xff, 0x46, // 64 (0x40)
+ 0x00, 0xff, 0x3f, 0x00, 0xff, 0x39, 0x00, 0xff, 0x33, 0x00, 0xff, 0x2c, // 68 (0x44)
+ 0x00, 0xff, 0x26, 0x00, 0xff, 0x1f, 0x00, 0xff, 0x19, 0x00, 0xff, 0x13, // 72 (0x48)
+ 0x00, 0xff, 0x0c, 0x00, 0xff, 0x06, 0x00, 0xff, 0x00, 0x06, 0xff, 0x00, // 76 (0x4c)
+ 0x0c, 0xff, 0x00, 0x13, 0xff, 0x00, 0x19, 0xff, 0x00, 0x1f, 0xff, 0x00, // 80 (0x50)
+ 0x26, 0xff, 0x00, 0x2c, 0xff, 0x00, 0x33, 0xff, 0x00, 0x39, 0xff, 0x00, // 84 (0x54)
+ 0x3f, 0xff, 0x00, 0x46, 0xff, 0x00, 0x4c, 0xff, 0x00, 0x52, 0xff, 0x00, // 88 (0x58)
+ 0x59, 0xff, 0x00, 0x5f, 0xff, 0x00, 0x66, 0xff, 0x00, 0x6c, 0xff, 0x00, // 92 (0x5c)
+ 0x72, 0xff, 0x00, 0x79, 0xff, 0x00, 0x7f, 0xff, 0x00, 0x85, 0xff, 0x00, // 96 (0x60)
+ 0x8c, 0xff, 0x00, 0x92, 0xff, 0x00, 0x99, 0xff, 0x00, 0x9f, 0xff, 0x00, // 100 (0x64)
+ 0xa5, 0xff, 0x00, 0xac, 0xff, 0x00, 0xb2, 0xff, 0x00, 0xb8, 0xff, 0x00, // 104 (0x68)
+ 0xbf, 0xff, 0x00, 0xc5, 0xff, 0x00, 0xcc, 0xff, 0x00, 0xd2, 0xff, 0x00, // 108 (0x6c)
+ 0xd8, 0xff, 0x00, 0xdf, 0xff, 0x00, 0xe5, 0xff, 0x00, 0xeb, 0xff, 0x00, // 112 (0x70)
+ 0xf2, 0xff, 0x00, 0xf8, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xf8, 0x00, // 116 (0x74)
+ 0xff, 0xf2, 0x00, 0xff, 0xeb, 0x00, 0xff, 0xe5, 0x00, 0xff, 0xdf, 0x00, // 120 (0x78)
+ 0xff, 0xd8, 0x00, 0xff, 0xd2, 0x00, 0xff, 0xcc, 0x00, 0xff, 0xc5, 0x00, // 124 (0x7c)
+ 0xff, 0xbf, 0x00, 0xff, 0xb8, 0x00, 0xff, 0xb2, 0x00, 0xff, 0xac, 0x00, // 128 (0x80)
+ 0xff, 0xa5, 0x00, 0xff, 0x9f, 0x00, 0xff, 0x99, 0x00, 0xff, 0x92, 0x00, // 132 (0x84)
+ 0xff, 0x8c, 0x00, 0xff, 0x85, 0x00, 0xff, 0x7f, 0x00, 0xff, 0x79, 0x00, // 136 (0x88)
+ 0xff, 0x72, 0x00, 0xff, 0x6c, 0x00, 0xff, 0x66, 0x00, 0xff, 0x5f, 0x00, // 140 (0x8c)
+ 0xff, 0x59, 0x00, 0xff, 0x52, 0x00, 0xff, 0x4c, 0x00, 0xff, 0x46, 0x00, // 144 (0x90)
+ 0xff, 0x3f, 0x00, 0xff, 0x39, 0x00, 0xff, 0x33, 0x00, 0xff, 0x2c, 0x00, // 148 (0x94)
+ 0xff, 0x26, 0x00, 0xff, 0x1f, 0x00, 0xff, 0x19, 0x00, 0xff, 0x13, 0x00, // 152 (0x98)
+ 0xff, 0x0c, 0x00, 0xff, 0x06, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x06, // 156 (0x9c)
+ 0xff, 0x00, 0x0c, 0xff, 0x00, 0x13, 0xff, 0x00, 0x19, 0xff, 0x00, 0x1f, // 160 (0xa0)
+ 0xff, 0x00, 0x26, 0xff, 0x00, 0x2c, 0xff, 0x00, 0x33, 0xff, 0x00, 0x39, // 164 (0xa4)
+ 0xff, 0x00, 0x3f, 0xff, 0x00, 0x46, 0xff, 0x00, 0x4c, 0xff, 0x00, 0x52, // 168 (0xa8)
+ 0xff, 0x00, 0x59, 0xff, 0x00, 0x5f, 0xff, 0x00, 0x66, 0xff, 0x00, 0x6c, // 172 (0xac)
+ 0xff, 0x00, 0x72, 0xff, 0x00, 0x79, 0xff, 0x00, 0x7f, 0xff, 0x00, 0x85, // 176 (0xb0)
+ 0xff, 0x00, 0x8c, 0xff, 0x00, 0x92, 0xff, 0x00, 0x99, 0xff, 0x00, 0x9f, // 180 (0xb4)
+ 0xff, 0x00, 0xa5, 0xff, 0x00, 0xac, 0xff, 0x00, 0xb2, 0xff, 0x00, 0xb8, // 184 (0xb8)
+ 0xff, 0x00, 0xbf, 0xff, 0x00, 0xc5, 0xff, 0x00, 0xcc, 0xff, 0x00, 0xd2, // 188 (0xbc)
+ 0xff, 0x00, 0xd8, 0xff, 0x00, 0xdf, 0xff, 0x00, 0xe5, 0xff, 0x00, 0xeb, // 192 (0xc0)
+ 0xff, 0x00, 0xf2, 0xff, 0x00, 0xf8, 0xff, 0x00, 0xff, 0xf8, 0x00, 0xff, // 196 (0xc4)
+ 0xf2, 0x00, 0xff, 0xeb, 0x00, 0xff, 0xe5, 0x00, 0xff, 0xdf, 0x00, 0xff, // 200 (0xc8)
+ 0xd8, 0x00, 0xff, 0xd2, 0x00, 0xff, 0xcc, 0x00, 0xff, 0xc5, 0x00, 0xff, // 204 (0xcc)
+ 0xbf, 0x00, 0xff, 0xb8, 0x00, 0xff, 0xb2, 0x00, 0xff, 0xac, 0x00, 0xff, // 208 (0xd0)
+ 0xa5, 0x00, 0xff, 0x9f, 0x00, 0xff, 0x99, 0x00, 0xff, 0x92, 0x00, 0xff, // 212 (0xd4)
+ 0x8c, 0x00, 0xff, 0x85, 0x00, 0xff, 0x7f, 0x00, 0xff, 0x79, 0x00, 0xff, // 216 (0xd8)
+ 0x72, 0x00, 0xff, 0x6c, 0x00, 0xff, 0x66, 0x00, 0xff, 0x5f, 0x00, 0xff, // 220 (0xdc)
+ 0x59, 0x00, 0xff, 0x52, 0x00, 0xff, 0x4c, 0x00, 0xff, 0x46, 0x00, 0xff, // 224 (0xe0)
+ 0x3f, 0x00, 0xff, 0x39, 0x00, 0xff, 0x33, 0x00, 0xff, 0x2c, 0x00, 0xff, // 228 (0xe4)
+ 0x26, 0x00, 0xff, 0x1f, 0x00, 0xff, 0x19, 0x00, 0xff, 0x13, 0x00, 0xff, // 232 (0xe8)
+ 0x0c, 0x00, 0xff, 0x06, 0x00, 0xff, 0x00, 0x03, 0xff, 0x00, 0x0a, 0xff, // 236 (0xec)
+ 0x00, 0x10, 0xff, 0x00, 0x17, 0xff, 0x00, 0x1d, 0xff, 0x00, 0x23, 0xff, // 240 (0xf0)
+ 0x00, 0x2a, 0xff, 0x00, 0x30, 0xff, 0x00, 0x36, 0xff, 0x00, 0x3d, 0xff, // 244 (0xf4)
+ 0x00, 0x43, 0xff, 0x00, 0x4a, 0xff, 0x00, 0x50, 0xff, 0x00, 0x56, 0xff, // 248 (0xf8)
+ 0x00, 0x5d, 0xff, 0x00, 0x63, 0xff, 0x00, 0x69, 0xff, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte grayscalePalette[768] = {
+ 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, // 0 (0x00)
+ 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, // 4 (0x04)
+ 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, // 8 (0x08)
+ 0x0c, 0x0c, 0x0c, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, // 12 (0x0c)
+ 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, // 16 (0x10)
+ 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, // 20 (0x14)
+ 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b, 0x1b, // 24 (0x18)
+ 0x1c, 0x1c, 0x1c, 0x1d, 0x1d, 0x1d, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, // 28 (0x1c)
+ 0x20, 0x20, 0x20, 0x21, 0x21, 0x21, 0x22, 0x22, 0x22, 0x23, 0x23, 0x23, // 32 (0x20)
+ 0x24, 0x24, 0x24, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26, 0x27, 0x27, 0x27, // 36 (0x24)
+ 0x28, 0x28, 0x28, 0x29, 0x29, 0x29, 0x2a, 0x2a, 0x2a, 0x2b, 0x2b, 0x2b, // 40 (0x28)
+ 0x2c, 0x2c, 0x2c, 0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f, 0x2f, // 44 (0x2c)
+ 0x30, 0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x33, // 48 (0x30)
+ 0x34, 0x34, 0x34, 0x35, 0x35, 0x35, 0x36, 0x36, 0x36, 0x37, 0x37, 0x37, // 52 (0x34)
+ 0x38, 0x38, 0x38, 0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b, 0x3b, // 56 (0x38)
+ 0x3c, 0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e, 0x3f, 0x3f, 0x3f, // 60 (0x3c)
+ 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x43, 0x43, 0x43, // 64 (0x40)
+ 0x44, 0x44, 0x44, 0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47, 0x47, // 68 (0x44)
+ 0x48, 0x48, 0x48, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a, 0x4b, 0x4b, 0x4b, // 72 (0x48)
+ 0x4c, 0x4c, 0x4c, 0x4d, 0x4d, 0x4d, 0x4e, 0x4e, 0x4e, 0x4f, 0x4f, 0x4f, // 76 (0x4c)
+ 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53, 0x53, // 80 (0x50)
+ 0x54, 0x54, 0x54, 0x55, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0x57, 0x57, // 84 (0x54)
+ 0x58, 0x58, 0x58, 0x59, 0x59, 0x59, 0x5a, 0x5a, 0x5a, 0x5b, 0x5b, 0x5b, // 88 (0x58)
+ 0x5c, 0x5c, 0x5c, 0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f, 0x5f, // 92 (0x5c)
+ 0x60, 0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62, 0x63, 0x63, 0x63, // 96 (0x60)
+ 0x64, 0x64, 0x64, 0x65, 0x65, 0x65, 0x66, 0x66, 0x66, 0x67, 0x67, 0x67, // 100 (0x64)
+ 0x68, 0x68, 0x68, 0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b, 0x6b, // 104 (0x68)
+ 0x6c, 0x6c, 0x6c, 0x6d, 0x6d, 0x6d, 0x6e, 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, // 108 (0x6c)
+ 0x70, 0x70, 0x70, 0x71, 0x71, 0x71, 0x72, 0x72, 0x72, 0x73, 0x73, 0x73, // 112 (0x70)
+ 0x74, 0x74, 0x74, 0x75, 0x75, 0x75, 0x76, 0x76, 0x76, 0x77, 0x77, 0x77, // 116 (0x74)
+ 0x78, 0x78, 0x78, 0x79, 0x79, 0x79, 0x7a, 0x7a, 0x7a, 0x7b, 0x7b, 0x7b, // 120 (0x78)
+ 0x7c, 0x7c, 0x7c, 0x7d, 0x7d, 0x7d, 0x7e, 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, // 124 (0x7c)
+ 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x82, 0x82, 0x82, 0x83, 0x83, 0x83, // 128 (0x80)
+ 0x84, 0x84, 0x84, 0x85, 0x85, 0x85, 0x86, 0x86, 0x86, 0x87, 0x87, 0x87, // 132 (0x84)
+ 0x88, 0x88, 0x88, 0x89, 0x89, 0x89, 0x8a, 0x8a, 0x8a, 0x8b, 0x8b, 0x8b, // 136 (0x88)
+ 0x8c, 0x8c, 0x8c, 0x8d, 0x8d, 0x8d, 0x8e, 0x8e, 0x8e, 0x8f, 0x8f, 0x8f, // 140 (0x8c)
+ 0x90, 0x90, 0x90, 0x91, 0x91, 0x91, 0x92, 0x92, 0x92, 0x93, 0x93, 0x93, // 144 (0x90)
+ 0x94, 0x94, 0x94, 0x95, 0x95, 0x95, 0x96, 0x96, 0x96, 0x97, 0x97, 0x97, // 148 (0x94)
+ 0x98, 0x98, 0x98, 0x99, 0x99, 0x99, 0x9a, 0x9a, 0x9a, 0x9b, 0x9b, 0x9b, // 152 (0x98)
+ 0x9c, 0x9c, 0x9c, 0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f, 0x9f, // 156 (0x9c)
+ 0xa0, 0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0xa2, 0xa3, 0xa3, 0xa3, // 160 (0xa0)
+ 0xa4, 0xa4, 0xa4, 0xa5, 0xa5, 0xa5, 0xa6, 0xa6, 0xa6, 0xa7, 0xa7, 0xa7, // 164 (0xa4)
+ 0xa8, 0xa8, 0xa8, 0xa9, 0xa9, 0xa9, 0xaa, 0xaa, 0xaa, 0xab, 0xab, 0xab, // 168 (0xa8)
+ 0xac, 0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae, 0xaf, 0xaf, 0xaf, // 172 (0xac)
+ 0xb0, 0xb0, 0xb0, 0xb1, 0xb1, 0xb1, 0xb2, 0xb2, 0xb2, 0xb3, 0xb3, 0xb3, // 176 (0xb0)
+ 0xb4, 0xb4, 0xb4, 0xb5, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7, 0xb7, // 180 (0xb4)
+ 0xb8, 0xb8, 0xb8, 0xb9, 0xb9, 0xb9, 0xba, 0xba, 0xba, 0xbb, 0xbb, 0xbb, // 184 (0xb8)
+ 0xbc, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbe, 0xbe, 0xbe, 0xbf, 0xbf, 0xbf, // 188 (0xbc)
+ 0xc0, 0xc0, 0xc0, 0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3, 0xc3, // 192 (0xc0)
+ 0xc4, 0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6, 0xc7, 0xc7, 0xc7, // 196 (0xc4)
+ 0xc8, 0xc8, 0xc8, 0xc9, 0xc9, 0xc9, 0xca, 0xca, 0xca, 0xcb, 0xcb, 0xcb, // 200 (0xc8)
+ 0xcc, 0xcc, 0xcc, 0xcd, 0xcd, 0xcd, 0xce, 0xce, 0xce, 0xcf, 0xcf, 0xcf, // 204 (0xcc)
+ 0xd0, 0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2, 0xd3, 0xd3, 0xd3, // 208 (0xd0)
+ 0xd4, 0xd4, 0xd4, 0xd5, 0xd5, 0xd5, 0xd6, 0xd6, 0xd6, 0xd7, 0xd7, 0xd7, // 212 (0xd4)
+ 0xd8, 0xd8, 0xd8, 0xd9, 0xd9, 0xd9, 0xda, 0xda, 0xda, 0xdb, 0xdb, 0xdb, // 216 (0xd8)
+ 0xdc, 0xdc, 0xdc, 0xdd, 0xdd, 0xdd, 0xde, 0xde, 0xde, 0xdf, 0xdf, 0xdf, // 220 (0xdc)
+ 0xe0, 0xe0, 0xe0, 0xe1, 0xe1, 0xe1, 0xe2, 0xe2, 0xe2, 0xe3, 0xe3, 0xe3, // 224 (0xe0)
+ 0xe4, 0xe4, 0xe4, 0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7, 0xe7, // 228 (0xe4)
+ 0xe8, 0xe8, 0xe8, 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea, 0xeb, 0xeb, 0xeb, // 232 (0xe8)
+ 0xec, 0xec, 0xec, 0xed, 0xed, 0xed, 0xee, 0xee, 0xee, 0xef, 0xef, 0xef, // 236 (0xec)
+ 0xf0, 0xf0, 0xf0, 0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3, 0xf3, // 240 (0xf0)
+ 0xf4, 0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6, 0xf7, 0xf7, 0xf7, // 244 (0xf4)
+ 0xf8, 0xf8, 0xf8, 0xf9, 0xf9, 0xf9, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, // 248 (0xf8)
+ 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte pastelsPalette[768] = {
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x30, 0x30, 0x30, // 0 (0x00)
+ 0x40, 0x40, 0x40, 0x50, 0x50, 0x50, 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, // 4 (0x04)
+ 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, 0xb0, // 8 (0x08)
+ 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xd0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, // 12 (0x0c)
+ 0xe4, 0xe4, 0xee, 0xd9, 0xd9, 0xed, 0xcd, 0xcd, 0xec, 0xc2, 0xc2, 0xeb, // 16 (0x10)
+ 0xb6, 0xb6, 0xea, 0xab, 0xab, 0xe9, 0x9f, 0x9f, 0xe8, 0x94, 0x94, 0xe7, // 20 (0x14)
+ 0x88, 0x88, 0xe6, 0x7d, 0x7d, 0xe5, 0x71, 0x71, 0xe4, 0x66, 0x66, 0xe3, // 24 (0x18)
+ 0x5a, 0x5a, 0xe2, 0x4f, 0x4f, 0xe1, 0x44, 0x44, 0xe0, 0x50, 0x45, 0xdc, // 28 (0x1c)
+ 0x5c, 0x45, 0xd8, 0x68, 0x46, 0xd4, 0x74, 0x46, 0xd0, 0x7f, 0x46, 0xcc, // 32 (0x20)
+ 0x8b, 0x47, 0xc8, 0x97, 0x47, 0xc4, 0xa3, 0x48, 0xc1, 0xaf, 0x48, 0xbd, // 36 (0x24)
+ 0xba, 0x48, 0xb9, 0xc6, 0x49, 0xb5, 0xd2, 0x49, 0xb1, 0xde, 0x4a, 0xad, // 40 (0x28)
+ 0xea, 0x4a, 0xa9, 0xf6, 0x4b, 0xa6, 0xf4, 0x4b, 0x9f, 0xf3, 0x4b, 0x99, // 44 (0x2c)
+ 0xf2, 0x4b, 0x93, 0xf1, 0x4b, 0x8d, 0xf0, 0x4b, 0x87, 0xef, 0x4b, 0x81, // 48 (0x30)
+ 0xee, 0x4b, 0x7b, 0xec, 0x4b, 0x74, 0xeb, 0x4b, 0x6e, 0xea, 0x4b, 0x68, // 52 (0x34)
+ 0xe9, 0x4b, 0x62, 0xe8, 0x4b, 0x5c, 0xe7, 0x4b, 0x56, 0xe6, 0x4b, 0x50, // 56 (0x38)
+ 0xe5, 0x4b, 0x4a, 0xe7, 0x57, 0x49, 0xe9, 0x62, 0x49, 0xea, 0x6d, 0x49, // 60 (0x3c)
+ 0xec, 0x79, 0x49, 0xed, 0x84, 0x49, 0xef, 0x8f, 0x49, 0xf0, 0x9b, 0x49, // 64 (0x40)
+ 0xf2, 0xa6, 0x49, 0xf3, 0xb1, 0x49, 0xf5, 0xbd, 0x49, 0xf6, 0xc8, 0x49, // 68 (0x44)
+ 0xf8, 0xd3, 0x49, 0xf9, 0xdf, 0x49, 0xfb, 0xea, 0x49, 0xfd, 0xf6, 0x49, // 72 (0x48)
+ 0xf4, 0xec, 0x48, 0xec, 0xe2, 0x48, 0xe4, 0xd9, 0x48, 0xdc, 0xcf, 0x48, // 76 (0x4c)
+ 0xd4, 0xc5, 0x48, 0xcc, 0xbc, 0x48, 0xc4, 0xb2, 0x48, 0xbc, 0xa8, 0x48, // 80 (0x50)
+ 0xb4, 0x9f, 0x48, 0xac, 0x95, 0x48, 0xa4, 0x8b, 0x48, 0x9c, 0x82, 0x48, // 84 (0x54)
+ 0x94, 0x78, 0x48, 0x8c, 0x6e, 0x48, 0x84, 0x65, 0x48, 0x7f, 0x68, 0x49, // 88 (0x58)
+ 0x7b, 0x6b, 0x4a, 0x77, 0x6e, 0x4a, 0x72, 0x70, 0x4b, 0x6e, 0x73, 0x4b, // 92 (0x5c)
+ 0x6a, 0x76, 0x4c, 0x66, 0x79, 0x4c, 0x61, 0x7b, 0x4d, 0x5d, 0x7e, 0x4d, // 96 (0x60)
+ 0x59, 0x81, 0x4e, 0x55, 0x84, 0x4e, 0x50, 0x86, 0x4f, 0x4c, 0x89, 0x4f, // 100 (0x64)
+ 0x48, 0x8c, 0x50, 0x44, 0x8f, 0x51, 0x46, 0x93, 0x52, 0x48, 0x97, 0x52, // 104 (0x68)
+ 0x49, 0x9b, 0x52, 0x4b, 0x9f, 0x52, 0x4c, 0xa3, 0x52, 0x4e, 0xa7, 0x52, // 108 (0x6c)
+ 0x4f, 0xab, 0x52, 0x51, 0xaf, 0x52, 0x52, 0xb3, 0x52, 0x54, 0xb7, 0x52, // 112 (0x70)
+ 0x55, 0xbb, 0x52, 0x57, 0xbf, 0x52, 0x58, 0xc3, 0x52, 0x5a, 0xc7, 0x52, // 116 (0x74)
+ 0x5c, 0xcb, 0x53, 0x5a, 0xca, 0x5e, 0x59, 0xc9, 0x68, 0x57, 0xc9, 0x73, // 120 (0x78)
+ 0x56, 0xc8, 0x7d, 0x55, 0xc8, 0x87, 0x53, 0xc7, 0x92, 0x52, 0xc6, 0x9c, // 124 (0x7c)
+ 0x50, 0xc6, 0xa7, 0x4f, 0xc5, 0xb1, 0x4e, 0xc5, 0xbb, 0x4c, 0xc4, 0xc6, // 128 (0x80)
+ 0x4b, 0xc3, 0xd0, 0x49, 0xc3, 0xdb, 0x48, 0xc2, 0xe5, 0x47, 0xc2, 0xf0, // 132 (0x84)
+ 0x46, 0xb9, 0xee, 0x46, 0xb1, 0xed, 0x46, 0xa9, 0xec, 0x46, 0xa0, 0xeb, // 136 (0x88)
+ 0x46, 0x98, 0xea, 0x45, 0x90, 0xe9, 0x45, 0x87, 0xe8, 0x45, 0x7f, 0xe7, // 140 (0x8c)
+ 0x45, 0x77, 0xe6, 0x45, 0x6e, 0xe5, 0x44, 0x66, 0xe4, 0x44, 0x5e, 0xe3, // 144 (0x90)
+ 0x44, 0x55, 0xe2, 0x44, 0x4d, 0xe1, 0x44, 0x45, 0xe0, 0x48, 0x44, 0xdd, // 148 (0x94)
+ 0x4b, 0x44, 0xdb, 0x4f, 0x44, 0xd9, 0x52, 0x44, 0xd6, 0x55, 0x44, 0xd4, // 152 (0x98)
+ 0x59, 0x44, 0xd2, 0x5c, 0x44, 0xcf, 0x60, 0x44, 0xcd, 0x63, 0x44, 0xcb, // 156 (0x9c)
+ 0x66, 0x44, 0xc8, 0x6a, 0x44, 0xc6, 0x6d, 0x44, 0xc4, 0x71, 0x44, 0xc1, // 160 (0xa0)
+ 0x74, 0x44, 0xbf, 0x78, 0x44, 0xbd, 0x81, 0x45, 0xbb, 0x89, 0x45, 0xb9, // 164 (0xa4)
+ 0x91, 0x46, 0xb8, 0x9a, 0x46, 0xb6, 0xa2, 0x46, 0xb5, 0xaa, 0x47, 0xb3, // 168 (0xa8)
+ 0xb3, 0x47, 0xb2, 0xbb, 0x48, 0xb0, 0xc3, 0x48, 0xaf, 0xcc, 0x48, 0xad, // 172 (0xac)
+ 0xd4, 0x49, 0xac, 0xdc, 0x49, 0xaa, 0xe5, 0x4a, 0xa9, 0xed, 0x4a, 0xa7, // 176 (0xb0)
+ 0xf6, 0x4b, 0xa6, 0xf2, 0x49, 0x9f, 0xee, 0x47, 0x98, 0xea, 0x45, 0x91, // 180 (0xb4)
+ 0xe6, 0x43, 0x8b, 0xe2, 0x41, 0x84, 0xde, 0x3f, 0x7d, 0xda, 0x3d, 0x76, // 184 (0xb8)
+ 0xd6, 0x3b, 0x70, 0xd2, 0x39, 0x69, 0xce, 0x37, 0x62, 0xca, 0x35, 0x5b, // 188 (0xbc)
+ 0xc6, 0x33, 0x55, 0xc2, 0x31, 0x4e, 0xbe, 0x2f, 0x47, 0xba, 0x2d, 0x41, // 192 (0xc0)
+ 0xbd, 0x2f, 0x42, 0xc0, 0x31, 0x43, 0xc3, 0x33, 0x43, 0xc6, 0x35, 0x44, // 196 (0xc4)
+ 0xc8, 0x37, 0x44, 0xcb, 0x39, 0x45, 0xce, 0x3b, 0x45, 0xd1, 0x3d, 0x46, // 200 (0xc8)
+ 0xd4, 0x3f, 0x46, 0xd6, 0x41, 0x47, 0xd9, 0x43, 0x47, 0xdc, 0x45, 0x48, // 204 (0xcc)
+ 0xdf, 0x47, 0x48, 0xe2, 0x49, 0x49, 0xe5, 0x4b, 0x4a, 0xe7, 0x50, 0x49, // 208 (0xd0)
+ 0xe9, 0x54, 0x49, 0xea, 0x58, 0x49, 0xec, 0x5d, 0x48, 0xee, 0x61, 0x48, // 212 (0xd4)
+ 0xef, 0x65, 0x48, 0xf1, 0x6a, 0x48, 0xf3, 0x6e, 0x47, 0xf4, 0x72, 0x47, // 216 (0xd8)
+ 0xf6, 0x77, 0x47, 0xf8, 0x7b, 0x47, 0xf9, 0x7f, 0x46, 0xfb, 0x84, 0x46, // 220 (0xdc)
+ 0xfd, 0x88, 0x46, 0xff, 0x8d, 0x46, 0xfe, 0x94, 0x47, 0xfe, 0x9b, 0x47, // 224 (0xe0)
+ 0xfe, 0xa2, 0x47, 0xfe, 0xa9, 0x47, 0xfe, 0xb0, 0x47, 0xfd, 0xb7, 0x47, // 228 (0xe4)
+ 0xfd, 0xbe, 0x47, 0xfd, 0xc4, 0x47, 0xfd, 0xcb, 0x47, 0xfd, 0xd2, 0x47, // 232 (0xe8)
+ 0xfc, 0xd9, 0x47, 0xfc, 0xe0, 0x47, 0xfc, 0xe7, 0x47, 0xfc, 0xee, 0x47, // 236 (0xec)
+ 0xfc, 0xf5, 0x48, 0xfd, 0xf6, 0x55, 0xfd, 0xf7, 0x61, 0xfd, 0xf7, 0x6d, // 240 (0xf0)
+ 0xfd, 0xf8, 0x79, 0xfd, 0xf8, 0x85, 0xfd, 0xf9, 0x91, 0xfd, 0xfa, 0x9d, // 244 (0xf4)
+ 0xfe, 0xfa, 0xaa, 0xfe, 0xfb, 0xb6, 0xfe, 0xfb, 0xc2, 0xfe, 0xfc, 0xce, // 248 (0xf8)
+ 0xfe, 0xfd, 0xda, 0xfe, 0xfd, 0xe6, 0xfe, 0xfe, 0xf2, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte vividPalette[768] = {
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x30, 0x30, 0x30, // 0 (0x00)
+ 0x40, 0x40, 0x40, 0x50, 0x50, 0x50, 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, // 4 (0x04)
+ 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, 0xb0, // 8 (0x08)
+ 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xd0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, // 12 (0x0c)
+ 0xe0, 0xe0, 0xee, 0xd0, 0xd0, 0xec, 0xc0, 0xc0, 0xea, 0xb0, 0xb0, 0xe8, // 16 (0x10)
+ 0xa0, 0xa0, 0xe6, 0x90, 0x90, 0xe4, 0x80, 0x80, 0xe2, 0x70, 0x70, 0xe1, // 20 (0x14)
+ 0x60, 0x60, 0xdf, 0x50, 0x50, 0xdd, 0x40, 0x40, 0xdb, 0x30, 0x30, 0xd9, // 24 (0x18)
+ 0x20, 0x20, 0xd7, 0x10, 0x10, 0xd5, 0x00, 0x00, 0xd4, 0x10, 0x00, 0xce, // 28 (0x1c)
+ 0x20, 0x01, 0xc9, 0x30, 0x01, 0xc4, 0x40, 0x02, 0xbe, 0x50, 0x02, 0xb9, // 32 (0x20)
+ 0x60, 0x03, 0xb4, 0x70, 0x03, 0xae, 0x81, 0x04, 0xa9, 0x91, 0x04, 0xa4, // 36 (0x24)
+ 0xa1, 0x05, 0x9e, 0xb1, 0x05, 0x99, 0xc1, 0x06, 0x94, 0xd1, 0x06, 0x8e, // 40 (0x28)
+ 0xe1, 0x07, 0x89, 0xf2, 0x08, 0x84, 0xf0, 0x07, 0x7b, 0xef, 0x07, 0x73, // 44 (0x2c)
+ 0xed, 0x07, 0x6a, 0xec, 0x07, 0x62, 0xea, 0x07, 0x5a, 0xe9, 0x07, 0x51, // 48 (0x30)
+ 0xe7, 0x07, 0x49, 0xe6, 0x07, 0x40, 0xe4, 0x07, 0x38, 0xe3, 0x07, 0x30, // 52 (0x34)
+ 0xe1, 0x07, 0x27, 0xe0, 0x07, 0x1f, 0xde, 0x07, 0x16, 0xdd, 0x07, 0x0e, // 56 (0x38)
+ 0xdc, 0x07, 0x06, 0xdf, 0x17, 0x05, 0xe1, 0x27, 0x05, 0xe3, 0x36, 0x05, // 60 (0x3c)
+ 0xe5, 0x46, 0x05, 0xe7, 0x56, 0x05, 0xe9, 0x65, 0x05, 0xeb, 0x75, 0x05, // 64 (0x40)
+ 0xed, 0x85, 0x05, 0xef, 0x94, 0x05, 0xf1, 0xa4, 0x05, 0xf3, 0xb4, 0x05, // 68 (0x44)
+ 0xf5, 0xc3, 0x05, 0xf7, 0xd3, 0x05, 0xf9, 0xe3, 0x05, 0xfc, 0xf3, 0x05, // 72 (0x48)
+ 0xf0, 0xe5, 0x04, 0xe5, 0xd8, 0x04, 0xda, 0xcb, 0x04, 0xcf, 0xbd, 0x04, // 76 (0x4c)
+ 0xc4, 0xb0, 0x04, 0xb9, 0xa3, 0x04, 0xae, 0x95, 0x04, 0xa3, 0x88, 0x04, // 80 (0x50)
+ 0x98, 0x7b, 0x04, 0x8d, 0x6d, 0x04, 0x82, 0x60, 0x04, 0x77, 0x53, 0x04, // 84 (0x54)
+ 0x6c, 0x45, 0x04, 0x61, 0x38, 0x04, 0x56, 0x2b, 0x04, 0x50, 0x2f, 0x05, // 88 (0x58)
+ 0x4a, 0x33, 0x06, 0x44, 0x36, 0x07, 0x3f, 0x3a, 0x07, 0x39, 0x3e, 0x08, // 92 (0x5c)
+ 0x33, 0x41, 0x09, 0x2d, 0x45, 0x0a, 0x28, 0x49, 0x0a, 0x22, 0x4c, 0x0b, // 96 (0x60)
+ 0x1c, 0x50, 0x0c, 0x16, 0x54, 0x0d, 0x11, 0x57, 0x0d, 0x0b, 0x5b, 0x0e, // 100 (0x64)
+ 0x05, 0x5f, 0x0f, 0x00, 0x63, 0x10, 0x02, 0x69, 0x11, 0x04, 0x6f, 0x11, // 104 (0x68)
+ 0x06, 0x74, 0x11, 0x08, 0x7a, 0x11, 0x0a, 0x7f, 0x11, 0x0c, 0x85, 0x11, // 108 (0x6c)
+ 0x0e, 0x8a, 0x11, 0x10, 0x90, 0x12, 0x12, 0x95, 0x12, 0x14, 0x9b, 0x12, // 112 (0x70)
+ 0x16, 0xa0, 0x12, 0x18, 0xa6, 0x12, 0x1a, 0xab, 0x12, 0x1c, 0xb1, 0x12, // 116 (0x74)
+ 0x1f, 0xb7, 0x13, 0x1d, 0xb6, 0x22, 0x1b, 0xb5, 0x30, 0x19, 0xb4, 0x3e, // 120 (0x78)
+ 0x17, 0xb3, 0x4d, 0x15, 0xb3, 0x5b, 0x13, 0xb2, 0x69, 0x11, 0xb1, 0x77, // 124 (0x7c)
+ 0x0f, 0xb0, 0x86, 0x0d, 0xaf, 0x94, 0x0b, 0xaf, 0xa2, 0x09, 0xae, 0xb0, // 128 (0x80)
+ 0x07, 0xad, 0xbf, 0x05, 0xac, 0xcd, 0x03, 0xab, 0xdb, 0x02, 0xab, 0xea, // 132 (0x84)
+ 0x01, 0x9f, 0xe8, 0x01, 0x94, 0xe7, 0x01, 0x88, 0xe5, 0x01, 0x7d, 0xe4, // 136 (0x88)
+ 0x01, 0x72, 0xe2, 0x01, 0x66, 0xe1, 0x01, 0x5b, 0xdf, 0x00, 0x4f, 0xde, // 140 (0x8c)
+ 0x00, 0x44, 0xdc, 0x00, 0x39, 0xdb, 0x00, 0x2d, 0xd9, 0x00, 0x22, 0xd8, // 144 (0x90)
+ 0x00, 0x16, 0xd6, 0x00, 0x0b, 0xd5, 0x00, 0x00, 0xd4, 0x04, 0x00, 0xd0, // 148 (0x94)
+ 0x09, 0x00, 0xcd, 0x0d, 0x00, 0xca, 0x12, 0x00, 0xc7, 0x16, 0x00, 0xc4, // 152 (0x98)
+ 0x1b, 0x00, 0xc1, 0x20, 0x00, 0xbe, 0x24, 0x00, 0xba, 0x29, 0x00, 0xb7, // 156 (0x9c)
+ 0x2d, 0x00, 0xb4, 0x32, 0x00, 0xb1, 0x37, 0x00, 0xae, 0x3b, 0x00, 0xab, // 160 (0xa0)
+ 0x40, 0x00, 0xa8, 0x45, 0x00, 0xa5, 0x51, 0x00, 0xa2, 0x5c, 0x01, 0xa0, // 164 (0xa4)
+ 0x68, 0x01, 0x9e, 0x73, 0x02, 0x9c, 0x7f, 0x02, 0x9a, 0x8a, 0x03, 0x97, // 168 (0xa8)
+ 0x96, 0x03, 0x95, 0xa1, 0x04, 0x93, 0xad, 0x04, 0x91, 0xb8, 0x05, 0x8f, // 172 (0xac)
+ 0xc4, 0x05, 0x8c, 0xcf, 0x06, 0x8a, 0xdb, 0x06, 0x88, 0xe6, 0x07, 0x86, // 176 (0xb0)
+ 0xf2, 0x08, 0x84, 0xed, 0x07, 0x7c, 0xe8, 0x06, 0x75, 0xe3, 0x06, 0x6e, // 180 (0xb4)
+ 0xde, 0x05, 0x67, 0xda, 0x05, 0x60, 0xd5, 0x04, 0x58, 0xd0, 0x04, 0x51, // 184 (0xb8)
+ 0xcb, 0x03, 0x4a, 0xc6, 0x03, 0x43, 0xc2, 0x02, 0x3c, 0xbd, 0x02, 0x34, // 188 (0xbc)
+ 0xb8, 0x01, 0x2d, 0xb3, 0x01, 0x26, 0xae, 0x00, 0x1f, 0xaa, 0x00, 0x18, // 192 (0xc0)
+ 0xae, 0x00, 0x16, 0xb1, 0x00, 0x15, 0xb4, 0x01, 0x14, 0xb8, 0x01, 0x13, // 196 (0xc4)
+ 0xbb, 0x02, 0x12, 0xbe, 0x02, 0x10, 0xc1, 0x03, 0x0f, 0xc5, 0x03, 0x0e, // 200 (0xc8)
+ 0xc8, 0x04, 0x0d, 0xcb, 0x04, 0x0c, 0xce, 0x05, 0x0a, 0xd2, 0x05, 0x09, // 204 (0xcc)
+ 0xd5, 0x06, 0x08, 0xd8, 0x06, 0x07, 0xdc, 0x07, 0x06, 0xdf, 0x0e, 0x05, // 208 (0xd0)
+ 0xe1, 0x14, 0x05, 0xe3, 0x1a, 0x05, 0xe6, 0x20, 0x04, 0xe8, 0x26, 0x04, // 212 (0xd4)
+ 0xea, 0x2c, 0x04, 0xec, 0x32, 0x03, 0xef, 0x38, 0x03, 0xf1, 0x3e, 0x03, // 216 (0xd8)
+ 0xf3, 0x44, 0x02, 0xf5, 0x4a, 0x02, 0xf8, 0x50, 0x02, 0xfa, 0x56, 0x01, // 220 (0xdc)
+ 0xfc, 0x5c, 0x01, 0xff, 0x63, 0x01, 0xfe, 0x6d, 0x02, 0xfe, 0x76, 0x02, // 224 (0xe0)
+ 0xfe, 0x80, 0x02, 0xfd, 0x89, 0x02, 0xfd, 0x93, 0x02, 0xfd, 0x9c, 0x02, // 228 (0xe4)
+ 0xfd, 0xa6, 0x02, 0xfc, 0xaf, 0x03, 0xfc, 0xb9, 0x03, 0xfc, 0xc2, 0x03, // 232 (0xe8)
+ 0xfc, 0xcc, 0x03, 0xfb, 0xd5, 0x03, 0xfb, 0xdf, 0x03, 0xfb, 0xe8, 0x03, // 236 (0xec)
+ 0xfb, 0xf2, 0x04, 0xfc, 0xf3, 0x15, 0xfc, 0xf4, 0x26, 0xfc, 0xf5, 0x36, // 240 (0xf0)
+ 0xfc, 0xf6, 0x47, 0xfc, 0xf6, 0x58, 0xfd, 0xf7, 0x68, 0xfd, 0xf8, 0x79, // 244 (0xf4)
+ 0xfd, 0xf9, 0x8a, 0xfd, 0xfa, 0x9a, 0xfd, 0xfa, 0xab, 0xfe, 0xfb, 0xbc, // 248 (0xf8)
+ 0xfe, 0xfc, 0xcc, 0xfe, 0xfd, 0xdd, 0xfe, 0xfe, 0xee, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte ntscPalette[768] = {
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x30, 0x30, 0x30, // 0 (0x00)
+ 0x40, 0x40, 0x40, 0x50, 0x50, 0x50, 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, // 4 (0x04)
+ 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, 0xb0, // 8 (0x08)
+ 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xd0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, // 12 (0x0c)
+ 0xe0, 0xe3, 0xef, 0xd1, 0xd7, 0xee, 0xc2, 0xca, 0xed, 0xb3, 0xbe, 0xec, // 16 (0x10)
+ 0xa4, 0xb2, 0xec, 0x95, 0xa5, 0xeb, 0x86, 0x99, 0xea, 0x77, 0x8c, 0xe9, // 20 (0x14)
+ 0x68, 0x80, 0xe9, 0x59, 0x74, 0xe8, 0x4a, 0x67, 0xe7, 0x3b, 0x5b, 0xe6, // 24 (0x18)
+ 0x2c, 0x4f, 0xe6, 0x1d, 0x42, 0xe5, 0x0f, 0x36, 0xe4, 0x00, 0x29, 0xe3, // 28 (0x1c)
+ 0x00, 0x27, 0xd9, 0x00, 0x25, 0xcc, 0x00, 0x23, 0xbf, 0x00, 0x20, 0xb2, // 32 (0x20)
+ 0x00, 0x1e, 0xa5, 0x00, 0x1c, 0x98, 0x00, 0x19, 0x8b, 0x00, 0x17, 0x7e, // 36 (0x24)
+ 0x00, 0x14, 0x71, 0x00, 0x12, 0x64, 0x00, 0x10, 0x57, 0x00, 0x0d, 0x4a, // 40 (0x28)
+ 0x00, 0x0b, 0x3d, 0x00, 0x08, 0x30, 0x00, 0x06, 0x23, 0x00, 0x04, 0x16, // 44 (0x2c)
+ 0x06, 0x00, 0x0c, 0x0e, 0x01, 0x1a, 0x15, 0x02, 0x27, 0x1c, 0x03, 0x35, // 48 (0x30)
+ 0x24, 0x04, 0x42, 0x2b, 0x05, 0x50, 0x32, 0x06, 0x5d, 0x3a, 0x07, 0x6b, // 52 (0x34)
+ 0x41, 0x08, 0x78, 0x49, 0x09, 0x86, 0x50, 0x0a, 0x93, 0x57, 0x0b, 0xa1, // 56 (0x38)
+ 0x5f, 0x0c, 0xae, 0x66, 0x0d, 0xbc, 0x6d, 0x0e, 0xc9, 0x75, 0x0f, 0xd7, // 60 (0x3c)
+ 0x78, 0x19, 0xd7, 0x7d, 0x23, 0xd8, 0x83, 0x2d, 0xda, 0x88, 0x36, 0xdc, // 64 (0x40)
+ 0x8d, 0x40, 0xdd, 0x93, 0x4a, 0xdf, 0x98, 0x53, 0xe1, 0x9e, 0x5d, 0xe3, // 68 (0x44)
+ 0xa3, 0x67, 0xe4, 0xa8, 0x70, 0xe6, 0xae, 0x7a, 0xe8, 0xb3, 0x84, 0xe9, // 72 (0x48)
+ 0xb9, 0x8d, 0xeb, 0xbe, 0x97, 0xed, 0xc3, 0xa1, 0xef, 0xc9, 0xaa, 0xf0, // 76 (0x4c)
+ 0xe7, 0xad, 0xc3, 0xe3, 0xa1, 0xb8, 0xdf, 0x95, 0xad, 0xdb, 0x8a, 0xa2, // 80 (0x50)
+ 0xd7, 0x7e, 0x97, 0xd4, 0x73, 0x8c, 0xd0, 0x67, 0x81, 0xcc, 0x5c, 0x76, // 84 (0x54)
+ 0xc8, 0x50, 0x6b, 0xc4, 0x45, 0x60, 0xc1, 0x39, 0x55, 0xbd, 0x2e, 0x4a, // 88 (0x58)
+ 0xb9, 0x22, 0x3f, 0xb5, 0x17, 0x35, 0xb1, 0x0b, 0x2a, 0xa2, 0x16, 0x2f, // 92 (0x5c)
+ 0xa2, 0x16, 0x2f, 0x96, 0x14, 0x2b, 0x8b, 0x13, 0x28, 0x7f, 0x11, 0x25, // 96 (0x60)
+ 0x73, 0x0f, 0x21, 0x68, 0x0e, 0x1e, 0x5c, 0x0c, 0x1a, 0x51, 0x0b, 0x17, // 100 (0x64)
+ 0x45, 0x09, 0x14, 0x39, 0x07, 0x10, 0x2e, 0x06, 0x0d, 0x22, 0x04, 0x0a, // 104 (0x68)
+ 0x17, 0x03, 0x06, 0x17, 0x00, 0x04, 0x0b, 0x00, 0x02, 0x00, 0x00, 0x00, // 108 (0x6c)
+ 0x00, 0x00, 0x00, 0x0e, 0x05, 0x01, 0x1d, 0x09, 0x03, 0x2b, 0x0e, 0x05, // 112 (0x70)
+ 0x3a, 0x13, 0x07, 0x48, 0x18, 0x09, 0x57, 0x1d, 0x0b, 0x65, 0x22, 0x0c, // 116 (0x74)
+ 0x74, 0x27, 0x0e, 0x82, 0x2c, 0x10, 0x91, 0x31, 0x12, 0x9f, 0x36, 0x14, // 120 (0x78)
+ 0xae, 0x3b, 0x16, 0xbc, 0x40, 0x17, 0xcb, 0x45, 0x19, 0xd9, 0x4a, 0x1b, // 124 (0x7c)
+ 0xd9, 0x4e, 0x20, 0xd9, 0x54, 0x29, 0xd9, 0x5b, 0x31, 0xd9, 0x61, 0x3a, // 128 (0x80)
+ 0xd9, 0x68, 0x42, 0xd9, 0x6e, 0x4b, 0xd9, 0x75, 0x53, 0xd9, 0x7b, 0x5c, // 132 (0x84)
+ 0xd9, 0x82, 0x65, 0xd9, 0x88, 0x6d, 0xd9, 0x8f, 0x76, 0xd9, 0x95, 0x7e, // 136 (0x88)
+ 0xd9, 0x9c, 0x87, 0xd9, 0xa2, 0x8f, 0xd9, 0xa9, 0x98, 0xd9, 0xaf, 0xa1, // 140 (0x8c)
+ 0xf5, 0xee, 0x90, 0xf2, 0xeb, 0x87, 0xef, 0xe8, 0x7f, 0xeb, 0xe5, 0x76, // 144 (0x90)
+ 0xe8, 0xe2, 0x6d, 0xe5, 0xdf, 0x64, 0xe2, 0xdc, 0x5b, 0xdf, 0xd9, 0x52, // 148 (0x94)
+ 0xdb, 0xd6, 0x4a, 0xd8, 0xd3, 0x41, 0xd5, 0xd0, 0x38, 0xd2, 0xcd, 0x2f, // 152 (0x98)
+ 0xcf, 0xca, 0x26, 0xcb, 0xc7, 0x1d, 0xc8, 0xc4, 0x15, 0xc5, 0xc0, 0x0c, // 156 (0x9c)
+ 0xbf, 0xbb, 0x0b, 0xb3, 0xaf, 0x0b, 0xa7, 0xa3, 0x0a, 0x9b, 0x97, 0x09, // 160 (0xa0)
+ 0x8f, 0x8b, 0x08, 0x83, 0x80, 0x08, 0x77, 0x74, 0x07, 0x6a, 0x68, 0x06, // 164 (0xa4)
+ 0x5e, 0x5c, 0x05, 0x52, 0x50, 0x05, 0x46, 0x44, 0x04, 0x3a, 0x39, 0x03, // 168 (0xa8)
+ 0x2e, 0x2d, 0x02, 0x22, 0x21, 0x02, 0x16, 0x15, 0x01, 0x0a, 0x09, 0x00, // 172 (0xac)
+ 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x28, 0x00, // 176 (0xb0)
+ 0x00, 0x35, 0x00, 0x00, 0x42, 0x00, 0x00, 0x50, 0x00, 0x00, 0x5d, 0x00, // 180 (0xb4)
+ 0x00, 0x6b, 0x00, 0x00, 0x78, 0x00, 0x00, 0x85, 0x01, 0x00, 0x93, 0x01, // 184 (0xb8)
+ 0x00, 0xa0, 0x01, 0x00, 0xae, 0x01, 0x00, 0xbb, 0x01, 0x01, 0xc8, 0x01, // 188 (0xbc)
+ 0x01, 0xda, 0x01, 0x0c, 0xdc, 0x0e, 0x18, 0xdd, 0x1a, 0x24, 0xdf, 0x26, // 192 (0xc0)
+ 0x30, 0xe0, 0x32, 0x3b, 0xe2, 0x3f, 0x47, 0xe4, 0x4b, 0x53, 0xe5, 0x57, // 196 (0xc4)
+ 0x5f, 0xe7, 0x63, 0x6b, 0xe8, 0x70, 0x76, 0xea, 0x7c, 0x82, 0xec, 0x88, // 200 (0xc8)
+ 0x8e, 0xed, 0x94, 0x9a, 0xef, 0xa1, 0xa5, 0xf0, 0xad, 0xb1, 0xf2, 0xb9, // 204 (0xcc)
+ 0xb3, 0xd1, 0xd5, 0xa9, 0xd0, 0xd5, 0x9f, 0xcf, 0xd5, 0x95, 0xce, 0xd5, // 208 (0xd0)
+ 0x8b, 0xcd, 0xd5, 0x81, 0xcc, 0xd5, 0x77, 0xcb, 0xd5, 0x6d, 0xca, 0xd5, // 212 (0xd4)
+ 0x63, 0xc9, 0xd5, 0x59, 0xc8, 0xd5, 0x4f, 0xc7, 0xd5, 0x45, 0xc6, 0xd5, // 216 (0xd8)
+ 0x3b, 0xc5, 0xd5, 0x30, 0xc4, 0xd5, 0x26, 0xc3, 0xd5, 0x1c, 0xc2, 0xd5, // 220 (0xdc)
+ 0x30, 0x4b, 0xc2, 0x29, 0x52, 0xa3, 0x21, 0x58, 0x84, 0x19, 0x5b, 0x65, // 224 (0xe0)
+ 0x1b, 0x6c, 0x55, 0x21, 0x83, 0x49, 0x27, 0x9a, 0x3c, 0x2d, 0xb1, 0x2d, // 228 (0xe4)
+ 0x46, 0xb7, 0x2f, 0x60, 0xbd, 0x31, 0x79, 0xc3, 0x33, 0x93, 0xc8, 0x35, // 232 (0xe8)
+ 0xac, 0xce, 0x37, 0xc6, 0xd4, 0x38, 0xe3, 0xdd, 0x3c, 0xdc, 0xc9, 0x3b, // 236 (0xec)
+ 0xd5, 0xb5, 0x3a, 0xcf, 0xa1, 0x39, 0xc8, 0x8d, 0x37, 0xc1, 0x7a, 0x36, // 240 (0xf0)
+ 0xba, 0x66, 0x35, 0xb4, 0x53, 0x33, 0xb0, 0x4f, 0x37, 0xac, 0x4b, 0x3a, // 244 (0xf4)
+ 0xa9, 0x47, 0x3e, 0xa5, 0x43, 0x41, 0xa1, 0x3d, 0x42, 0x9a, 0x30, 0x44, // 248 (0xf8)
+ 0x7b, 0x28, 0x52, 0x5d, 0x21, 0x5f, 0x59, 0x2b, 0x85, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte metallicPalette[768] = {
+ 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x33, 0x33, 0x33, // 0 (0x00)
+ 0x44, 0x44, 0x44, 0x55, 0x55, 0x55, 0x66, 0x66, 0x66, 0x77, 0x77, 0x77, // 4 (0x04)
+ 0x88, 0x88, 0x88, 0x99, 0x99, 0x99, 0xaa, 0xaa, 0xaa, 0xbb, 0xbb, 0xbb, // 8 (0x08)
+ 0xcc, 0xcc, 0xcc, 0xdd, 0xdd, 0xdd, 0xee, 0xee, 0xee, 0xff, 0xff, 0xff, // 12 (0x0c)
+ 0xf1, 0xf1, 0xf1, 0xe2, 0xe2, 0xe2, 0xd3, 0xd3, 0xd3, 0xc4, 0xc4, 0xc4, // 16 (0x10)
+ 0xb5, 0xb5, 0xb5, 0xa6, 0xa6, 0xa6, 0x97, 0x97, 0x97, 0x88, 0x88, 0x88, // 20 (0x14)
+ 0x79, 0x79, 0x79, 0x6a, 0x6a, 0x6a, 0x5c, 0x5c, 0x5c, 0x4d, 0x4d, 0x4d, // 24 (0x18)
+ 0x3e, 0x3e, 0x3e, 0x2f, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x11, 0x11, 0x11, // 28 (0x1c)
+ 0x00, 0x0f, 0x55, 0x0e, 0x1e, 0x61, 0x1d, 0x2c, 0x6c, 0x2c, 0x3a, 0x77, // 32 (0x20)
+ 0x3b, 0x48, 0x83, 0x4a, 0x56, 0x8e, 0x58, 0x65, 0x99, 0x67, 0x73, 0xa5, // 36 (0x24)
+ 0x76, 0x81, 0xb0, 0x85, 0x8f, 0xbb, 0x94, 0x9d, 0xc7, 0xa3, 0xac, 0xd2, // 40 (0x28)
+ 0xb1, 0xba, 0xdd, 0xc0, 0xc8, 0xe9, 0xcf, 0xd6, 0xf4, 0xde, 0xe5, 0xff, // 44 (0x2c)
+ 0xd0, 0xd7, 0xf5, 0xc2, 0xca, 0xea, 0xb4, 0xbd, 0xe0, 0xa6, 0xaf, 0xd5, // 48 (0x30)
+ 0x98, 0xa2, 0xca, 0x8a, 0x95, 0xc0, 0x7d, 0x87, 0xb5, 0x6f, 0x7a, 0xaa, // 52 (0x34)
+ 0x61, 0x6d, 0xa0, 0x53, 0x5f, 0x95, 0x45, 0x52, 0x8a, 0x37, 0x45, 0x80, // 56 (0x38)
+ 0x29, 0x37, 0x75, 0x1b, 0x2a, 0x6a, 0x0d, 0x1d, 0x60, 0x00, 0x0f, 0x55, // 60 (0x3c)
+ 0x03, 0x30, 0x03, 0x0f, 0x3e, 0x10, 0x1c, 0x4c, 0x1c, 0x28, 0x5a, 0x28, // 64 (0x40)
+ 0x34, 0x67, 0x35, 0x41, 0x75, 0x41, 0x4d, 0x83, 0x4d, 0x5a, 0x91, 0x5a, // 68 (0x44)
+ 0x66, 0x9f, 0x66, 0x72, 0xad, 0x72, 0x7f, 0xba, 0x7f, 0x8b, 0xc8, 0x8b, // 72 (0x48)
+ 0x97, 0xd6, 0x97, 0xa4, 0xe4, 0xa4, 0xb0, 0xf2, 0xb0, 0xbc, 0xff, 0xbc, // 76 (0x4c)
+ 0xb1, 0xf2, 0xb1, 0xa5, 0xe6, 0xa5, 0x9a, 0xd9, 0x9a, 0x8e, 0xcc, 0x8e, // 80 (0x50)
+ 0x82, 0xbf, 0x83, 0x77, 0xb2, 0x77, 0x6b, 0xa5, 0x6b, 0x60, 0x98, 0x60, // 84 (0x54)
+ 0x54, 0x8b, 0x54, 0x49, 0x7e, 0x49, 0x3d, 0x71, 0x3d, 0x31, 0x64, 0x31, // 88 (0x58)
+ 0x26, 0x57, 0x26, 0x1a, 0x4a, 0x1a, 0x0f, 0x3d, 0x0f, 0x03, 0x30, 0x03, // 92 (0x5c)
+ 0x76, 0x55, 0x12, 0x80, 0x5d, 0x1c, 0x8a, 0x66, 0x26, 0x93, 0x6e, 0x2f, // 96 (0x60)
+ 0x9d, 0x77, 0x39, 0xa7, 0x7f, 0x43, 0xb1, 0x88, 0x4c, 0xbb, 0x91, 0x56, // 100 (0x64)
+ 0xc5, 0x99, 0x5f, 0xce, 0xa2, 0x69, 0xd8, 0xaa, 0x73, 0xe2, 0xb3, 0x7c, // 104 (0x68)
+ 0xec, 0xbb, 0x86, 0xf6, 0xc4, 0x8f, 0xff, 0xd8, 0xb1, 0xff, 0xe1, 0xc2, // 108 (0x6c)
+ 0xff, 0xd5, 0xab, 0xff, 0xcc, 0x99, 0xf6, 0xc4, 0x8f, 0xec, 0xbb, 0x86, // 112 (0x70)
+ 0xe2, 0xb3, 0x7c, 0xd8, 0xaa, 0x73, 0xce, 0xa2, 0x69, 0xc5, 0x99, 0x5f, // 116 (0x74)
+ 0xbb, 0x91, 0x56, 0xb1, 0x88, 0x4c, 0xa7, 0x7f, 0x43, 0x9d, 0x77, 0x39, // 120 (0x78)
+ 0x93, 0x6e, 0x2f, 0x8a, 0x66, 0x26, 0x80, 0x5d, 0x1c, 0x76, 0x55, 0x12, // 124 (0x7c)
+ 0x44, 0x26, 0x19, 0x4f, 0x31, 0x23, 0x5b, 0x3c, 0x2d, 0x66, 0x48, 0x37, // 128 (0x80)
+ 0x71, 0x53, 0x41, 0x7d, 0x5e, 0x4b, 0x88, 0x69, 0x55, 0x93, 0x74, 0x5f, // 132 (0x84)
+ 0x9f, 0x80, 0x69, 0xaa, 0x8b, 0x73, 0xb5, 0x96, 0x7d, 0xc1, 0xa1, 0x87, // 136 (0x88)
+ 0xcc, 0xac, 0x91, 0xd7, 0xb8, 0x9b, 0xe3, 0xc3, 0xa5, 0xee, 0xd1, 0xb4, // 140 (0x8c)
+ 0xe3, 0xc6, 0xaa, 0xd9, 0xbb, 0xa1, 0xce, 0xb1, 0x97, 0xc3, 0xa6, 0x8d, // 144 (0x90)
+ 0xb9, 0x9b, 0x83, 0xae, 0x91, 0x7a, 0xa4, 0x86, 0x70, 0x99, 0x7b, 0x66, // 148 (0x94)
+ 0x8e, 0x71, 0x5d, 0x84, 0x66, 0x53, 0x79, 0x5b, 0x49, 0x6f, 0x51, 0x40, // 152 (0x98)
+ 0x64, 0x46, 0x36, 0x59, 0x3b, 0x2c, 0x4f, 0x31, 0x22, 0x44, 0x26, 0x19, // 156 (0x9c)
+ 0x51, 0x20, 0x1f, 0x5d, 0x2c, 0x2c, 0x68, 0x38, 0x38, 0x74, 0x44, 0x45, // 160 (0xa0)
+ 0x7f, 0x50, 0x51, 0x8b, 0x5c, 0x5d, 0x97, 0x67, 0x6a, 0xa2, 0x73, 0x76, // 164 (0xa4)
+ 0xae, 0x7f, 0x83, 0xba, 0x8b, 0x8f, 0xc5, 0x97, 0x9b, 0xd1, 0xa3, 0xa8, // 168 (0xa8)
+ 0xdd, 0xaf, 0xb4, 0xe8, 0xbb, 0xc1, 0xf4, 0xc6, 0xcd, 0xff, 0xd2, 0xda, // 172 (0xac)
+ 0xf5, 0xc7, 0xce, 0xea, 0xbc, 0xc2, 0xdf, 0xb1, 0xb7, 0xd4, 0xa6, 0xab, // 176 (0xb0)
+ 0xc9, 0x9b, 0x9f, 0xbe, 0x90, 0x94, 0xb3, 0x84, 0x88, 0xa8, 0x79, 0x7c, // 180 (0xb4)
+ 0x9d, 0x6e, 0x71, 0x92, 0x63, 0x65, 0x87, 0x58, 0x59, 0x7d, 0x4d, 0x4e, // 184 (0xb8)
+ 0x72, 0x42, 0x42, 0x67, 0x37, 0x37, 0x5c, 0x2b, 0x2b, 0x51, 0x20, 0x1f, // 188 (0xbc)
+ 0x44, 0x2a, 0x5c, 0x4e, 0x36, 0x67, 0x59, 0x41, 0x71, 0x64, 0x4c, 0x7b, // 192 (0xc0)
+ 0x6f, 0x58, 0x85, 0x79, 0x63, 0x8f, 0x84, 0x6e, 0x99, 0x8f, 0x7a, 0xa3, // 196 (0xc4)
+ 0x99, 0x85, 0xad, 0xa4, 0x90, 0xb7, 0xaf, 0x9c, 0xc1, 0xb9, 0xa7, 0xcb, // 200 (0xc8)
+ 0xc4, 0xb2, 0xd6, 0xcf, 0xbe, 0xe0, 0xda, 0xc9, 0xea, 0xe4, 0xd4, 0xf4, // 204 (0xcc)
+ 0xda, 0xca, 0xea, 0xd0, 0xbf, 0xe1, 0xc6, 0xb4, 0xd7, 0xbc, 0xaa, 0xce, // 208 (0xd0)
+ 0xb2, 0x9f, 0xc4, 0xa8, 0x94, 0xbb, 0x9e, 0x8a, 0xb2, 0x94, 0x7f, 0xa8, // 212 (0xd4)
+ 0x8a, 0x75, 0x9f, 0x80, 0x6a, 0x95, 0x76, 0x5f, 0x8c, 0x6c, 0x55, 0x82, // 216 (0xd8)
+ 0x62, 0x4a, 0x79, 0x58, 0x3f, 0x6f, 0x4e, 0x35, 0x66, 0x44, 0x2a, 0x5c, // 220 (0xdc)
+ 0x63, 0x73, 0xbc, 0x58, 0x6d, 0xa5, 0x4e, 0x67, 0x8e, 0x43, 0x61, 0x76, // 224 (0xe0)
+ 0x38, 0x5a, 0x5f, 0x4a, 0x7d, 0x5f, 0x58, 0x94, 0x63, 0x66, 0xab, 0x66, // 228 (0xe4)
+ 0x76, 0xb1, 0x69, 0x85, 0xb7, 0x6d, 0x96, 0xbd, 0x70, 0xa6, 0xc3, 0x74, // 232 (0xe8)
+ 0xb6, 0xc8, 0x77, 0xc7, 0xce, 0x7b, 0xdd, 0xda, 0x83, 0xd0, 0xbe, 0x7b, // 236 (0xec)
+ 0xc9, 0xb0, 0x77, 0xc2, 0xa2, 0x73, 0xbb, 0x94, 0x6f, 0xb4, 0x86, 0x6b, // 240 (0xf0)
+ 0xae, 0x79, 0x67, 0xaa, 0x73, 0x65, 0xa6, 0x6f, 0x66, 0xa3, 0x6d, 0x68, // 244 (0xf4)
+ 0x9f, 0x6c, 0x6a, 0x9b, 0x66, 0x69, 0x94, 0x58, 0x63, 0x75, 0x47, 0x5e, // 248 (0xf8)
+ 0x58, 0x37, 0x59, 0x5f, 0x42, 0x6c, 0x66, 0x4c, 0x80, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte winPalette[768] = {
+ 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xbf, 0x00, 0xbf, 0xbf, 0x00, // 0 (0x00)
+ 0x00, 0x00, 0xbf, 0xbf, 0x00, 0xbf, 0x00, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0, // 4 (0x04)
+ 0xc0, 0xdc, 0xc0, 0xa4, 0xc8, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0x99, // 8 (0x08)
+ 0x99, 0xd4, 0x99, 0x99, 0xd4, 0xff, 0xff, 0xcc, 0xff, 0xff, 0x99, 0x99, // 12 (0x0c)
+ 0x22, 0x22, 0x30, 0x00, 0x00, 0x11, 0x00, 0x00, 0x22, 0x00, 0x00, 0x44, // 16 (0x10)
+ 0x00, 0x00, 0x55, 0x00, 0x00, 0x77, 0x00, 0x00, 0x88, 0x00, 0x00, 0xaa, // 20 (0x14)
+ 0x00, 0x00, 0xdd, 0x00, 0x00, 0xee, 0x00, 0x11, 0x00, 0x00, 0x22, 0x00, // 24 (0x18)
+ 0x00, 0x44, 0x00, 0x00, 0x55, 0x00, 0x00, 0x77, 0x00, 0x00, 0x88, 0x00, // 28 (0x1c)
+ 0x00, 0xaa, 0x00, 0x00, 0xdd, 0x00, 0x00, 0xee, 0x00, 0x11, 0x00, 0x00, // 32 (0x20)
+ 0x22, 0x00, 0x00, 0x44, 0x00, 0x00, 0x55, 0x00, 0x00, 0x77, 0x00, 0x00, // 36 (0x24)
+ 0x90, 0x00, 0x00, 0xaa, 0x00, 0x00, 0xdd, 0x00, 0x00, 0xee, 0x00, 0x00, // 40 (0x28)
+ 0x00, 0x00, 0x33, 0x00, 0x00, 0x66, 0x00, 0x00, 0x99, 0x00, 0x00, 0xcc, // 44 (0x2c)
+ 0x00, 0x33, 0x00, 0x00, 0x33, 0x33, 0x00, 0x33, 0x66, 0x00, 0x33, 0xa1, // 48 (0x30)
+ 0x00, 0x33, 0xcc, 0x00, 0x33, 0xff, 0x00, 0x66, 0x00, 0x00, 0x66, 0x33, // 52 (0x34)
+ 0x00, 0x66, 0x66, 0x00, 0x66, 0x99, 0x00, 0x66, 0xcc, 0x00, 0x66, 0xff, // 56 (0x38)
+ 0x00, 0x99, 0x00, 0x00, 0x99, 0x33, 0x00, 0x99, 0x66, 0x00, 0x99, 0x99, // 60 (0x3c)
+ 0x00, 0x99, 0xcc, 0x00, 0x99, 0xff, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0x33, // 64 (0x40)
+ 0x00, 0xcc, 0x66, 0x00, 0xcc, 0x99, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xff, // 68 (0x44)
+ 0x00, 0xff, 0x33, 0x00, 0xff, 0x66, 0x00, 0xff, 0x99, 0x00, 0xff, 0xcc, // 72 (0x48)
+ 0x33, 0x00, 0x00, 0x33, 0x00, 0x33, 0x33, 0x00, 0x66, 0x33, 0x00, 0x99, // 76 (0x4c)
+ 0x33, 0x00, 0xcc, 0x33, 0x00, 0xff, 0x33, 0x33, 0x00, 0x33, 0x33, 0x3b, // 80 (0x50)
+ 0x33, 0x33, 0x66, 0x33, 0x33, 0x99, 0x33, 0x33, 0xcc, 0x33, 0x33, 0xff, // 84 (0x54)
+ 0x33, 0x66, 0x00, 0x33, 0x6e, 0x33, 0x33, 0x66, 0x66, 0x33, 0x66, 0x99, // 88 (0x58)
+ 0x33, 0x66, 0xcc, 0x33, 0x66, 0xff, 0x33, 0x99, 0x00, 0x33, 0x99, 0x33, // 92 (0x5c)
+ 0x33, 0x99, 0x66, 0x33, 0x99, 0x99, 0x33, 0x99, 0xcc, 0x33, 0x99, 0xff, // 96 (0x60)
+ 0x33, 0xcc, 0x00, 0x33, 0xcc, 0x33, 0x33, 0xcc, 0x66, 0x33, 0xcc, 0x99, // 100 (0x64)
+ 0x33, 0xcc, 0xcc, 0x33, 0xcc, 0xff, 0x33, 0xff, 0x00, 0x33, 0xff, 0x33, // 104 (0x68)
+ 0x33, 0xff, 0x66, 0x33, 0xff, 0x99, 0x33, 0xff, 0xcc, 0x33, 0xff, 0xff, // 108 (0x6c)
+ 0x66, 0x00, 0x00, 0x66, 0x00, 0x33, 0x66, 0x00, 0x66, 0x66, 0x00, 0x99, // 112 (0x70)
+ 0x66, 0x00, 0xcc, 0x66, 0x00, 0xff, 0x66, 0x33, 0x00, 0x66, 0x33, 0x33, // 116 (0x74)
+ 0x66, 0x33, 0x66, 0x66, 0x33, 0x99, 0x66, 0x33, 0xcc, 0x66, 0x33, 0xff, // 120 (0x78)
+ 0x66, 0x66, 0x00, 0x66, 0x66, 0x33, 0x66, 0x66, 0x66, 0x66, 0x66, 0x99, // 124 (0x7c)
+ 0x66, 0x66, 0xcc, 0x66, 0x66, 0xff, 0x66, 0x99, 0x00, 0x66, 0x99, 0x33, // 128 (0x80)
+ 0x66, 0x99, 0x66, 0x66, 0x99, 0x99, 0x66, 0x99, 0xcc, 0x66, 0x99, 0xff, // 132 (0x84)
+ 0x66, 0xcc, 0x00, 0x66, 0xcc, 0x33, 0x66, 0xcc, 0x66, 0x66, 0xcc, 0x99, // 136 (0x88)
+ 0x66, 0xcc, 0xcc, 0x66, 0xcc, 0xff, 0x66, 0xff, 0x00, 0x66, 0xff, 0x33, // 140 (0x8c)
+ 0x66, 0xff, 0x66, 0x66, 0xff, 0x99, 0x66, 0xff, 0xcc, 0x66, 0xff, 0xff, // 144 (0x90)
+ 0x99, 0x00, 0x00, 0x99, 0x00, 0x33, 0x99, 0x00, 0x66, 0x99, 0x00, 0x99, // 148 (0x94)
+ 0x99, 0x00, 0xcc, 0x99, 0x00, 0xff, 0x99, 0x33, 0x00, 0x99, 0x33, 0x33, // 152 (0x98)
+ 0x99, 0x33, 0x66, 0x99, 0x33, 0x99, 0x99, 0x33, 0xcc, 0x99, 0x33, 0xff, // 156 (0x9c)
+ 0xa1, 0x66, 0x00, 0x99, 0x66, 0x33, 0x99, 0x66, 0x66, 0x99, 0x66, 0x99, // 160 (0xa0)
+ 0x99, 0x66, 0xcc, 0x99, 0x66, 0xff, 0x99, 0x99, 0x00, 0x99, 0x99, 0x33, // 164 (0xa4)
+ 0x99, 0x99, 0x66, 0x99, 0x99, 0x99, 0x99, 0x99, 0xcc, 0x99, 0x99, 0xff, // 168 (0xa8)
+ 0x99, 0xcc, 0x00, 0x99, 0xcc, 0x33, 0x99, 0xcc, 0x66, 0x99, 0xcc, 0x99, // 172 (0xac)
+ 0x99, 0xcc, 0xcc, 0x99, 0xcc, 0xff, 0x99, 0xff, 0x00, 0x99, 0xff, 0x33, // 176 (0xb0)
+ 0x99, 0xff, 0x66, 0x99, 0xff, 0x99, 0x99, 0xff, 0xcc, 0x99, 0xff, 0xff, // 180 (0xb4)
+ 0xcc, 0x00, 0x00, 0xcc, 0x00, 0x33, 0xcc, 0x00, 0x66, 0xcc, 0x00, 0x99, // 184 (0xb8)
+ 0xcc, 0x00, 0xcc, 0xd4, 0x08, 0xff, 0xcc, 0x33, 0x00, 0xcc, 0x33, 0x33, // 188 (0xbc)
+ 0xcc, 0x33, 0x66, 0xcc, 0x33, 0x99, 0xcc, 0x33, 0xcc, 0xcc, 0x33, 0xff, // 192 (0xc0)
+ 0xcc, 0x66, 0x00, 0xcc, 0x66, 0x33, 0xcc, 0x66, 0x66, 0xcc, 0x66, 0x99, // 196 (0xc4)
+ 0xcc, 0x66, 0xcc, 0xcc, 0x66, 0xff, 0xcc, 0x99, 0x00, 0xcc, 0x99, 0x33, // 200 (0xc8)
+ 0xcc, 0x99, 0x66, 0xcc, 0x99, 0x99, 0xcc, 0x99, 0xcc, 0xcc, 0x99, 0xff, // 204 (0xcc)
+ 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x33, 0xcc, 0xcc, 0x66, 0xcc, 0xcc, 0x99, // 208 (0xd0)
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xff, 0x00, 0xcc, 0xff, 0x33, // 212 (0xd4)
+ 0xcc, 0xff, 0x66, 0xcc, 0xff, 0x99, 0xcc, 0xff, 0xcc, 0xcc, 0xff, 0xff, // 216 (0xd8)
+ 0xff, 0x00, 0x33, 0xff, 0x00, 0x66, 0xff, 0x00, 0x99, 0xff, 0x00, 0xcc, // 220 (0xdc)
+ 0xff, 0x33, 0x00, 0xff, 0x33, 0x33, 0xff, 0x33, 0x66, 0xff, 0x33, 0x99, // 224 (0xe0)
+ 0xff, 0x33, 0xcc, 0xff, 0x33, 0xff, 0xff, 0x66, 0x00, 0xff, 0x66, 0x33, // 228 (0xe4)
+ 0xff, 0x66, 0x66, 0xff, 0x66, 0x99, 0xff, 0x66, 0xcc, 0xff, 0x66, 0xff, // 232 (0xe8)
+ 0xff, 0x99, 0x00, 0xdd, 0xdd, 0xdd, 0xff, 0x99, 0xcc, 0xff, 0xcc, 0x66, // 236 (0xec)
+ 0x88, 0x00, 0x00, 0xcc, 0x00, 0xff, 0x00, 0x33, 0x99, 0x33, 0x66, 0x33, // 240 (0xf0)
+ 0x99, 0x66, 0x00, 0x33, 0x33, 0x33, 0xff, 0xfb, 0xf0, 0xa0, 0xa0, 0xa4, // 244 (0xf4)
+ 0x80, 0x80, 0x80, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, // 248 (0xf8)
+ 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+
+static PaletteV4 director4Palettes[] = {
+ {-1, macPalette, 256},
+ {-2, rainbowPalette, 256},
+ {-3, grayscalePalette, 256},
+ {-4, pastelsPalette, 256},
+ {-5, vividPalette, 256},
+ {-6, ntscPalette, 256},
+ {-7, metallicPalette, 256},
+ {-101, winPalette, 256},
+ {0, nullptr, 0}
+};
+
static byte director3Patterns[][8] = {
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
@@ -231,7 +712,23 @@ Graphics::MacPatterns &DirectorEngine::getPatterns() {
return _director3QuickDrawPatterns;
}
+void DirectorEngine::loadPalettes() {
+ for (PaletteV4 *pal = director4Palettes; pal->id != 0; pal++) {
+ _director4Palettes[pal->id] = pal;
+ }
+}
+
+void DirectorEngine::setPalette(int id) {
+ if (!_director4Palettes.contains(id)) {
+ warning("setPalette(): no palette with matching id %d", id);
+ return;
+ }
+ PaletteV4 *pal = _director4Palettes[id];
+ setPalette(pal->palette, pal->length);
+}
+
void DirectorEngine::setPalette(byte *palette, uint16 count) {
+ _system->getPaletteManager()->setPalette(palette, 0, count);
_currentPalette = palette;
_currentPaletteLength = count;
@@ -245,7 +742,7 @@ void DirectorEngine::testFontScaling() {
int h = 480;
initGraphics(w, h);
- _system->getPaletteManager()->setPalette(defaultPalette, 0, 256);
+ _system->getPaletteManager()->setPalette(macPalette, 0, 256);
Graphics::ManagedSurface surface;
@@ -311,7 +808,7 @@ void DirectorEngine::testFonts() {
Common::MacResManager *fontFile = new Common::MacResManager();
if (!fontFile->open(fontName))
- error("Could not open %s as a resource fork", fontName.c_str());
+ error("testFonts(): Could not open %s as a resource fork", fontName.c_str());
Common::MacResIDArray fonds = fontFile->getResIDArray(MKTAG('F','O','N','D'));
if (fonds.size() > 0) {
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 10d73accc1..bff1a6a7fc 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -149,6 +149,7 @@ BITDDecoder::~BITDDecoder() {
}
void BITDDecoder::destroy() {
+ delete _surface;
_surface = 0;
delete[] _palette;
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 861dc0a2d3..e02ac63e6f 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -146,7 +146,7 @@ static struct BuiltinProto {
// Misc
{ "alert", LB::b_alert, 1, 1, false, 2, BLTIN }, // D2 c
{ "birth", LB::b_birth, -1,0, false, 4, FBLTIN }, // D4 f
- { "clearGlobals", LB::b_clearGlobals, 0, 0, false, 4, BLTIN }, // D4 c
+ { "clearGlobals", LB::b_clearGlobals, 0, 0, false, 3, BLTIN }, // D3.1 c
{ "cursor", LB::b_cursor, 1, 1, false, 2, BLTIN }, // D2 c
{ "framesToHMS", LB::b_framesToHMS, 4, 4, false, 3, FBLTIN }, // D3 f
{ "HMStoFrames", LB::b_HMStoFrames, 4, 4, false, 3, FBLTIN }, // D3 f
@@ -161,7 +161,7 @@ static struct BuiltinProto {
{ "constrainV", LB::b_constrainV, 2, 2, true, 2, FBLTIN }, // D2 f
{ "copyToClipBoard",LB::b_copyToClipBoard,1,1, false, 4, BLTIN }, // D4 c
{ "duplicate", LB::b_duplicate, 1, 2, false, 4, BLTIN }, // D4 c
- { "editableText", LB::b_editableText, 0, 0, false, 2, BLTIN }, // D2
+ { "editableText", LB::b_editableText, 0, 0, false, 2, BLTIN }, // D2, FIXME: the field in D4+
{ "erase", LB::b_erase, 1, 1, false, 4, BLTIN }, // D4 c
{ "findEmpty", LB::b_findEmpty, 1, 1, true, 4, FBLTIN }, // D4 f
// go // D2
@@ -170,18 +170,18 @@ static struct BuiltinProto {
{ "label", LB::b_label, 1, 1, true, 2, FBLTIN }, // D2 f
{ "marker", LB::b_marker, 1, 1, true, 2, FBLTIN }, // D2 f
{ "move", LB::b_move, 1, 2, false, 4, BLTIN }, // D4 c
- { "moveableSprite", LB::b_moveableSprite,0, 0, false, 2, BLTIN }, // D2
+ { "moveableSprite", LB::b_moveableSprite,0, 0, false, 2, BLTIN }, // D2, FIXME: the field in D4+
{ "pasteClipBoardInto",LB::b_pasteClipBoardInto,1,1,false,4,BLTIN },// D4 c
{ "puppetPalette", LB::b_puppetPalette, -1,0, false, 2, BLTIN }, // D2 c
{ "puppetSound", LB::b_puppetSound, -1,0, false, 2, BLTIN }, // D2 c
{ "puppetSprite", LB::b_puppetSprite, -1,0, false, 2, BLTIN }, // D2 c
{ "puppetTempo", LB::b_puppetTempo, 1, 1, false, 2, BLTIN }, // D2 c
{ "puppetTransition",LB::b_puppetTransition,-1,0,false,2, BLTIN }, // D2 c
- { "ramNeeded", LB::b_ramNeeded, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "ramNeeded", LB::b_ramNeeded, 2, 2, true, 3, FBLTIN }, // D3.1 f
{ "rollOver", LB::b_rollOver, 1, 1, true, 2, FBLTIN }, // D2 f
{ "spriteBox", LB::b_spriteBox, -1,0, false, 2, BLTIN }, // D2 c
- { "unLoad", LB::b_unLoad, 0, 2, false, 4, BLTIN }, // D4 c
- { "unLoadCast", LB::b_unLoadCast, 0, 2, false, 4, BLTIN }, // D4 c
+ { "unLoad", LB::b_unLoad, 0, 2, false, 3, BLTIN }, // D3.1 c
+ { "unLoadCast", LB::b_unLoadCast, 0, 2, false, 3, BLTIN }, // D3.1 c
{ "updateStage", LB::b_updateStage, 0, 0, false, 2, BLTIN }, // D2 c
{ "zoomBox", LB::b_zoomBox, -1,0, false, 2, BLTIN }, // D2 c
// Point
@@ -193,7 +193,7 @@ static struct BuiltinProto {
{ "union", LB::b_union, 2, 2, true, 4, FBLTIN }, // D4 f
// Sound
{ "beep", LB::b_beep, 0, 1, false, 2, BLTIN }, // D2
- { "mci", LB::b_mci, 1, 1, false, 4, BLTIN }, // D4 c
+ { "mci", LB::b_mci, 1, 1, false, 3, BLTIN }, // D3.1 c
{ "mciwait", LB::b_mciwait, 1, 1, false, 4, BLTIN }, // D4 c
{ "sound-close", LB::b_soundClose, 1, 1, false, 4, BLTIN }, // D4 c
{ "sound-fadeIn", LB::b_soundFadeIn, 1, 2, false, 3, BLTIN }, // D3 c
@@ -495,6 +495,8 @@ void LB::b_hilite(int nargs) {
void LB::b_length(int nargs) {
Datum d = g_lingo->pop();
+ if (d.type == REFERENCE)
+ d.toString();
if (d.type != STRING)
error("Incorrect type for 'length' function: %s", d.type2str());
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index da5da4481d..5a71233c01 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -85,7 +85,7 @@ static LingoV4Bytecode lingoV4[] = {
};
static LingoV4TheEntity lingoV4TheEntity[] = {
- { 0x00, 0x00, kTheFloatPrecision, kTheNOField, false, kTEANOArgs },
+ { 0x00, 0x00, kTheFloatPrecision, kTheNOField, true, kTEANOArgs },
{ 0x00, 0x01, kTheMouseDownScript, kTheNOField, true, kTEANOArgs },
{ 0x00, 0x02, kTheMouseUpScript, kTheNOField, true, kTEANOArgs },
{ 0x00, 0x03, kTheKeyDownScript, kTheNOField, true, kTEANOArgs },
@@ -252,56 +252,52 @@ void LC::cb_v4theentitypush() {
int bank = g_lingo->readInt();
Datum firstArg = g_lingo->pop();
+ firstArg.toInt();
Datum result;
result.u.s = NULL;
result.type = VOID;
- if (firstArg.type == INT) {
- int key = (bank << 8) + firstArg.u.i;
- if (g_lingo->_lingoV4TheEntity.contains(key)) {
- debugC(3, kDebugLingoExec, "cb_v4theentitypush: mapping 0x%02x, 0x%02x", bank, firstArg.u.i);
- int entity = g_lingo->_lingoV4TheEntity[key]->entity;
- int field = g_lingo->_lingoV4TheEntity[key]->field;
- switch (g_lingo->_lingoV4TheEntity[key]->type) {
- case kTEANOArgs:
- {
- Datum id;
- id.u.s = NULL;
- id.type = VOID;
- debugC(3, kDebugLingoExec, "cb_v4theentitypush: calling getTheEntity(0x%02x, NULL, 0x%02x)", entity, field);
- result = g_lingo->getTheEntity(entity, id, field);
- }
- break;
- case kTEAItemId:
- {
- Datum id = g_lingo->pop();
- debugC(3, kDebugLingoExec, "cb_v4theentitypush: calling getTheEntity(0x%02x, id, 0x%02x)", entity, field);
- result = g_lingo->getTheEntity(entity, id, field);
- }
- break;
- case kTEAString:
- {
- /*Datum stringArg = */g_lingo->pop();
- warning("cb_v4theentitypush: STUB: kTEAString");
- }
- break;
- case kTEAMenuIdItemId:
- {
- /*Datum menuId = */g_lingo->pop();
- /*Datum itemId = */g_lingo->pop();
- warning("cb_v4theentitypush: STUB: kTEAMenuIdItemId");
- }
- break;
- default:
- warning("cb_v4theentitypush: unknown call type %d", g_lingo->_lingoV4TheEntity[key]->type);
- break;
+ int key = (bank << 8) + firstArg.u.i;
+ if (g_lingo->_lingoV4TheEntity.contains(key)) {
+ debugC(3, kDebugLingoExec, "cb_v4theentitypush: mapping 0x%02x, 0x%02x", bank, firstArg.u.i);
+ int entity = g_lingo->_lingoV4TheEntity[key]->entity;
+ int field = g_lingo->_lingoV4TheEntity[key]->field;
+ switch (g_lingo->_lingoV4TheEntity[key]->type) {
+ case kTEANOArgs:
+ {
+ Datum id;
+ id.u.s = NULL;
+ id.type = VOID;
+ debugC(3, kDebugLingoExec, "cb_v4theentitypush: calling getTheEntity(0x%02x, NULL, 0x%02x)", entity, field);
+ result = g_lingo->getTheEntity(entity, id, field);
}
- } else {
- warning("cb_v4theentitypush: unhandled mapping 0x%02x 0x%02x", bank, firstArg.u.i);
+ break;
+ case kTEAItemId:
+ {
+ Datum id = g_lingo->pop();
+ debugC(3, kDebugLingoExec, "cb_v4theentitypush: calling getTheEntity(0x%02x, id, 0x%02x)", entity, field);
+ result = g_lingo->getTheEntity(entity, id, field);
+ }
+ break;
+ case kTEAString:
+ {
+ /*Datum stringArg = */g_lingo->pop();
+ warning("cb_v4theentitypush: STUB: kTEAString");
+ }
+ break;
+ case kTEAMenuIdItemId:
+ {
+ /*Datum menuId = */g_lingo->pop();
+ /*Datum itemId = */g_lingo->pop();
+ warning("cb_v4theentitypush: STUB: kTEAMenuIdItemId");
+ }
+ break;
+ default:
+ warning("cb_v4theentitypush: unknown call type %d", g_lingo->_lingoV4TheEntity[key]->type);
+ break;
}
-
} else {
- warning("cb_v4theentitypush: first arg should be of type INT, not %s", firstArg.type2str());
+ warning("cb_v4theentitypush: unhandled mapping 0x%02x 0x%02x", bank, firstArg.u.i);
}
g_lingo->push(result);
@@ -342,61 +338,57 @@ void LC::cb_v4theentityassign() {
int bank = g_lingo->readInt();
Datum firstArg = g_lingo->pop();
+ firstArg.toInt();
Datum value = g_lingo->pop();
Datum result;
result.u.s = NULL;
result.type = VOID;
- if (firstArg.type == INT) {
- int key = (bank << 8) + firstArg.u.i;
- if (g_lingo->_lingoV4TheEntity.contains(key)) {
- debugC(3, kDebugLingoExec, "cb_v4theentityassign: mapping 0x%02x, 0x%02x", bank, firstArg.u.i);
- if (g_lingo->_lingoV4TheEntity[key]->writable) {
- int entity = g_lingo->_lingoV4TheEntity[key]->entity;
- int field = g_lingo->_lingoV4TheEntity[key]->field;
- switch (g_lingo->_lingoV4TheEntity[key]->type) {
- case kTEANOArgs:
- {
- Datum id;
- id.u.s = NULL;
- id.type = VOID;
- debugC(3, kDebugLingoExec, "cb_v4theentityassign: calling setTheEntity(0x%02x, NULL, 0x%02x, value)", entity, field);
- g_lingo->setTheEntity(entity, id, field, value);
- }
- break;
- case kTEAItemId:
- {
- Datum id = g_lingo->pop();
- debugC(3, kDebugLingoExec, "cb_v4theentityassign: calling setTheEntity(0x%02x, id, 0x%02x, value)", entity, field);
- g_lingo->setTheEntity(entity, id, field, value);
- }
- break;
- case kTEAString:
- {
- /*Datum stringArg = */g_lingo->pop();
- warning("cb_v4theentityassign: STUB: kTEAString");
- }
- break;
- case kTEAMenuIdItemId:
- {
- /*Datum menuId = */g_lingo->pop();
- /*Datum itemId = */g_lingo->pop();
- warning("cb_v4theentityassign: STUB: kTEAMenuIdItemId");
- }
- break;
- default:
- warning("cb_v4theentityassign: unknown call type %d", g_lingo->_lingoV4TheEntity[key]->type);
- break;
+ int key = (bank << 8) + firstArg.u.i;
+ if (g_lingo->_lingoV4TheEntity.contains(key)) {
+ debugC(3, kDebugLingoExec, "cb_v4theentityassign: mapping 0x%02x, 0x%02x", bank, firstArg.u.i);
+ if (g_lingo->_lingoV4TheEntity[key]->writable) {
+ int entity = g_lingo->_lingoV4TheEntity[key]->entity;
+ int field = g_lingo->_lingoV4TheEntity[key]->field;
+ switch (g_lingo->_lingoV4TheEntity[key]->type) {
+ case kTEANOArgs:
+ {
+ Datum id;
+ id.u.s = NULL;
+ id.type = VOID;
+ debugC(3, kDebugLingoExec, "cb_v4theentityassign: calling setTheEntity(0x%02x, NULL, 0x%02x, value)", entity, field);
+ g_lingo->setTheEntity(entity, id, field, value);
}
- } else {
- warning("cb_v4theentityassign: non-writable mapping 0x%02x 0x%02x", bank, firstArg.u.i);
+ break;
+ case kTEAItemId:
+ {
+ Datum id = g_lingo->pop();
+ debugC(3, kDebugLingoExec, "cb_v4theentityassign: calling setTheEntity(0x%02x, id, 0x%02x, value)", entity, field);
+ g_lingo->setTheEntity(entity, id, field, value);
+ }
+ break;
+ case kTEAString:
+ {
+ /*Datum stringArg = */g_lingo->pop();
+ warning("cb_v4theentityassign: STUB: kTEAString");
+ }
+ break;
+ case kTEAMenuIdItemId:
+ {
+ /*Datum menuId = */g_lingo->pop();
+ /*Datum itemId = */g_lingo->pop();
+ warning("cb_v4theentityassign: STUB: kTEAMenuIdItemId");
+ }
+ break;
+ default:
+ warning("cb_v4theentityassign: unknown call type %d", g_lingo->_lingoV4TheEntity[key]->type);
+ break;
}
} else {
- warning("cb_v4theentityassign: unhandled mapping 0x%02x 0x%02x", bank, firstArg.u.i);
+ warning("cb_v4theentityassign: non-writable mapping 0x%02x 0x%02x", bank, firstArg.u.i);
}
-
} else {
- warning("cb_v4theentityassign: first arg should be of type INT, not %s", firstArg.type2str());
+ warning("cb_v4theentityassign: unhandled mapping 0x%02x 0x%02x", bank, firstArg.u.i);
}
}
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index 9077e9d6ad..4d15f964b0 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -242,7 +242,12 @@ Symbol *Lingo::define(Common::String &name, int nargs, ScriptData *code) {
// 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;
+
+ // Do not attempt to remove code from built-ins
+ if (sym->type == HANDLER)
+ delete sym->u.defn;
+ else
+ sym->type = HANDLER;
}
sym->u.defn = code;
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index fe64b80e29..ab3b62aa50 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -34,9 +34,9 @@ struct EventHandlerType {
const char *name;
} static const eventHandlerDescs[] = {
{ kEventPrepareMovie, "prepareMovie" },
- { kEventStartMovie, "startMovie" }, // D3?
- { kEventStepMovie, "stepMovie" }, // D3?
- { kEventStopMovie, "stopMovie" }, // D3?
+ { kEventStartMovie, "startMovie" }, // D3
+ { kEventStepMovie, "stepMovie" }, // D3
+ { kEventStopMovie, "stopMovie" }, // D3
{ kEventNew, "newSprite" },
{ kEventBeginSprite, "beginSprite" },
@@ -44,7 +44,7 @@ struct EventHandlerType {
{ kEventEnterFrame, "enterFrame" }, // D4
{ kEventPrepareFrame, "prepareFrame" },
- { kEventIdle, "idle" },
+ { kEventIdle, "idle" }, // D3
{ kEventStepFrame, "stepFrame"},
{ kEventExitFrame, "exitFrame" }, // D4
@@ -58,8 +58,8 @@ struct EventHandlerType {
{ kEventKeyUp, "keyUp" }, // D4
{ kEventKeyDown, "keyDown" }, // D2 w D4 (as when from D2)
- { kEventMouseUp, "mouseUp" }, // D2 w D3?
- { kEventMouseDown, "mouseDown" }, // D2 w D3?
+ { kEventMouseUp, "mouseUp" }, // D2 w D3
+ { kEventMouseDown, "mouseDown" }, // D2 w D3
{ kEventRightMouseDown, "rightMouseDown" },
{ kEventRightMouseUp, "rightMouseUp" },
{ kEventMouseEnter, "mouseEnter" },
@@ -200,8 +200,9 @@ void Lingo::runMovieScript(LEvent event) {
if (_dontPassEvent)
return;
- for (uint i = 0; i < _scriptContexts[kMovieScript].size(); i++) {
- processEvent(event, kMovieScript, i);
+ for (ScriptContextHash::iterator it = _scriptContexts[kMovieScript].begin();
+ it != _scriptContexts[kMovieScript].end(); ++it) {
+ processEvent(event, kMovieScript, it->_key);
// TODO: How do know which script handles the message?
}
debugC(9, kDebugEvents, "STUB: processEvent(event, kMovieScript, ?)");
@@ -243,12 +244,13 @@ void Lingo::processFrameEvent(LEvent event) {
void Lingo::processGenericEvent(LEvent event) {
// Movie Script
int id = -1;
- if (event == kEventStart || event == kEventPrepareMovie)
+ if (event == kEventStart || event == kEventPrepareMovie ||
+ event == kEventStartMovie || event == kEventStopMovie)
id = 0;
else
- warning("STUB: processGenericEvent called for something else than kEventStart or kEventPrepareMovie, additional logic probably needed");
+ warning("STUB: processGenericEvent called for unprocessed event, additional logic probably needed");
- processEvent(event, kMovieScript, id);
+ runMovieScript(event);
}
void Lingo::processSpriteEvent(LEvent event) {
diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp
index d4448546ee..0eaeab1e62 100644
--- a/engines/director/lingo/lingo-gr.cpp
+++ b/engines/director/lingo/lingo-gr.cpp
@@ -552,7 +552,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 126
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 1638
+#define YYLAST 1598
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 107
@@ -561,7 +561,7 @@ union yyalloc
/* YYNRULES -- Number of rules. */
#define YYNRULES 160
/* YYNRULES -- Number of states. */
-#define YYNSTATES 343
+#define YYNSTATES 342
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
@@ -642,7 +642,7 @@ static const yytype_int16 yyrhs[] =
30, -1, 52, 128, 45, 129, -1, 52, 128, 74,
128, -1, 52, 128, 75, 128, -1, 54, 30, 68,
128, -1, 54, 15, 68, 128, -1, 54, 30, 56,
- 128, -1, 54, 15, 56, 128, -1, 54, 16, 128,
+ 128, -1, 54, 15, 56, 128, -1, 54, 16, 127,
56, 128, -1, 54, 16, 127, 68, 128, -1, 54,
37, 56, 128, -1, 145, -1, 128, -1, 130, -1,
145, -1, 128, -1, 130, -1, 117, -1, 111, -1,
@@ -661,7 +661,7 @@ static const yytype_int16 yyrhs[] =
113, -1, 57, 30, 55, -1, 86, -1, 12, -1,
17, -1, 33, -1, 31, -1, 30, -1, 127, -1,
129, -1, 25, -1, 26, 128, -1, 27, 146, -1,
- 30, 102, 146, 103, -1, 15, -1, 16, 128, -1,
+ 30, 102, 146, 103, -1, 15, -1, 16, 127, -1,
37, -1, 110, -1, 128, 96, 128, -1, 128, 97,
128, -1, 128, 98, 128, -1, 128, 99, 128, -1,
128, 73, 128, -1, 128, 94, 128, -1, 128, 93,
@@ -828,7 +828,7 @@ static const yytype_uint8 yydefact[] =
51, 0, 0, 101, 0, 0, 0, 156, 0, 3,
66, 26, 7, 27, 0, 0, 0, 0, 0, 57,
20, 58, 21, 104, 105, 6, 45, 19, 4, 56,
- 0, 64, 113, 112, 157, 115, 156, 60, 61, 56,
+ 64, 56, 0, 113, 112, 157, 115, 156, 60, 61,
102, 156, 159, 155, 156, 45, 106, 119, 108, 125,
0, 126, 0, 127, 128, 130, 139, 103, 0, 41,
0, 0, 0, 0, 0, 141, 117, 133, 134, 136,
@@ -838,33 +838,33 @@ static const yytype_uint8 yydefact[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 147, 156, 0, 0, 118,
157, 0, 0, 138, 147, 0, 132, 0, 129, 45,
- 0, 0, 0, 42, 0, 0, 57, 0, 0, 0,
- 0, 50, 0, 135, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 87, 88, 2,
- 47, 46, 0, 31, 46, 0, 47, 76, 77, 74,
- 75, 78, 79, 71, 82, 83, 84, 73, 72, 81,
- 67, 68, 69, 70, 148, 0, 158, 62, 160, 0,
- 120, 131, 147, 8, 9, 10, 11, 15, 13, 0,
- 0, 14, 12, 18, 116, 124, 91, 0, 93, 0,
- 95, 0, 97, 0, 89, 90, 122, 99, 156, 46,
- 0, 47, 0, 33, 46, 154, 0, 154, 0, 17,
- 16, 0, 0, 0, 0, 0, 48, 49, 0, 0,
- 0, 46, 0, 0, 0, 47, 149, 47, 154, 92,
- 94, 96, 98, 100, 28, 0, 46, 36, 46, 32,
- 150, 145, 143, 47, 46, 47, 44, 46, 36, 0,
- 0, 151, 140, 47, 46, 45, 0, 37, 46, 45,
- 40, 152, 144, 46, 0, 47, 34, 0, 0, 0,
- 0, 29, 46, 47, 46, 153, 30, 0, 46, 0,
- 35, 38, 39
+ 0, 0, 0, 42, 0, 0, 0, 0, 0, 0,
+ 50, 0, 135, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 87, 88, 2, 47,
+ 46, 0, 31, 46, 0, 47, 76, 77, 74, 75,
+ 78, 79, 71, 82, 83, 84, 73, 72, 81, 67,
+ 68, 69, 70, 148, 0, 158, 62, 160, 0, 120,
+ 131, 147, 8, 9, 10, 11, 15, 13, 0, 0,
+ 14, 12, 18, 116, 124, 91, 0, 93, 0, 95,
+ 0, 97, 0, 89, 90, 122, 99, 156, 46, 0,
+ 47, 0, 33, 46, 154, 0, 154, 0, 16, 17,
+ 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
+ 46, 0, 0, 0, 47, 149, 47, 154, 92, 94,
+ 96, 98, 100, 28, 0, 46, 36, 46, 32, 150,
+ 145, 143, 47, 46, 47, 44, 46, 36, 0, 0,
+ 151, 140, 47, 46, 45, 0, 37, 46, 45, 40,
+ 152, 144, 46, 0, 47, 34, 0, 0, 0, 0,
+ 29, 46, 47, 46, 153, 30, 0, 46, 0, 35,
+ 38, 39
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 48, 49, 50, 51, 131, 277, 53, 307, 308,
- 132, 54, 55, 56, 309, 155, 200, 259, 57, 58,
+ -1, 48, 49, 50, 51, 131, 276, 53, 306, 307,
+ 132, 54, 55, 56, 308, 155, 199, 258, 57, 58,
59, 60, 61, 62, 88, 119, 111, 63, 95, 64,
- 84, 65, 169, 85, 66, 225, 322, 285, 67, 161,
+ 84, 65, 169, 85, 66, 224, 321, 284, 67, 161,
83
};
@@ -873,50 +873,50 @@ static const yytype_int16 yydefgoto[] =
#define YYPACT_NINF -268
static const yytype_int16 yypact[] =
{
- 316, -42, -268, -268, 976, -268, -268, 976, 976, 976,
- 21, -268, 976, 976, 57, 1009, -268, -268, -268, -268,
- -268, 15, 40, 854, -268, 55, 976, -38, 41, 64,
- 71, 976, 915, 80, 976, 976, 976, 976, 976, 976,
- -268, 81, 82, 11, 976, 976, 976, 976, 2, -268,
- -268, -268, -268, -268, 976, 46, 976, 680, 976, -268,
- 1526, -268, -268, -268, -268, -268, -268, -268, -268, 13,
- 976, 1526, 1526, 1526, 1526, 10, 976, 1526, 10, -268,
- -268, 976, 1526, 12, 976, -268, -268, -268, 14, -268,
- 976, -268, 69, -268, 1062, -268, -268, 1048, 89, -268,
- -31, 976, 36, 65, 72, -268, 1420, -268, 1062, -268,
- -268, 18, -268, 1098, 1132, 1166, 1200, 1492, -268, 20,
- -268, 100, -268, -268, 1454, 3, -268, 407, 1526, 976,
- 1526, -268, -268, 976, 1526, -268, -268, 1370, 976, 976,
- 976, 976, 976, 976, 976, 976, 976, 976, 976, 976,
- 976, 976, 976, 976, 976, 101, 976, 1048, 976, 10,
- 1454, -27, 976, 10, 101, 102, 1526, 976, -268, -268,
- 77, 976, 976, -268, 976, 976, 83, 1406, 976, 976,
- 976, -268, 976, -268, 103, 976, 976, 976, 976, 976,
- 976, 976, 976, 976, 976, 125, -10, -268, -268, -268,
- -268, 1526, 104, -268, 1526, 976, -268, -50, -50, -50,
- -50, 1539, 1539, -268, -34, -50, -50, -50, -50, -34,
- -15, -15, -268, -268, -268, -77, 1526, -268, 1526, -46,
- -268, 1526, 101, -268, -268, 1526, 1526, 1526, -50, 976,
- 976, 1526, -50, 1526, 1526, -268, 1526, 1234, 1526, 1268,
- 1526, 1302, 1526, 1336, 1526, 1526, -268, -268, 976, 589,
- -20, -268, 105, 1526, 589, 50, 127, 50, -6, -50,
- 1526, 976, 976, 976, 976, -1, -268, -268, 70, 106,
- 976, 589, 771, 73, 134, -268, -268, -268, 50, 1526,
- 1526, 1526, 1526, -268, -268, 976, 1526, 126, -268, -268,
- -268, 498, 589, -268, 1526, -268, -268, 130, 126, 976,
- -23, 142, 589, -268, 589, -268, 90, -268, 1526, -268,
- -268, -268, 67, 589, 107, -268, -268, 136, 771, 162,
- 108, -268, 589, -268, -268, -268, -268, 110, 589, 112,
- -268, -268, -268
+ 312, -79, -268, -268, 73, -268, -268, 972, 972, 972,
+ 5, -268, 972, 972, 73, 1005, -268, -268, -268, -268,
+ -268, -36, 46, 850, -268, 62, 972, -13, 65, 71,
+ 79, 972, 911, 81, 972, 972, 972, 972, 972, 972,
+ -268, 82, 83, -76, 972, 972, 972, 972, 9, -268,
+ -268, -268, -268, -268, 972, 47, 972, 676, 972, -268,
+ 1486, -268, -268, -268, -268, -268, -268, -268, -268, -268,
+ -268, 12, 972, 1486, 1486, 1486, 10, 972, 1486, 10,
+ -268, 972, 1486, 11, 972, -268, -268, -268, 17, -268,
+ 972, -268, 76, -268, 1058, -268, -268, 1044, 88, -268,
+ -14, 73, 7, 69, 72, -268, 1380, -268, 1058, -268,
+ -268, 22, -268, 1094, 1128, 1162, 1196, 1452, -268, 23,
+ -268, 100, -268, -268, 1414, -44, -268, 403, 1486, 972,
+ 1486, -268, -268, 972, 1486, -268, -268, 1366, 972, 972,
+ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972,
+ 972, 972, 972, 972, 972, 120, 972, 1044, 972, 10,
+ 1414, -88, 972, 10, 120, 122, 1486, 972, -268, -268,
+ 70, 972, 972, -268, 972, 972, 26, 972, 972, 972,
+ -268, 972, -268, 123, 972, 972, 972, 972, 972, 972,
+ 972, 972, 972, 972, 124, -10, -268, -268, -268, -268,
+ 1486, 101, -268, 1486, 972, -268, -40, -40, -40, -40,
+ 1499, 1499, -268, -30, -40, -40, -40, -40, -30, -1,
+ -1, -268, -268, -268, -53, 1486, -268, 1486, -17, -268,
+ 1486, 120, -268, -268, 1486, 1486, 1486, -40, 972, 972,
+ 1486, -40, 1486, 1486, -268, 1486, 1230, 1486, 1264, 1486,
+ 1298, 1486, 1332, 1486, 1486, -268, -268, 972, 585, -4,
+ -268, 102, 1486, 585, 52, 129, 52, -15, 1486, -40,
+ 972, 972, 972, 972, 2, -268, -268, 75, 105, 972,
+ 585, 767, 77, 132, -268, -268, -268, 52, 1486, 1486,
+ 1486, 1486, -268, -268, 972, 1486, 133, -268, -268, -268,
+ 494, 585, -268, 1486, -268, -268, 136, 133, 972, -26,
+ 157, 585, -268, 585, -268, 98, -268, 1486, -268, -268,
+ -268, 57, 585, 99, -268, -268, 138, 767, 161, 103,
+ -268, 585, -268, -268, -268, -268, 106, 585, 108, -268,
+ -268, -268
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -268, -268, 76, -268, -267, -268, 1, -268, -114, -268,
- -268, -268, -268, 147, -268, -78, -8, -108, -268, -268,
- -2, -4, 37, 149, -268, -268, -268, -268, -19, -268,
- -268, -268, -268, -268, -268, -150, -268, -250, 151, -3,
+ -268, -268, 68, -268, -267, -268, 21, -268, -108, -268,
+ -268, -268, -268, 144, -268, -81, -11, -84, -268, -268,
+ 6, -7, 33, 147, -268, -268, -268, -268, -21, -268,
+ -268, -268, -268, -268, -268, -152, -268, -243, 148, -6,
-268
};
@@ -927,132 +927,135 @@ static const yytype_int16 yypgoto[] =
#define YYTABLE_NINF -6
static const yytype_int16 yytable[] =
{
- 71, 52, 126, 72, 73, 74, 75, 164, 77, 74,
- 78, 82, 80, 109, 229, 298, 319, 287, 279, 94,
- 98, 99, 97, 144, 265, 174, 145, 106, 108, 266,
- 112, 113, 114, 115, 116, 117, 280, 175, 303, 144,
- 122, 123, 124, 74, 125, 150, 151, 152, 153, 154,
- 128, 76, 130, 134, 137, 267, 100, 101, 144, 68,
- 266, 334, 151, 152, 153, 154, 157, 320, 86, 2,
- 87, 102, 74, 159, 5, 168, 227, 160, 103, 158,
- 74, 163, 268, 153, 154, 96, 166, 79, 16, 183,
- 17, 232, 178, 257, 104, 288, 258, 177, 264, 176,
- 266, 105, 293, 127, 179, 158, 14, 233, 198, 158,
- 110, 118, 120, 121, 129, 156, 158, 167, 162, 173,
- 165, 180, 202, 203, 184, 201, 195, 181, 52, 204,
- 196, 224, 230, 245, 207, 208, 209, 210, 211, 212,
- 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
- 223, 239, 74, 281, 226, 256, 284, 286, 228, 261,
- 282, 294, 295, 231, 300, 299, 306, 235, 236, 315,
- 237, 238, 321, 329, 241, 242, 243, 301, 244, 302,
- 326, 246, 247, 248, 249, 250, 251, 252, 253, 254,
- 255, 333, 335, 260, 317, 312, 262, 314, 331, 336,
- 340, 263, 342, 199, 133, 323, 135, 234, 136, 0,
- 0, 0, 0, 0, 0, 0, 0, 332, 0, 0,
- 0, 0, 0, 0, 0, 338, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 269, 270, 325, 0, 0,
- 0, 328, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 278, 0, 0, 74, 275, 283, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 289, 290, 291,
- 292, 0, 0, 297, 0, 0, 296, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 305, 0,
- 310, 304, 0, 0, 0, 0, 313, 0, 0, 316,
- 0, 0, 0, 0, 0, 318, 324, 0, 0, 0,
- 327, 0, 0, 0, 0, 330, -5, 1, 0, 0,
- 0, 0, 0, 0, 337, 0, 339, 0, 2, 0,
- 341, 3, 4, 5, 0, 6, 7, 8, 9, 10,
+ 73, 74, 75, 76, 164, 78, 75, 79, 82, 126,
+ 70, 109, 228, 318, 297, 226, 94, 86, 158, 97,
+ 80, 52, 68, 286, 106, 108, 121, 112, 113, 114,
+ 115, 116, 117, 144, 278, 77, 145, 122, 123, 124,
+ 75, 125, 174, 144, 302, 98, 99, 128, 264, 130,
+ 134, 137, 279, 265, 175, 150, 151, 152, 153, 154,
+ 333, 197, 158, 177, 319, 157, 151, 152, 153, 154,
+ 75, 159, 144, 168, 160, 178, 87, 75, 163, 267,
+ 100, 101, 238, 166, 266, 2, 287, 182, 231, 265,
+ 5, 265, 96, 256, 239, 102, 257, 153, 154, 14,
+ 232, 104, 103, 69, 16, 292, 17, 176, 158, 105,
+ 127, 110, 118, 120, 156, 129, 158, 162, 173, 201,
+ 202, 263, 200, 165, 167, 179, 203, 180, 183, 194,
+ 195, 206, 207, 208, 209, 210, 211, 212, 213, 214,
+ 215, 216, 217, 218, 219, 220, 221, 222, 52, 75,
+ 223, 225, 229, 244, 255, 227, 260, 281, 283, 285,
+ 230, 294, 299, 328, 234, 235, 293, 236, 237, 298,
+ 240, 241, 242, 305, 243, 314, 280, 245, 246, 247,
+ 248, 249, 250, 251, 252, 253, 254, 320, 325, 259,
+ 330, 334, 261, 332, 335, 198, 339, 262, 341, 316,
+ 300, 133, 301, 233, 135, 136, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 311, 0,
+ 313, 0, 0, 0, 0, 0, 0, 0, 322, 0,
+ 0, 268, 269, 324, 0, 0, 0, 327, 0, 0,
+ 331, 0, 0, 0, 0, 0, 0, 277, 337, 0,
+ 75, 274, 282, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 288, 289, 290, 291, 0, 0, 296,
+ 0, 0, 295, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 304, 0, 309, 303, 0, 0,
+ 0, 0, 312, 0, 0, 315, 0, 0, 0, 0,
+ 0, 317, 323, 0, 0, 0, 326, 0, 0, 0,
+ 0, 329, -5, 1, 0, 0, 0, 0, 0, 0,
+ 336, 0, 338, 0, 2, 0, 340, 3, 4, 5,
+ 0, 6, 7, 8, 9, 10, 0, 11, 12, 13,
+ 0, 14, 15, 16, 0, 17, 0, 18, 19, 20,
+ 0, 0, 0, 21, 22, 23, 24, 0, 0, 25,
+ 0, 0, 0, 0, 26, 27, 28, 0, 0, 29,
+ 0, 0, 0, 30, 31, 32, 0, 33, 0, 0,
+ 0, 0, 0, 0, 34, 0, 0, 0, 0, 0,
+ 0, 35, 36, 37, 38, 39, 0, 0, 40, 41,
+ 42, 43, 0, 0, 0, 0, 0, 0, 44, 45,
+ 0, 0, 0, -5, 46, 2, 47, 0, 3, 4,
+ 5, 0, 6, 7, 8, 9, 10, 0, 11, 12,
+ 13, 0, 14, 15, 16, 0, 17, 0, 18, 19,
+ 20, 0, 0, 0, 21, 22, 23, 24, 0, 0,
+ 25, 0, 0, 0, 0, 26, 27, 28, 0, 0,
+ 29, 0, 0, 0, 30, 31, 32, 0, 33, 0,
+ 0, 0, 0, 0, 0, 34, 0, 0, 0, 0,
+ 0, 0, 35, 36, 37, 38, 39, 0, 0, 40,
+ 41, 42, 43, 0, 0, 0, 0, 0, 0, 44,
+ 45, 0, 0, 0, 0, 46, 2, 47, 0, 3,
+ 4, 5, 0, 6, 7, 8, 9, 10, 0, 11,
+ 12, 13, 0, 14, 15, 16, 0, 17, 310, 18,
+ 0, 20, 0, 0, 0, 21, 22, 23, 24, 0,
+ 0, 0, 0, 0, 0, 0, 26, 27, 28, 0,
+ 0, 29, 0, 0, 0, 0, 31, 32, 0, 33,
+ 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
+ 0, 0, 0, 35, 36, 37, 38, 39, 0, 0,
+ 40, 41, 0, 43, 0, 0, 0, 0, 0, 0,
+ 44, 45, 0, 0, 0, 275, 46, 2, 47, 0,
+ 3, 4, 5, 0, 6, 7, 8, 9, 10, 0,
+ 11, 12, 13, 0, 14, 15, 16, 0, 17, 0,
+ 18, 0, 20, 0, 0, 0, 21, 22, 23, 24,
+ 0, 0, 0, 0, 0, 0, 0, 26, 27, 28,
+ 0, 0, 29, 0, 0, 0, 0, 31, 32, 0,
+ 33, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 0, 0, 0, 35, 36, 37, 38, 39, 0,
+ 0, 40, 41, 0, 43, 0, 0, 0, 0, 0,
+ 0, 44, 45, 0, 0, 0, 275, 46, 2, 47,
+ 0, 3, 4, 5, 0, 6, 7, 8, 9, 10,
0, 11, 12, 13, 0, 14, 15, 16, 0, 17,
- 0, 18, 19, 20, 0, 0, 0, 21, 22, 23,
- 24, 0, 0, 25, 0, 0, 0, 0, 26, 27,
- 28, 0, 0, 29, 0, 0, 0, 30, 31, 32,
+ 0, 18, 0, 20, 0, 0, 0, 21, 22, 23,
+ 24, 0, 0, 0, 0, 0, 0, 0, 26, 0,
+ 28, 0, 0, 0, 0, 0, 0, 0, 31, 32,
0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
0, 0, 0, 0, 0, 35, 36, 37, 38, 39,
- 0, 0, 40, 41, 42, 43, 0, 0, 0, 0,
- 0, 0, 44, 45, 0, 0, 0, -5, 46, 2,
+ 0, 0, 0, 41, 0, 43, 0, 0, 0, 0,
+ 0, 0, 44, 45, 0, 0, 0, 0, 46, 2,
47, 0, 3, 4, 5, 0, 6, 7, 8, 9,
10, 0, 11, 12, 13, 0, 14, 15, 16, 0,
- 17, 0, 18, 19, 20, 0, 0, 0, 21, 22,
- 23, 24, 0, 0, 25, 0, 0, 0, 0, 26,
- 27, 28, 0, 0, 29, 0, 0, 0, 30, 31,
+ 17, 0, 18, 0, 20, 0, 0, 0, 21, 22,
+ 23, 0, 0, 0, 0, 0, 0, 0, 0, 26,
+ 0, 28, 0, 0, 0, 0, 0, 0, 0, 31,
32, 0, 33, 0, 0, 0, 0, 0, 0, 34,
0, 0, 0, 0, 0, 0, 35, 36, 37, 38,
- 39, 0, 0, 40, 41, 42, 43, 0, 0, 0,
- 0, 0, 0, 44, 45, 0, 0, 0, 0, 46,
- 2, 47, 0, 3, 4, 5, 0, 6, 7, 8,
- 9, 10, 0, 11, 12, 13, 0, 14, 15, 16,
- 0, 17, 311, 18, 0, 20, 0, 0, 0, 21,
- 22, 23, 24, 0, 0, 0, 0, 0, 0, 0,
- 26, 27, 28, 0, 0, 29, 0, 0, 0, 0,
- 31, 32, 0, 33, 0, 0, 0, 0, 0, 0,
- 34, 0, 0, 0, 0, 0, 0, 35, 36, 37,
- 38, 39, 0, 0, 40, 41, 0, 43, 0, 0,
- 0, 0, 0, 0, 44, 45, 0, 0, 0, 276,
- 46, 2, 47, 0, 3, 4, 5, 0, 6, 7,
- 8, 9, 10, 0, 11, 12, 13, 0, 14, 15,
- 16, 0, 17, 0, 18, 0, 20, 0, 0, 0,
- 21, 22, 23, 24, 0, 0, 0, 0, 0, 0,
- 0, 26, 27, 28, 0, 0, 29, 0, 0, 0,
- 0, 31, 32, 0, 33, 0, 0, 0, 0, 0,
- 0, 34, 0, 0, 0, 0, 0, 0, 35, 36,
- 37, 38, 39, 0, 0, 40, 41, 0, 43, 0,
- 0, 0, 0, 0, 0, 44, 45, 0, 0, 0,
- 276, 46, 2, 47, 0, 3, 4, 5, 0, 6,
- 7, 8, 9, 10, 0, 11, 12, 13, 0, 14,
- 15, 16, 0, 17, 0, 18, 0, 20, 0, 0,
- 0, 21, 22, 23, 24, 0, 0, 0, 0, 0,
- 0, 0, 26, 0, 28, 0, 0, 0, 0, 0,
- 0, 0, 31, 32, 0, 33, 0, 0, 0, 0,
- 0, 0, 34, 0, 0, 0, 0, 0, 0, 35,
- 36, 37, 38, 39, 0, 0, 0, 41, 0, 43,
- 0, 0, 0, 0, 0, 0, 44, 45, 0, 0,
- 0, 0, 46, 2, 47, 0, 3, 4, 5, 0,
- 6, 7, 8, 9, 10, 0, 11, 12, 13, 0,
- 14, 15, 16, 0, 17, 0, 18, 0, 20, 0,
- 0, 0, 21, 22, 23, 0, 0, 0, 0, 0,
- 0, 0, 0, 26, 0, 28, 0, 0, 0, 0,
- 0, 0, 0, 31, 32, 0, 33, 0, 0, 0,
- 0, 0, 0, 34, 0, 0, 0, 0, 0, 0,
- 35, 36, 37, 38, 39, 0, 0, 0, 41, 0,
- 43, 0, 0, 0, 0, 0, 2, 44, 45, 3,
- 4, 5, 0, 46, 0, 47, 0, 0, 0, 11,
- 12, 13, 0, 14, 69, 16, 0, 17, 0, 0,
- 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
- 89, 0, 90, 91, 92, 93, 70, 0, 28, 0,
+ 39, 0, 0, 0, 41, 0, 43, 0, 0, 0,
+ 0, 0, 2, 44, 45, 3, 4, 5, 0, 46,
+ 0, 47, 0, 0, 0, 11, 12, 13, 0, 14,
+ 71, 16, 0, 17, 0, 0, 0, 20, 0, 0,
+ 0, 0, 0, 0, 0, 0, 89, 0, 90, 91,
+ 92, 93, 72, 0, 28, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 34, 2, 0, 0,
- 3, 4, 5, 35, 36, 37, 38, 39, 0, 0,
- 11, 12, 13, 43, 14, 69, 16, 0, 17, 0,
- 44, 45, 20, 0, 0, 0, 46, 0, 47, 0,
- 0, 0, 0, 90, 0, 92, 0, 70, 0, 28,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 107,
- 0, 0, 0, 0, 0, 0, 0, 34, 2, 0,
- 0, 3, 4, 5, 35, 36, 37, 38, 39, 0,
- 0, 11, 12, 13, 43, 14, 69, 16, 0, 17,
- 0, 44, 45, 20, 0, 0, 0, 46, 0, 47,
- 0, 2, 0, 0, 3, 4, 5, 0, 70, 0,
- 28, 0, 0, 0, 11, 12, 13, 0, 14, 69,
- 16, 0, 17, 0, 0, 0, 20, 0, 34, 0,
- 0, 0, 0, 0, 0, 35, 36, 37, 38, 39,
- 0, 70, 0, 28, 0, 43, 0, 0, 0, 0,
- 0, 0, 44, 45, 0, 0, 0, 0, 46, 0,
- 47, 34, 0, 0, 0, 0, 0, 0, 35, 36,
- 37, 38, 39, 170, 0, 0, 0, 0, 43, 0,
- 0, 0, 0, 0, 0, 44, 45, 0, 0, 0,
- 90, 81, 92, 47, 138, 139, 140, 141, 142, 143,
- 0, 144, 171, 172, 145, 146, 147, 0, 138, 139,
- 140, 141, 142, 143, 0, 144, 0, 0, 145, 146,
- 147, 148, 149, 150, 151, 152, 153, 154, 185, 0,
- 0, 0, 0, 0, 186, 148, 149, 150, 151, 152,
- 153, 154, 0, 0, 138, 139, 140, 141, 142, 143,
+ 0, 0, 34, 2, 0, 0, 3, 4, 5, 35,
+ 36, 37, 38, 39, 0, 0, 11, 12, 13, 43,
+ 14, 71, 16, 0, 17, 0, 44, 45, 20, 0,
+ 0, 0, 46, 0, 47, 0, 0, 0, 0, 90,
+ 0, 92, 0, 72, 0, 28, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 107, 0, 0, 0, 0,
+ 0, 0, 0, 34, 2, 0, 0, 3, 4, 5,
+ 35, 36, 37, 38, 39, 0, 0, 11, 12, 13,
+ 43, 14, 71, 16, 0, 17, 0, 44, 45, 20,
+ 0, 0, 0, 46, 0, 47, 0, 2, 0, 0,
+ 3, 4, 5, 0, 72, 0, 28, 0, 0, 0,
+ 11, 12, 13, 0, 14, 71, 16, 0, 17, 0,
+ 0, 0, 20, 0, 34, 0, 0, 0, 0, 0,
+ 0, 35, 36, 37, 38, 39, 0, 72, 0, 28,
+ 0, 43, 0, 0, 0, 0, 0, 0, 44, 45,
+ 0, 0, 0, 0, 46, 0, 47, 34, 0, 0,
+ 0, 0, 0, 0, 35, 36, 37, 38, 39, 170,
+ 0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
+ 0, 44, 45, 0, 0, 0, 90, 81, 92, 47,
+ 138, 139, 140, 141, 142, 143, 0, 144, 171, 172,
+ 145, 146, 147, 0, 138, 139, 140, 141, 142, 143,
+ 0, 144, 0, 0, 145, 146, 147, 148, 149, 150,
+ 151, 152, 153, 154, 184, 0, 0, 0, 0, 0,
+ 185, 148, 149, 150, 151, 152, 153, 154, 0, 0,
+ 138, 139, 140, 141, 142, 143, 0, 144, 0, 0,
+ 145, 146, 147, 0, 0, 0, 0, 0, 186, 0,
+ 0, 0, 0, 0, 187, 0, 0, 148, 149, 150,
+ 151, 152, 153, 154, 138, 139, 140, 141, 142, 143,
0, 144, 0, 0, 145, 146, 147, 0, 0, 0,
- 0, 0, 187, 0, 0, 0, 0, 0, 188, 0,
+ 0, 0, 188, 0, 0, 0, 0, 0, 189, 0,
0, 148, 149, 150, 151, 152, 153, 154, 138, 139,
140, 141, 142, 143, 0, 144, 0, 0, 145, 146,
- 147, 0, 0, 0, 0, 0, 189, 0, 0, 0,
- 0, 0, 190, 0, 0, 148, 149, 150, 151, 152,
+ 147, 0, 0, 0, 0, 0, 190, 0, 0, 0,
+ 0, 0, 191, 0, 0, 148, 149, 150, 151, 152,
153, 154, 138, 139, 140, 141, 142, 143, 0, 144,
0, 0, 145, 146, 147, 0, 0, 0, 0, 0,
- 191, 0, 0, 0, 0, 0, 192, 0, 0, 148,
+ 270, 0, 0, 0, 0, 0, 0, 0, 0, 148,
149, 150, 151, 152, 153, 154, 138, 139, 140, 141,
142, 143, 0, 144, 0, 0, 145, 146, 147, 0,
0, 0, 0, 0, 271, 0, 0, 0, 0, 0,
@@ -1065,26 +1068,19 @@ static const yytype_int16 yytable[] =
0, 0, 273, 0, 0, 0, 0, 0, 0, 0,
0, 148, 149, 150, 151, 152, 153, 154, 138, 139,
140, 141, 142, 143, 0, 144, 0, 0, 145, 146,
- 147, 0, 0, 0, 0, 0, 274, 0, 0, 0,
- 0, 0, 0, 0, 0, 148, 149, 150, 151, 152,
- 153, 154, 138, 139, 140, 141, 142, 143, 0, 144,
- 0, 0, 145, 146, 147, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 205, 0, 0, 148,
- 149, 150, 151, 152, 153, 154, 138, 139, 140, 141,
- 142, 143, 0, 144, 0, 0, 145, 146, 147, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 240, 148, 149, 150, 151, 152, 153, 154,
- 0, 206, 138, 139, 140, 141, 142, 143, 182, 144,
+ 147, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 204, 0, 0, 148, 149, 150, 151, 152,
+ 153, 154, 138, 139, 140, 141, 142, 143, 181, 144,
0, 0, 145, 146, 147, 0, 138, 139, 140, 141,
142, 143, 0, 144, 0, 0, 145, 146, 147, 148,
- 149, 150, 151, 152, 153, 154, 0, 0, 0, 0,
+ 149, 150, 151, 152, 153, 154, 0, 205, 0, 0,
0, 0, 0, 148, 149, 150, 151, 152, 153, 154,
138, 139, 140, 141, 142, 143, 0, 144, 0, 0,
145, 146, 147, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 148, 149, 150,
- 151, 152, 153, 154, 0, 0, 0, 197, 138, 139,
+ 151, 152, 153, 154, 0, 0, 0, 196, 138, 139,
140, 141, 142, 143, 0, 144, 0, 0, 145, 146,
- 147, 0, 0, 0, 0, 0, 193, 194, 0, 0,
+ 147, 0, 0, 0, 0, 0, 192, 193, 0, 0,
0, 0, 0, 0, 0, 148, 149, 150, 151, 152,
153, 154, 138, 139, 140, 141, 142, 143, 0, 144,
0, 0, 145, 146, 147, 138, 139, 140, 141, 0,
@@ -1095,123 +1091,126 @@ static const yytype_int16 yytable[] =
static const yytype_int16 yycheck[] =
{
- 4, 0, 0, 7, 8, 9, 9, 85, 12, 13,
- 13, 15, 14, 32, 164, 282, 39, 267, 38, 23,
- 58, 59, 26, 73, 101, 56, 76, 31, 32, 106,
- 34, 35, 36, 37, 38, 39, 56, 68, 288, 73,
- 44, 45, 46, 47, 47, 95, 96, 97, 98, 99,
- 54, 30, 56, 57, 58, 101, 15, 16, 73, 101,
- 106, 328, 96, 97, 98, 99, 70, 90, 53, 12,
- 30, 30, 76, 76, 17, 94, 103, 81, 37, 106,
- 84, 84, 232, 98, 99, 30, 90, 30, 31, 108,
- 33, 169, 56, 103, 30, 101, 106, 101, 206, 101,
- 106, 30, 103, 101, 68, 106, 29, 30, 105, 106,
- 30, 30, 30, 102, 68, 102, 106, 48, 106, 30,
- 106, 56, 130, 131, 106, 129, 106, 55, 127, 133,
- 30, 30, 30, 30, 138, 139, 140, 141, 142, 143,
- 144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
- 154, 68, 156, 261, 158, 30, 106, 30, 162, 55,
- 55, 91, 56, 167, 30, 92, 40, 171, 172, 39,
- 174, 175, 30, 106, 178, 179, 180, 285, 182, 287,
- 90, 185, 186, 187, 188, 189, 190, 191, 192, 193,
- 194, 55, 30, 201, 308, 303, 204, 305, 91, 91,
- 90, 205, 90, 127, 57, 313, 57, 170, 57, -1,
- -1, -1, -1, -1, -1, -1, -1, 325, -1, -1,
- -1, -1, -1, -1, -1, 333, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 239, 240, 315, -1, -1,
- -1, 319, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 259, -1, -1, 258, 258, 264, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 271, 272, 273,
- 274, -1, -1, 281, -1, -1, 280, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 296, -1,
- 298, 295, -1, -1, -1, -1, 304, -1, -1, 307,
- -1, -1, -1, -1, -1, 309, 314, -1, -1, -1,
- 318, -1, -1, -1, -1, 323, 0, 1, -1, -1,
- -1, -1, -1, -1, 332, -1, 334, -1, 12, -1,
- 338, 15, 16, 17, -1, 19, 20, 21, 22, 23,
+ 7, 8, 9, 9, 85, 12, 13, 13, 15, 0,
+ 4, 32, 164, 39, 281, 103, 23, 53, 106, 26,
+ 14, 0, 101, 266, 31, 32, 102, 34, 35, 36,
+ 37, 38, 39, 73, 38, 30, 76, 44, 45, 46,
+ 47, 47, 56, 73, 287, 58, 59, 54, 101, 56,
+ 57, 58, 56, 106, 68, 95, 96, 97, 98, 99,
+ 327, 105, 106, 56, 90, 72, 96, 97, 98, 99,
+ 77, 77, 73, 94, 81, 68, 30, 84, 84, 231,
+ 15, 16, 56, 90, 101, 12, 101, 108, 169, 106,
+ 17, 106, 30, 103, 68, 30, 106, 98, 99, 29,
+ 30, 30, 37, 30, 31, 103, 33, 101, 106, 30,
+ 101, 30, 30, 30, 102, 68, 106, 106, 30, 130,
+ 131, 205, 129, 106, 48, 56, 133, 55, 106, 106,
+ 30, 138, 139, 140, 141, 142, 143, 144, 145, 146,
+ 147, 148, 149, 150, 151, 152, 153, 154, 127, 156,
+ 30, 158, 30, 30, 30, 162, 55, 55, 106, 30,
+ 167, 56, 30, 106, 171, 172, 91, 174, 175, 92,
+ 177, 178, 179, 40, 181, 39, 260, 184, 185, 186,
+ 187, 188, 189, 190, 191, 192, 193, 30, 90, 200,
+ 91, 30, 203, 55, 91, 127, 90, 204, 90, 307,
+ 284, 57, 286, 170, 57, 57, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 302, -1,
+ 304, -1, -1, -1, -1, -1, -1, -1, 312, -1,
+ -1, 238, 239, 314, -1, -1, -1, 318, -1, -1,
+ 324, -1, -1, -1, -1, -1, -1, 258, 332, -1,
+ 257, 257, 263, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 270, 271, 272, 273, -1, -1, 280,
+ -1, -1, 279, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 295, -1, 297, 294, -1, -1,
+ -1, -1, 303, -1, -1, 306, -1, -1, -1, -1,
+ -1, 308, 313, -1, -1, -1, 317, -1, -1, -1,
+ -1, 322, 0, 1, -1, -1, -1, -1, -1, -1,
+ 331, -1, 333, -1, 12, -1, 337, 15, 16, 17,
+ -1, 19, 20, 21, 22, 23, -1, 25, 26, 27,
+ -1, 29, 30, 31, -1, 33, -1, 35, 36, 37,
+ -1, -1, -1, 41, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, -1, 52, 53, 54, -1, -1, 57,
+ -1, -1, -1, 61, 62, 63, -1, 65, -1, -1,
+ -1, -1, -1, -1, 72, -1, -1, -1, -1, -1,
+ -1, 79, 80, 81, 82, 83, -1, -1, 86, 87,
+ 88, 89, -1, -1, -1, -1, -1, -1, 96, 97,
+ -1, -1, -1, 101, 102, 12, 104, -1, 15, 16,
+ 17, -1, 19, 20, 21, 22, 23, -1, 25, 26,
+ 27, -1, 29, 30, 31, -1, 33, -1, 35, 36,
+ 37, -1, -1, -1, 41, 42, 43, 44, -1, -1,
+ 47, -1, -1, -1, -1, 52, 53, 54, -1, -1,
+ 57, -1, -1, -1, 61, 62, 63, -1, 65, -1,
+ -1, -1, -1, -1, -1, 72, -1, -1, -1, -1,
+ -1, -1, 79, 80, 81, 82, 83, -1, -1, 86,
+ 87, 88, 89, -1, -1, -1, -1, -1, -1, 96,
+ 97, -1, -1, -1, -1, 102, 12, 104, -1, 15,
+ 16, 17, -1, 19, 20, 21, 22, 23, -1, 25,
+ 26, 27, -1, 29, 30, 31, -1, 33, 34, 35,
+ -1, 37, -1, -1, -1, 41, 42, 43, 44, -1,
+ -1, -1, -1, -1, -1, -1, 52, 53, 54, -1,
+ -1, 57, -1, -1, -1, -1, 62, 63, -1, 65,
+ -1, -1, -1, -1, -1, -1, 72, -1, -1, -1,
+ -1, -1, -1, 79, 80, 81, 82, 83, -1, -1,
+ 86, 87, -1, 89, -1, -1, -1, -1, -1, -1,
+ 96, 97, -1, -1, -1, 101, 102, 12, 104, -1,
+ 15, 16, 17, -1, 19, 20, 21, 22, 23, -1,
+ 25, 26, 27, -1, 29, 30, 31, -1, 33, -1,
+ 35, -1, 37, -1, -1, -1, 41, 42, 43, 44,
+ -1, -1, -1, -1, -1, -1, -1, 52, 53, 54,
+ -1, -1, 57, -1, -1, -1, -1, 62, 63, -1,
+ 65, -1, -1, -1, -1, -1, -1, 72, -1, -1,
+ -1, -1, -1, -1, 79, 80, 81, 82, 83, -1,
+ -1, 86, 87, -1, 89, -1, -1, -1, -1, -1,
+ -1, 96, 97, -1, -1, -1, 101, 102, 12, 104,
+ -1, 15, 16, 17, -1, 19, 20, 21, 22, 23,
-1, 25, 26, 27, -1, 29, 30, 31, -1, 33,
- -1, 35, 36, 37, -1, -1, -1, 41, 42, 43,
- 44, -1, -1, 47, -1, -1, -1, -1, 52, 53,
- 54, -1, -1, 57, -1, -1, -1, 61, 62, 63,
+ -1, 35, -1, 37, -1, -1, -1, 41, 42, 43,
+ 44, -1, -1, -1, -1, -1, -1, -1, 52, -1,
+ 54, -1, -1, -1, -1, -1, -1, -1, 62, 63,
-1, 65, -1, -1, -1, -1, -1, -1, 72, -1,
-1, -1, -1, -1, -1, 79, 80, 81, 82, 83,
- -1, -1, 86, 87, 88, 89, -1, -1, -1, -1,
- -1, -1, 96, 97, -1, -1, -1, 101, 102, 12,
+ -1, -1, -1, 87, -1, 89, -1, -1, -1, -1,
+ -1, -1, 96, 97, -1, -1, -1, -1, 102, 12,
104, -1, 15, 16, 17, -1, 19, 20, 21, 22,
23, -1, 25, 26, 27, -1, 29, 30, 31, -1,
- 33, -1, 35, 36, 37, -1, -1, -1, 41, 42,
- 43, 44, -1, -1, 47, -1, -1, -1, -1, 52,
- 53, 54, -1, -1, 57, -1, -1, -1, 61, 62,
+ 33, -1, 35, -1, 37, -1, -1, -1, 41, 42,
+ 43, -1, -1, -1, -1, -1, -1, -1, -1, 52,
+ -1, 54, -1, -1, -1, -1, -1, -1, -1, 62,
63, -1, 65, -1, -1, -1, -1, -1, -1, 72,
-1, -1, -1, -1, -1, -1, 79, 80, 81, 82,
- 83, -1, -1, 86, 87, 88, 89, -1, -1, -1,
- -1, -1, -1, 96, 97, -1, -1, -1, -1, 102,
- 12, 104, -1, 15, 16, 17, -1, 19, 20, 21,
- 22, 23, -1, 25, 26, 27, -1, 29, 30, 31,
- -1, 33, 34, 35, -1, 37, -1, -1, -1, 41,
- 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
- 52, 53, 54, -1, -1, 57, -1, -1, -1, -1,
- 62, 63, -1, 65, -1, -1, -1, -1, -1, -1,
- 72, -1, -1, -1, -1, -1, -1, 79, 80, 81,
- 82, 83, -1, -1, 86, 87, -1, 89, -1, -1,
- -1, -1, -1, -1, 96, 97, -1, -1, -1, 101,
- 102, 12, 104, -1, 15, 16, 17, -1, 19, 20,
- 21, 22, 23, -1, 25, 26, 27, -1, 29, 30,
- 31, -1, 33, -1, 35, -1, 37, -1, -1, -1,
- 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
- -1, 52, 53, 54, -1, -1, 57, -1, -1, -1,
- -1, 62, 63, -1, 65, -1, -1, -1, -1, -1,
- -1, 72, -1, -1, -1, -1, -1, -1, 79, 80,
- 81, 82, 83, -1, -1, 86, 87, -1, 89, -1,
- -1, -1, -1, -1, -1, 96, 97, -1, -1, -1,
- 101, 102, 12, 104, -1, 15, 16, 17, -1, 19,
- 20, 21, 22, 23, -1, 25, 26, 27, -1, 29,
- 30, 31, -1, 33, -1, 35, -1, 37, -1, -1,
- -1, 41, 42, 43, 44, -1, -1, -1, -1, -1,
- -1, -1, 52, -1, 54, -1, -1, -1, -1, -1,
- -1, -1, 62, 63, -1, 65, -1, -1, -1, -1,
- -1, -1, 72, -1, -1, -1, -1, -1, -1, 79,
- 80, 81, 82, 83, -1, -1, -1, 87, -1, 89,
- -1, -1, -1, -1, -1, -1, 96, 97, -1, -1,
- -1, -1, 102, 12, 104, -1, 15, 16, 17, -1,
- 19, 20, 21, 22, 23, -1, 25, 26, 27, -1,
- 29, 30, 31, -1, 33, -1, 35, -1, 37, -1,
- -1, -1, 41, 42, 43, -1, -1, -1, -1, -1,
- -1, -1, -1, 52, -1, 54, -1, -1, -1, -1,
- -1, -1, -1, 62, 63, -1, 65, -1, -1, -1,
- -1, -1, -1, 72, -1, -1, -1, -1, -1, -1,
- 79, 80, 81, 82, 83, -1, -1, -1, 87, -1,
- 89, -1, -1, -1, -1, -1, 12, 96, 97, 15,
- 16, 17, -1, 102, -1, 104, -1, -1, -1, 25,
- 26, 27, -1, 29, 30, 31, -1, 33, -1, -1,
- -1, 37, -1, -1, -1, -1, -1, -1, -1, -1,
- 46, -1, 48, 49, 50, 51, 52, -1, 54, -1,
+ 83, -1, -1, -1, 87, -1, 89, -1, -1, -1,
+ -1, -1, 12, 96, 97, 15, 16, 17, -1, 102,
+ -1, 104, -1, -1, -1, 25, 26, 27, -1, 29,
+ 30, 31, -1, 33, -1, -1, -1, 37, -1, -1,
+ -1, -1, -1, -1, -1, -1, 46, -1, 48, 49,
+ 50, 51, 52, -1, 54, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 72, 12, -1, -1,
- 15, 16, 17, 79, 80, 81, 82, 83, -1, -1,
- 25, 26, 27, 89, 29, 30, 31, -1, 33, -1,
- 96, 97, 37, -1, -1, -1, 102, -1, 104, -1,
- -1, -1, -1, 48, -1, 50, -1, 52, -1, 54,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 64,
- -1, -1, -1, -1, -1, -1, -1, 72, 12, -1,
- -1, 15, 16, 17, 79, 80, 81, 82, 83, -1,
- -1, 25, 26, 27, 89, 29, 30, 31, -1, 33,
- -1, 96, 97, 37, -1, -1, -1, 102, -1, 104,
- -1, 12, -1, -1, 15, 16, 17, -1, 52, -1,
- 54, -1, -1, -1, 25, 26, 27, -1, 29, 30,
- 31, -1, 33, -1, -1, -1, 37, -1, 72, -1,
- -1, -1, -1, -1, -1, 79, 80, 81, 82, 83,
- -1, 52, -1, 54, -1, 89, -1, -1, -1, -1,
- -1, -1, 96, 97, -1, -1, -1, -1, 102, -1,
- 104, 72, -1, -1, -1, -1, -1, -1, 79, 80,
- 81, 82, 83, 45, -1, -1, -1, -1, 89, -1,
- -1, -1, -1, -1, -1, 96, 97, -1, -1, -1,
- 48, 102, 50, 104, 66, 67, 68, 69, 70, 71,
- -1, 73, 74, 75, 76, 77, 78, -1, 66, 67,
- 68, 69, 70, 71, -1, 73, -1, -1, 76, 77,
- 78, 93, 94, 95, 96, 97, 98, 99, 50, -1,
- -1, -1, -1, -1, 56, 93, 94, 95, 96, 97,
- 98, 99, -1, -1, 66, 67, 68, 69, 70, 71,
+ -1, -1, 72, 12, -1, -1, 15, 16, 17, 79,
+ 80, 81, 82, 83, -1, -1, 25, 26, 27, 89,
+ 29, 30, 31, -1, 33, -1, 96, 97, 37, -1,
+ -1, -1, 102, -1, 104, -1, -1, -1, -1, 48,
+ -1, 50, -1, 52, -1, 54, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 64, -1, -1, -1, -1,
+ -1, -1, -1, 72, 12, -1, -1, 15, 16, 17,
+ 79, 80, 81, 82, 83, -1, -1, 25, 26, 27,
+ 89, 29, 30, 31, -1, 33, -1, 96, 97, 37,
+ -1, -1, -1, 102, -1, 104, -1, 12, -1, -1,
+ 15, 16, 17, -1, 52, -1, 54, -1, -1, -1,
+ 25, 26, 27, -1, 29, 30, 31, -1, 33, -1,
+ -1, -1, 37, -1, 72, -1, -1, -1, -1, -1,
+ -1, 79, 80, 81, 82, 83, -1, 52, -1, 54,
+ -1, 89, -1, -1, -1, -1, -1, -1, 96, 97,
+ -1, -1, -1, -1, 102, -1, 104, 72, -1, -1,
+ -1, -1, -1, -1, 79, 80, 81, 82, 83, 45,
+ -1, -1, -1, -1, 89, -1, -1, -1, -1, -1,
+ -1, 96, 97, -1, -1, -1, 48, 102, 50, 104,
+ 66, 67, 68, 69, 70, 71, -1, 73, 74, 75,
+ 76, 77, 78, -1, 66, 67, 68, 69, 70, 71,
+ -1, 73, -1, -1, 76, 77, 78, 93, 94, 95,
+ 96, 97, 98, 99, 50, -1, -1, -1, -1, -1,
+ 56, 93, 94, 95, 96, 97, 98, 99, -1, -1,
+ 66, 67, 68, 69, 70, 71, -1, 73, -1, -1,
+ 76, 77, 78, -1, -1, -1, -1, -1, 50, -1,
+ -1, -1, -1, -1, 56, -1, -1, 93, 94, 95,
+ 96, 97, 98, 99, 66, 67, 68, 69, 70, 71,
-1, 73, -1, -1, 76, 77, 78, -1, -1, -1,
-1, -1, 50, -1, -1, -1, -1, -1, 56, -1,
-1, 93, 94, 95, 96, 97, 98, 99, 66, 67,
@@ -1220,7 +1219,7 @@ static const yytype_int16 yycheck[] =
-1, -1, 56, -1, -1, 93, 94, 95, 96, 97,
98, 99, 66, 67, 68, 69, 70, 71, -1, 73,
-1, -1, 76, 77, 78, -1, -1, -1, -1, -1,
- 50, -1, -1, -1, -1, -1, 56, -1, -1, 93,
+ 50, -1, -1, -1, -1, -1, -1, -1, -1, 93,
94, 95, 96, 97, 98, 99, 66, 67, 68, 69,
70, 71, -1, 73, -1, -1, 76, 77, 78, -1,
-1, -1, -1, -1, 50, -1, -1, -1, -1, -1,
@@ -1233,19 +1232,12 @@ static const yytype_int16 yycheck[] =
-1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
-1, 93, 94, 95, 96, 97, 98, 99, 66, 67,
68, 69, 70, 71, -1, 73, -1, -1, 76, 77,
- 78, -1, -1, -1, -1, -1, 50, -1, -1, -1,
- -1, -1, -1, -1, -1, 93, 94, 95, 96, 97,
- 98, 99, 66, 67, 68, 69, 70, 71, -1, 73,
- -1, -1, 76, 77, 78, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 56, -1, -1, 93,
- 94, 95, 96, 97, 98, 99, 66, 67, 68, 69,
- 70, 71, -1, 73, -1, -1, 76, 77, 78, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 56, 93, 94, 95, 96, 97, 98, 99,
- -1, 101, 66, 67, 68, 69, 70, 71, 58, 73,
+ 78, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 56, -1, -1, 93, 94, 95, 96, 97,
+ 98, 99, 66, 67, 68, 69, 70, 71, 58, 73,
-1, -1, 76, 77, 78, -1, 66, 67, 68, 69,
70, 71, -1, 73, -1, -1, 76, 77, 78, 93,
- 94, 95, 96, 97, 98, 99, -1, -1, -1, -1,
+ 94, 95, 96, 97, 98, 99, -1, 101, -1, -1,
-1, -1, -1, 93, 94, 95, 96, 97, 98, 99,
66, 67, 68, 69, 70, 71, -1, 73, -1, -1,
76, 77, 78, -1, -1, -1, -1, -1, -1, -1,
@@ -1272,7 +1264,7 @@ static const yytype_uint8 yystos[] =
86, 87, 88, 89, 96, 97, 102, 104, 108, 109,
110, 111, 113, 114, 118, 119, 120, 125, 126, 127,
128, 129, 130, 134, 136, 138, 141, 145, 101, 30,
- 52, 128, 128, 128, 128, 146, 30, 128, 146, 30,
+ 127, 30, 52, 128, 128, 128, 146, 30, 128, 146,
127, 102, 128, 147, 137, 140, 53, 30, 131, 46,
48, 49, 50, 51, 128, 135, 30, 128, 58, 59,
15, 16, 30, 37, 30, 30, 128, 64, 128, 135,
@@ -1282,24 +1274,24 @@ static const yytype_uint8 yystos[] =
68, 69, 70, 71, 73, 76, 77, 78, 93, 94,
95, 96, 97, 98, 99, 122, 102, 128, 106, 146,
128, 146, 106, 146, 122, 106, 128, 48, 135, 139,
- 45, 74, 75, 30, 56, 68, 127, 128, 56, 68,
- 56, 55, 58, 135, 106, 50, 56, 50, 56, 50,
- 56, 50, 56, 84, 85, 106, 30, 103, 105, 109,
- 123, 128, 123, 123, 128, 56, 101, 128, 128, 128,
+ 45, 74, 75, 30, 56, 68, 127, 56, 68, 56,
+ 55, 58, 135, 106, 50, 56, 50, 56, 50, 56,
+ 50, 56, 84, 85, 106, 30, 103, 105, 109, 123,
+ 128, 123, 123, 128, 56, 101, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 30, 142, 128, 103, 128, 142,
- 30, 128, 122, 30, 129, 128, 128, 128, 128, 68,
- 56, 128, 128, 128, 128, 30, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 30, 103, 106, 124,
- 123, 55, 123, 128, 124, 101, 106, 101, 142, 128,
- 128, 50, 50, 50, 50, 146, 101, 113, 123, 38,
- 56, 124, 55, 123, 106, 144, 30, 144, 101, 128,
- 128, 128, 128, 103, 91, 56, 128, 123, 111, 92,
- 30, 124, 124, 144, 128, 123, 40, 115, 116, 121,
- 123, 34, 124, 123, 124, 39, 123, 115, 128, 39,
- 90, 30, 143, 124, 123, 122, 90, 123, 122, 106,
- 123, 91, 124, 55, 111, 30, 91, 123, 124, 123,
- 90, 123, 90
+ 128, 128, 128, 30, 142, 128, 103, 128, 142, 30,
+ 128, 122, 30, 129, 128, 128, 128, 128, 56, 68,
+ 128, 128, 128, 128, 30, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 30, 103, 106, 124, 123,
+ 55, 123, 128, 124, 101, 106, 101, 142, 128, 128,
+ 50, 50, 50, 50, 146, 101, 113, 123, 38, 56,
+ 124, 55, 123, 106, 144, 30, 144, 101, 128, 128,
+ 128, 128, 103, 91, 56, 128, 123, 111, 92, 30,
+ 124, 124, 144, 128, 123, 40, 115, 116, 121, 123,
+ 34, 124, 123, 124, 39, 123, 115, 128, 39, 90,
+ 30, 143, 124, 123, 122, 90, 123, 122, 106, 123,
+ 91, 124, 55, 111, 30, 91, 123, 124, 123, 90,
+ 123, 90
};
#define yyerrok (yyerrstatus = 0)
@@ -2985,7 +2977,7 @@ yyreduce:
/* Line 1267 of yacc.c. */
-#line 2989 "engines/director/lingo/lingo-gr.cpp"
+#line 2981 "engines/director/lingo/lingo-gr.cpp"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y
index a818cf41fe..668c52f178 100644
--- a/engines/director/lingo/lingo-gr.y
+++ b/engines/director/lingo/lingo-gr.y
@@ -176,7 +176,7 @@ asgn: tPUT expr tINTO ID {
g_lingo->codeInt($2[0]);
g_lingo->codeInt($2[1]);
$$ = $4; }
- | tSET THEENTITYWITHID expr tTO expr {
+ | tSET THEENTITYWITHID simpleexpr tTO expr {
g_lingo->code1(LC::c_swap);
g_lingo->code1(LC::c_theentityassign);
g_lingo->codeInt($2[0]);
@@ -405,7 +405,7 @@ expr: simpleexpr { $$ = $1; }
WRITE_UINT32(&e, $1[0]);
WRITE_UINT32(&f, $1[1]);
g_lingo->code2(e, f); }
- | THEENTITYWITHID expr {
+ | THEENTITYWITHID simpleexpr {
$$ = g_lingo->code1(LC::c_theentitypush);
inst e = 0, f = 0;
WRITE_UINT32(&e, $1[0]);
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp
index b6f9e63e06..8c192ada77 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 76
-#define YY_END_OF_BUFFER 77
+#define YY_NUM_RULES 75
+#define YY_END_OF_BUFFER 76
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -373,43 +373,42 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[314] =
+static yyconst flex_int16_t yy_accept[307] =
{ 0,
- 0, 0, 77, 75, 4, 73, 73, 75, 75, 75,
- 72, 72, 72, 71, 72, 68, 72, 69, 69, 69,
- 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
- 69, 69, 69, 69, 75, 3, 3, 69, 4, 73,
- 0, 0, 0, 74, 5, 67, 2, 70, 71, 66,
- 64, 65, 69, 69, 69, 69, 69, 69, 69, 69,
- 69, 69, 69, 22, 13, 69, 69, 69, 69, 69,
- 69, 69, 69, 69, 35, 36, 69, 38, 69, 69,
- 69, 69, 69, 69, 69, 69, 69, 57, 69, 69,
- 69, 1, 3, 3, 0, 69, 5, 2, 70, 69,
-
- 7, 69, 69, 69, 69, 69, 69, 16, 69, 69,
- 0, 69, 69, 69, 69, 69, 69, 69, 31, 69,
- 69, 34, 69, 69, 69, 69, 44, 69, 46, 69,
- 69, 69, 69, 69, 69, 69, 69, 0, 69, 69,
- 69, 9, 69, 11, 12, 15, 0, 18, 69, 0,
- 69, 69, 25, 26, 27, 28, 69, 69, 69, 33,
- 37, 40, 69, 69, 69, 69, 69, 48, 0, 56,
- 61, 69, 59, 63, 0, 69, 6, 69, 69, 0,
- 16, 69, 21, 69, 69, 29, 69, 32, 0, 69,
- 69, 69, 69, 69, 69, 55, 55, 55, 55, 55,
-
- 62, 69, 0, 69, 8, 69, 0, 16, 19, 0,
- 69, 69, 69, 0, 69, 69, 69, 45, 58, 47,
- 0, 0, 55, 55, 55, 55, 60, 0, 69, 69,
- 14, 0, 69, 69, 0, 30, 0, 69, 69, 69,
- 0, 0, 0, 0, 55, 55, 55, 55, 0, 17,
- 10, 0, 23, 69, 30, 30, 0, 69, 42, 43,
- 0, 0, 0, 55, 55, 55, 55, 17, 0, 69,
- 30, 0, 41, 0, 0, 0, 0, 55, 0, 55,
- 0, 24, 39, 54, 53, 54, 0, 0, 55, 0,
- 0, 0, 20, 53, 0, 0, 0, 0, 0, 49,
-
- 0, 0, 50, 51, 0, 51, 0, 53, 0, 53,
- 0, 52, 0
+ 0, 0, 76, 74, 4, 72, 72, 74, 74, 74,
+ 71, 71, 71, 70, 71, 67, 71, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 74, 3, 3, 68, 4, 72,
+ 0, 0, 0, 73, 5, 66, 2, 69, 70, 65,
+ 63, 64, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 22, 13, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 35, 36, 68, 38, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 56, 68, 68,
+ 68, 1, 3, 3, 0, 68, 5, 2, 69, 68,
+
+ 7, 68, 68, 68, 68, 68, 68, 16, 68, 68,
+ 0, 68, 68, 68, 68, 68, 68, 68, 31, 68,
+ 68, 34, 68, 68, 68, 68, 44, 68, 46, 68,
+ 68, 68, 68, 68, 68, 68, 68, 0, 68, 68,
+ 68, 9, 68, 11, 12, 15, 0, 18, 68, 0,
+ 68, 68, 25, 26, 27, 28, 68, 68, 68, 33,
+ 37, 40, 68, 68, 68, 68, 68, 48, 0, 55,
+ 60, 68, 58, 62, 0, 68, 6, 68, 68, 0,
+ 16, 68, 21, 68, 68, 29, 68, 32, 0, 68,
+ 68, 68, 68, 68, 68, 54, 54, 54, 54, 61,
+
+ 68, 0, 68, 8, 68, 0, 16, 19, 0, 68,
+ 68, 68, 0, 68, 68, 68, 45, 57, 47, 0,
+ 0, 54, 54, 54, 59, 0, 68, 68, 14, 0,
+ 68, 68, 0, 30, 0, 68, 68, 68, 0, 0,
+ 0, 0, 54, 54, 54, 0, 17, 10, 0, 23,
+ 68, 30, 30, 0, 68, 42, 43, 0, 0, 0,
+ 54, 54, 54, 17, 0, 68, 30, 0, 41, 0,
+ 0, 0, 54, 0, 54, 0, 24, 39, 53, 52,
+ 53, 54, 0, 0, 0, 20, 52, 0, 0, 0,
+ 0, 0, 0, 49, 50, 0, 50, 0, 52, 0,
+
+ 52, 0, 0, 51, 51, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -455,18 +454,18 @@ static yyconst flex_int32_t yy_meta[66] =
5, 5, 5, 5, 1
} ;
-static yyconst flex_int16_t yy_base[330] =
+static yyconst flex_int16_t yy_base[323] =
{ 0,
- 0, 64, 436, 834, 68, 834, 834, 72, 428, 0,
- 834, 406, 390, 55, 63, 834, 365, 59, 59, 59,
+ 0, 64, 485, 800, 68, 800, 800, 72, 474, 0,
+ 800, 427, 419, 55, 63, 800, 365, 59, 59, 59,
55, 63, 0, 64, 75, 70, 100, 77, 110, 102,
- 98, 129, 128, 131, 83, 166, 187, 293, 191, 834,
- 195, 144, 320, 834, 0, 834, 0, 305, 160, 834,
- 834, 834, 0, 66, 131, 156, 162, 74, 173, 149,
+ 98, 129, 128, 131, 83, 166, 187, 293, 191, 800,
+ 195, 144, 320, 800, 0, 800, 0, 305, 160, 800,
+ 800, 800, 0, 66, 131, 156, 162, 74, 173, 149,
167, 180, 156, 91, 0, 174, 193, 172, 186, 198,
184, 200, 183, 188, 0, 0, 203, 0, 211, 208,
192, 210, 209, 215, 233, 228, 236, 0, 238, 231,
- 234, 834, 290, 294, 271, 225, 0, 0, 223, 237,
+ 234, 800, 290, 294, 271, 225, 0, 0, 223, 237,
0, 246, 244, 243, 243, 251, 260, 213, 250, 268,
268, 270, 286, 282, 266, 283, 282, 284, 0, 292,
@@ -474,68 +473,68 @@ static yyconst flex_int16_t yy_base[330] =
295, 303, 346, 307, 326, 307, 337, 177, 147, 328,
329, 0, 341, 0, 0, 269, 361, 0, 347, 337,
348, 335, 0, 0, 0, 0, 339, 340, 350, 0,
- 0, 371, 347, 357, 362, 339, 346, 0, 412, 0,
- 0, 363, 362, 0, 107, 91, 0, 374, 375, 405,
- 0, 375, 406, 387, 384, 0, 386, 0, 422, 403,
- 389, 388, 393, 402, 395, 449, 462, 456, 466, 472,
-
- 0, 403, 86, 79, 0, 404, 413, 0, 0, 473,
- 418, 459, 481, 451, 462, 449, 452, 0, 0, 0,
- 495, 468, 497, 491, 519, 531, 0, 42, 20, 476,
- 834, 485, 491, 504, 530, 0, 509, 507, 504, 499,
- 542, 528, 524, 525, 554, 555, 564, 575, 18, 0,
- 0, 544, 0, 532, 0, 0, 540, 551, 0, 0,
- 544, 579, 555, 585, 595, 599, 610, 834, 565, 560,
- 0, 587, 0, 593, 617, 600, 622, 627, 623, 645,
- 605, 0, 834, 834, 0, 834, 643, 612, 659, 660,
- 616, 673, 834, 0, 669, 681, 683, 687, 632, 689,
-
- 693, 658, 694, 702, 704, 708, 710, 717, 675, 726,
- 577, 834, 834, 767, 769, 772, 775, 781, 786, 791,
- 793, 798, 803, 806, 809, 814, 817, 822, 827
+ 0, 371, 347, 357, 362, 339, 346, 0, 382, 0,
+ 0, 374, 375, 0, 107, 91, 0, 380, 377, 404,
+ 0, 380, 410, 379, 376, 0, 394, 0, 416, 398,
+ 392, 390, 389, 407, 399, 439, 450, 456, 454, 0,
+
+ 416, 86, 79, 0, 421, 415, 0, 0, 468, 432,
+ 446, 470, 432, 449, 441, 443, 0, 0, 0, 479,
+ 459, 493, 495, 515, 0, 42, 20, 448, 800, 454,
+ 470, 488, 517, 0, 506, 505, 479, 489, 525, 514,
+ 512, 510, 539, 559, 560, 18, 0, 0, 526, 0,
+ 504, 0, 0, 519, 523, 0, 0, 519, 570, 539,
+ 571, 575, 585, 800, 555, 550, 0, 565, 0, 567,
+ 595, 568, 599, 610, 600, 577, 0, 800, 800, 0,
+ 800, 614, 620, 581, 631, 800, 0, 632, 624, 633,
+ 599, 642, 621, 637, 652, 668, 673, 677, 679, 658,
+
+ 692, 612, 667, 800, 800, 800, 733, 735, 738, 741,
+ 747, 752, 757, 759, 764, 769, 772, 775, 780, 783,
+ 788, 793
} ;
-static yyconst flex_int16_t yy_def[330] =
+static yyconst flex_int16_t yy_def[323] =
{ 0,
- 313, 1, 313, 313, 313, 313, 313, 313, 314, 315,
- 313, 313, 313, 313, 313, 313, 313, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 313, 313, 313, 316, 313, 313,
- 313, 313, 314, 313, 317, 313, 318, 313, 313, 313,
- 313, 313, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 313, 313, 313, 313, 316, 317, 318, 313, 316,
-
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 313, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 313, 316, 316,
- 316, 316, 316, 316, 316, 316, 319, 316, 316, 313,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 320, 316,
- 316, 316, 316, 316, 313, 316, 316, 316, 316, 313,
- 321, 316, 313, 316, 316, 316, 316, 316, 313, 316,
- 316, 316, 316, 316, 316, 320, 320, 320, 320, 320,
-
- 316, 316, 313, 316, 316, 316, 313, 321, 316, 313,
- 316, 316, 322, 313, 316, 316, 316, 316, 316, 316,
- 313, 313, 320, 320, 320, 320, 316, 313, 316, 316,
- 313, 313, 316, 316, 323, 324, 313, 316, 316, 316,
- 313, 313, 313, 313, 320, 320, 320, 320, 313, 316,
- 316, 313, 316, 316, 325, 324, 313, 316, 316, 316,
- 313, 313, 313, 320, 320, 320, 320, 313, 313, 316,
- 325, 313, 316, 313, 326, 313, 313, 320, 313, 320,
- 313, 316, 313, 313, 327, 313, 313, 313, 320, 313,
- 313, 313, 313, 327, 313, 313, 313, 313, 313, 326,
-
- 313, 313, 326, 313, 313, 326, 328, 329, 313, 329,
- 313, 313, 0, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313
+ 306, 1, 306, 306, 306, 306, 306, 306, 307, 308,
+ 306, 306, 306, 306, 306, 306, 306, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 306, 306, 306, 309, 306, 306,
+ 306, 306, 307, 306, 310, 306, 311, 306, 306, 306,
+ 306, 306, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 306, 306, 306, 306, 309, 310, 311, 306, 309,
+
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 306, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 306, 309, 309,
+ 309, 309, 309, 309, 309, 309, 312, 309, 309, 306,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 313, 309,
+ 309, 309, 309, 309, 306, 309, 309, 309, 309, 306,
+ 314, 309, 306, 309, 309, 309, 309, 309, 306, 309,
+ 309, 309, 309, 309, 309, 313, 313, 313, 313, 309,
+
+ 309, 306, 309, 309, 309, 306, 314, 309, 306, 309,
+ 309, 315, 306, 309, 309, 309, 309, 309, 309, 306,
+ 306, 313, 313, 313, 309, 306, 309, 309, 306, 306,
+ 309, 309, 316, 317, 306, 309, 309, 309, 306, 306,
+ 306, 306, 313, 313, 313, 306, 309, 309, 306, 309,
+ 309, 318, 317, 306, 309, 309, 309, 306, 306, 306,
+ 313, 313, 313, 306, 306, 309, 318, 306, 309, 306,
+ 319, 306, 313, 306, 313, 306, 309, 306, 306, 320,
+ 306, 313, 306, 306, 306, 306, 320, 306, 306, 306,
+ 306, 306, 306, 319, 306, 306, 319, 321, 322, 306,
+
+ 322, 306, 306, 306, 306, 0, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306
} ;
-static yyconst flex_int16_t yy_nxt[900] =
+static yyconst flex_int16_t yy_nxt[866] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 11,
13, 4, 14, 15, 16, 17, 18, 19, 20, 21,
@@ -545,16 +544,16 @@ static yyconst flex_int16_t yy_nxt[900] =
26, 27, 28, 29, 30, 23, 31, 32, 33, 23,
23, 34, 23, 23, 35, 36, 48, 49, 37, 39,
40, 40, 41, 41, 40, 40, 41, 50, 51, 56,
- 54, 268, 57, 250, 59, 92, 92, 55, 58, 60,
- 63, 61, 111, 64, 68, 111, 65, 73, 249, 69,
+ 54, 264, 57, 247, 59, 92, 92, 55, 58, 60,
+ 63, 61, 111, 64, 68, 111, 65, 73, 246, 69,
100, 62, 104, 66, 56, 54, 74, 57, 59, 67,
38, 55, 58, 60, 63, 61, 70, 64, 82, 68,
71, 65, 73, 69, 100, 62, 104, 66, 79, 72,
- 74, 75, 42, 67, 80, 229, 42, 81, 76, 228,
- 77, 70, 78, 82, 204, 71, 92, 92, 86, 83,
+ 74, 75, 42, 67, 80, 227, 42, 81, 76, 226,
+ 77, 70, 78, 82, 203, 71, 92, 92, 86, 83,
101, 87, 79, 72, 89, 90, 75, 88, 80, 84,
- 91, 81, 76, 85, 77, 203, 78, 93, 40, 40,
+ 91, 81, 76, 85, 77, 202, 78, 93, 40, 40,
94, 48, 49, 86, 83, 101, 87, 102, 103, 89,
90, 88, 107, 84, 91, 110, 108, 85, 94, 40,
40, 94, 39, 40, 40, 41, 41, 40, 40, 41,
@@ -578,67 +577,63 @@ static yyconst flex_int16_t yy_nxt[900] =
169, 167, 172, 168, 42, 173, 174, 179, 42, 171,
177, 178, 147, 182, 184, 147, 183, 185, 186, 187,
188, 191, 189, 194, 170, 189, 172, 192, 193, 52,
- 195, 174, 179, 201, 177, 178, 202, 190, 182, 184,
- 183, 185, 186, 187, 205, 188, 191, 194, 170, 206,
-
- 47, 209, 192, 193, 195, 213, 180, 210, 201, 180,
- 210, 202, 190, 169, 46, 211, 169, 212, 216, 205,
- 217, 215, 219, 189, 206, 209, 189, 218, 220, 207,
- 213, 227, 230, 44, 231, 313, 233, 313, 197, 211,
- 198, 212, 216, 214, 217, 199, 215, 219, 200, 313,
- 221, 218, 220, 221, 207, 227, 230, 221, 222, 231,
- 221, 233, 197, 221, 198, 222, 221, 221, 214, 199,
- 221, 222, 200, 221, 210, 222, 221, 210, 223, 234,
- 238, 222, 235, 237, 239, 235, 240, 242, 226, 313,
- 313, 224, 221, 53, 232, 221, 241, 225, 221, 241,
-
- 222, 221, 244, 223, 234, 238, 222, 237, 239, 251,
- 240, 253, 242, 226, 242, 224, 313, 252, 246, 232,
- 221, 225, 254, 221, 243, 257, 244, 258, 222, 244,
- 245, 235, 221, 251, 235, 221, 253, 259, 260, 242,
- 222, 252, 246, 241, 261, 262, 241, 254, 243, 263,
- 257, 247, 258, 244, 245, 221, 221, 248, 221, 221,
- 269, 259, 260, 222, 222, 221, 270, 272, 221, 261,
- 262, 243, 265, 222, 263, 247, 221, 273, 274, 221,
- 275, 248, 276, 275, 222, 269, 277, 313, 264, 277,
- 270, 272, 281, 282, 222, 243, 221, 265, 266, 221,
-
- 279, 273, 274, 279, 222, 312, 276, 283, 222, 313,
- 267, 221, 264, 284, 221, 278, 281, 282, 275, 222,
- 286, 275, 266, 287, 290, 293, 287, 290, 221, 312,
- 280, 221, 283, 295, 267, 313, 222, 297, 284, 313,
- 278, 242, 242, 313, 287, 286, 292, 287, 313, 292,
- 293, 288, 291, 304, 222, 280, 244, 244, 295, 289,
- 296, 290, 297, 296, 290, 313, 242, 242, 222, 313,
- 300, 313, 288, 300, 298, 288, 291, 298, 304, 305,
- 244, 244, 301, 289, 303, 301, 313, 303, 298, 291,
- 300, 298, 242, 300, 301, 303, 288, 301, 303, 311,
-
- 242, 313, 299, 306, 305, 307, 306, 244, 307, 306,
- 302, 307, 306, 291, 307, 244, 299, 242, 309, 313,
- 313, 309, 302, 313, 311, 242, 299, 309, 313, 294,
- 309, 244, 313, 313, 302, 313, 313, 313, 294, 244,
- 299, 313, 313, 313, 313, 313, 302, 313, 313, 313,
- 285, 313, 313, 313, 313, 313, 313, 294, 313, 313,
- 313, 313, 313, 313, 313, 313, 294, 43, 43, 313,
- 43, 43, 43, 45, 45, 53, 53, 53, 97, 97,
- 97, 98, 98, 313, 98, 98, 98, 181, 313, 313,
- 181, 181, 196, 313, 313, 196, 208, 208, 208, 236,
-
- 313, 236, 236, 236, 255, 313, 313, 255, 255, 256,
- 256, 256, 271, 271, 271, 285, 313, 313, 285, 285,
- 294, 294, 294, 308, 313, 313, 308, 308, 310, 313,
- 310, 310, 310, 3, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313
-
+ 195, 174, 179, 169, 177, 178, 169, 190, 182, 184,
+ 183, 185, 186, 187, 200, 188, 191, 194, 170, 201,
+
+ 204, 205, 192, 193, 195, 180, 208, 210, 180, 211,
+ 197, 209, 190, 212, 209, 198, 214, 189, 199, 200,
+ 189, 215, 216, 217, 201, 204, 205, 218, 206, 47,
+ 208, 210, 219, 211, 197, 46, 229, 213, 212, 198,
+ 220, 214, 199, 220, 225, 215, 216, 217, 221, 228,
+ 231, 220, 218, 206, 220, 220, 219, 220, 220, 221,
+ 220, 229, 213, 221, 235, 221, 232, 236, 225, 209,
+ 224, 233, 209, 228, 233, 231, 237, 238, 240, 44,
+ 239, 248, 53, 239, 306, 222, 249, 223, 235, 230,
+ 250, 232, 236, 242, 220, 224, 220, 220, 240, 220,
+
+ 237, 238, 221, 240, 221, 248, 251, 306, 241, 222,
+ 249, 223, 256, 242, 230, 250, 220, 242, 233, 220,
+ 243, 233, 254, 240, 221, 255, 239, 244, 257, 239,
+ 258, 251, 241, 259, 260, 306, 256, 242, 266, 306,
+ 220, 245, 265, 220, 243, 306, 268, 254, 221, 269,
+ 255, 244, 257, 270, 241, 258, 261, 306, 259, 260,
+ 220, 220, 266, 220, 220, 245, 272, 265, 221, 221,
+ 268, 271, 220, 269, 271, 220, 274, 270, 241, 274,
+ 221, 261, 276, 277, 221, 278, 220, 279, 281, 220,
+ 272, 273, 306, 262, 221, 263, 271, 286, 306, 271,
+
+ 220, 285, 289, 220, 285, 275, 276, 277, 221, 221,
+ 278, 283, 279, 281, 283, 288, 273, 262, 288, 263,
+ 295, 283, 286, 221, 283, 294, 306, 289, 294, 240,
+ 275, 282, 290, 292, 290, 290, 292, 290, 294, 284,
+ 304, 294, 296, 292, 242, 295, 292, 306, 306, 284,
+ 240, 240, 306, 297, 240, 282, 297, 306, 306, 306,
+ 291, 293, 291, 284, 304, 242, 242, 296, 242, 298,
+ 306, 293, 298, 284, 297, 240, 240, 297, 298, 306,
+ 300, 298, 302, 300, 291, 293, 291, 303, 305, 242,
+ 242, 287, 306, 300, 306, 293, 300, 306, 306, 306,
+
+ 306, 306, 306, 306, 287, 306, 306, 302, 306, 306,
+ 306, 303, 306, 305, 306, 306, 306, 280, 306, 287,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 287, 43, 43, 306, 43, 43, 43, 45,
+ 45, 53, 53, 53, 97, 97, 97, 98, 98, 306,
+ 98, 98, 98, 181, 306, 306, 181, 181, 196, 306,
+ 306, 196, 207, 207, 207, 234, 306, 234, 234, 234,
+ 252, 306, 306, 252, 252, 253, 253, 253, 267, 267,
+ 267, 280, 306, 306, 280, 280, 287, 287, 287, 299,
+ 306, 306, 299, 299, 301, 306, 301, 301, 301, 3,
+
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306
} ;
-static yyconst flex_int16_t yy_chk[900] =
+static yyconst flex_int16_t yy_chk[866] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -648,13 +643,13 @@ static yyconst flex_int16_t yy_chk[900] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 14, 14, 2, 5,
5, 5, 5, 8, 8, 8, 8, 15, 15, 19,
- 18, 249, 20, 229, 21, 35, 35, 18, 20, 22,
- 24, 22, 64, 24, 26, 64, 25, 28, 228, 26,
+ 18, 246, 20, 227, 21, 35, 35, 18, 20, 22,
+ 24, 22, 64, 24, 26, 64, 25, 28, 226, 26,
54, 22, 58, 25, 19, 18, 28, 20, 21, 25,
2, 18, 20, 22, 24, 22, 27, 24, 31, 26,
27, 25, 28, 26, 54, 22, 58, 25, 30, 27,
- 28, 29, 5, 25, 30, 204, 8, 30, 29, 203,
+ 28, 29, 5, 25, 30, 203, 8, 30, 29, 202,
29, 27, 29, 31, 176, 27, 42, 42, 33, 32,
55, 33, 30, 27, 34, 34, 29, 33, 30, 32,
34, 30, 29, 32, 29, 175, 29, 36, 36, 36,
@@ -681,64 +676,60 @@ static yyconst flex_int16_t yy_chk[900] =
133, 131, 135, 132, 93, 136, 137, 143, 94, 134,
140, 141, 147, 149, 151, 147, 150, 152, 157, 158,
159, 163, 162, 166, 133, 162, 135, 164, 165, 17,
- 167, 137, 143, 172, 140, 141, 173, 162, 149, 151,
- 150, 152, 157, 158, 178, 159, 163, 166, 133, 179,
-
- 13, 182, 164, 165, 167, 187, 180, 183, 172, 180,
- 183, 173, 162, 169, 12, 184, 169, 185, 191, 178,
- 192, 190, 194, 189, 179, 182, 189, 193, 195, 180,
- 187, 202, 206, 9, 207, 3, 211, 0, 169, 184,
- 169, 185, 191, 189, 192, 169, 190, 194, 169, 0,
- 196, 193, 195, 196, 180, 202, 206, 198, 196, 207,
- 198, 211, 169, 197, 169, 198, 197, 199, 189, 169,
- 199, 197, 169, 200, 210, 199, 200, 210, 197, 212,
- 215, 200, 213, 214, 216, 213, 217, 222, 200, 0,
- 0, 198, 224, 213, 210, 224, 221, 199, 223, 221,
-
- 224, 223, 222, 197, 212, 215, 223, 214, 216, 230,
- 217, 233, 222, 200, 221, 198, 0, 232, 224, 210,
- 225, 199, 234, 225, 221, 237, 222, 238, 225, 221,
- 223, 235, 226, 230, 235, 226, 233, 239, 240, 221,
- 226, 232, 224, 241, 242, 243, 241, 234, 221, 244,
- 237, 225, 238, 221, 223, 245, 246, 226, 245, 246,
- 252, 239, 240, 245, 246, 247, 254, 257, 247, 242,
- 243, 241, 246, 247, 244, 225, 248, 258, 261, 248,
- 262, 226, 263, 262, 248, 252, 264, 0, 245, 264,
- 254, 257, 269, 270, 264, 241, 265, 246, 247, 265,
-
- 266, 258, 261, 266, 265, 311, 263, 272, 266, 0,
- 248, 267, 245, 274, 267, 265, 269, 270, 275, 267,
- 276, 275, 247, 277, 279, 281, 277, 279, 278, 311,
- 267, 278, 272, 288, 248, 0, 278, 291, 274, 0,
- 265, 277, 279, 0, 287, 276, 280, 287, 0, 280,
- 281, 277, 279, 299, 280, 267, 277, 279, 288, 278,
- 289, 290, 291, 289, 290, 0, 277, 279, 289, 0,
- 295, 0, 287, 295, 292, 277, 279, 292, 299, 302,
- 277, 279, 296, 278, 297, 296, 0, 297, 298, 290,
- 300, 298, 292, 300, 301, 303, 287, 301, 303, 309,
-
- 296, 0, 292, 304, 302, 305, 304, 292, 305, 306,
- 296, 307, 306, 290, 307, 296, 298, 292, 308, 0,
- 0, 308, 301, 0, 309, 296, 292, 310, 0, 308,
- 310, 292, 0, 0, 296, 0, 0, 0, 310, 296,
- 298, 0, 0, 0, 0, 0, 301, 0, 0, 0,
- 307, 0, 0, 0, 0, 0, 0, 308, 0, 0,
- 0, 0, 0, 0, 0, 0, 310, 314, 314, 0,
- 314, 314, 314, 315, 315, 316, 316, 316, 317, 317,
- 317, 318, 318, 0, 318, 318, 318, 319, 0, 0,
- 319, 319, 320, 0, 0, 320, 321, 321, 321, 322,
-
- 0, 322, 322, 322, 323, 0, 0, 323, 323, 324,
- 324, 324, 325, 325, 325, 326, 0, 0, 326, 326,
- 327, 327, 327, 328, 0, 0, 328, 328, 329, 0,
- 329, 329, 329, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313
-
+ 167, 137, 143, 169, 140, 141, 169, 162, 149, 151,
+ 150, 152, 157, 158, 172, 159, 163, 166, 133, 173,
+
+ 178, 179, 164, 165, 167, 180, 182, 184, 180, 185,
+ 169, 183, 162, 187, 183, 169, 190, 189, 169, 172,
+ 189, 191, 192, 193, 173, 178, 179, 194, 180, 13,
+ 182, 184, 195, 185, 169, 12, 206, 189, 187, 169,
+ 196, 190, 169, 196, 201, 191, 192, 193, 196, 205,
+ 210, 197, 194, 180, 197, 199, 195, 198, 199, 197,
+ 198, 206, 189, 199, 213, 198, 211, 214, 201, 209,
+ 199, 212, 209, 205, 212, 210, 215, 216, 221, 9,
+ 220, 228, 212, 220, 3, 197, 230, 198, 213, 209,
+ 231, 211, 214, 221, 222, 199, 223, 222, 220, 223,
+
+ 215, 216, 222, 221, 223, 228, 232, 0, 220, 197,
+ 230, 198, 237, 220, 209, 231, 224, 221, 233, 224,
+ 222, 233, 235, 220, 224, 236, 239, 223, 238, 239,
+ 240, 232, 220, 241, 242, 0, 237, 220, 251, 0,
+ 243, 224, 249, 243, 222, 0, 254, 235, 243, 255,
+ 236, 223, 238, 258, 239, 240, 243, 0, 241, 242,
+ 244, 245, 251, 244, 245, 224, 260, 249, 244, 245,
+ 254, 259, 261, 255, 259, 261, 262, 258, 239, 262,
+ 261, 243, 265, 266, 262, 268, 263, 270, 272, 263,
+ 260, 261, 0, 244, 263, 245, 271, 276, 0, 271,
+
+ 273, 275, 284, 273, 275, 263, 265, 266, 273, 275,
+ 268, 274, 270, 272, 274, 282, 261, 244, 282, 245,
+ 291, 283, 276, 282, 283, 289, 0, 284, 289, 274,
+ 263, 273, 285, 288, 290, 285, 288, 290, 294, 274,
+ 302, 294, 293, 292, 274, 291, 292, 0, 0, 283,
+ 285, 288, 0, 295, 274, 273, 295, 0, 0, 0,
+ 285, 288, 290, 274, 302, 285, 288, 293, 274, 296,
+ 0, 292, 296, 283, 297, 285, 288, 297, 298, 0,
+ 299, 298, 300, 299, 285, 288, 290, 300, 303, 285,
+ 288, 299, 0, 301, 0, 292, 301, 0, 0, 0,
+
+ 0, 0, 0, 0, 301, 0, 0, 300, 0, 0,
+ 0, 300, 0, 303, 0, 0, 0, 298, 0, 299,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 301, 307, 307, 0, 307, 307, 307, 308,
+ 308, 309, 309, 309, 310, 310, 310, 311, 311, 0,
+ 311, 311, 311, 312, 0, 0, 312, 312, 313, 0,
+ 0, 313, 314, 314, 314, 315, 0, 315, 315, 315,
+ 316, 0, 0, 316, 316, 317, 317, 317, 318, 318,
+ 318, 319, 0, 0, 319, 319, 320, 320, 320, 321,
+ 0, 0, 321, 321, 322, 0, 322, 322, 322, 306,
+
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306
} ;
static yy_state_type yy_last_accepting_state;
@@ -827,7 +818,7 @@ static int checkImmediate(int token) {
return token;
}
-#line 831 "engines/director/lingo/lingo-lex.cpp"
+#line 822 "engines/director/lingo/lingo-lex.cpp"
#define INITIAL 0
@@ -1013,7 +1004,7 @@ YY_DECL
#line 87 "engines/director/lingo/lingo-lex.l"
-#line 1017 "engines/director/lingo/lingo-lex.cpp"
+#line 1008 "engines/director/lingo/lingo-lex.cpp"
if ( !(yy_init) )
{
@@ -1067,13 +1058,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 >= 314 )
+ if ( yy_current_state >= 307 )
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_current_state != 313 );
+ while ( yy_current_state != 306 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
@@ -1367,7 +1358,7 @@ YY_RULE_SETUP
{
count();
- yylval.e[0] = g_lingo->_theEntities["last"]->entity;
+ yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity;
yylval.e[1] = 0; // No field
return THEENTITYWITHID;
@@ -1379,26 +1370,14 @@ YY_RULE_SETUP
{
count();
- yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity;
- yylval.e[1] = 0; // No field
-
- return THEENTITYWITHID;
- }
- YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 182 "engines/director/lingo/lingo-lex.l"
-{
- count();
-
yylval.s = new Common::String("value");
return FBLTINONEARG;
}
YY_BREAK
-case 52:
+case 51:
YY_RULE_SETUP
-#line 189 "engines/director/lingo/lingo-lex.l"
+#line 181 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1423,9 +1402,9 @@ YY_RULE_SETUP
error("LEXER: Unhandled chunk expression '%s'", yylval.s->c_str());
}
YY_BREAK
-case 53:
+case 52:
YY_RULE_SETUP
-#line 212 "engines/director/lingo/lingo-lex.l"
+#line 204 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1480,9 +1459,9 @@ YY_RULE_SETUP
warning("LEXER: Unhandled the entity '%s', field '%s'", ptr, field.c_str());
}
YY_BREAK
-case 54:
+case 53:
YY_RULE_SETUP
-#line 265 "engines/director/lingo/lingo-lex.l"
+#line 257 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1515,9 +1494,9 @@ YY_RULE_SETUP
return THEENTITY;
}
YY_BREAK
-case 55:
+case 54:
YY_RULE_SETUP
-#line 296 "engines/director/lingo/lingo-lex.l"
+#line 288 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1538,74 +1517,74 @@ YY_RULE_SETUP
warning("LEXER: Unhandled the entity '%s'", ptr);
}
YY_BREAK
-case 56:
+case 55:
YY_RULE_SETUP
-#line 315 "engines/director/lingo/lingo-lex.l"
+#line 307 "engines/director/lingo/lingo-lex.l"
{ count(); return tTHEN; }
YY_BREAK
-case 57:
+case 56:
YY_RULE_SETUP
-#line 316 "engines/director/lingo/lingo-lex.l"
+#line 308 "engines/director/lingo/lingo-lex.l"
{ count(); return tTO; }
YY_BREAK
-case 58:
+case 57:
YY_RULE_SETUP
-#line 317 "engines/director/lingo/lingo-lex.l"
+#line 309 "engines/director/lingo/lingo-lex.l"
{ count(); return tSPRITE; }
YY_BREAK
-case 59:
+case 58:
YY_RULE_SETUP
-#line 318 "engines/director/lingo/lingo-lex.l"
+#line 310 "engines/director/lingo/lingo-lex.l"
{ count(); return tWITH; }
YY_BREAK
-case 60:
+case 59:
YY_RULE_SETUP
-#line 319 "engines/director/lingo/lingo-lex.l"
+#line 311 "engines/director/lingo/lingo-lex.l"
{ count(); return tWITHIN; }
YY_BREAK
-case 61:
+case 60:
YY_RULE_SETUP
-#line 320 "engines/director/lingo/lingo-lex.l"
+#line 312 "engines/director/lingo/lingo-lex.l"
{ count(); return tWHEN; }
YY_BREAK
-case 62:
+case 61:
YY_RULE_SETUP
-#line 321 "engines/director/lingo/lingo-lex.l"
+#line 313 "engines/director/lingo/lingo-lex.l"
{ count(); return tWHILE; }
YY_BREAK
-case 63:
+case 62:
YY_RULE_SETUP
-#line 322 "engines/director/lingo/lingo-lex.l"
+#line 314 "engines/director/lingo/lingo-lex.l"
{ count(); return tWORD; }
YY_BREAK
-case 64:
+case 63:
YY_RULE_SETUP
-#line 324 "engines/director/lingo/lingo-lex.l"
+#line 316 "engines/director/lingo/lingo-lex.l"
{ count(); return tNEQ; }
YY_BREAK
-case 65:
+case 64:
YY_RULE_SETUP
-#line 325 "engines/director/lingo/lingo-lex.l"
+#line 317 "engines/director/lingo/lingo-lex.l"
{ count(); return tGE; }
YY_BREAK
-case 66:
+case 65:
YY_RULE_SETUP
-#line 326 "engines/director/lingo/lingo-lex.l"
+#line 318 "engines/director/lingo/lingo-lex.l"
{ count(); return tLE; }
YY_BREAK
-case 67:
+case 66:
YY_RULE_SETUP
-#line 327 "engines/director/lingo/lingo-lex.l"
+#line 319 "engines/director/lingo/lingo-lex.l"
{ count(); return tCONCAT; }
YY_BREAK
-case 68:
+case 67:
YY_RULE_SETUP
-#line 328 "engines/director/lingo/lingo-lex.l"
+#line 320 "engines/director/lingo/lingo-lex.l"
{ count(); return tEQ; }
YY_BREAK
-case 69:
+case 68:
YY_RULE_SETUP
-#line 330 "engines/director/lingo/lingo-lex.l"
+#line 322 "engines/director/lingo/lingo-lex.l"
{
count();
yylval.s = new Common::String(yytext);
@@ -1661,43 +1640,43 @@ YY_RULE_SETUP
return ID;
}
YY_BREAK
-case 70:
+case 69:
YY_RULE_SETUP
-#line 384 "engines/director/lingo/lingo-lex.l"
+#line 376 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.f = atof(yytext); return FLOAT; }
YY_BREAK
-case 71:
+case 70:
YY_RULE_SETUP
-#line 385 "engines/director/lingo/lingo-lex.l"
+#line 377 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; }
YY_BREAK
-case 72:
+case 71:
YY_RULE_SETUP
-#line 386 "engines/director/lingo/lingo-lex.l"
+#line 378 "engines/director/lingo/lingo-lex.l"
{ count(); return *yytext; }
YY_BREAK
-case 73:
-/* rule 73 can match eol */
+case 72:
+/* rule 72 can match eol */
YY_RULE_SETUP
-#line 387 "engines/director/lingo/lingo-lex.l"
+#line 379 "engines/director/lingo/lingo-lex.l"
{ count(); return '\n'; }
YY_BREAK
-case 74:
+case 73:
YY_RULE_SETUP
-#line 388 "engines/director/lingo/lingo-lex.l"
+#line 380 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
YY_BREAK
-case 75:
+case 74:
YY_RULE_SETUP
-#line 389 "engines/director/lingo/lingo-lex.l"
+#line 381 "engines/director/lingo/lingo-lex.l"
{ count(); }
YY_BREAK
-case 76:
+case 75:
YY_RULE_SETUP
-#line 391 "engines/director/lingo/lingo-lex.l"
+#line 383 "engines/director/lingo/lingo-lex.l"
ECHO;
YY_BREAK
-#line 1701 "engines/director/lingo/lingo-lex.cpp"
+#line 1680 "engines/director/lingo/lingo-lex.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1991,7 +1970,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 >= 314 )
+ if ( yy_current_state >= 307 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -2019,11 +1998,11 @@ 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 >= 314 )
+ if ( yy_current_state >= 307 )
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 == 313);
+ yy_is_jam = (yy_current_state == 306);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -2657,7 +2636,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 391 "engines/director/lingo/lingo-lex.l"
+#line 383 "engines/director/lingo/lingo-lex.l"
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index fc554259a9..cb07b80a95 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -163,14 +163,6 @@ whitespace [\t ]
(?i:set) { count(); return tSET; }
(?i:starts) { count(); return tSTARTS; }
(?i:tell) { count(); return tTELL; }
-(?i:the[ \t]+last[\t ]+of[\t ]+) {
- count();
-
- yylval.e[0] = g_lingo->_theEntities["last"]->entity;
- yylval.e[1] = 0; // No field
-
- return THEENTITYWITHID;
- }
(?i:the[ \t]+sqrt[\t ]+of[\t ]+) {
count();
@@ -186,7 +178,7 @@ whitespace [\t ]
return FBLTINONEARG;
}
-(?i:the[ \t]+number[\t ]+of[\t ]+[[:alpha:]]+[\t ]in) {
+(?i:the[ \t]+number[\t ]+of[\t ]+[[:alpha:]]+[\t ](in|of)) {
count();
const char *ptr = &yytext[4]; // Skip 'the '
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index c46f360c64..79ea2f2866 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -41,7 +41,6 @@ TheEntity entities[] = {
{ kTheCast, "cast", true, 2 }, // D2
{ kTheCastMembers, "castmembers", false, 3 }, // D3
{ kTheCenterStage, "centerStage", false, 2 }, // D2 p
- { kTheChars, "chars", false, 3 }, // D3
{ kTheCheckBoxAccess, "checkBoxAccess", false, 2 }, // D2 p
{ kTheCheckBoxType, "checkBoxType", false, 2 }, // D2 p
{ kTheClickLoc, "clickLoc", false, 4 }, // D4 function
@@ -64,7 +63,6 @@ TheEntity entities[] = {
{ kTheFreeBytes, "freeBytes", false, 2 }, // D2 f
{ kTheFullColorPermit, "fullColorPermit", false, 2 }, // D2 p
{ kTheImageDirect, "imageDirect", false, 2 }, // D2 p
- { kTheItems, "items", false, 3 }, // D3
{ kTheItemDelimiter, "itemDelimiter", false, 4 }, // D4 p
{ kTheKey, "key", false, 2 }, // D2 f
{ kTheKeyCode, "keyCode", false, 2 }, // D2 f
@@ -76,12 +74,10 @@ TheEntity entities[] = {
{ kTheLastFrame, "lastFrame", false, 4 }, // D4 p
{ kTheLastKey, "lastKey", false, 2 }, // D2 f
{ kTheLastRoll, "lastRoll", false, 2 }, // D2 f
- { kTheLines, "lines", false, 3 }, // D3
{ kTheMachineType, "machineType", false, 2 }, // D2 f
- { kTheMaxInteger, "maxInteger", false, 4 }, // D4 f
+ { kTheMaxInteger, "maxInteger", false, 3 }, // D3.1 f
{ kTheMemorySize, "memorySize", false, 2 }, // D2 f
{ kTheMenu, "menu", true, 3 }, // D3 p
- { kTheMenus, "menus", false, 3 }, // D3 p
{ kTheMenuItem, "menuitem", true, 3 }, // D3 p
{ kTheMenuItems, "menuitems", false, 3 }, // D3 f
{ kTheMouseCast, "mouseCast", false, 3 }, // D3 f
@@ -100,20 +96,21 @@ TheEntity entities[] = {
{ kTheMovieFileSize, "movieFileSize", false, 4 }, // D4 f
{ kTheMovieName, "movieName", false, 4 }, // D4 f
{ kTheMoviePath, "moviePath", false, 4 }, // D4 f
- { kTheMultiSound, "multiSound", false, 4 }, // D4 p
+ { kTheMultiSound, "multiSound", false, 3 }, // D3.1 f
{ kTheOptionDown, "optionDown", false, 2 }, // D2 f
{ kTheParamCount, "paramCount", false, 4 }, // D4 f
{ kThePathName, "pathName", false, 2 }, // D2 f
{ kThePauseState, "pauseState", false, 2 }, // D2 f
+ { kThePi, "pi", false, 4 }, // D4 f
{ kThePerFrameHook, "perFrameHook", false, 2 }, // D2 p
{ kThePreloadEventAbort,"preloadEventAbort",false, 4 }, // D4 p
{ kThePreLoadRAM, "preLoadRAM", false, 4 }, // D4 p
- { kTheQuickTimePresent, "quickTimePresent", false, 4 }, // D4 f
+ { kTheQuickTimePresent, "quickTimePresent", false, 3 }, // D3.1 f
{ kTheRandomSeed, "randomSeed", false, 4 }, // D4 p
{ kTheResult, "result", false, 2 }, // D2 f
{ kTheRightMouseDown, "rightMouseDown", false, 5 }, // D5 f
{ kTheRightMouseUp, "rightMouseUp", false, 5 }, // D5 f
- { kTheRomanLingo, "romanLingo", false, 4 }, // D4 p
+ { kTheRomanLingo, "romanLingo", false, 3 }, // D3.1 p
{ kTheSearchCurrentFolder,"searchCurrentFolder",false,4 },// D4 f
{ kTheSearchPath, "searchPath", false, 4 }, // D4 f
{ kTheSelection, "selection", false, 2 }, // D2 f
@@ -147,7 +144,6 @@ TheEntity entities[] = {
{ kTheUpdateMovieEnabled,"updateMovieEnabled",false,4 },// D4 p
{ kTheWindow, "window", true, 4 }, // D4
{ kTheWindowList, "windowList", false, 4 }, // D4 p
- { kTheWords, "words", false, 3 }, // D3
{ kTheNOEntity, NULL, false, 0 }
};
@@ -168,21 +164,16 @@ TheEntityField fields[] = {
{ kTheSprite, "locH", kTheLocH, 2 },// D2 p
{ kTheSprite, "locV", kTheLocV, 2 },// D2 p
{ kTheSprite, "moveableSprite",kTheMoveableSprite,4 },// D4 p
- { kTheSprite, "movieRate", kTheMovieRate, 4 },// D4 P
- { kTheSprite, "movieTime", kTheMovieTime, 4 },// D4 P
{ kTheSprite, "pattern", kThePattern, 2 },// D2 p
{ kTheSprite, "puppet", kThePuppet, 2 },// D2 p
{ kTheSprite, "right", kTheRight, 2 },// D2 p
{ kTheSprite, "scoreColor", kTheScoreColor, 4 },// D4 p
{ kTheSprite, "scriptNum", kTheScriptNum, 4 },// D4 p
- { kTheSprite, "startTime", kTheStartTime, 4 },// D4 p
{ kTheSprite, "stretch", kTheStrech, 2 },// D2 p
- { kTheSprite, "stopTime", kTheStopTime, 4 },// D4 p
{ kTheSprite, "top", kTheTop, 2 },// D2 p
- { kTheSprite, "trails", kTheTrails, 4 },// D4 p
+ { kTheSprite, "trails", kTheTrails, 3 },// D3.1 p
{ kTheSprite, "type", kTheType, 2 },// D2 p
{ kTheSprite, "visible", kTheVisible, 4 },// D4 p
- { kTheSprite, "volume", kTheVolume, 4 },// D4 p
{ kTheSprite, "width", kTheWidth, 2 },// D2 p
// Common cast fields
@@ -204,16 +195,21 @@ TheEntityField fields[] = {
// Digital video fields
{ kTheCast, "center", kTheCenter, 4 },// D4 p
- { kTheCast, "controller", kTheController, 4 },// D4 p
+ { kTheCast, "controller", kTheController, 3 },// D3.1 p
{ kTheCast, "crop", kTheCrop, 4 },// D4 p
- { kTheCast, "directToStage",kTheDirectToStage,4 },// D4 p
- { kTheCast, "duration", kTheDuration, 4 },// D4 p
+ { kTheCast, "directToStage",kTheDirectToStage,3 },// D3.1 p
+ { kTheCast, "duration", kTheDuration, 3 },// D3.1 p
{ kTheCast, "frameRate", kTheFrameRate, 4 },// D4 p
- { kTheCast, "loop", kTheLoop, 4 },// D4 p
+ { kTheCast, "loop", kTheLoop, 3 },// D3.1 p
+ { kTheSprite, "movieRate", kTheMovieRate, 3 },// D3.1 P
+ { kTheSprite, "movieTime", kTheMovieTime, 3 },// D3.1 P
{ kTheCast, "pausedAtStart",kThePausedAtStart,4 },// D4 p
- { kTheCast, "preLoad", kThePreLoad, 4 },// D4 p
- { kTheCast, "sound", kTheSound, 4 },// D4 p // 0-1 off-on
+ { kTheCast, "preLoad", kThePreLoad, 3 },// D3.1 p
+ { kTheCast, "sound", kTheSound, 3 },// D3.1 p // 0-1 off-on
+ { kTheSprite, "startTime", kTheStartTime, 3 },// D3.1 p
+ { kTheSprite, "stopTime", kTheStopTime, 3 },// D3.1 p
{ kTheCast, "video", kTheVideo, 4 },// D4 p
+ { kTheSprite, "volume", kTheVolume, 3 },// D3.1 p
// Bitmap fields
{ kTheCast, "depth", kTheDepth, 4 },// D4 p
@@ -251,16 +247,6 @@ TheEntityField fields[] = {
{ kTheMenu, "name", kTheName, 3 },// D3 p
{ kTheCastMembers, "number", kTheNumber, 3 },// D3 p
- { kTheChars, "number", kTheNumber, 3 },// D3 p
- { kTheChars, "last", kTheLast, 4 },// D4 f
- { kTheItems, "number", kTheNumber, 3 },// D3 p
- { kTheItems, "last", kTheLast, 4 },// D4 f
- { kTheLines, "number", kTheNumber, 3 },// D3 p
- { kTheLines, "last", kTheLast, 4 },// D4 f
- { kTheMenuItems,"number", kTheNumber, 3 },// D3 p
- { kTheMenus, "number", kTheNumber, 3 },// D3 p
- { kTheWords, "number", kTheNumber, 3 },// D3 p
- { kTheWords, "last", kTheLast, 4 },// D4 f
{ kTheDate, "short", kTheShort, 3 },// D3 f
{ kTheDate, "long", kTheLong, 3 },// D3 f
@@ -538,6 +524,10 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
d.type = INT;
d.u.i = _vm->getCurrentScore()->_mouseIsDown;
break;
+ case kThePi:
+ d.type = FLOAT;
+ d.u.f = M_PI;
+ break;
default:
warning("Lingo::getTheEntity(): Unprocessed getting field %d of entity %d", field, entity);
d.type = VOID;
@@ -685,8 +675,6 @@ Datum Lingo::getTheCast(Datum &id1, int field) {
}
return d;
- } else {
- warning("Lingo::getTheCast(): The cast %d found", id);
}
castType = _vm->getCurrentScore()->_loadedCast->getVal(id)->_type;
diff --git a/engines/director/lingo/lingo-the.h b/engines/director/lingo/lingo-the.h
index c4306d4416..9857adb9d9 100644
--- a/engines/director/lingo/lingo-the.h
+++ b/engines/director/lingo/lingo-the.h
@@ -99,6 +99,7 @@ enum TheEntityType {
kThePathName,
kThePauseState,
kThePerFrameHook,
+ kThePi,
kThePreloadEventAbort,
kThePreLoadRAM,
kTheQuickTimePresent,
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 03533babe6..8935614242 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -301,9 +301,13 @@ int Datum::toInt() {
switch (type) {
case REFERENCE:
toString();
+ // fallthrough
case STRING:
u.i = atoi(u.s->c_str());
break;
+ case VOID:
+ u.i = 0;
+ break;
case INT:
// no-op
break;
@@ -323,9 +327,13 @@ double Datum::toFloat() {
switch (type) {
case REFERENCE:
toString();
+ // fallthrough
case STRING:
u.f = atof(u.s->c_str());
break;
+ case VOID:
+ u.f = 0.0;
+ break;
case INT:
u.f = (double)u.i;
break;
@@ -516,13 +524,13 @@ void Lingo::printAllVars() {
for (SymbolHash::iterator i = _localvars->begin(); i != _localvars->end(); ++i) {
debugN("%s, ", (*i)._key.c_str());
}
- debug("");
+ debugN("\n");
debugN(" Global vars: ");
for (SymbolHash::iterator i = _globalvars.begin(); i != _globalvars.end(); ++i) {
debugN("%s, ", (*i)._key.c_str());
}
- debug("");
+ debugN("\n");
}
} // End of namespace Director
diff --git a/engines/director/lingo/tests/lingotests.lingo b/engines/director/lingo/tests/lingotests
index e69de29bb2..e69de29bb2 100644
--- a/engines/director/lingo/tests/lingotests.lingo
+++ b/engines/director/lingo/tests/lingotests
diff --git a/engines/director/lingo/tests/the.lingo b/engines/director/lingo/tests/the.lingo
index 088502e2a1..bdb56b5f46 100644
--- a/engines/director/lingo/tests/the.lingo
+++ b/engines/director/lingo/tests/the.lingo
@@ -26,3 +26,5 @@ set the windowtype of BlastWindow to 5
set the bottom of x to originV + (the number of lines in someText) * 16
set the bottom of x to originV + (the number of words in someText) * 16
+
+put the number of words of field 1 into field 5
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 4d5f9a9cd4..d0f802a715 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -63,8 +63,13 @@ Archive *DirectorEngine::openMainArchive(const Common::String movie) {
_mainArchive = createArchive();
- if (!_mainArchive->openFile(movie))
- error("Could not open '%s'", movie.c_str());
+ if (!_mainArchive->openFile(movie)) {
+ delete _mainArchive;
+ _mainArchive = nullptr;
+
+ warning("openMainArchive(): Could not open '%s'", movie.c_str());
+ return nullptr;
+ }
return _mainArchive;
}
@@ -256,14 +261,21 @@ void DirectorEngine::clearSharedCast() {
delete _sharedScore;
+ _sharedScore = nullptr;
+
delete _sharedDIB;
delete _sharedSTXT;
delete _sharedSound;
delete _sharedBMP;
+
+ _sharedDIB = nullptr;
+ _sharedSTXT = nullptr;
+ _sharedSound = nullptr;
+ _sharedBMP = nullptr;
}
void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
- if (_sharedScore) {
+ if (_sharedScore && _sharedScore->_movieArchive) {
if (_sharedScore->_movieArchive->getFileName().equalsIgnoreCase(filename))
return;
}
@@ -272,10 +284,6 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
Archive *shardcst = createArchive();
- debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
- debug(0, "@@@@ Loading Shared cast '%s'", filename.c_str());
- debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
-
_sharedDIB = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>;
_sharedSTXT = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>;
_sharedSound = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>;
@@ -284,11 +292,15 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
if (!shardcst->openFile(filename)) {
warning("No shared cast %s", filename.c_str());
- _sharedScore = new Score(this);
+ delete shardcst;
return;
}
+ debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ debug(0, "@@@@ Loading Shared cast '%s'", filename.c_str());
+ debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+
_sharedScore = new Score(this);
_sharedScore->setArchive(shardcst);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 1eb1dcebe6..9f4bbc7b5d 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -50,7 +50,8 @@ const char *scriptTypes[] = {
"SpriteScript",
"FrameScript",
"CastScript",
- "GlobalScript"
+ "GlobalScript",
+ "ScoreScript"
};
const char *scriptType2str(ScriptType scr) {
@@ -66,9 +67,9 @@ const char *scriptType2str(ScriptType scr) {
Score::Score(DirectorEngine *vm) {
_vm = vm;
- _surface = new Graphics::ManagedSurface;
- _trailSurface = new Graphics::ManagedSurface;
- _backSurface = new Graphics::ManagedSurface;
+ _surface = nullptr;
+ _trailSurface = nullptr;
+ _backSurface = nullptr;
_lingo = _vm->getLingo();
_soundManager = _vm->getSoundManager();
_currentMouseDownSpriteId = 0;
@@ -97,8 +98,8 @@ Score::Score(DirectorEngine *vm) {
_movieArchive = nullptr;
- _loadedStxts = new Common::HashMap<int, const Stxt *>();
- _loadedCast = new Common::HashMap<int, Cast *>();
+ _loadedStxts = nullptr;
+ _loadedCast = nullptr;
}
void Score::setArchive(Archive *archive) {
@@ -123,14 +124,12 @@ void Score::loadArchive() {
if (clutList.size() == 0) {
warning("CLUT resource not found, using default Mac palette");
- g_system->getPaletteManager()->setPalette(defaultPalette, 0, 256);
- _vm->setPalette(defaultPalette, 256);
+ _vm->setPalette(-1);
} else {
Common::SeekableSubReadStreamEndian *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]);
debugC(2, kDebugLoading, "****** Loading Palette CLUT");
loadPalette(*pal);
- g_system->getPaletteManager()->setPalette(_vm->getPalette(), 0, _vm->getPaletteColorCount());
}
// Font Directory
@@ -222,6 +221,9 @@ void Score::loadArchive() {
}
Common::Array<uint16> cast = _movieArchive->getResourceIDList(MKTAG('C', 'A', 'S', 't'));
+ if (!_loadedCast)
+ _loadedCast = new Common::HashMap<int, Cast *>();
+
if (cast.size() > 0) {
debugC(2, kDebugLoading, "****** Loading %d CASt resources", cast.size());
@@ -254,6 +256,9 @@ void Score::loadArchive() {
// Now process STXTs
Common::Array<uint16> stxt = _movieArchive->getResourceIDList(MKTAG('S','T','X','T'));
debugC(2, kDebugLoading, "****** Loading %d STXT resources", stxt.size());
+
+ _loadedStxts = new Common::HashMap<int, const Stxt *>();
+
for (Common::Array<uint16>::iterator iterator = stxt.begin(); iterator != stxt.end(); ++iterator) {
_loadedStxts->setVal(*iterator,
new Stxt(*_movieArchive->getResource(MKTAG('S','T','X','T'), *iterator)));
@@ -357,13 +362,13 @@ void Score::loadSpriteImages(bool isSharedCast) {
Score::~Score() {
- if (_surface)
+ if (_surface && _surface->w)
_surface->free();
- if (_trailSurface)
+ if (_trailSurface && _trailSurface->w)
_trailSurface->free();
- if (_backSurface)
+ if (_backSurface && _backSurface->w)
_backSurface->free();
delete _backSurface;
@@ -511,6 +516,9 @@ void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) {
void Score::loadConfig(Common::SeekableSubReadStreamEndian &stream) {
debugC(1, kDebugLoading, "****** Loading Config VWCF");
+ if (debugChannelSet(5, kDebugLoading))
+ stream.hexdump(stream.size());
+
uint16 len = stream.readUint16();
uint16 ver1 = stream.readUint16();
_movieRect = Score::readRect(stream);
@@ -534,13 +542,29 @@ void Score::loadConfig(Common::SeekableSubReadStreamEndian &stream) {
uint16 stageColorG = stream.readUint16();
uint16 stageColorB = stream.readUint16();
+ for (int i = 0; i < 0x0b; i++) {
+ stream.readByte();
+ }
+
+ if (_vm->getVersion() >= 4) {
+ for (int i = 0; i < 0x16; i++) {
+ stream.readByte();
+ }
+
+ int palette = (int16)stream.readUint16();
+ _vm->setPalette(palette - 1);
+
+ for (int i = 0; i < 0x08; i++) {
+ stream.readByte();
+ }
+ }
+
debugC(1, kDebugLoading, "Score::loadConfig(): len: %d, ver: %d, framerate: %d, light: %d, unk: %d, font: %d, size: %d"
", style: %d", len, ver1, _currentFrameRate, lightswitch, unk1, commentFont, commentSize, commentStyle);
debugC(1, kDebugLoading, "Score::loadConfig(): stagecolor: %d, depth: %d, color: %d, rgb: 0x%04x 0x%04x 0x%04x",
_stageColor, bitdepth, color, stageColorR, stageColorG, stageColorB);
if (debugChannelSet(1, kDebugLoading))
_movieRect.debugPrint(1, "Score::loadConfig(): Movie rect: ");
- debugC(1, kDebugLoading, "Score::loadConfig(): %d bytes left", stream.size() - stream.pos());
}
void Score::readVersion(uint32 rid) {
@@ -553,6 +577,8 @@ void Score::readVersion(uint32 rid) {
void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
debugC(1, kDebugLoading, "****** Loading Cast rects VWCR. start: %d, end: %d", _castArrayStart, _castArrayEnd);
+ _loadedCast = new Common::HashMap<int, Cast *>();
+
for (uint16 id = _castArrayStart; id <= _castArrayEnd; id++) {
byte size = stream.readByte();
if (size == 0)
@@ -598,7 +624,7 @@ void Score::setSpriteCasts() {
if (castId == 0)
continue;
- if (_vm->getSharedScore() != nullptr && _vm->getSharedScore()->_loadedCast->contains(castId)) {
+ if (_vm->getSharedScore() && _vm->getSharedScore()->_loadedCast && _vm->getSharedScore()->_loadedCast->contains(castId)) {
_frames[i]->_sprites[j]->_cast = _vm->getSharedScore()->_loadedCast->getVal(castId);
} else if (_loadedCast->contains(castId)) {
_frames[i]->_sprites[j]->_cast = _loadedCast->getVal(castId);
@@ -615,7 +641,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
// TODO: Determine if there really is a minimum size.
// This value was too small for Shape Casts.
if (stream.size() < 10) {
- warning("Score::loadCastData(): CAST data id %d is too small", id);
+ warning("Score::loadCastData(): CASt data id %d is too small", id);
return;
}
@@ -745,12 +771,33 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
CastInfo *ci = new CastInfo();
- if (castStrings.size() >= 5) {
- ci->script = castStrings[0];
- ci->name = castStrings[1];
- ci->directory = castStrings[2];
- ci->fileName = castStrings[3];
+ // We have here variable number of strings. Thus, instead of
+ // adding tons of ifs, we use this switch()
+ switch (castStrings.size()) {
+ default:
+ warning("Score::loadCastData(): extra %d strings", castStrings.size() - 5);
+ // fallthrough
+ case 5:
ci->type = castStrings[4];
+ // fallthrough
+ case 4:
+ ci->fileName = castStrings[3];
+ // fallthrough
+ case 3:
+ ci->directory = castStrings[2];
+ // fallthrough
+ case 2:
+ ci->name = castStrings[1];
+
+ if (!ci->name.empty()) {
+ _castsNames[ci->name] = id;
+ }
+ // fallthrough
+ case 1:
+ ci->script = castStrings[0];
+ // fallthrough
+ case 0:
+ break;
}
// FIXME. Disabled by default, requires --debugflags=bytecode for now
@@ -759,7 +806,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
uint scriptId = ((ScriptCast *)(*_loadedCast)[id])->_id - 1;
if (scriptId < _castScriptIds.size()) {
int resourceId = _castScriptIds[scriptId];
- _lingo->addCodeV4(*_movieArchive->getResource(MKTAG('L', 's', 'c', 'r'), resourceId), kCastScript, id);
+ _lingo->addCodeV4(*_movieArchive->getResource(MKTAG('L', 's', 'c', 'r'), resourceId), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
} else {
warning("Score::loadCastData(): Lingo context missing a resource entry for script %d referenced in cast %d", scriptId, id);
}
@@ -767,9 +814,9 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
if (!ci->script.empty()) {
// the script type here could be wrong!
if (ConfMan.getBool("dump_scripts"))
- dumpScript(ci->script.c_str(), kCastScript, id);
+ dumpScript(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
- _lingo->addCode(ci->script.c_str(), kCastScript, id);
+ _lingo->addCode(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
}
}
@@ -1230,12 +1277,12 @@ Common::Array<Common::String> Score::loadStrings(Common::SeekableSubReadStreamEn
for (uint j = entries[i]; j < entries[i + 1]; j++)
if (data[j] == '\r')
entryString += '\n';
- else
+ else if (j > entries[i] || data[j] >= 0x20) // Skip first byte which is string length
entryString += data[j];
strings.push_back(entryString);
- debugC(6, kDebugLoading, "String %d:\n%s\n", i, entryString.c_str());
+ debugC(6, kDebugLoading, "String %d:\n%s\n", i, Common::toPrintable(entryString).c_str());
}
free(data);
@@ -1292,6 +1339,10 @@ void Score::startLoop() {
initGraphics(_movieRect.width(), _movieRect.height());
+ _surface = new Graphics::ManagedSurface;
+ _trailSurface = new Graphics::ManagedSurface;
+ _backSurface = new Graphics::ManagedSurface;
+
_surface->create(_movieRect.width(), _movieRect.height());
_trailSurface->create(_movieRect.width(), _movieRect.height());
_backSurface->create(_movieRect.width(), _movieRect.height());
@@ -1307,6 +1358,8 @@ void Score::startLoop() {
_stopPlay = false;
_nextFrameTime = 0;
+ _lingo->processEvent(kEventStartMovie);
+
_frames[_currentFrame]->prepareFrame(this);
while (!_stopPlay) {
@@ -1322,6 +1375,8 @@ void Score::startLoop() {
if (_currentFrame < _frames.size())
_vm->processEvents();
}
+
+ _lingo->processEvent(kEventStopMovie);
}
void Score::update() {
@@ -1481,7 +1536,7 @@ void Score::renderZoomBox(bool redraw) {
end = MIN(start + 3 - box->step % 2, 8);
}
- Graphics::MacPlotData pd(_surface, &_vm->_wm->getPatterns(), Graphics::kPatternCheckers, 1, 0);
+ Graphics::MacPlotData pd(_surface, &_vm->_wm->getPatterns(), Graphics::kPatternCheckers, 0, 0, 1, 0);
for (int i = start; i <= end; i++) {
Common::Rect r(box->start.left + (box->end.left - box->start.left) * i / 8,
diff --git a/engines/director/score.h b/engines/director/score.h
index ef7244bf97..d4d402bb3e 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -123,7 +123,7 @@ private:
public:
Common::Array<Frame *> _frames;
Common::HashMap<uint16, CastInfo *> _castsInfo;
- Common::HashMap<Common::String, int> _castsNames;
+ Common::HashMap<Common::String, int, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _castsNames;
Common::SortedArray<Label *> *_labels;
Common::HashMap<uint16, Common::String> _actions;
Common::HashMap<uint16, bool> _immediateActions;
diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index d9f8291761..d953ebadaf 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -129,7 +129,7 @@ uint16 Sprite::getPattern() {
warning("Sprite::getPattern(): Unhandled cast type: %d", _cast->_type);
break;
}
-
+ // fallthrough
default:
return 0;
}
@@ -146,6 +146,7 @@ void Sprite::setPattern(uint16 pattern) {
case kOutlinedRoundedRectangleSprite:
case kOutlinedOvalSprite:
_castId = pattern;
+ break;
case kCastMemberSprite:
// TODO
diff --git a/engines/director/types.h b/engines/director/types.h
index d05cd3b72b..4a9bcc8f4a 100644
--- a/engines/director/types.h
+++ b/engines/director/types.h
@@ -42,13 +42,14 @@ enum CastType {
};
enum ScriptType {
+ kNoneScript = -1,
kMovieScript = 0,
kSpriteScript = 1,
kFrameScript = 2,
kCastScript = 3,
kGlobalScript = 4,
- kNoneScript = -1,
- kMaxScriptType = 4 // Sync with score.cpp:45, array scriptTypes[]
+ kScoreScript = 5,
+ kMaxScriptType = 5 // Sync with score.cpp:45, array scriptTypes[]
};
enum ShapeType {
@@ -71,9 +72,9 @@ enum TextAlignType {
};
enum TextFlag {
- kTextFlagEditable,
- kTextFlagAutoTab,
- kTextFlagDoNotWrap
+ kTextFlagEditable = (1 << 0),
+ kTextFlagAutoTab = (1 << 1),
+ kTextFlagDoNotWrap = (1 << 2)
};
enum SizeType {
@@ -174,6 +175,62 @@ enum LEvent {
kEventStart
};
+enum TransitionType {
+ kTransNone,
+ kTransWipeRight,
+ kTransWipeLeft,
+ kTransWipeDown,
+ kTransWipeUp,
+ kTransCenterOutHorizontal,
+ kTransEdgesInHorizontal,
+ kTransCenterOutVertical,
+ kTransEdgesInVertical,
+ kTransCenterOutSquare,
+ kTransEdgesInSquare,
+ kTransPushLeft,
+ kTransPushRight,
+ kTransPushDown,
+ kTransPushUp,
+ kTransRevealUp,
+ kTransRevealUpRight,
+ kTransRevealRight,
+ kTransRevealDown,
+ kTransRevealDownRight,
+ kTransRevealDownLeft,
+ kTransRevealLeft,
+ kTransRevealUpLeft,
+ kTransDissolvePixelsFast,
+ kTransDissolveBoxyRects,
+ kTransDissolveBoxySquares,
+ kTransDissolvePatterns,
+ kTransRandomRows,
+ kTransRandomColumns,
+ kTransCoverDown,
+ kTransCoverDownLeft,
+ kTransCoverDownRight,
+ kTransCoverLeft,
+ kTransCoverRight,
+ kTransCoverUp,
+ kTransCoverUpLeft,
+ kTransCoverUpRight,
+ kTransTypeVenitianBlind,
+ kTransTypeCheckerboard,
+ kTransTypeStripsBottomBuildLeft,
+ kTransTypeStripsBottomBuildRight,
+ kTransTypeStripsLeftBuildDown,
+ kTransTypeStripsLeftBuildUp,
+ kTransTypeStripsRightBuildDown,
+ kTransTypeStripsRightBuildUp,
+ kTransTypeStripsTopBuildLeft,
+ kTransTypeStripsTopBuildRight,
+ kTransZoomOpen,
+ kTransZoomClose,
+ kTransVerticalBinds,
+ kTransDissolveBitsTrans,
+ kTransDissolvePixels,
+ kTransDissolveBits
+};
+
const char *scriptType2str(ScriptType scr);
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index a5434fb65f..ac4cc91bda 100644
--- a/engines/gnap/gnap.cpp
+++ b/engines/gnap/gnap.cpp
@@ -30,6 +30,9 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/timer.h"
+#include "common/winexe_pe.h"
+
+#include "graphics/wincursor.h"
#include "engines/util.h"
@@ -544,7 +547,7 @@ void GnapEngine::setVerbCursor(int verbCursor) {
void GnapEngine::setCursor(int cursorIndex) {
if (_cursorIndex != cursorIndex) {
const char *cursorName = kCursorNames[cursorIndex];
- Graphics::WinCursorGroup *cursorGroup = Graphics::WinCursorGroup::createCursorGroup(*_exe, Common::WinResourceID(cursorName));
+ Graphics::WinCursorGroup *cursorGroup = Graphics::WinCursorGroup::createCursorGroup(_exe, Common::WinResourceID(cursorName));
if (cursorGroup) {
Graphics::Cursor *cursor = cursorGroup->cursors[0].cursor;
CursorMan.replaceCursor(cursor);
diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h
index dd653304e7..45d57fe79e 100644
--- a/engines/gnap/gnap.h
+++ b/engines/gnap/gnap.h
@@ -33,11 +33,8 @@
#include "common/str.h"
#include "common/substream.h"
#include "common/system.h"
-#include "common/winexe.h"
-#include "common/winexe_pe.h"
#include "engines/engine.h"
#include "graphics/pixelformat.h"
-#include "graphics/wincursor.h"
#include "graphics/fontman.h"
#include "graphics/font.h"
#include "graphics/fonts/ttf.h"
@@ -50,6 +47,10 @@
struct ADGameDescription;
+namespace Common {
+class PEResources;
+}
+
namespace Gnap {
class DatManager;
diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp
index fd9406054c..efc281b10c 100644
--- a/engines/gob/inter_v7.cpp
+++ b/engines/gob/inter_v7.cpp
@@ -22,7 +22,6 @@
#include "common/endian.h"
#include "common/archive.h"
-#include "common/winexe.h"
#include "common/winexe_pe.h"
#include "graphics/cursorman.h"
@@ -181,7 +180,7 @@ void Inter_v7::o7_loadCursor() {
// Load the cursor file and cursor group
if (loadCursorFile())
- cursorGroup = Graphics::WinCursorGroup::createCursorGroup(*_cursors, Common::WinResourceID(cursorName));
+ cursorGroup = Graphics::WinCursorGroup::createCursorGroup(_cursors, Common::WinResourceID(cursorName));
// If the requested cursor does not exist, create a default one
const Graphics::Cursor *cursor = 0;
diff --git a/engines/griffon/dialogs.cpp b/engines/griffon/dialogs.cpp
index 847377a024..be21015522 100644
--- a/engines/griffon/dialogs.cpp
+++ b/engines/griffon/dialogs.cpp
@@ -48,6 +48,7 @@ namespace Griffon {
void GriffonEngine::title(int mode) {
float xofs = 0;
+ _itemyloc = 0;
bool exitTitle = false;
rcSrc.left = 0;
diff --git a/engines/griffon/engine.cpp b/engines/griffon/engine.cpp
index a1eb5139ac..1f4b7cfe94 100644
--- a/engines/griffon/engine.cpp
+++ b/engines/griffon/engine.cpp
@@ -54,6 +54,7 @@ void Player::reset() {
hp = 0;
maxHp = 0;
hpflash = 0;
+ hpflashb = 0;
level = 0;
maxLevel = 0;
sword = 0;
@@ -65,6 +66,7 @@ void Player::reset() {
inventory[i] = 0;
}
attackStrength = 0;
+ itemselshade = 0;
spellDamage = 0;
swordDamage = 0;
exp = 0;
diff --git a/engines/griffon/input.cpp b/engines/griffon/input.cpp
index 64c260b9c4..5caa5af99b 100644
--- a/engines/griffon/input.cpp
+++ b/engines/griffon/input.cpp
@@ -618,6 +618,11 @@ void GriffonEngine::checkTrigger() {
_canUseKey = false;
+ for (int i = 0; i < kMaxFloat; i++) {
+ _floatText[i].framesLeft = 0;
+ _floatIcon[i].framesLeft = 0;
+ }
+
if (_triggerLoc[lx][ly] > -1)
processTrigger(_triggerLoc[lx][ly]);
}
diff --git a/engines/griffon/resources.cpp b/engines/griffon/resources.cpp
index 40f98223ea..4ce1c5d12d 100644
--- a/engines/griffon/resources.cpp
+++ b/engines/griffon/resources.cpp
@@ -192,6 +192,12 @@ void GriffonEngine::loadMap(int mapnum) {
_spellInfo[i].frame = 0;
_roomLock = false;
+ _saidLocked = false;
+ _saidJammed = false;
+ _itemSelOn = false;
+ _selEnemyOn = false;
+ _curItem = 0;
+ _player.itemselshade = 0;
char name[256];
// read *.map file
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp
index 82fdf742be..4816ec9aa6 100644
--- a/engines/hdb/gfx.cpp
+++ b/engines/hdb/gfx.cpp
@@ -25,7 +25,6 @@
#include "common/random.h"
#include "common/memstream.h"
#include "graphics/cursor.h"
-#include "graphics/wincursor.h"
#include "graphics/cursorman.h"
#include "hdb/hdb.h"
diff --git a/engines/illusions/illusions.h b/engines/illusions/illusions.h
index 8110c686a5..1b367950ed 100644
--- a/engines/illusions/illusions.h
+++ b/engines/illusions/illusions.h
@@ -34,8 +34,6 @@
#include "common/str.h"
#include "common/substream.h"
#include "common/system.h"
-#include "common/winexe.h"
-#include "common/winexe_pe.h"
#include "engines/engine.h"
#include "graphics/surface.h"
diff --git a/engines/kyra/engine/kyra_v1.cpp b/engines/kyra/engine/kyra_v1.cpp
index fc43919b57..c708756b19 100644
--- a/engines/kyra/engine/kyra_v1.cpp
+++ b/engines/kyra/engine/kyra_v1.cpp
@@ -235,6 +235,19 @@ void KyraEngine_v1::setMousePos(int x, int y) {
y <<= 1;
}
_system->warpMouse(x, y);
+
+ // Feed the event manager an artficial mouse move event, since warpMouse() won't generate one.
+ // From the warpMouse comments I gather that this behavior is intentional due to requirements of
+ // the SCUMM engine. In KYRA we need to get the same coordinates from _eventMan->getMousePos()
+ // that we send via warpMouse(). We have script situations in Kyra (like the Alchemists' crystals
+ // scene) where a new mouse cursor position is set and then immediately read. This function would
+ // then get wrong coordinates.
+ Common::Event event;
+ event.type = Common::EVENT_MOUSEMOVE;
+ event.mouse.x = x;
+ event.mouse.y = y;
+ _eventMan->pushEvent(event);
+ updateInput();
}
int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) {
diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 148f2d8f37..bbcada5991 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -3170,13 +3170,43 @@ void Screen::rectClip(int &x, int &y, int w, int h) {
}
void Screen::shakeScreen(int times) {
+ static const int8 _shakeParaPC[] = { 32, 0, -4, 32, 0, 0 };
+ static const int8 _shakeParaFMTOWNS[] = { 32, 0, -4, 48, 0, 4, 32, -4, 0, 32, 4, 0, 32, 0, 0 };
+
+ const int8 *data = _shakeParaPC;
+ int steps = ARRAYSIZE(_shakeParaPC) / 3;
+
+ // The FM-TOWNS version has a slightly better shake animation
+ // TODO: check PC-98 version
+ if (_vm->gameFlags().platform == Common::kPlatformFMTowns) {
+ data = _shakeParaFMTOWNS;
+ steps = ARRAYSIZE(_shakeParaFMTOWNS) / 3;
+ }
+
+ Common::Event event;
+
while (times--) {
- // seems to be 1 line (320 pixels) offset in the original
- // 4 looks more like dosbox though, maybe check this again
- _system->setShakePos(0, 4);
- _system->updateScreen();
- _system->setShakePos(0, 0);
- _system->updateScreen();
+ for (int i = 0; i < steps; ++i) {
+ // The original PC version did not need an artificial delay, but we do or the shake will be
+ // too fast to be actually seen.
+ uint32 end = _system->getMillis() + data[0];
+ _system->setShakePos(data[1], data[2]);
+
+ for (uint32 now = _system->getMillis(); now < end; ) {
+ // Update the event manager to keep smooth mouse pointer movement.
+ while (_vm->getEventManager()->pollEvent(event)) {
+ if (event.type == Common::EVENT_KEYDOWN) {
+ // This is really the only thing that should be handled.
+ if (event.kbd.keycode == Common::KEYCODE_q && event.kbd.hasFlags(Common::KBD_CTRL))
+ _vm->quitGame();
+ }
+ }
+ _system->updateScreen();
+ now = _system->getMillis();
+ _system->delayMillis(MIN<uint>(end - now, 10));
+ }
+ data += 3;
+ }
}
}
diff --git a/engines/kyra/gui/gui_lok.cpp b/engines/kyra/gui/gui_lok.cpp
index 96a10f0bab..b2971757ce 100644
--- a/engines/kyra/gui/gui_lok.cpp
+++ b/engines/kyra/gui/gui_lok.cpp
@@ -209,7 +209,7 @@ void GUI_LoK::createScreenThumbnail(Graphics::Surface &dst) {
if (_screen->isInterfacePaletteEnabled()) {
for (int y = 0; y < 64; ++y) {
for (int x = 0; x < 320; ++x) {
- screen[(y + 136) * Screen::SCREEN_W + x] += 32;
+ screen[(y + 136) * Screen::SCREEN_W + x] |= 0x20;
}
}
}
diff --git a/engines/kyra/script/script_lok.cpp b/engines/kyra/script/script_lok.cpp
index 325ee67c9e..2efa159f0b 100644
--- a/engines/kyra/script/script_lok.cpp
+++ b/engines/kyra/script/script_lok.cpp
@@ -362,6 +362,19 @@ int KyraEngine_LoK::o1_forceBrandonToNormal(EMCState *script) {
int KyraEngine_LoK::o1_poisonDeathNow(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_poisonDeathNow(%p) ()", (const void *)script);
seq_poisonDeathNow(1);
+
+ // WORKAROUND for the poison animation after drinking the green potion
+ // that can be made at the alchemists' crystals.
+ // The next animator update from inside delay() after completing the
+ // poison animation would cause invalid memory access (tryin to draw the
+ // already freed special anim shape 142).
+ // I can definitely confirm that for the FM-TOWNS version. I don't know
+ // about the DOS-CD version. Maybe this has been fixed there somehow.
+ // I simply repeat the same steps that are done after the potion animation
+ // when bitten by the snake (scene_lok.cpp, lines 964, 966).
+ _characterList[0].currentAnimFrame = 7;
+ _animator->animRefreshNPC(0);
+
return 0;
}
diff --git a/engines/kyra/script/script_v1.cpp b/engines/kyra/script/script_v1.cpp
index 2fbd2f22f4..356460dae0 100644
--- a/engines/kyra/script/script_v1.cpp
+++ b/engines/kyra/script/script_v1.cpp
@@ -65,7 +65,7 @@ int KyraEngine_v1::o1_showMouse(EMCState *script) {
int KyraEngine_v1::o1_setMousePos(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _system->warpMouse(stackPos(0), stackPos(1));
+ setMousePos(stackPos(0), stackPos(1));
return 0;
}
diff --git a/engines/kyra/sound/drivers/mlalf98.cpp b/engines/kyra/sound/drivers/mlalf98.cpp
index b2cb6d909c..1474589032 100644
--- a/engines/kyra/sound/drivers/mlalf98.cpp
+++ b/engines/kyra/sound/drivers/mlalf98.cpp
@@ -436,7 +436,7 @@ bool SoundChannel::_globalBlock = false;
SoundChannel::SoundChannel(PC98AudioCore *pc98a, int part, int regOffset, int type) : _pc98a(pc98a), _regOffset(regOffset), _part(part),
_ticksLeft(0), _program(0), _volume(0), _algorithm(0), _envRR(0), _vbrDelay(0), _vbrRem(0), _vbrRate(0), _vbrTicker(0), _vbrStepSize(0), _vbrModifier(0),
_vbrDepth(0), _vbrState(0), _duration(0), _frequency(0), _flags2(0), _note(0), _flags(0),
-_transpose(0), _envCurLvl(0), _fadeVolModifier(0), _fadeProgress(0), _fadeTicker(0), _trmCarrier(1),
+_transpose(0), _envCurLvl(0), _fadeVolModifier(0), _fadeProgress(0), _fadeTicker(16), _trmCarrier(1),
_dataPtr(0), _dataEnd(0), _loopStartPtr(0), _instrBuffer(0), _backupData(0), _mute(false), _type(type) {
_subOpcodes[0].reserve(8);
_subOpcodes[1].reserve(8);
@@ -510,6 +510,8 @@ void SoundChannel::updateFadeOut() {
if (--_fadeTicker)
return;
+ _fadeTicker = 16;
+
if (!_fadeProgress)
return;
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index 12c3ebfffe..152861b806 100644
--- a/engines/mohawk/cursors.cpp
+++ b/engines/mohawk/cursors.cpp
@@ -141,36 +141,6 @@ void MystCursorManager::setDefaultCursor() {
#endif
-NECursorManager::NECursorManager(const Common::String &appName) {
- _exe = new Common::NEResources();
-
- if (!_exe->loadFromEXE(appName)) {
- // Not all have cursors anyway, so this is not a problem
- delete _exe;
- _exe = nullptr;
- }
-}
-
-NECursorManager::~NECursorManager() {
- delete _exe;
-}
-
-void NECursorManager::setCursor(uint16 id) {
- if (_exe) {
- Graphics::WinCursorGroup *cursorGroup = Graphics::WinCursorGroup::createCursorGroup(*_exe, id);
-
- if (cursorGroup) {
- Graphics::Cursor *cursor = cursorGroup->cursors[0].cursor;
- CursorMan.replaceCursor(cursor);
- delete cursorGroup;
- return;
- }
- }
-
- // Last resort (not all have cursors)
- setDefaultCursor();
-}
-
MacCursorManager::MacCursorManager(const Common::String &appName) {
if (!appName.empty()) {
_resFork = new Common::MacResManager();
@@ -241,31 +211,41 @@ void LivingBooksCursorManager_v2::setCursor(const Common::String &name) {
setCursor(id);
}
-PECursorManager::PECursorManager(const Common::String &appName) {
- Common::PEResources *exe = new Common::PEResources();
- if (!exe->loadFromEXE(appName)) {
- // Not all have cursors anyway, so this is not a problem
- return;
+NECursorManager::NECursorManager(const Common::String &appName) {
+ Common::NEResources *exe = new Common::NEResources();
+ if (exe->loadFromEXE(appName)) {
+ // Not all have cursors anyway, so it's not a problem if this fails
+ loadCursors(exe);
}
+ delete exe;
+}
- const Common::Array<Common::WinResourceID> cursorGroups = exe->getNameList(Common::kWinGroupCursor);
-
- _cursors.resize(cursorGroups.size());
- for (uint i = 0; i < cursorGroups.size(); i++) {
- _cursors[i].id = cursorGroups[i].getID();
- _cursors[i].cursorGroup = Graphics::WinCursorGroup::createCursorGroup(*exe, cursorGroups[i]);
+PECursorManager::PECursorManager(const Common::String &appName) {
+ Common::PEResources *exe = new Common::PEResources();
+ if (exe->loadFromEXE(appName)) {
+ // Not all have cursors anyway, so it's not a problem if this fails
+ loadCursors(exe);
}
-
delete exe;
}
-PECursorManager::~PECursorManager() {
+WinCursorManager::~WinCursorManager() {
for (uint i = 0; i < _cursors.size(); i++) {
delete _cursors[i].cursorGroup;
}
}
-void PECursorManager::setCursor(uint16 id) {
+void WinCursorManager::loadCursors(Common::WinResources *exe) {
+ const Common::Array<Common::WinResourceID> cursorGroups = exe->getIDList(Common::kWinGroupCursor);
+
+ _cursors.resize(cursorGroups.size());
+ for (uint i = 0; i < cursorGroups.size(); i++) {
+ _cursors[i].id = cursorGroups[i].getID();
+ _cursors[i].cursorGroup = Graphics::WinCursorGroup::createCursorGroup(exe, cursorGroups[i]);
+ }
+}
+
+void WinCursorManager::setCursor(uint16 id) {
for (uint i = 0; i < _cursors.size(); i++) {
if (_cursors[i].id == id) {
Graphics::Cursor *cursor = _cursors[i].cursorGroup->cursors[0].cursor;
diff --git a/engines/mohawk/cursors.h b/engines/mohawk/cursors.h
index ff5db5b59c..eaee34b4e1 100644
--- a/engines/mohawk/cursors.h
+++ b/engines/mohawk/cursors.h
@@ -27,7 +27,7 @@
namespace Common {
class MacResManager;
-class NEResources;
+class WinResources;
class SeekableReadStream;
class String;
}
@@ -125,19 +125,6 @@ private:
#endif // ENABLE_MYST
-// The cursor manager for NE EXE's
-class NECursorManager : public CursorManager {
-public:
- explicit NECursorManager(const Common::String &appName);
- ~NECursorManager() override;
-
- void setCursor(uint16 id) override;
- bool hasSource() const override { return _exe != nullptr; }
-
-private:
- Common::NEResources *_exe;
-};
-
// The cursor manager for Mac applications
class MacCursorManager : public CursorManager {
public:
@@ -166,15 +153,17 @@ private:
MohawkArchive *_sysArchive;
};
-// The cursor manager for PE EXE's
-class PECursorManager : public CursorManager {
+// The cursor manager for Windows EXE's
+class WinCursorManager : public CursorManager {
public:
- explicit PECursorManager(const Common::String &appName);
- ~PECursorManager() override;
+ ~WinCursorManager() override;
void setCursor(uint16 id) override;
bool hasSource() const override { return !_cursors.empty(); }
+protected:
+ void loadCursors(Common::WinResources *exe);
+
private:
struct CursorItem {
uint16 id;
@@ -184,6 +173,18 @@ private:
Common::Array<CursorItem> _cursors;
};
+// The cursor manager for NE EXE's
+class NECursorManager : public WinCursorManager {
+public:
+ explicit NECursorManager(const Common::String &appName);
+};
+
+// The cursor manager for PE EXE's
+class PECursorManager : public WinCursorManager {
+public:
+ explicit PECursorManager(const Common::String &appName);
+};
+
} // End of namespace Mohawk
#endif
diff --git a/engines/pink/cursor_mgr.h b/engines/pink/cursor_mgr.h
index a08cb8e417..5e336a3e18 100644
--- a/engines/pink/cursor_mgr.h
+++ b/engines/pink/cursor_mgr.h
@@ -25,8 +25,6 @@
#include "common/rect.h"
-#include "graphics/wincursor.h"
-
#include "pink/objects/object.h"
namespace Pink {
diff --git a/engines/pink/director.h b/engines/pink/director.h
index 9dff49a271..a3255fc859 100644
--- a/engines/pink/director.h
+++ b/engines/pink/director.h
@@ -30,10 +30,6 @@
#include "graphics/macgui/macwindowmanager.h"
#include "graphics/screen.h"
-namespace Common {
- class PEResources;
-}
-
namespace Graphics {
class MacMenu;
}
diff --git a/engines/pink/gui.cpp b/engines/pink/gui.cpp
index 5267cbb540..9286747f63 100644
--- a/engines/pink/gui.cpp
+++ b/engines/pink/gui.cpp
@@ -129,7 +129,7 @@ static void menuCommandsCallback(int action, Common::U32String &, void *data) {
engine->executeMenuCommand(action);
}
-void PinkEngine::initMenu(Common::PEResources &exeResources) {
+void PinkEngine::initMenu(Common::PEResources *exeResources) {
_director->getWndManager().setEnginePauseCallback(this, &pauseEngine);
_menu = Graphics::MacMenu::createMenuFromPEexe(exeResources, &_director->getWndManager());
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index 2852348a72..a067d2bddf 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -30,6 +30,7 @@
#include "graphics/cursorman.h"
#include "graphics/thumbnail.h"
#include "graphics/surface.h"
+#include "graphics/wincursor.h"
#include "pink/pink.h"
#include "pink/console.h"
@@ -40,7 +41,7 @@
namespace Pink {
PinkEngine::PinkEngine(OSystem *system, const ADGameDescription *desc)
- : Engine(system), _console(nullptr), _rnd("pink"),
+ : Engine(system), _console(nullptr), _rnd("pink"), _exeResources(nullptr),
_desc(desc), _bro(nullptr), _menu(nullptr), _actor(nullptr),
_module(nullptr), _director(nullptr), _pdaMgr(this) {
@@ -56,6 +57,7 @@ PinkEngine::PinkEngine(OSystem *system, const ADGameDescription *desc)
PinkEngine::~PinkEngine() {
delete _console;
+ delete _exeResources;
delete _bro;
_pdaMgr.close();
for (uint i = 0; i < _modules.size(); ++i) {
@@ -72,16 +74,16 @@ Common::Error PinkEngine::init() {
debugC(10, kPinkDebugGeneral, "PinkEngine init");
initGraphics(640, 480);
- Common::PEResources exeResources;
+ _exeResources = new Common::PEResources();
Common::String fileName = isPeril() ? "pptp.exe" : "hpp.exe";
- if (!exeResources.loadFromEXE(fileName)) {
+ if (!_exeResources->loadFromEXE(fileName)) {
return Common::kNoGameDataFoundError;
}
_console = new Console(this);
_director = new Director();
- initMenu(exeResources);
+ initMenu(_exeResources);
Common::String orbName;
Common::String broName;
@@ -96,7 +98,7 @@ Common::Error PinkEngine::init() {
if (!_orb.open(orbName) || (_bro && !_bro->open(broName) && _orb.getTimestamp() == _bro->getTimestamp()))
return Common::kNoGameDataFoundError;
- if (!loadCursors(exeResources))
+ if (!loadCursors(_exeResources))
return Common::kNoGameDataFoundError;
setCursor(kLoadingCursor);
@@ -233,7 +235,7 @@ bool PinkEngine::checkValueOfVariable(Common::String &variable, Common::String &
return _variables[variable] == value;
}
-bool PinkEngine::loadCursors(Common::PEResources &exeResources) {
+bool PinkEngine::loadCursors(Common::PEResources *exeResources) {
bool isPokus = !isPeril();
_cursors.reserve(kCursorsCount);
diff --git a/engines/pink/pink.h b/engines/pink/pink.h
index cfc7190399..ce48a900ee 100644
--- a/engines/pink/pink.h
+++ b/engines/pink/pink.h
@@ -29,8 +29,6 @@
#include "engines/engine.h"
#include "engines/savestate.h"
-#include "graphics/wincursor.h"
-
#include "gui/debugger.h"
#include "pink/constants.h"
@@ -62,8 +60,13 @@
struct ADGameDescription;
+namespace Common {
+ class PEResources;
+}
+
namespace Graphics {
class MacMenu;
+class WinCursorGroup;
}
namespace Pink {
@@ -132,9 +135,9 @@ public:
private:
Common::Error init();
- void initMenu(Common::PEResources &exeResources);
+ void initMenu(Common::PEResources *exeResources);
- bool loadCursors(Common::PEResources &exeResources);
+ bool loadCursors(Common::PEResources *exeResources);
void initModule(const Common::String &moduleName, const Common::String &pageName, Archive *saveFile);
void addModule(const Common::String &moduleName);
@@ -148,6 +151,8 @@ private:
Common::String _nextModule;
Common::String _nextPage;
+ Common::PEResources *_exeResources;
+
OrbFile _orb;
BroFile *_bro;
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index fd01a0b541..2a23d26615 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -147,6 +147,7 @@ static const char *const selectorNameTable[] = {
#ifdef ENABLE_SCI32
"newWith", // SCI2 array script
"posn", // SCI2 benchmarking script
+ "printLang", // GK2
"view", // RAMA benchmarking, GK1, QFG4
"fade", // Shivers
"test", // Torin
@@ -260,6 +261,7 @@ enum ScriptPatcherSelectors {
,
SELECTOR_newWith,
SELECTOR_posn,
+ SELECTOR_printLang,
SELECTOR_view,
SELECTOR_fade,
SELECTOR_test,
@@ -3673,6 +3675,66 @@ static const uint16 gk2WagnerPaintingMessagePatch[] = {
PATCH_END
};
+// The game-over rooms 665 and 666 draw a pic over everything by setting the
+// default plane's priority to 202, but this is already inventoryBorderPlane's
+// priority. In our interpreter this causes a border fragment to be drawn above
+// the pics. This worked by luck in Sierra's interpreter because it sorts on
+// memory ID when planes have the same priority. In ScummVM the renderer
+// guarantees a sort order based on the creation order of the planes. The
+// default plane is created first and drawn before inventoryBorderPlane.
+//
+// We fix this by increasing the plane priority in the game-over rooms.
+//
+// Applies to: All versions
+// Responsible methods: gabeNews:init, uDie:init
+// Fixes bug: #11298
+static const uint16 gk2GameOverPrioritySignature[] = {
+ 0x39, SIG_SELECTOR8(priority), // pushi priority
+ SIG_MAGICDWORD,
+ 0x78, // push1
+ 0x38, SIG_UINT16(0x00ca), // pushi 00ca
+ 0x81, 0x03, // lag 03
+ 0x4a, SIG_UINT16(0x0012), // send 12 [ Plane ... priority: 202 ]
+ SIG_END
+};
+
+static const uint16 gk2GameOverPriorityPatch[] = {
+ PATCH_ADDTOOFFSET(+3),
+ 0x38, PATCH_UINT16(0x00cb), // pushi 00cb [ priority: 203 ]
+ PATCH_END
+};
+
+// GK2 fans have created patches that add subtitles to the entire game. There
+// are at least English and Spanish patch sets. Sierra added the subtitle
+// feature solely for the Portuguese version. The fan patches include these
+// subtitle scripts, replace the Portuguese resources and embedded script
+// strings, and configure Sierra's interpreter to use the Portuguese language
+// through RESOURCE.CFG. This sets GK2:printLang which the scripts test for
+// Portuguese in order to activate subtitles.
+//
+// The subtitle patches are compatible with ScummVM except for the requirement
+// that GK2:printLang equals Portuguese (351) since we don't use RESOURCE.CFG.
+// We fix this by patching the GK2:printLang tests to always activate subtitles
+// when a sync resource is present for synchronizing text to video playback.
+//
+// Applies to: PC versions with a subtitle fan-patch applied
+// Responsible methods: Any that test GK2:printLang for Portuguese
+// Fixes bugs: #9677, #11282
+static const uint16 gk2SubtitleCompatibilitySignature[] = {
+ SIG_MAGICDWORD,
+ 0x39, SIG_SELECTOR8(printLang), // pushi printLang
+ 0x76, // push0
+ 0x81, 0x01, // lag 01
+ 0x4a, SIG_UINT16(0x0004), // send 04 [ GK2 printLang? ]
+ SIG_END
+};
+
+static const uint16 gk2SubtitleCompatibilityPatch[] = {
+ 0x34, PATCH_UINT16(0x015f), // ldi 015f [ K_LANG_PORTUGUESE ]
+ 0x33, 0x03, // jmp 03
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry gk2Signatures[] = {
{ true, 0, "disable volume reset on startup", 1, gk2VolumeResetSignature, gk2VolumeResetPatch },
@@ -3682,6 +3744,8 @@ static const SciScriptPatcherEntry gk2Signatures[] = {
{ true, 23, "fix inventory scroll direction (no line numbers)", 1, gk2InventoryScrollDirSignature2, gk2InventoryScrollDirPatch2 },
{ true, 37, "fix sound manager lockup", 1, gk2SoundManagerLockupSignature1, gk2SoundManagerLockupPatch1 },
{ true, 37, "fix sound manager lockup (no line numbers)", 1, gk2SoundManagerLockupSignature2, gk2SoundManagerLockupPatch2 },
+ { true, 665, "fix game-over priority", 1, gk2GameOverPrioritySignature, gk2GameOverPriorityPatch },
+ { true, 666, "fix game-over priority", 1, gk2GameOverPrioritySignature, gk2GameOverPriorityPatch },
{ true, 800, "fix neuschwanstein hint (1/3)", 1, gk2NeuschwansteinHintSignature1, gk2NeuschwansteinHintPatch },
{ true, 800, "fix neuschwanstein hint (2/3)", 1, gk2NeuschwansteinHintSignature2, gk2NeuschwansteinHintPatch },
{ true, 800, "fix neuschwanstein hint (3/3)", 1, gk2NeuschwansteinHintSignature3, gk2NeuschwansteinHintPatch },
@@ -3695,6 +3759,13 @@ static const SciScriptPatcherEntry gk2Signatures[] = {
{ true, 64990, "increase number of save games (1/2)", 1, sci2NumSavesSignature1, sci2NumSavesPatch1 },
{ true, 64990, "increase number of save games (2/2)", 1, sci2NumSavesSignature2, sci2NumSavesPatch2 },
{ true, 64990, "disable change directory button", 1, sci2ChangeDirSignature, sci2ChangeDirPatch },
+ { false, 0, "subtitle patch compatibility", 3, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch },
+ { false, 11, "subtitle patch compatibility", 7, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch },
+ { false, 12, "subtitle patch compatibility", 5, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch },
+ { false, 91, "subtitle patch compatibility", 7, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch },
+ { false, 200, "subtitle patch compatibility", 1, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch },
+ { false, 1300, "subtitle patch compatibility", 1, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch },
+ { false, 64924, "subtitle patch compatibility", 1, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -17013,12 +17084,57 @@ static const uint16 sq1vgaPatchSpiderDroidTiming[] = {
PATCH_END
};
+// The Russian version of SQ1VGA has mangled class names in its scripts. This
+// isn't a problem in Sierra's interpreter since this is just metadata, but our
+// feature detection code looks up several classes by name and requires them to
+// exist. We fix this by patching the Motion, Rm, and Sound strings back to
+// their original values.
+//
+// Applies to: Russian PC Floppy
+// Fixes bug: #10156
+static const uint16 sq1vgaSignatureRussianMotionName[] = {
+ SIG_MAGICDWORD,
+ 0x2A, 0x4D, 0x6F, 0x74, 0x69, // *Motion.
+ 0x6F, 0x6E, 0x20,
+ SIG_END
+};
+
+static const uint16 sq1vgaPatchRussianMotionName[] = {
+ 0x4D, 0x6F, 0x74, 0x69, 0x6F, // Motion
+ 0x6E, 0x00,
+ PATCH_END
+};
+static const uint16 sq1vgaSignatureRussianRmName[] = {
+ SIG_MAGICDWORD,
+ 0x2a, 0x52, 0x6d, 0x00, // *Rm
+ SIG_END
+};
+
+static const uint16 sq1vgaPatchRussianRmName[] = {
+ 0x52, 0x6d, 0x00, // Rm
+ PATCH_END
+};
+
+static const uint16 sq1vgaSignatureRussianSoundName[] = {
+ SIG_MAGICDWORD,
+ 0x87, 0xa2, 0xe3, 0xaa, 0x00, 0x00, // ....
+ SIG_END
+};
+
+static const uint16 sq1vgaPatchRussianSoundName[] = {
+ 0x53, 0x6f, 0x75, 0x63, 0x64, // Sound
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry sq1vgaSignatures[] = {
{ true, 45, "Ulence Flats: timepod graphic glitch", 1, sq1vgaSignatureUlenceFlatsTimepodGfxGlitch, sq1vgaPatchUlenceFlatsTimepodGfxGlitch },
{ true, 45, "Ulence Flats: force field generator glitch", 1, sq1vgaSignatureUlenceFlatsGeneratorGlitch, sq1vgaPatchUlenceFlatsGeneratorGlitch },
{ true, 58, "Sarien armory droid zapping ego first time", 1, sq1vgaSignatureEgoShowsCard, sq1vgaPatchEgoShowsCard },
{ true, 704, "spider droid timing issue", 1, sq1vgaSignatureSpiderDroidTiming, sq1vgaPatchSpiderDroidTiming },
+ { true, 989, "rename russian Sound class", 1, sq1vgaSignatureRussianSoundName, sq1vgaPatchRussianSoundName },
+ { true, 992, "rename russian Motion class", 1, sq1vgaSignatureRussianMotionName, sq1vgaPatchRussianMotionName },
+ { true, 994, "rename russian Rm class", 1, sq1vgaSignatureRussianRmName, sq1vgaPatchRussianRmName },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -18531,6 +18647,12 @@ void ScriptPatcher::processScript(uint16 scriptNr, SciSpan<byte> scriptData) {
enablePatch(signatureTable, "Mac: skip broken hop singh scene");
}
break;
+ case GID_GK2:
+ // Enable subtitle compatibility if a sync resource is present
+ if (g_sci->getResMan()->testResource(ResourceId(kResourceTypeSync, 10))) {
+ enablePatch(signatureTable, "subtitle patch compatibility");
+ }
+ break;
case GID_KQ5:
if (g_sci->_features->useAltWinGMSound()) {
// See the explanation in the kq5SignatureWinGMSignals comment
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 7a1fe66d35..2f0dd008fc 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -945,32 +945,34 @@ void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr arg
} // switch
}
-void debugPropertyAccess(Object *obj, reg_t objp, unsigned int index, reg_t curValue, reg_t newValue, SegManager *segMan, BreakpointType breakpointType) {
+void debugPropertyAccess(Object *obj, reg_t objp, unsigned int index, Selector selector, reg_t curValue, reg_t newValue, SegManager *segMan, BreakpointType breakpointType) {
const Object *var_container = obj;
if (!obj->isClass() && getSciVersion() != SCI_VERSION_3)
var_container = segMan->getObject(obj->getSuperClassSelector());
- uint16 varSelector;
- if (getSciVersion() == SCI_VERSION_3) {
- varSelector = index;
- } else {
- index >>= 1;
-
- if (index >= var_container->getVarCount()) {
- // TODO: error, warning, debug?
- return;
+ if (selector == NULL_SELECTOR) {
+ if (getSciVersion() == SCI_VERSION_3) {
+ selector = index;
}
+ else {
+ index >>= 1;
+
+ if (index >= var_container->getVarCount()) {
+ // TODO: error, warning, debug?
+ return;
+ }
- varSelector = var_container->getVarSelector(index);
+ selector = var_container->getVarSelector(index);
+ }
}
- if (g_sci->checkSelectorBreakpoint(breakpointType, objp, varSelector)) {
+ if (g_sci->checkSelectorBreakpoint(breakpointType, objp, selector)) {
// checkSelectorBreakpoint has already triggered the breakpoint.
// We just output the relevant data here.
Console *con = g_sci->getSciDebugger();
const char *objectName = segMan->getObjectName(objp);
- const char *selectorName = g_sci->getKernel()->getSelectorName(varSelector).c_str();
+ const char *selectorName = g_sci->getKernel()->getSelectorName(selector).c_str();
if (breakpointType == BREAK_SELECTORWRITE) {
con->debugPrintf("Write to selector (%s:%s): change %04x:%04x to %04x:%04x\n",
objectName, selectorName,
@@ -986,27 +988,11 @@ void debugPropertyAccess(Object *obj, reg_t objp, unsigned int index, reg_t curV
}
}
-void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *kernelSubCall, EngineState *s, int argc, reg_t *argv, reg_t result) {
- if (s->abortScriptProcessing != kAbortNone) {
- return;
- }
-
- Kernel *kernel = g_sci->getKernel();
- if (!kernelSubCall) {
- debugN("k%s: ", kernelCall->name);
- } else {
- int callNameLen = strlen(kernelCall->name);
- if (strncmp(kernelCall->name, kernelSubCall->name, callNameLen) == 0) {
- const char *subCallName = kernelSubCall->name + callNameLen;
- debugN("k%s(%s): ", kernelCall->name, subCallName);
- } else {
- debugN("k%s(%s): ", kernelCall->name, kernelSubCall->name);
- }
- }
+static void logParameters(const KernelFunction *kernelCall, EngineState *s, int argc, reg_t *argv) {
for (int parmNr = 0; parmNr < argc; parmNr++) {
if (parmNr)
debugN(", ");
- uint16 regType = kernel->findRegType(argv[parmNr]);
+ uint16 regType = g_sci->getKernel()->findRegType(argv[parmNr]);
if (regType & SIG_TYPE_NULL)
debugN("0");
else if (regType & SIG_TYPE_UNINITIALIZED)
@@ -1043,7 +1029,7 @@ void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *ke
// TODO: Any other segment types which could
// use special handling?
- if (kernelCall->function == &kSaid) {
+ if (kernelCall != nullptr && kernelCall->function == &kSaid) {
SegmentRef saidSpec = s->_segMan->dereference(argv[parmNr]);
if (saidSpec.isRaw) {
debugN(" ('");
@@ -1064,12 +1050,46 @@ void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *ke
}
}
}
+}
+
+void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *kernelSubCall, EngineState *s, int argc, reg_t *argv, reg_t result) {
+ if (s->abortScriptProcessing != kAbortNone) {
+ return;
+ }
+
+ if (!kernelSubCall) {
+ debugN("k%s: ", kernelCall->name);
+ } else {
+ int callNameLen = strlen(kernelCall->name);
+ if (strncmp(kernelCall->name, kernelSubCall->name, callNameLen) == 0) {
+ const char *subCallName = kernelSubCall->name + callNameLen;
+ debugN("k%s(%s): ", kernelCall->name, subCallName);
+ } else {
+ debugN("k%s(%s): ", kernelCall->name, kernelSubCall->name);
+ }
+ }
+
+ logParameters(kernelCall, s, argc, argv);
+
if (result.isPointer())
debugN(" = %04x:%04x\n", PRINT_REG(result));
else
debugN(" = %d\n", result.getOffset());
}
+void logExportCall(uint16 script, uint16 pubfunct, EngineState *s, int argc, reg_t *argv) {
+ if (s->abortScriptProcessing != kAbortNone) {
+ return;
+ }
+
+ debugN("script %d, export %d: ", script, pubfunct);
+
+ if (argc > 1) {
+ argv++;
+ logParameters(nullptr, s, argc, argv);
+ }
+ debugN("\n");
+}
void logBacktrace() {
Console *con = g_sci->getSciDebugger();
diff --git a/engines/sci/engine/scriptdebug.h b/engines/sci/engine/scriptdebug.h
index 5e927efaf1..3d54b327d3 100644
--- a/engines/sci/engine/scriptdebug.h
+++ b/engines/sci/engine/scriptdebug.h
@@ -31,10 +31,12 @@ extern const char *opcodeNames[];
void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr argp, ObjVarRef &varp, reg_t funcp, SegManager *segMan, SelectorType selectorType);
-void debugPropertyAccess(Object *obj, reg_t objp, unsigned int index, reg_t curValue, reg_t newValue, SegManager *segMan, BreakpointType breakpointType);
+void debugPropertyAccess(Object *obj, reg_t objp, unsigned int index, Selector selector, reg_t curValue, reg_t newValue, SegManager *segMan, BreakpointType breakpointType);
void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *kernelSubCall, EngineState *s, int argc, reg_t *argv, reg_t result);
+void logExportCall(uint16 script, uint16 pubfunct, EngineState *s, int argc, reg_t *argv);
+
void logBacktrace();
bool printObject(reg_t obj);
diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp
index 6196495954..1a63b4dee1 100644
--- a/engines/sci/engine/selector.cpp
+++ b/engines/sci/engine/selector.cpp
@@ -23,6 +23,7 @@
#include "sci/sci.h"
#include "sci/engine/features.h"
#include "sci/engine/kernel.h"
+#include "sci/engine/scriptdebug.h"
#include "sci/engine/state.h"
#include "sci/engine/selector.h"
@@ -246,8 +247,14 @@ reg_t readSelector(SegManager *segMan, reg_t object, Selector selectorId) {
if (lookupSelector(segMan, object, selectorId, &address, NULL) != kSelectorVariable)
return NULL_REG;
- else
- return *address.getPointer(segMan);
+
+ if (g_sci->_debugState._activeBreakpointTypes & BREAK_SELECTORREAD) {
+ reg_t curValue = *address.getPointer(segMan);
+ debugPropertyAccess(segMan->getObject(object), object, 0, selectorId,
+ curValue, NULL_REG, segMan, BREAK_SELECTORREAD);
+ }
+
+ return *address.getPointer(segMan);
}
#ifdef ENABLE_SCI32
@@ -271,6 +278,12 @@ void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t
error("Selector '%s' of object could not be written to. Address %04x:%04x, %s", g_sci->getKernel()->getSelectorName(selectorId).c_str(), PRINT_REG(object), origin.toString().c_str());
}
+ if (g_sci->_debugState._activeBreakpointTypes & BREAK_SELECTORWRITE) {
+ reg_t curValue = *address.getPointer(segMan);
+ debugPropertyAccess(segMan->getObject(object), object, 0, selectorId,
+ curValue, value, segMan, BREAK_SELECTORWRITE);
+ }
+
*address.getPointer(segMan) = value;
#ifdef ENABLE_SCI32
updateInfoFlagViewVisible(segMan->getObject(object), address.varindex);
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index d5bcb63ce4..e8808a715c 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -222,7 +222,9 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP
}
// Check if a breakpoint is set on this method
- g_sci->checkExportBreakpoint(script, pubfunct);
+ if (g_sci->checkExportBreakpoint(script, pubfunct)) {
+ logExportCall(script, pubfunct, s, argc, argp);
+ }
uint32 exportAddr = scr->validateExportFunc(pubfunct, false);
if (!exportAddr)
@@ -1133,7 +1135,7 @@ void run_vm(EngineState *s) {
case op_pToa: // 0x31 (49)
// Property To Accumulator
if (g_sci->_debugState._activeBreakpointTypes & BREAK_SELECTORREAD) {
- debugPropertyAccess(obj, s->xs->objp, opparams[0],
+ debugPropertyAccess(obj, s->xs->objp, opparams[0], NULL_SELECTOR,
validate_property(s, obj, opparams[0]), NULL_REG,
s->_segMan, BREAK_SELECTORREAD);
}
@@ -1145,7 +1147,7 @@ void run_vm(EngineState *s) {
// Accumulator To Property
reg_t &opProperty = validate_property(s, obj, opparams[0]);
if (g_sci->_debugState._activeBreakpointTypes & BREAK_SELECTORWRITE) {
- debugPropertyAccess(obj, s->xs->objp, opparams[0],
+ debugPropertyAccess(obj, s->xs->objp, opparams[0], NULL_SELECTOR,
opProperty, s->r_acc,
s->_segMan, BREAK_SELECTORWRITE);
}
@@ -1162,7 +1164,7 @@ void run_vm(EngineState *s) {
// Property To Stack
reg_t value = validate_property(s, obj, opparams[0]);
if (g_sci->_debugState._activeBreakpointTypes & BREAK_SELECTORREAD) {
- debugPropertyAccess(obj, s->xs->objp, opparams[0],
+ debugPropertyAccess(obj, s->xs->objp, opparams[0], NULL_SELECTOR,
value, NULL_REG,
s->_segMan, BREAK_SELECTORREAD);
}
@@ -1176,7 +1178,7 @@ void run_vm(EngineState *s) {
reg_t newValue = POP32();
reg_t &opProperty = validate_property(s, obj, opparams[0]);
if (g_sci->_debugState._activeBreakpointTypes & BREAK_SELECTORWRITE) {
- debugPropertyAccess(obj, s->xs->objp, opparams[0],
+ debugPropertyAccess(obj, s->xs->objp, opparams[0], NULL_SELECTOR,
opProperty, newValue,
s->_segMan, BREAK_SELECTORWRITE);
}
@@ -1198,7 +1200,7 @@ void run_vm(EngineState *s) {
reg_t oldValue = opProperty;
if (g_sci->_debugState._activeBreakpointTypes & BREAK_SELECTORREAD) {
- debugPropertyAccess(obj, s->xs->objp, opparams[0],
+ debugPropertyAccess(obj, s->xs->objp, opparams[0], NULL_SELECTOR,
oldValue, NULL_REG,
s->_segMan, BREAK_SELECTORREAD);
}
@@ -1209,7 +1211,7 @@ void run_vm(EngineState *s) {
opProperty -= 1;
if (g_sci->_debugState._activeBreakpointTypes & BREAK_SELECTORWRITE) {
- debugPropertyAccess(obj, s->xs->objp, opparams[0],
+ debugPropertyAccess(obj, s->xs->objp, opparams[0], NULL_SELECTOR,
oldValue, opProperty,
s->_segMan, BREAK_SELECTORWRITE);
}
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index ba11883cbc..71046a83cf 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -1247,6 +1247,9 @@ static const SciMessageWorkaroundEntry messageWorkarounds[] = {
// audio36 for the the other has the wrong tuple, which we fix in the audio36 workarounds.
{ GID_GK1, SCI_MEDIA_ALL, K_LANG_NONE, -1, 420, 2, 32, 3, 1, { MSG_WORKAROUND_REMAP, 420, 2, 32, 0, 1, 0, 0, 0, NULL } },
{ GID_GK1, SCI_MEDIA_ALL, K_LANG_NONE, -1, 420, 2, 32, 0, 1, { MSG_WORKAROUND_REMAP, 420, 2, 32, 2, 1, 0, 0, 0, NULL } },
+ // Clicking one of Gabriel's letters on Gerde in room 120 after getting his address in some versions
+ { GID_GK2, SCI_MEDIA_ALL, K_LANG_NONE, -1, 120, 18, 63, 0, 1, { MSG_WORKAROUND_REMAP, 120, 18, 44, 0, 1, 0, 0, 0, NULL } },
+ { GID_GK2, SCI_MEDIA_ALL, K_LANG_NONE, -1, 120, 18, 64, 0, 1, { MSG_WORKAROUND_REMAP, 120, 18, 44, 0, 1, 0, 0, 0, NULL } },
// Clicking any item other than the dagger on theater vent in room 11853
{ GID_GK2, SCI_MEDIA_ALL, K_LANG_NONE, -1, 1185, 4, 0, 0, 1, { MSG_WORKAROUND_REMAP, 1185, 4, 62, 0, 1, 0, 0, 0, NULL } },
// Asking Yvette about Tut in act 2 party in floppy version - bug #10723
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index 567660d97a..be62ba7882 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -936,7 +936,9 @@ void VMDPlayer::closeOverlay() {
}
#endif
- g_sci->_gfxFrameout->frameOut(true, _drawRect);
+ if (!_leaveLastFrame && _leaveScreenBlack) {
+ g_sci->_gfxFrameout->frameOut(true, _drawRect);
+ }
}
void VMDPlayer::initComposited() {
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 779bd0acb2..a716a1230d 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -993,6 +993,11 @@ void ResourceManager::init() {
_mapVersion = _volVersion;
}
+ if ((_volVersion == kResVersionSci3) && (_mapVersion < kResVersionSci2)) {
+ warning("Detected volume version is too high for detected map version. Setting volume version to map version");
+ _volVersion = _mapVersion;
+ }
+
debugC(1, kDebugLevelResMan, "resMan: Detected resource map version %d: %s", _mapVersion, versionDescription(_mapVersion));
debugC(1, kDebugLevelResMan, "resMan: Detected volume version %d: %s", _volVersion, versionDescription(_volVersion));
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index c825196d93..73e10eb1ee 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -513,36 +513,23 @@ int ResourceManager::readAudioMapSCI11(IntMapResourceSource *map) {
continue;
}
+ // GK2 has invalid audio36 map entries on CD 1 of the German
+ // version and CD 6 of all versions. All are safe to ignore
+ // because their content doesn't apply to the disc's chapter.
if (g_sci->getGameId() == GID_GK2) {
- // At least version 1.00 of the US release, and the German
- // release, of GK2 have multiple invalid audio36 map entries on
- // CD 6
- if (map->_volumeNumber == 6 && offset + syncSize >= srcSize) {
- bool skip;
- switch (g_sci->getLanguage()) {
- case Common::EN_ANY:
- skip = (map->_mapNumber == 22 || map->_mapNumber == 160);
- break;
- case Common::DE_DEU:
- skip = (map->_mapNumber == 22);
- break;
- default:
- skip = false;
- }
-
- if (skip) {
- continue;
- }
+ // Map 2020 on CD 1 only exists in localized versions and
+ // contains inventory messages from later chapters.
+ if (map->_volumeNumber == 1 &&
+ map->_mapNumber == 2020) {
+ continue;
}
- // Map 2020 on CD 1 of the German release of GK2 is invalid.
- // This content does not appear to ever be used by the game (it
- // does not even exist in the US release), and there is a
- // correct copy of it on CD 6, so just ignore the bad copy on
- // CD 1
- if (g_sci->getLanguage() == Common::DE_DEU &&
- map->_volumeNumber == 1 &&
- map->_mapNumber == 2020) {
+ // Maps 22 and 160 on CD 6 appear in various broken forms
+ // in English and apparently every localized version.
+ // These messages are for Grace's notebook and castle
+ // secret passage rooms which aren't in chapter 6.
+ if (map->_volumeNumber == 6 &&
+ (map->_mapNumber == 22 || map->_mapNumber == 160)) {
continue;
}
}
diff --git a/engines/scumm/he/moonbase/moonbase.cpp b/engines/scumm/he/moonbase/moonbase.cpp
index cb76c3f273..890d9e4051 100644
--- a/engines/scumm/he/moonbase/moonbase.cpp
+++ b/engines/scumm/he/moonbase/moonbase.cpp
@@ -20,6 +20,8 @@
*
*/
+#include "common/winexe_pe.h"
+
#include "scumm/he/intern_he.h"
#include "scumm/he/moonbase/moonbase.h"
#include "scumm/he/moonbase/ai_main.h"
@@ -30,6 +32,8 @@
namespace Scumm {
Moonbase::Moonbase(ScummEngine_v100he *vm) : _vm(vm) {
+ _exe = new Common::PEResources();
+
initFOW();
_ai = new AI(_vm);
@@ -39,6 +43,7 @@ Moonbase::Moonbase(ScummEngine_v100he *vm) : _vm(vm) {
}
Moonbase::~Moonbase() {
+ delete _exe;
delete _ai;
#ifdef USE_LIBCURL
delete _net;
diff --git a/engines/scumm/he/moonbase/moonbase.h b/engines/scumm/he/moonbase/moonbase.h
index d5fa4550ac..09eb197cb5 100644
--- a/engines/scumm/he/moonbase/moonbase.h
+++ b/engines/scumm/he/moonbase/moonbase.h
@@ -25,7 +25,9 @@
#ifdef ENABLE_HE
-#include "common/winexe_pe.h"
+namespace Common {
+class PEResources;
+}
namespace Scumm {
@@ -106,7 +108,7 @@ private:
int32 _fowRenderTable[32768];
- Common::PEResources _exe;
+ Common::PEResources *_exe;
Common::String _fileName;
};
diff --git a/engines/scumm/he/moonbase/moonbase_fow.cpp b/engines/scumm/he/moonbase/moonbase_fow.cpp
index 2e1265aff2..af58c11310 100644
--- a/engines/scumm/he/moonbase/moonbase_fow.cpp
+++ b/engines/scumm/he/moonbase/moonbase_fow.cpp
@@ -21,6 +21,7 @@
*/
#include "common/config-manager.h"
+#include "common/winexe_pe.h"
#include "scumm/he/intern_he.h"
#include "scumm/he/moonbase/moonbase.h"
@@ -99,11 +100,11 @@ bool Moonbase::setFOWImage(int image) {
if (_fileName.empty()) { // We are running for the first time
_fileName = _vm->generateFilename(-3);
- if (!_exe.loadFromEXE(_fileName))
+ if (!_exe->loadFromEXE(_fileName))
error("Cannot open file %s", _fileName.c_str());
}
- Common::SeekableReadStream *stream = _exe.getResource(Common::kWinRCData, resId);
+ Common::SeekableReadStream *stream = _exe->getResource(Common::kWinRCData, resId);
if (stream->size()) {
_fowImage = (uint8 *)malloc(stream->size());
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index ddde352686..0d2c6f5365 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -35,6 +35,7 @@
#include "common/archive.h"
#include "common/memstream.h"
#include "common/system.h"
+#include "common/winexe_pe.h"
namespace Scumm {
@@ -114,13 +115,18 @@ void ResExtractor::setCursor(int id) {
Win32ResExtractor::Win32ResExtractor(ScummEngine_v70he *scumm) : ResExtractor(scumm) {
+ _exe = new Common::PEResources();
+}
+
+Win32ResExtractor::~Win32ResExtractor() {
+ delete _exe;
}
bool Win32ResExtractor::extractResource(int id, CachedCursor *cc) {
if (_fileName.empty()) { // We are running for the first time
_fileName = _vm->generateFilename(-3);
- if (!_exe.loadFromEXE(_fileName))
+ if (!_exe->loadFromEXE(_fileName))
error("Cannot open file %s", _fileName.c_str());
}
diff --git a/engines/scumm/he/resource_he.h b/engines/scumm/he/resource_he.h
index 49175db8d4..c3fca17737 100644
--- a/engines/scumm/he/resource_he.h
+++ b/engines/scumm/he/resource_he.h
@@ -24,7 +24,10 @@
#define SCUMM_HE_RESOURCE_HE_H
#include "common/macresman.h"
-#include "common/winexe_pe.h"
+
+namespace Common {
+class PEResources;
+}
namespace Scumm {
@@ -68,10 +71,10 @@ private:
class Win32ResExtractor : public ResExtractor {
public:
Win32ResExtractor(ScummEngine_v70he *scumm);
- ~Win32ResExtractor() {}
+ ~Win32ResExtractor();
private:
- Common::PEResources _exe;
+ Common::PEResources *_exe;
bool extractResource(int id, CachedCursor *cc);
};
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index d9b21af423..83feea1ea5 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -24,7 +24,6 @@
#define TITANIC_TITLE_ENGINE_H
#include "common/stream.h"
-#include "common/winexe_pe.h"
#include "titanic/support/string.h"
#include "titanic/true_talk/script_handler.h"
#include "titanic/true_talk/tt_response.h"
diff --git a/engines/wintermute/ad/ad_actor.cpp b/engines/wintermute/ad/ad_actor.cpp
index 75e7c45d7e..a598581632 100644
--- a/engines/wintermute/ad/ad_actor.cpp
+++ b/engines/wintermute/ad/ad_actor.cpp
@@ -34,6 +34,7 @@
#include "engines/wintermute/ad/ad_waypoint_group.h"
#include "engines/wintermute/ad/ad_path.h"
#include "engines/wintermute/ad/ad_sentence.h"
+#include "engines/wintermute/base/base_frame.h"
#include "engines/wintermute/base/base_parser.h"
#include "engines/wintermute/base/sound/base_sound.h"
#include "engines/wintermute/base/base_region.h"
@@ -919,7 +920,7 @@ void AdActor::getNextStep() {
//////////////////////////////////////////////////////////////////////////
void AdActor::initLine(const BasePoint &startPt, const BasePoint &endPt) {
- _pFCount = MAX((abs(endPt.x - startPt.x)) , (abs(endPt.y - startPt.y)));
+ _pFCount = MAX((abs(endPt.x - startPt.x)), (abs(endPt.y - startPt.y)));
_pFStepX = (double)(endPt.x - startPt.x) / _pFCount;
_pFStepY = (double)(endPt.y - startPt.y) / _pFCount;
@@ -1022,6 +1023,55 @@ bool AdActor::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
return STATUS_OK;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] StopWalking
+ // Used to stop Leah in one scene only at rabbit_run.script in action()
+ // Let's just call turnTo() for current direction to finalize movement
+ // Return value is never used
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "StopWalking") == 0) {
+ stack->correctParams(0);
+ turnTo(_dir);
+ stack->pushNULL();
+
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] SetSpeedWalkAnim
+ // Used to set Leah speed at leah.script in SetSpeed()
+ // Modifies walking animations interframe delays
+ // Takes integer parameter:
+ // 10 on state.ultra_super_mega_fast_walk cheat code
+ // 40 on "Fast" settings
+ // 70 on "Normal" settings
+ // 90 on "Slow" settings
+ // Return value is never used
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "SetSpeedWalkAnim") == 0) {
+ stack->correctParams(1);
+ int speedWalk = stack->pop()->getInt();
+ for (uint32 dir = 0; dir < NUM_DIRECTIONS; dir++) {
+ AdSpriteSet *anim = getAnimByName(_walkAnimName);
+ if (anim != nullptr) {
+ BaseSprite *item = anim->getSprite((TDirection)dir);
+ if (item != nullptr) {
+ for (uint32 i = 0; i < item->_frames.size(); i++) {
+ BaseFrame *frame = item->_frames[i];
+ if (frame != nullptr) {
+ frame->_delay = speedWalk;
+ }
+ }
+ }
+ }
+ }
+ stack->pushNULL();
+
+ return STATUS_OK;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// MergeAnims
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/ad/ad_entity.cpp b/engines/wintermute/ad/ad_entity.cpp
index 7a4df6c114..ea7c46c5ac 100644
--- a/engines/wintermute/ad/ad_entity.cpp
+++ b/engines/wintermute/ad/ad_entity.cpp
@@ -34,6 +34,7 @@
#include "engines/wintermute/ad/ad_sentence.h"
#include "engines/wintermute/base/base_active_rect.h"
#include "engines/wintermute/base/base_dynamic_buffer.h"
+#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/base_file_manager.h"
#include "engines/wintermute/base/base_game.h"
#include "engines/wintermute/base/base_parser.h"
@@ -67,6 +68,10 @@ AdEntity::AdEntity(BaseGame *inGame) : AdTalkHolder(inGame) {
_walkToX = _walkToY = 0;
_walkToDir = DI_NONE;
+#ifdef ENABLE_FOXTAIL
+ _hintX = _hintY = -1;
+#endif
+
_theora = nullptr;
}
@@ -98,6 +103,16 @@ const char *AdEntity::getItemName() const {
return _item;
}
+#ifdef ENABLE_FOXTAIL
+int32 AdEntity::getHintX() const {
+ return _hintX;
+}
+
+int32 AdEntity::getHintY() const {
+ return _hintY;
+}
+#endif
+
//////////////////////////////////////////////////////////////////////////
bool AdEntity::loadFile(const char *filename) {
char *buffer = (char *)BaseFileManager::getEngineInstance()->readWholeFile(filename);
@@ -164,6 +179,10 @@ TOKEN_DEF(WALK_TO_X)
TOKEN_DEF(WALK_TO_Y)
TOKEN_DEF(WALK_TO_DIR)
TOKEN_DEF(SAVE_STATE)
+#ifdef ENABLE_FOXTAIL
+TOKEN_DEF(HINT_X)
+TOKEN_DEF(HINT_Y)
+#endif
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
bool AdEntity::loadBuffer(char *buffer, bool complete) {
@@ -210,6 +229,10 @@ bool AdEntity::loadBuffer(char *buffer, bool complete) {
TOKEN_TABLE(WALK_TO_Y)
TOKEN_TABLE(WALK_TO_DIR)
TOKEN_TABLE(SAVE_STATE)
+#ifdef ENABLE_FOXTAIL
+ TOKEN_TABLE(HINT_X)
+ TOKEN_TABLE(HINT_Y)
+#endif
TOKEN_TABLE_END
char *params;
@@ -487,6 +510,14 @@ bool AdEntity::loadBuffer(char *buffer, bool complete) {
i = DI_NONE;
}
_walkToDir = (TDirection)i;
+#ifdef ENABLE_FOXTAIL
+ case TOKEN_HINT_X:
+ parser.scanStr(params, "%d", &_hintX);
+ break;
+ case TOKEN_HINT_Y:
+ parser.scanStr(params, "%d", &_hintY);
+ break;
+#endif
}
break;
@@ -900,6 +931,24 @@ ScValue *AdEntity::scGetProperty(const Common::String &name) {
return _scValue;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] HintX
+ //////////////////////////////////////////////////////////////////////////
+ else if (name == "HintX") {
+ _scValue->setInt(_hintX);
+ return _scValue;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] HintY
+ //////////////////////////////////////////////////////////////////////////
+ else if (name == "HintY") {
+ _scValue->setInt(_hintY);
+ return _scValue;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// WalkToDirection
//////////////////////////////////////////////////////////////////////////
@@ -951,6 +1000,24 @@ bool AdEntity::scSetProperty(const char *name, ScValue *value) {
return STATUS_OK;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] HintX
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "HintX") == 0) {
+ _hintX = value->getInt();
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // HintY
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "HintY") == 0) {
+ _hintY = value->getInt();
+ return STATUS_OK;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// WalkToDirection
//////////////////////////////////////////////////////////////////////////
@@ -1012,6 +1079,11 @@ bool AdEntity::saveAsText(BaseDynamicBuffer *buffer, int indent) {
buffer->putTextIndent(indent + 2, "WALK_TO_DIR=%d\n", (int)_walkToDir);
}
+#ifdef ENABLE_FOXTAIL
+ buffer->putTextIndent(indent + 2, "HINT_X=%d\n", _hintX);
+ buffer->putTextIndent(indent + 2, "HINT_Y=%d\n", _hintY);
+#endif
+
for (uint32 i = 0; i < _scripts.size(); i++) {
buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
@@ -1108,6 +1180,13 @@ bool AdEntity::persist(BasePersistenceManager *persistMgr) {
persistMgr->transferPtr(TMEMBER_PTR(_theora));
+#ifdef ENABLE_FOXTAIL
+ if (BaseEngine::instance().isFoxTail(FOXTAIL_1_2_527, FOXTAIL_LATEST_VERSION)) {
+ persistMgr->transferSint32(TMEMBER(_hintX));
+ persistMgr->transferSint32(TMEMBER(_hintY));
+ }
+#endif
+
return STATUS_OK;
}
diff --git a/engines/wintermute/ad/ad_entity.h b/engines/wintermute/ad/ad_entity.h
index 678608af36..5407093915 100644
--- a/engines/wintermute/ad/ad_entity.h
+++ b/engines/wintermute/ad/ad_entity.h
@@ -55,6 +55,11 @@ public:
TDirection getWalkToDir() const;
const char* getItemName() const;
+#ifdef ENABLE_FOXTAIL
+ int32 getHintX() const;
+ int32 getHintY() const;
+#endif
+
// scripting interface
virtual ScValue *scGetProperty(const Common::String &name) override;
virtual bool scSetProperty(const char *name, ScValue *value) override;
@@ -67,6 +72,11 @@ private:
TDirection _walkToDir;
char *_item;
TEntityType _subtype;
+
+#ifdef ENABLE_FOXTAIL
+ int32 _hintX;
+ int32 _hintY;
+#endif
};
} // End of namespace Wintermute
diff --git a/engines/wintermute/ad/ad_game.cpp b/engines/wintermute/ad/ad_game.cpp
index dff0216c10..a6730feecd 100644
--- a/engines/wintermute/ad/ad_game.cpp
+++ b/engines/wintermute/ad/ad_game.cpp
@@ -873,6 +873,19 @@ bool AdGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
return STATUS_OK;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] SetInventoryBoxHideSelected
+ // Used while changing cursor type at some included script
+ // Return value is never used
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "SetInventoryBoxHideSelected") == 0) {
+ stack->correctParams(1);
+ _inventoryBox->_hideSelected = stack->pop()->getBool(false);
+ stack->pushNULL();
+ return STATUS_OK;
+ }
+#endif
else {
return BaseGame::scCallMethod(script, stack, thisStack, name);
diff --git a/engines/wintermute/ad/ad_item.cpp b/engines/wintermute/ad/ad_item.cpp
index b414fbdadf..cebc6980d9 100644
--- a/engines/wintermute/ad/ad_item.cpp
+++ b/engines/wintermute/ad/ad_item.cpp
@@ -535,6 +535,23 @@ bool AdItem::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
return STATUS_OK;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] RemoveNormalCursor
+ // Used while changing cursor type at some included script
+ // Return value is never used
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "RemoveNormalCursor") == 0) {
+ stack->correctParams(0);
+
+ delete _cursorNormal;
+ _cursorNormal = nullptr;
+
+ stack->pushNULL();
+ return STATUS_OK;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// GetNormalCursor
//////////////////////////////////////////////////////////////////////////
@@ -584,6 +601,23 @@ bool AdItem::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
return STATUS_OK;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] RemoveHoverCursor
+ // Used while changing cursor type at some included script
+ // Return value is never used
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "RemoveHoverCursor") == 0) {
+ stack->correctParams(0);
+
+ delete _cursorHover;
+ _cursorHover = nullptr;
+
+ stack->pushNULL();
+ return STATUS_OK;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// GetHoverCursor
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/ad/ad_response_box.cpp b/engines/wintermute/ad/ad_response_box.cpp
index fc8e778f37..bd4ae50eab 100644
--- a/engines/wintermute/ad/ad_response_box.cpp
+++ b/engines/wintermute/ad/ad_response_box.cpp
@@ -29,6 +29,7 @@
#include "engines/wintermute/ad/ad_game.h"
#include "engines/wintermute/ad/ad_response.h"
#include "engines/wintermute/ad/ad_response_box.h"
+#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/base_dynamic_buffer.h"
#include "engines/wintermute/base/base_file_manager.h"
#include "engines/wintermute/base/base_parser.h"
@@ -190,6 +191,18 @@ bool AdResponseBox::createButtons() {
btn->setWidth(width);
}
}
+
+#ifdef ENABLE_FOXTAIL
+ if (BaseEngine::instance().isFoxTail()) {
+ btn->addScript("interface/scripts/dialogue_button.script");
+ btn->setWidth(120);
+ if (_fontHover == nullptr) {
+ btn->setFontHover(btn->getFont());
+ btn->setFontPress(btn->getFontHover());
+ }
+ }
+#endif
+
btn->setName("response");
btn->correctSize();
@@ -500,6 +513,22 @@ bool AdResponseBox::display() {
// prepare response buttons
bool scrollNeeded = false;
for (i = _scrollOffset; i < _respButtons.size(); i++) {
+
+#ifdef ENABLE_FOXTAIL
+ // FoxTail's "HORIZONTAL=TRUE" display boxes are actual 2x3 display boxes
+ // Tests show that this hack was removed in FOXTAIL_1_2_362
+ if (_horizontal && BaseEngine::instance().isFoxTail(FOXTAIL_OLDEST_VERSION, FOXTAIL_1_2_304)) {
+ if (i >= _scrollOffset + 6) {
+ scrollNeeded = true;
+ break;
+ }
+ _respButtons[i]->setVisible(true);
+ _respButtons[i]->_posX = 55 + 120 * (i / 3);
+ _respButtons[i]->_posY = 100 + 10 * (i % 3);
+ continue;
+ }
+#endif
+
if ((_horizontal && xxx + _respButtons[i]->getWidth() > rect.right)
|| (!_horizontal && yyy + _respButtons[i]->getHeight() > rect.bottom)) {
diff --git a/engines/wintermute/base/base_engine.h b/engines/wintermute/base/base_engine.h
index a8770f6168..14a14a3c19 100644
--- a/engines/wintermute/base/base_engine.h
+++ b/engines/wintermute/base/base_engine.h
@@ -84,7 +84,14 @@ enum WMETargetExecutable {
WME_1_9_2, // DEAD:CODE 2010
WME_1_9_3, // DEAD:CODE 2012, released as "1.10.1 beta"
WME_LITE,
- LATEST_VERSION
+ LATEST_VERSION,
+ FOXTAIL_OLDEST_VERSION,
+ FOXTAIL_1_2_227,
+ FOXTAIL_1_2_230,
+ FOXTAIL_1_2_304,
+ FOXTAIL_1_2_362,
+ FOXTAIL_1_2_527,
+ FOXTAIL_LATEST_VERSION
};
class BaseFileManager;
@@ -129,6 +136,12 @@ public:
WMETargetExecutable getTargetExecutable() const {
return _targetExecutable;
}
+ static bool isFoxTailCheck(WMETargetExecutable t, WMETargetExecutable v1=FOXTAIL_OLDEST_VERSION, WMETargetExecutable v2=FOXTAIL_LATEST_VERSION) {
+ return t >= v1 && t <= v2;
+ }
+ bool isFoxTail(WMETargetExecutable v1=FOXTAIL_OLDEST_VERSION, WMETargetExecutable v2=FOXTAIL_LATEST_VERSION) const {
+ return isFoxTailCheck(_targetExecutable, v1, v2);
+ }
};
} // End of namespace Wintermute
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp
index dad8b43d65..6102c10725 100644
--- a/engines/wintermute/base/base_file_manager.cpp
+++ b/engines/wintermute/base/base_file_manager.cpp
@@ -300,7 +300,7 @@ bool BaseFileManager::registerPackages() {
}
}
debugC(kWintermuteDebugFileAccess, "Registering %s %s", fileIt->getPath().c_str(), fileIt->getName().c_str());
- registerPackage((*fileIt), "", searchSignature);
+ registerPackage((*fileIt), fileName, searchSignature);
}
}
@@ -311,7 +311,8 @@ bool BaseFileManager::registerPackages() {
bool BaseFileManager::registerPackage(Common::FSNode file, const Common::String &filename, bool searchSignature) {
PackageSet *pack = new PackageSet(file, filename, searchSignature);
- _packages.add(file.getName(), pack, pack->getPriority() , true);
+ _packages.add(filename, pack, pack->getPriority() , true);
+ _versions[filename] = pack->getVersion();
return STATUS_OK;
}
@@ -348,6 +349,16 @@ Common::SeekableReadStream *BaseFileManager::openPkgFile(const Common::String &f
return file;
}
+//////////////////////////////////////////////////////////////////////////
+uint32 BaseFileManager::getPackageVersion(const Common::String &filename) {
+ Common::HashMap<Common::String, uint32>::iterator it = _versions.find(filename);
+ if (it != _versions.end()) {
+ return it->_value;
+ }
+ return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////
bool BaseFileManager::hasFile(const Common::String &filename) {
if (scumm_strnicmp(filename.c_str(), "savegame:", 9) == 0) {
BasePersistenceManager pm(BaseEngine::instance().getGameTargetName());
diff --git a/engines/wintermute/base/base_file_manager.h b/engines/wintermute/base/base_file_manager.h
index 85181f1f58..397e38cc3d 100644
--- a/engines/wintermute/base/base_file_manager.h
+++ b/engines/wintermute/base/base_file_manager.h
@@ -46,6 +46,7 @@ public:
Common::SeekableReadStream *openFile(const Common::String &filename, bool absPathWarning = true, bool keepTrackOf = true);
Common::WriteStream *openFileForWrite(const Common::String &filename);
byte *readWholeFile(const Common::String &filename, uint32 *size = nullptr, bool mustExist = true);
+ uint32 getPackageVersion(const Common::String &filename);
BaseFileManager(Common::Language lang, bool detectionMode = false);
virtual ~BaseFileManager();
@@ -72,6 +73,8 @@ private:
Common::Array<Common::SeekableReadStream *> _openFiles;
Common::Language _language;
Common::Archive *_resources;
+ Common::HashMap<Common::String, uint32> _versions;
+
// This class is intentionally not a subclass of Base, as it needs to be used by
// the detector too, without launching the entire engine:
};
diff --git a/engines/wintermute/base/base_frame.cpp b/engines/wintermute/base/base_frame.cpp
index a821234ba0..6aa9785d84 100644
--- a/engines/wintermute/base/base_frame.cpp
+++ b/engines/wintermute/base/base_frame.cpp
@@ -174,7 +174,7 @@ bool BaseFrame::loadBuffer(char *buffer, int lifeTime, bool keepLoaded) {
int r = 255, g = 255, b = 255;
int ar = 255, ag = 255, ab = 255, alpha = 255;
int hotspotX = 0, hotspotY = 0;
- bool custoTrans = false;
+ bool customTrans = false;
bool editorSelected = false;
bool is2DOnly = false;
bool is3DOnly = false;
@@ -196,7 +196,7 @@ bool BaseFrame::loadBuffer(char *buffer, int lifeTime, bool keepLoaded) {
case TOKEN_TRANSPARENT:
parser.scanStr(params, "%d,%d,%d", &r, &g, &b);
- custoTrans = true;
+ customTrans = true;
break;
case TOKEN_RECT:
@@ -310,7 +310,7 @@ bool BaseFrame::loadBuffer(char *buffer, int lifeTime, bool keepLoaded) {
BaseSubFrame *sub = new BaseSubFrame(_gameRef);
if (surface_file != nullptr) {
- if (custoTrans) {
+ if (customTrans) {
sub->setSurface(surface_file, false, r, g, b, lifeTime, keepLoaded);
} else {
sub->setSurface(surface_file, true, 0, 0, 0, lifeTime, keepLoaded);
@@ -323,7 +323,7 @@ bool BaseFrame::loadBuffer(char *buffer, int lifeTime, bool keepLoaded) {
}
sub->_alpha = BYTETORGBA(ar, ag, ab, alpha);
- if (custoTrans) {
+ if (customTrans) {
sub->_transparent = BYTETORGBA(r, g, b, 0xFF);
}
}
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp
index a06511f3ea..f5caaa8d2e 100644
--- a/engines/wintermute/base/base_game.cpp
+++ b/engines/wintermute/base/base_game.cpp
@@ -48,6 +48,7 @@
#include "engines/wintermute/base/base_surface_storage.h"
#include "engines/wintermute/base/saveload.h"
#include "engines/wintermute/base/save_thumb_helper.h"
+#include "engines/wintermute/base/scriptables/script_ext_array.h"
#include "engines/wintermute/base/scriptables/script_value.h"
#include "engines/wintermute/base/scriptables/script_engine.h"
#include "engines/wintermute/base/scriptables/script_stack.h"
@@ -1259,6 +1260,21 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
return STATUS_OK;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] RegistryFlush
+ // Return value is never used
+ // Used at SaveGameSettings() and Game.RegistryFlush()
+ // Called after a series of RegWriteNumber calls
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "RegistryFlush") == 0) {
+ stack->correctParams(0);
+ ConfMan.flushToDisk();
+ stack->pushNULL();
+ return STATUS_OK;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// RegWriteNumber
//////////////////////////////////////////////////////////////////////////
@@ -1362,13 +1378,54 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
else if (strcmp(name, "GetSaveSlotDescription") == 0) {
stack->correctParams(1);
int slot = stack->pop()->getInt();
- char desc[512];
- desc[0] = '\0';
- SaveLoad::getSaveSlotDescription(slot, desc);
- stack->pushString(desc);
+ Common::String desc = SaveLoad::getSaveSlotDescription(slot);
+ stack->pushString(desc.c_str());
return STATUS_OK;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] GetSaveSlotDescriptionTimestamp
+ // Return struct with "Description" and "Timestamp" fields in 1.2.362-
+ // Return array with "Description" and "Timestamp" items in 1.2.527+
+ // Timestamps should be comparable types
+ // Used to sort saved games by timestamps at save.script & load.script
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "GetSaveSlotDescriptionTimestamp") == 0) {
+ stack->correctParams(1);
+ int slot = stack->pop()->getInt();
+
+ TimeDate time;
+ SaveLoad::getSaveSlotTimestamp(slot, &time);
+ stack->pushInt(time.tm_sec);
+ stack->pushInt(time.tm_min);
+ stack->pushInt(time.tm_hour);
+ stack->pushInt(time.tm_mday);
+ stack->pushInt(time.tm_mon + 1);
+ stack->pushInt(time.tm_year + 1900);
+ stack->pushInt(6);
+ BaseScriptable *date = makeSXDate(_gameRef, stack);
+ stack->pushNative(date, false);
+
+ Common::String desc = SaveLoad::getSaveSlotDescription(slot);
+ stack->pushString(desc.c_str());
+
+ BaseScriptable *obj;
+ if (BaseEngine::instance().isFoxTail(FOXTAIL_1_2_527, FOXTAIL_LATEST_VERSION)) {
+ stack->pushInt(2);
+ obj = makeSXArray(_gameRef, stack);
+ } else {
+ stack->pushInt(0);
+ obj = makeSXObject(_gameRef, stack);
+ obj->scSetProperty("Description", stack->pop());
+ obj->scSetProperty("Timestamp", stack->pop());
+ }
+ stack->pushNative(obj, false);
+
+ return STATUS_OK;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// EmptySaveSlot
//////////////////////////////////////////////////////////////////////////
@@ -1941,6 +1998,96 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
return STATUS_OK;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] GetScreenType
+ // Returns 0 on fullscreen and 1 on window
+ // Used to init and update controls at options.script and methods.script
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "GetScreenType") == 0) {
+ stack->correctParams(0);
+ int type = !g_system->getFeatureState(OSystem::kFeatureFullscreenMode);
+ stack->pushInt(type);
+
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] GetScreenMode
+ // Returns integer to be used as a pixelization mode multiplier
+ // (e.g. it returns 2 for 640x360, 3 for 960x540, etc...)
+ // Used to init and update controls at options.script and methods.script
+ // This implementation always return 2 to fake window size of 2*320 x 2*180
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "GetScreenMode") == 0) {
+ stack->correctParams(0);
+ stack->pushInt(2);
+
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] GetDesktopDisplayMode
+ // Return struct with "w" and "h" fields in 1.2.362-
+ // Return array with "w" and "h" items in 1.2.527+
+ // Used to init and update controls at options.script and methods.script
+ // w,h of actual desktop size expected to calcucate maximum available size
+ // Available screen modes are calcucated as 2...N, N*320<w and N*180<h
+ // This implementation fakes available size as 2*320 x 2*180 only
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "GetDesktopDisplayMode") == 0) {
+ stack->correctParams(0);
+ stack->pushInt(2 * 180 + 1);
+ stack->pushInt(2 * 320 + 1);
+
+ BaseScriptable *obj;
+ if (BaseEngine::instance().isFoxTail(FOXTAIL_1_2_527, FOXTAIL_LATEST_VERSION)) {
+ stack->pushInt(2);
+ obj = makeSXArray(_gameRef, stack);
+ } else {
+ stack->pushInt(0);
+ obj = makeSXObject(_gameRef, stack);
+ obj->scSetProperty("w", stack->pop());
+ obj->scSetProperty("h", stack->pop());
+ }
+ stack->pushNative(obj, false);
+
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] SetScreenTypeMode
+ // This implementation ignores mode, toggles screen type only
+ // Used to change screen type&mode at options.script and methods.script
+ // Return value is never used
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "SetScreenTypeMode") == 0) {
+ stack->correctParams(2);
+ int type = stack->pop()->getInt();
+ stack->pop()->getInt(); //mode is unused
+ g_system->beginGFXTransaction();
+ g_system->setFeatureState(OSystem::kFeatureFullscreenMode, !type);
+ g_system->endGFXTransaction();
+ stack->pushNULL();
+
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] ChangeWindowGrab
+ // Used at game.script on "Keypress" event on F11
+ // Readme of FoxTail says: "F11 - free the mouse pointer from the window"
+ // This implementation does nothing
+ // Return value is never used
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "ChangeWindowGrab") == 0) {
+ stack->correctParams(0);
+ stack->pushNULL();
+
+ return STATUS_OK;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// ShowStatusLine
//////////////////////////////////////////////////////////////////////////
@@ -2329,6 +2476,123 @@ ScValue *BaseGame::scGetProperty(const Common::String &name) {
return _scValue;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] SystemLanguage (RO)
+ // Returns Steam API language name string
+ //////////////////////////////////////////////////////////////////////////
+ else if (name == "SystemLanguage") {
+ switch (Common::parseLanguage(ConfMan.get("language"))) {
+ case Common::CZ_CZE:
+ _scValue->setString("czech");
+ break;
+ case Common::DA_DAN:
+ _scValue->setString("danish");
+ break;
+ case Common::DE_DEU:
+ _scValue->setString("german");
+ break;
+ case Common::ES_ESP:
+ _scValue->setString("spanish");
+ break;
+ case Common::FI_FIN:
+ _scValue->setString("finnish");
+ break;
+ case Common::FR_FRA:
+ _scValue->setString("french");
+ break;
+ case Common::GR_GRE:
+ _scValue->setString("greek");
+ break;
+ case Common::HU_HUN:
+ _scValue->setString("hungarian");
+ break;
+ case Common::IT_ITA:
+ _scValue->setString("italian");
+ break;
+ case Common::JA_JPN:
+ _scValue->setString("japanese");
+ break;
+ case Common::KO_KOR:
+ _scValue->setString("koreana");
+ break;
+ case Common::NB_NOR:
+ _scValue->setString("norwegian");
+ break;
+ case Common::NL_NLD:
+ _scValue->setString("dutch");
+ break;
+ case Common::PT_BRA:
+ _scValue->setString("brazilian");
+ break;
+ case Common::PT_POR:
+ _scValue->setString("portuguese");
+ break;
+ case Common::PL_POL:
+ _scValue->setString("polish");
+ break;
+ case Common::RU_RUS:
+ _scValue->setString("russian");
+ break;
+ case Common::SE_SWE:
+ _scValue->setString("swedish");
+ break;
+ case Common::UA_UKR:
+ _scValue->setString("ukrainian");
+ break;
+ case Common::ZH_CNA:
+ _scValue->setString("schinese");
+ break;
+ case Common::ZH_TWN:
+ _scValue->setString("tchinese");
+ break;
+ default:
+ _scValue->setString("english");
+ break;
+ }
+ return _scValue;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] BuildVersion (RO)
+ // Used to display full game version at options.script in UpdateControls()
+ // Returns FoxTail engine version number as a dotted string
+ //////////////////////////////////////////////////////////////////////////
+ else if (name == "BuildVersion") {
+ if (BaseEngine::instance().getTargetExecutable() == FOXTAIL_1_2_227) {
+ _scValue->setString("1.2.227");
+ } else if (BaseEngine::instance().getTargetExecutable() == FOXTAIL_1_2_230) {
+ _scValue->setString("1.2.230");
+ } else if (BaseEngine::instance().getTargetExecutable() == FOXTAIL_1_2_304) {
+ _scValue->setString("1.2.304");
+ } else if (BaseEngine::instance().getTargetExecutable() == FOXTAIL_1_2_362) {
+ _scValue->setString("1.2.362");
+ } else if (BaseEngine::instance().getTargetExecutable() == FOXTAIL_1_2_527) {
+ _scValue->setString("1.2.527");
+ } else {
+ _scValue->setString("UNKNOWN");
+ }
+ return _scValue;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] GameVersion (RO)
+ // Used to display full game version at options.script in UpdateControls()
+ // Returns FoxTail version number as a string
+ //////////////////////////////////////////////////////////////////////////
+ else if (name == "GameVersion") {
+ uint32 gameVersion = 0;
+ BaseFileManager *fileManager = BaseEngine::instance().getFileManager();
+ if (fileManager) {
+ gameVersion = fileManager->getPackageVersion("data.dcp");
+ }
+ char tmp[16];
+ sprintf(tmp,"%u",gameVersion);
+ _scValue->setString(tmp);
+ return _scValue;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// Platform (RO)
//////////////////////////////////////////////////////////////////////////
@@ -2997,6 +3261,44 @@ bool BaseGame::externalCall(ScScript *script, ScStack *stack, ScStack *thisStack
stack->pushBool(val);
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] Split
+ // Returns array of words of a string, using another as a delimeter
+ // Used to split strings by 1 character delimeter in various scripts
+ // All the delimeters ever used in FoxTail are: " ", "@", "#", "$", "&"
+ // So, this implementation takes 1st char of delimeter string only
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "Split") == 0) {
+ stack->correctParams(2);
+ const char *str = stack->pop()->getString();
+ const char sep = stack->pop()->getString()[0];
+ size_t size = strlen(str) + 1;
+
+ // There is no way to makeSXArray() with exactly 1 given element
+ // That's why we are creating empty Array and SXArray::push() later
+ stack->pushInt(0);
+ BaseScriptable *arr = makeSXArray(_gameRef, stack);
+
+ // Iterating string copy, replacing delimeter with '\0' and pushing matches
+ char *copy = new char[size];
+ strcpy(copy, str);
+ char *begin = copy;
+ for (char *it = copy; it < copy + size; it++) {
+ if (*it == sep || *it == '\0') {
+ *it = '\0';
+ stack->pushString(begin);
+ ((SXArray *)arr)->push(stack->pop());
+ begin = it + 1;
+ }
+ }
+
+ stack->pushNative(arr, false);
+
+ delete[] copy;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// failure
else {
diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp
index 13b753a7d6..502577c656 100644
--- a/engines/wintermute/base/base_keyboard_state.cpp
+++ b/engines/wintermute/base/base_keyboard_state.cpp
@@ -39,8 +39,207 @@ namespace Wintermute {
IMPLEMENT_PERSISTENT(BaseKeyboardState, false)
+// Used in WME 1.x
+// See "MSDN: Virtual-Key Codes" for more details on original WME keycodes
+const keyCodeMapping wmeOriginalMapping[] = {
+ { Common::KEYCODE_BACKSPACE, 8 },
+ { Common::KEYCODE_TAB, 9 },
+ { Common::KEYCODE_RETURN, 13 },
+ { Common::KEYCODE_CAPSLOCK, 20 },
+ { Common::KEYCODE_ESCAPE, 27 },
+ { Common::KEYCODE_SPACE, 32 },
+
+ { Common::KEYCODE_PAUSE, 19 },
+ { Common::KEYCODE_PAGEUP, 33 },
+ { Common::KEYCODE_PAGEDOWN, 34 },
+ { Common::KEYCODE_END, 35 },
+ { Common::KEYCODE_HOME, 36 },
+ { Common::KEYCODE_LEFT, 37 },
+ { Common::KEYCODE_UP, 38 },
+ { Common::KEYCODE_RIGHT, 39 },
+ { Common::KEYCODE_DOWN, 40 },
+ { Common::KEYCODE_PRINT, 42 },
+ { Common::KEYCODE_INSERT, 45 },
+ { Common::KEYCODE_DELETE, 46 },
+ { Common::KEYCODE_SCROLLOCK, 145 },
+
+ { Common::KEYCODE_0, 48 },
+ { Common::KEYCODE_1, 49 },
+ { Common::KEYCODE_2, 50 },
+ { Common::KEYCODE_3, 51 },
+ { Common::KEYCODE_4, 52 },
+ { Common::KEYCODE_5, 53 },
+ { Common::KEYCODE_6, 54 },
+ { Common::KEYCODE_7, 55 },
+ { Common::KEYCODE_8, 56 },
+ { Common::KEYCODE_9, 57 },
+
+ { Common::KEYCODE_a, 65 },
+ { Common::KEYCODE_b, 66 },
+ { Common::KEYCODE_c, 67 },
+ { Common::KEYCODE_d, 68 },
+ { Common::KEYCODE_e, 69 },
+ { Common::KEYCODE_f, 70 },
+ { Common::KEYCODE_g, 71 },
+ { Common::KEYCODE_h, 72 },
+ { Common::KEYCODE_i, 73 },
+ { Common::KEYCODE_j, 74 },
+ { Common::KEYCODE_k, 75 },
+ { Common::KEYCODE_l, 76 },
+ { Common::KEYCODE_m, 77 },
+ { Common::KEYCODE_n, 78 },
+ { Common::KEYCODE_o, 79 },
+ { Common::KEYCODE_p, 80 },
+ { Common::KEYCODE_q, 81 },
+ { Common::KEYCODE_r, 82 },
+ { Common::KEYCODE_s, 83 },
+ { Common::KEYCODE_t, 84 },
+ { Common::KEYCODE_u, 85 },
+ { Common::KEYCODE_v, 86 },
+ { Common::KEYCODE_w, 87 },
+ { Common::KEYCODE_x, 88 },
+ { Common::KEYCODE_y, 89 },
+ { Common::KEYCODE_z, 90 },
+
+ { Common::KEYCODE_CLEAR, 12 },
+ { Common::KEYCODE_KP_ENTER, 13 },
+ { Common::KEYCODE_KP0, 96 },
+ { Common::KEYCODE_KP1, 97 },
+ { Common::KEYCODE_KP2, 98 },
+ { Common::KEYCODE_KP3, 99 },
+ { Common::KEYCODE_KP4, 100 },
+ { Common::KEYCODE_KP5, 101 },
+ { Common::KEYCODE_KP6, 102 },
+ { Common::KEYCODE_KP7, 103 },
+ { Common::KEYCODE_KP8, 104 },
+ { Common::KEYCODE_KP9, 105 },
+ { Common::KEYCODE_KP_MULTIPLY, 106 },
+ { Common::KEYCODE_KP_PLUS, 107 },
+ { Common::KEYCODE_KP_MINUS, 109 },
+ { Common::KEYCODE_KP_PERIOD, 110 },
+ { Common::KEYCODE_KP_DIVIDE, 111 },
+ { Common::KEYCODE_NUMLOCK, 144 },
+
+ { Common::KEYCODE_F1, 112 },
+ { Common::KEYCODE_F2, 113 },
+ { Common::KEYCODE_F3, 114 },
+ { Common::KEYCODE_F4, 115 },
+ { Common::KEYCODE_F5, 116 },
+ { Common::KEYCODE_F6, 117 },
+ { Common::KEYCODE_F7, 118 },
+ { Common::KEYCODE_F8, 119 },
+ { Common::KEYCODE_F9, 120 },
+ { Common::KEYCODE_F10, 121 },
+ { Common::KEYCODE_F11, 122 },
+ { Common::KEYCODE_F12, 123 },
+
+ { Common::KEYCODE_INVALID, 0 }
+};
+
+// Used in WME Lite & FoxTail
+// See "SDL_Keycode" for more details on new WME keycodes
+const keyCodeMapping wmeSdlMapping[] = {
+ { Common::KEYCODE_BACKSPACE, 8 },
+ { Common::KEYCODE_TAB, 9 },
+ { Common::KEYCODE_RETURN, 13 },
+ { Common::KEYCODE_ESCAPE, 27 },
+ { Common::KEYCODE_SPACE, 32 },
+ { Common::KEYCODE_CAPSLOCK, 1073741881 },
+
+ { Common::KEYCODE_DELETE, 127 },
+ { Common::KEYCODE_PRINT, 1073741894 },
+ { Common::KEYCODE_SCROLLOCK, 1073741895 },
+ { Common::KEYCODE_PAUSE, 1073741896 },
+ { Common::KEYCODE_INSERT, 1073741897 },
+ { Common::KEYCODE_HOME, 1073741898 },
+ { Common::KEYCODE_PAGEUP, 1073741899 },
+ { Common::KEYCODE_END, 1073741901 },
+ { Common::KEYCODE_PAGEDOWN, 1073741902 },
+ { Common::KEYCODE_RIGHT, 1073741903 },
+ { Common::KEYCODE_LEFT, 1073741904 },
+ { Common::KEYCODE_DOWN, 1073741905 },
+ { Common::KEYCODE_UP, 1073741906 },
+
+ { Common::KEYCODE_0, 48 },
+ { Common::KEYCODE_1, 49 },
+ { Common::KEYCODE_2, 50 },
+ { Common::KEYCODE_3, 51 },
+ { Common::KEYCODE_4, 52 },
+ { Common::KEYCODE_5, 53 },
+ { Common::KEYCODE_6, 54 },
+ { Common::KEYCODE_7, 55 },
+ { Common::KEYCODE_8, 56 },
+ { Common::KEYCODE_9, 57 },
+
+ { Common::KEYCODE_a, 97 },
+ { Common::KEYCODE_b, 98 },
+ { Common::KEYCODE_c, 99 },
+ { Common::KEYCODE_d, 100 },
+ { Common::KEYCODE_e, 101 },
+ { Common::KEYCODE_f, 102 },
+ { Common::KEYCODE_g, 103 },
+ { Common::KEYCODE_h, 104 },
+ { Common::KEYCODE_i, 105 },
+ { Common::KEYCODE_j, 106 },
+ { Common::KEYCODE_k, 107 },
+ { Common::KEYCODE_l, 108 },
+ { Common::KEYCODE_m, 109 },
+ { Common::KEYCODE_n, 110 },
+ { Common::KEYCODE_o, 111 },
+ { Common::KEYCODE_p, 112 },
+ { Common::KEYCODE_q, 113 },
+ { Common::KEYCODE_r, 114 },
+ { Common::KEYCODE_s, 115 },
+ { Common::KEYCODE_t, 116 },
+ { Common::KEYCODE_u, 117 },
+ { Common::KEYCODE_v, 118 },
+ { Common::KEYCODE_w, 119 },
+ { Common::KEYCODE_x, 120 },
+ { Common::KEYCODE_y, 121 },
+ { Common::KEYCODE_z, 122 },
+
+ { Common::KEYCODE_KP_ENTER, 13 },
+ { Common::KEYCODE_NUMLOCK, 1073741907 },
+ { Common::KEYCODE_KP_DIVIDE, 1073741908 },
+ { Common::KEYCODE_KP_MULTIPLY, 1073741909 },
+ { Common::KEYCODE_KP_MINUS, 1073741910 },
+ { Common::KEYCODE_KP_PLUS, 1073741911 },
+ { Common::KEYCODE_KP1, 1073741913 },
+ { Common::KEYCODE_KP2, 1073741914 },
+ { Common::KEYCODE_KP3, 1073741915 },
+ { Common::KEYCODE_KP4, 1073741916 },
+ { Common::KEYCODE_KP5, 1073741917 },
+ { Common::KEYCODE_KP6, 1073741918 },
+ { Common::KEYCODE_KP7, 1073741919 },
+ { Common::KEYCODE_KP8, 1073741920 },
+ { Common::KEYCODE_KP9, 1073741921 },
+ { Common::KEYCODE_KP0, 1073741922 },
+ { Common::KEYCODE_KP_PERIOD, 1073741923 },
+ { Common::KEYCODE_CLEAR, 1073741980 },
+
+ { Common::KEYCODE_F1, 1073741882 },
+ { Common::KEYCODE_F2, 1073741883 },
+ { Common::KEYCODE_F3, 1073741884 },
+ { Common::KEYCODE_F4, 1073741885 },
+ { Common::KEYCODE_F5, 1073741886 },
+ { Common::KEYCODE_F6, 1073741887 },
+ { Common::KEYCODE_F7, 1073741888 },
+ { Common::KEYCODE_F8, 1073741889 },
+ { Common::KEYCODE_F9, 1073741890 },
+ { Common::KEYCODE_F10, 1073741891 },
+ { Common::KEYCODE_F11, 1073741892 },
+ { Common::KEYCODE_F12, 1073741893 },
+
+ { Common::KEYCODE_INVALID, 0 }
+};
+
//////////////////////////////////////////////////////////////////////////
BaseKeyboardState::BaseKeyboardState(BaseGame *inGame) : BaseScriptable(inGame) {
+ init();
+}
+
+//////////////////////////////////////////////////////////////////////////
+void BaseKeyboardState::init() {
_currentPrintable = false;
_currentCharCode = 0;
_currentKeyData = 0;
@@ -53,6 +252,14 @@ BaseKeyboardState::BaseKeyboardState(BaseGame *inGame) : BaseScriptable(inGame)
for (int i = 0; i < KEYSTATES_ARRAY_SIZE; i++) {
_keyStates[i] = false;
}
+
+ if (BaseEngine::instance().getTargetExecutable() < WME_LITE) {
+ _mapping = wmeOriginalMapping;
+ _mappingSize = ARRAYSIZE(wmeOriginalMapping);
+ } else {
+ _mapping = wmeSdlMapping;
+ _mappingSize = ARRAYSIZE(wmeSdlMapping);
+ }
}
//////////////////////////////////////////////////////////////////////////
@@ -108,8 +315,18 @@ bool BaseKeyboardState::scCallMethod(ScScript *script, ScStack *stack, ScStack *
// For letters, single keycode is used for upper and lower case
// This mean that IsKeyDown(65) is true for both 'a' and Shift+'a'
- // See "MSDN: Virtual-Key Codes" for more details on original WME keycodes
- vKeyCode = vKeyToKeyCode(val->getInt());
+ vKeyCode = Common::KEYCODE_INVALID;
+ uint32 temp = (uint32)val->getInt();
+
+ for (uint32 i = 0; i < _mappingSize; i++) {
+ if (_mapping[i].engineKeycode == temp) {
+ vKeyCode = _mapping[i].commonKeycode;
+ }
+ }
+
+ if (vKeyCode == Common::KEYCODE_INVALID) {
+ warning("Unknown VKEY: %d", temp);
+ }
}
bool isDown = _keyStates[vKeyCode];
@@ -231,6 +448,11 @@ bool BaseKeyboardState::readKey(Common::Event *event) {
else if (code >= Common::KEYCODE_SPACE && code < Common::KEYCODE_DELETE) {
_currentCharCode = event->kbd.ascii;
_currentPrintable = true;
+#ifdef ENABLE_FOXTAIL
+ if (BaseEngine::instance().isFoxTail()) {
+ _currentCharCode = tolower(_currentCharCode);
+ }
+#endif
}
// use ASCII value for numpad '/', '*', '-', '+'
@@ -246,22 +468,28 @@ bool BaseKeyboardState::readKey(Common::Event *event) {
_currentPrintable = true;
}
- // use keyCodeToVKey mapping for all other events
- // in WME 1.x some of those keys are printable
- else if (BaseEngine::instance().getTargetExecutable() < WME_LITE) {
- _currentCharCode = keyCodeToVKey(event);
- _currentPrintable = code == Common::KEYCODE_BACKSPACE ||
- code == Common::KEYCODE_TAB ||
- code == Common::KEYCODE_RETURN ||
- code == Common::KEYCODE_KP_ENTER ||
- code == Common::KEYCODE_ESCAPE;
- }
-
- // use keyCodeToVKey mapping for all other events
- // in WME_LITE all of those key are not printable
+ // use _mapping for all other events
else {
- _currentCharCode = keyCodeToVKey(event);
- _currentPrintable = false;
+ _currentCharCode = 0;
+ for (uint32 i = 0; i < _mappingSize; i++) {
+ if (_mapping[i].commonKeycode == event->kbd.keycode) {
+ _currentCharCode = _mapping[i].engineKeycode;
+ }
+ }
+
+ if (!_currentCharCode && (event->kbd.flags & Common::KBD_NON_STICKY) == 0) {
+ warning("Key pressed (%d '%c') is not recognized, ASCII returned (%d '%c').", event->kbd.keycode, event->kbd.keycode, event->kbd.ascii, event->kbd.ascii);
+ }
+
+ if (BaseEngine::instance().getTargetExecutable() < WME_LITE) {
+ _currentPrintable = code == Common::KEYCODE_BACKSPACE ||
+ code == Common::KEYCODE_TAB ||
+ code == Common::KEYCODE_RETURN ||
+ code == Common::KEYCODE_KP_ENTER ||
+ code == Common::KEYCODE_ESCAPE;
+ } else {
+ _currentPrintable = false;
+ }
}
_currentControl = isControlDown();
@@ -285,10 +513,7 @@ bool BaseKeyboardState::persist(BasePersistenceManager *persistMgr) {
persistMgr->transferBool(TMEMBER(_currentShift));
if (!persistMgr->getIsSaving()) {
- _keyStates = new uint8[323]; // Hardcoded size for the common/keyboard.h enum
- for (int i = 0; i < 323; i++) {
- _keyStates[i] = false;
- }
+ init();
}
return STATUS_OK;
@@ -317,342 +542,4 @@ bool BaseKeyboardState::isCurrentPrintable() const {
return _currentPrintable;
}
-//////////////////////////////////////////////////////////////////////////
-enum VKeyCodes {
- kVkBack = 8, //printable
- kVkTab = 9, //printable
- kVkClear = 12,
- kVkReturn = 13, //printable
- kVkPause = 19,
- kVkCapital = 20,
- kVkEscape = 27, //printable
- kVkSpace = 32, //printable
-
- kVkPrior = 33,
- kVkNext = 34,
- kVkEnd = 35,
- kVkHome = 36,
- kVkLeft = 37,
- kVkUp = 38,
- kVkRight = 39,
- kVkDown = 40,
- kVkPrint = 42,
- kVkInsert = 45,
- kVkDelete = 46,
-
- kVkA = 65, //printable
- kVkB = 66, //printable
- kVkC = 67, //printable
- kVkD = 68, //printable
- kVkE = 69, //printable
- kVkF = 70, //printable
- kVkG = 71, //printable
- kVkH = 72, //printable
- kVkI = 73, //printable
- kVkJ = 74, //printable
- kVkK = 75, //printable
- kVkL = 76, //printable
- kVkM = 77, //printable
- kVkN = 78, //printable
- kVkO = 79, //printable
- kVkP = 80, //printable
- kVkQ = 81, //printable
- kVkR = 82, //printable
- kVkS = 83, //printable
- kVkT = 84, //printable
- kVkU = 85, //printable
- kVkV = 86, //printable
- kVkW = 87, //printable
- kVkX = 88, //printable
- kVkY = 89, //printable
- kVkZ = 90, //printable
-
- kVkNumpad0 = 96, //printable
- kVkNumpad1 = 97, //printable
- kVkNumpad2 = 98, //printable
- kVkNumpad3 = 99, //printable
- kVkNumpad4 = 100, //printable
- kVkNumpad5 = 101, //printable
- kVkNumpad6 = 102, //printable
- kVkNumpad7 = 103, //printable
- kVkNumpad8 = 104, //printable
- kVkNumpad9 = 105, //printable
- kVkMultiply = 106, //printable
- kVkAdd = 107, //printable
- kVkSeparator = 108, //printable
- kVkSubtract = 109, //printable
- kVkDecimal = 110, //printable
- kVkDivide = 111, //printable
-
- kVkF1 = 112,
- kVkF2 = 113,
- kVkF3 = 114,
- kVkF4 = 115,
- kVkF5 = 116,
- kVkF6 = 117,
- kVkF7 = 118,
- kVkF8 = 119,
- kVkF9 = 120,
- kVkF10 = 121,
- kVkF11 = 122,
- kVkF12 = 123,
-
- kVkNumLock = 144,
- kVkScroll = 145
-
- //TODO: shift, ctrl, menu, etc...
-};
-
-//////////////////////////////////////////////////////////////////////////
-uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) {
- switch (event->kbd.keycode) {
- case Common::KEYCODE_BACKSPACE:
- return kVkBack;
- case Common::KEYCODE_TAB:
- return kVkTab;
- case Common::KEYCODE_CLEAR:
- case Common::KEYCODE_KP5:
- return kVkClear;
- case Common::KEYCODE_RETURN:
- case Common::KEYCODE_KP_ENTER:
- return kVkReturn;
- case Common::KEYCODE_PAUSE:
- return kVkPause;
- case Common::KEYCODE_CAPSLOCK:
- return kVkCapital;
- case Common::KEYCODE_ESCAPE:
- return kVkEscape;
- case Common::KEYCODE_KP9:
- case Common::KEYCODE_PAGEUP:
- return kVkPrior;
- case Common::KEYCODE_KP3:
- case Common::KEYCODE_PAGEDOWN:
- return kVkNext;
- case Common::KEYCODE_END:
- case Common::KEYCODE_KP1:
- return kVkEnd;
- case Common::KEYCODE_HOME:
- case Common::KEYCODE_KP7:
- return kVkHome;
- case Common::KEYCODE_LEFT:
- case Common::KEYCODE_KP4:
- return kVkLeft;
- case Common::KEYCODE_RIGHT:
- case Common::KEYCODE_KP6:
- return kVkRight;
- case Common::KEYCODE_UP:
- case Common::KEYCODE_KP8:
- return kVkUp;
- case Common::KEYCODE_DOWN:
- case Common::KEYCODE_KP2:
- return kVkDown;
- case Common::KEYCODE_PRINT:
- return kVkPrint;
- case Common::KEYCODE_INSERT:
- case Common::KEYCODE_KP0:
- return kVkInsert;
- case Common::KEYCODE_DELETE:
- case Common::KEYCODE_KP_PERIOD:
- return kVkDelete;
- case Common::KEYCODE_F1:
- return kVkF1;
- case Common::KEYCODE_F2:
- return kVkF2;
- case Common::KEYCODE_F3:
- return kVkF3;
- case Common::KEYCODE_F4:
- return kVkF4;
- case Common::KEYCODE_F5:
- return kVkF5;
- case Common::KEYCODE_F6:
- return kVkF6;
- case Common::KEYCODE_F7:
- return kVkF7;
- case Common::KEYCODE_F8:
- return kVkF8;
- case Common::KEYCODE_F9:
- return kVkF9;
- case Common::KEYCODE_F10:
- return kVkF10;
- case Common::KEYCODE_F11:
- return kVkF11;
- case Common::KEYCODE_F12:
- return kVkF12;
- case Common::KEYCODE_NUMLOCK:
- return kVkNumLock;
- case Common::KEYCODE_SCROLLOCK:
- return kVkScroll;
- default:
- // check if any non-sticky keys were used, otherwise key is unknown to us
- if ((event->kbd.flags & Common::KBD_NON_STICKY) == 0) {
- warning("Key pressed is not recognized, ASCII returned (%d '%c').", event->kbd.keycode, event->kbd.keycode);
- }
- // return ASCII if no match, since it could be used for typing
- return event->kbd.ascii;
- break;
- }
-
-}
-
-//////////////////////////////////////////////////////////////////////////
-Common::KeyCode BaseKeyboardState::vKeyToKeyCode(uint32 vkey) {
- switch (vkey) {
- case kVkBack:
- return Common::KEYCODE_BACKSPACE;
- case kVkTab:
- return Common::KEYCODE_TAB;
- case kVkClear:
- return Common::KEYCODE_CLEAR;
- case kVkReturn:
- return Common::KEYCODE_RETURN;
- case kVkPause:
- return Common::KEYCODE_PAUSE;
- case kVkCapital:
- return Common::KEYCODE_CAPSLOCK;
- case kVkEscape:
- return Common::KEYCODE_ESCAPE;
- case kVkSpace:
- return Common::KEYCODE_SPACE;
- case kVkPrior:
- return Common::KEYCODE_PAGEUP;
- case kVkNext:
- return Common::KEYCODE_PAGEDOWN;
- case kVkHome:
- return Common::KEYCODE_HOME;
- case kVkEnd:
- return Common::KEYCODE_END;
- case kVkLeft:
- return Common::KEYCODE_LEFT;
- case kVkRight:
- return Common::KEYCODE_RIGHT;
- case kVkUp:
- return Common::KEYCODE_UP;
- case kVkDown:
- return Common::KEYCODE_DOWN;
- case kVkPrint:
- return Common::KEYCODE_PRINT;
- case kVkInsert:
- return Common::KEYCODE_INSERT;
- case kVkDelete:
- return Common::KEYCODE_DELETE;
- case kVkA:
- return Common::KEYCODE_a;
- case kVkB:
- return Common::KEYCODE_b;
- case kVkC:
- return Common::KEYCODE_c;
- case kVkD:
- return Common::KEYCODE_d;
- case kVkE:
- return Common::KEYCODE_e;
- case kVkF:
- return Common::KEYCODE_f;
- case kVkG:
- return Common::KEYCODE_g;
- case kVkH:
- return Common::KEYCODE_h;
- case kVkI:
- return Common::KEYCODE_i;
- case kVkJ:
- return Common::KEYCODE_j;
- case kVkK:
- return Common::KEYCODE_k;
- case kVkL:
- return Common::KEYCODE_l;
- case kVkM:
- return Common::KEYCODE_m;
- case kVkN:
- return Common::KEYCODE_n;
- case kVkO:
- return Common::KEYCODE_o;
- case kVkP:
- return Common::KEYCODE_p;
- case kVkQ:
- return Common::KEYCODE_q;
- case kVkR:
- return Common::KEYCODE_r;
- case kVkS:
- return Common::KEYCODE_s;
- case kVkT:
- return Common::KEYCODE_t;
- case kVkU:
- return Common::KEYCODE_u;
- case kVkV:
- return Common::KEYCODE_v;
- case kVkW:
- return Common::KEYCODE_w;
- case kVkX:
- return Common::KEYCODE_x;
- case kVkY:
- return Common::KEYCODE_y;
- case kVkZ:
- return Common::KEYCODE_z;
- case kVkNumpad0:
- return Common::KEYCODE_KP0;
- case kVkNumpad1:
- return Common::KEYCODE_KP1;
- case kVkNumpad2:
- return Common::KEYCODE_KP2;
- case kVkNumpad3:
- return Common::KEYCODE_KP3;
- case kVkNumpad4:
- return Common::KEYCODE_KP4;
- case kVkNumpad5:
- return Common::KEYCODE_KP5;
- case kVkNumpad6:
- return Common::KEYCODE_KP6;
- case kVkNumpad7:
- return Common::KEYCODE_KP7;
- case kVkNumpad8:
- return Common::KEYCODE_KP8;
- case kVkNumpad9:
- return Common::KEYCODE_KP9;
- case kVkMultiply:
- return Common::KEYCODE_KP_MULTIPLY;
- case kVkAdd:
- return Common::KEYCODE_KP_PLUS;
- case kVkSeparator:
- return Common::KEYCODE_KP_EQUALS;
- case kVkSubtract:
- return Common::KEYCODE_KP_MINUS;
- case kVkDecimal:
- return Common::KEYCODE_KP_PERIOD;
- case kVkDivide:
- return Common::KEYCODE_KP_DIVIDE;
- case kVkF1:
- return Common::KEYCODE_F1;
- case kVkF2:
- return Common::KEYCODE_F2;
- case kVkF3:
- return Common::KEYCODE_F3;
- case kVkF4:
- return Common::KEYCODE_F4;
- case kVkF5:
- return Common::KEYCODE_F5;
- case kVkF6:
- return Common::KEYCODE_F6;
- case kVkF7:
- return Common::KEYCODE_F7;
- case kVkF8:
- return Common::KEYCODE_F8;
- case kVkF9:
- return Common::KEYCODE_F9;
- case kVkF10:
- return Common::KEYCODE_F10;
- case kVkF11:
- return Common::KEYCODE_F11;
- case kVkF12:
- return Common::KEYCODE_F12;
- case kVkNumLock:
- return Common::KEYCODE_NUMLOCK;
- case kVkScroll:
- return Common::KEYCODE_SCROLLOCK;
- default:
- warning("Unknown VKEY: %d", vkey);
- return (Common::KeyCode)(vkey < KEYSTATES_ARRAY_SIZE ? vkey : 0);
- break;
- }
-
-}
-
} // End of namespace Wintermute
diff --git a/engines/wintermute/base/base_keyboard_state.h b/engines/wintermute/base/base_keyboard_state.h
index 32680b34c1..b2f7f781ea 100644
--- a/engines/wintermute/base/base_keyboard_state.h
+++ b/engines/wintermute/base/base_keyboard_state.h
@@ -37,6 +37,11 @@
namespace Wintermute {
+struct keyCodeMapping {
+ Common::KeyCode commonKeycode;
+ uint32 engineKeycode;
+};
+
class BaseKeyboardState : public BaseScriptable {
public:
DECLARE_PERSISTENT(BaseKeyboardState, BaseScriptable)
@@ -58,6 +63,8 @@ public:
virtual const char *scToString();
private:
+ void init();
+
bool _currentPrintable;
uint32 _currentKeyData;
uint32 _currentCharCode;
@@ -67,8 +74,9 @@ private:
bool _currentControl;
uint8 *_keyStates;
- uint32 keyCodeToVKey(Common::Event *event); //TODO, add more mappings
- Common::KeyCode vKeyToKeyCode(uint32 vkey); //TODO, reimplement using ScummVM-backend
+
+ const keyCodeMapping *_mapping;
+ uint32 _mappingSize;
};
} // End of namespace Wintermute
diff --git a/engines/wintermute/base/base_persistence_manager.h b/engines/wintermute/base/base_persistence_manager.h
index 760b45c907..e8ca663cb7 100644
--- a/engines/wintermute/base/base_persistence_manager.h
+++ b/engines/wintermute/base/base_persistence_manager.h
@@ -69,6 +69,7 @@ public:
uint32 _offset;
bool getIsSaving() { return _saving; }
+ TimeDate getSavedTimestamp() { return _savedTimestamp; }
uint32 _richBufferSize;
byte *_richBuffer;
diff --git a/engines/wintermute/base/base_sub_frame.cpp b/engines/wintermute/base/base_sub_frame.cpp
index e8e62fb6bc..039e481fe3 100644
--- a/engines/wintermute/base/base_sub_frame.cpp
+++ b/engines/wintermute/base/base_sub_frame.cpp
@@ -119,7 +119,7 @@ bool BaseSubFrame::loadBuffer(char *buffer, int lifeTime, bool keepLoaded) {
Rect32 rect;
int r = 255, g = 255, b = 255;
int ar = 255, ag = 255, ab = 255, alpha = 255;
- bool custoTrans = false;
+ bool customTrans = false;
rect.setEmpty();
char *surfaceFile = nullptr;
@@ -134,7 +134,7 @@ bool BaseSubFrame::loadBuffer(char *buffer, int lifeTime, bool keepLoaded) {
case TOKEN_TRANSPARENT:
parser.scanStr(params, "%d,%d,%d", &r, &g, &b);
- custoTrans = true;
+ customTrans = true;
break;
case TOKEN_RECT:
@@ -191,7 +191,7 @@ bool BaseSubFrame::loadBuffer(char *buffer, int lifeTime, bool keepLoaded) {
}
if (surfaceFile != nullptr) {
- if (custoTrans) {
+ if (customTrans) {
setSurface(surfaceFile, false, r, g, b, lifeTime, keepLoaded);
} else {
setSurface(surfaceFile, true, 0, 0, 0, lifeTime, keepLoaded);
@@ -199,7 +199,7 @@ bool BaseSubFrame::loadBuffer(char *buffer, int lifeTime, bool keepLoaded) {
}
_alpha = BYTETORGBA(ar, ag, ab, alpha);
- if (custoTrans) {
+ if (customTrans) {
_transparent = BYTETORGBA(r, g, b, 0xFF);
}
@@ -434,6 +434,57 @@ bool BaseSubFrame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisS
return STATUS_OK;
}
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] GetHeight
+ // Used to find sprite center at methods.script in fix_offset()
+ // Return value is integer
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "GetHeight") == 0) {
+ stack->correctParams(0);
+ if (_surface) {
+ stack->pushInt(_surface->getHeight());
+ } else {
+ stack->pushNULL();
+ }
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] GetWidth
+ // Used to find sprite center at methods.script in fix_offset()
+ // Return value is integer
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "GetWidth") == 0) {
+ stack->correctParams(0);
+ if (_surface) {
+ stack->pushInt(_surface->getWidth());
+ } else {
+ stack->pushNULL();
+ }
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] GetPixelAt
+ // Used for dynamic light at mixing.script in make_RGB() and make_HSV()
+ // Return value is passed to Game.GetRValue(), Game.GetGValue(), etc...
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "GetPixelAt") == 0) {
+ stack->correctParams(2);
+ int x = stack->pop()->getInt();
+ int y = stack->pop()->getInt();
+ byte r, g, b, a;
+ if (_surface && _surface->getPixel(x, y, &r, &g, &b, &a)) {
+ uint32 pixel = BYTETORGBA(r, g, b, a);
+ stack->pushInt(pixel);
+ } else {
+ stack->pushNULL();
+ }
+ return STATUS_OK;
+ }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// SetImage
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/base/file/base_package.cpp b/engines/wintermute/base/file/base_package.cpp
index 2ed27e2c32..3d67d02774 100644
--- a/engines/wintermute/base/file/base_package.cpp
+++ b/engines/wintermute/base/file/base_package.cpp
@@ -142,6 +142,8 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool
debugC(kWintermuteDebugFileAccess | kWintermuteDebugLog, " Warning: package file '%s' is outdated.", filename.c_str());
}
_priority = hdr._priority;
+ _version = hdr._gameVersion;
+
// new in v2
if (hdr._packageVersion == PACKAGE_VERSION) {
uint32 dirOffset;
diff --git a/engines/wintermute/base/file/base_package.h b/engines/wintermute/base/file/base_package.h
index 35976eb47b..578dc789fa 100644
--- a/engines/wintermute/base/file/base_package.h
+++ b/engines/wintermute/base/file/base_package.h
@@ -78,8 +78,11 @@ public:
virtual Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const;
int getPriority() const { return _priority; }
+ uint32 getVersion() const { return _version; }
+
private:
byte _priority;
+ uint32 _version;
Common::Array<BasePackage *> _packages;
Common::HashMap<Common::String, Common::ArchiveMemberPtr> _files;
Common::HashMap<Common::String, Common::ArchiveMemberPtr>::iterator _filesIter;
diff --git a/engines/wintermute/base/font/base_font_bitmap.cpp b/engines/wintermute/base/font/base_font_bitmap.cpp
index c33b48d085..0c3c0ae97d 100644
--- a/engines/wintermute/base/font/base_font_bitmap.cpp
+++ b/engines/wintermute/base/font/base_font_bitmap.cpp
@@ -28,6 +28,7 @@
#include "engines/wintermute/base/font/base_font_bitmap.h"
#include "engines/wintermute/utils/string_util.h"
+#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/base_parser.h"
#include "engines/wintermute/base/base_frame.h"
#include "engines/wintermute/base/gfx/base_surface.h"
@@ -141,6 +142,9 @@ int BaseFontBitmap::textHeightDraw(const byte *text, int x, int y, int width, TT
bool done = false;
bool newLine = false;
bool longLine = false;
+#ifdef ENABLE_FOXTAIL
+ bool minimizeSpacing = BaseEngine::instance().isFoxTail();
+#endif
if (draw) {
_gameRef->_renderer->startSpriteBatch();
@@ -211,6 +215,11 @@ int BaseFontBitmap::textHeightDraw(const byte *text, int x, int y, int width, TT
startX += getCharWidth(str[i]);
}
y += _tileHeight;
+#ifdef ENABLE_FOXTAIL
+ if (minimizeSpacing) {
+ y -= 3;
+ }
+#endif
last_end = end;
if (longLine) {
end--;
@@ -264,7 +273,7 @@ void BaseFontBitmap::drawChar(byte c, int x, int y) {
}
}
if (!handled && _subframe) {
- _subframe->_surface->displayTrans(x, y, rect);
+ _subframe->_surface->displayTrans(x, y, rect, _subframe->_alpha);
}
}
@@ -308,6 +317,9 @@ TOKEN_DEF(EDITOR_PROPERTY)
TOKEN_DEF(SPRITE)
TOKEN_DEF(WIDTHS_FRAME)
TOKEN_DEF(PAINT_WHOLE_CELL)
+#ifdef ENABLE_FOXTAIL
+TOKEN_DEF(COLOR)
+#endif
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////
bool BaseFontBitmap::loadBuffer(char *buffer) {
@@ -328,6 +340,9 @@ bool BaseFontBitmap::loadBuffer(char *buffer) {
TOKEN_TABLE(SPRITE)
TOKEN_TABLE(WIDTHS_FRAME)
TOKEN_TABLE(PAINT_WHOLE_CELL)
+#ifdef ENABLE_FOXTAIL
+ TOKEN_TABLE(COLOR)
+#endif
TOKEN_TABLE_END
char *params;
@@ -345,7 +360,11 @@ bool BaseFontBitmap::loadBuffer(char *buffer) {
int lastWidth = 0;
int i;
int r = 255, g = 255, b = 255;
- bool custoTrans = false;
+ bool customTrans = false;
+#ifdef ENABLE_FOXTAIL
+ int ar = 255, ag = 255, ab = 255;
+ bool customAlpha = false;
+#endif
char *surfaceFile = nullptr;
char *spriteFile = nullptr;
@@ -366,8 +385,15 @@ bool BaseFontBitmap::loadBuffer(char *buffer) {
case TOKEN_TRANSPARENT:
parser.scanStr(params, "%d,%d,%d", &r, &g, &b);
- custoTrans = true;
+ customTrans = true;
+ break;
+
+#ifdef ENABLE_FOXTAIL
+ case TOKEN_COLOR:
+ parser.scanStr(params, "%d,%d,%d", &ar, &ag, &ab);
+ customAlpha = true;
break;
+#endif
case TOKEN_WIDTHS:
parser.scanStr(params, "%D", widths, &num);
@@ -441,11 +467,16 @@ bool BaseFontBitmap::loadBuffer(char *buffer) {
if (surfaceFile != nullptr && !_sprite) {
_subframe = new BaseSubFrame(_gameRef);
- if (custoTrans) {
+ if (customTrans) {
_subframe->setSurface(surfaceFile, false, r, g, b);
} else {
_subframe->setSurface(surfaceFile);
}
+#ifdef ENABLE_FOXTAIL
+ if (customAlpha) {
+ _subframe->_alpha = BYTETORGBA(ar, ag, ab, 255);
+ }
+#endif
}
@@ -489,6 +520,14 @@ bool BaseFontBitmap::loadBuffer(char *buffer) {
}
}
+#ifdef ENABLE_FOXTAIL
+ if (BaseEngine::instance().isFoxTail()) {
+ for (i = lastWidth; i < NUM_CHARACTERS; i++) {
+ _widths[i]--;
+ }
+ }
+#endif
+
return STATUS_OK;
}
diff --git a/engines/wintermute/base/gfx/base_renderer.cpp b/engines/wintermute/base/gfx/base_renderer.cpp
index 0f33fc2c43..b60a4d4b38 100644
--- a/engines/wintermute/base/gfx/base_renderer.cpp
+++ b/engines/wintermute/base/gfx/base_renderer.cpp
@@ -32,6 +32,7 @@
#include "engines/wintermute/base/gfx/base_image.h"
#include "engines/wintermute/base/base_sub_frame.h"
#include "engines/wintermute/base/base_region.h"
+#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/platform_osystem.h"
#include "engines/wintermute/base/base_persistence_manager.h"
@@ -372,6 +373,26 @@ bool BaseRenderer::displayIndicator() {
if (!_indicatorDisplay || !_indicatorProgress) {
return STATUS_OK;
}
+
+#ifdef ENABLE_FOXTAIL
+ if (BaseEngine::instance().isFoxTail()) {
+ _hasDrawnSaveLoadImage = false;
+ fill(0, 0, 0);
+ displaySaveloadLines();
+ displaySaveloadImage();
+ forcedFlip();
+ return STATUS_OK;
+ }
+#endif
+
+ displaySaveloadImage();
+ displaySaveloadLines();
+ indicatorFlip();
+ return STATUS_OK;
+}
+
+//////////////////////////////////////////////////////////////////////////
+bool BaseRenderer::displaySaveloadImage() {
if (_saveLoadImage && !_hasDrawnSaveLoadImage) {
Rect32 rc;
rc.setRect(0, 0, _saveLoadImage->getWidth(), _saveLoadImage->getHeight());
@@ -384,6 +405,11 @@ bool BaseRenderer::displayIndicator() {
_hasDrawnSaveLoadImage = true;
}
+ return STATUS_OK;
+}
+
+//////////////////////////////////////////////////////////////////////////
+bool BaseRenderer::displaySaveloadLines() {
if ((!_indicatorDisplay && _indicatorWidth <= 0) || _indicatorHeight <= 0) {
return STATUS_OK;
}
@@ -395,9 +421,6 @@ bool BaseRenderer::displayIndicator() {
setup2D();
_indicatorWidthDrawn = curWidth;
- if (_indicatorWidthDrawn) {
- indicatorFlip();
- }
return STATUS_OK;
}
diff --git a/engines/wintermute/base/gfx/base_renderer.h b/engines/wintermute/base/gfx/base_renderer.h
index 6b1a4f97f4..981171b78b 100644
--- a/engines/wintermute/base/gfx/base_renderer.h
+++ b/engines/wintermute/base/gfx/base_renderer.h
@@ -116,6 +116,7 @@ public:
* essentially, just copies the region defined by the _indicator-variables.
*/
virtual bool indicatorFlip() = 0;
+ virtual bool forcedFlip() = 0;
virtual void initLoop();
virtual bool setup2D(bool force = false);
virtual bool setupLines();
@@ -223,6 +224,8 @@ protected:
Rect32 _monitorRect;
private:
Common::Array<BaseActiveRect *> _rectList;
+ bool displaySaveloadImage();
+ bool displaySaveloadLines();
};
BaseRenderer *makeOSystemRenderer(BaseGame *inGame); // Implemented in BRenderSDL.cpp
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index 7692bc6c48..cfa43adb17 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -146,7 +146,15 @@ bool BaseRenderOSystem::initRenderer(int width, int height, bool windowed) {
}
bool BaseRenderOSystem::indicatorFlip() {
- g_system->copyRectToScreen((byte *)_renderSurface->getBasePtr(_indicatorX, _indicatorY), _renderSurface->pitch, _indicatorX, _indicatorY, _indicatorWidthDrawn, _indicatorHeight);
+ if (_indicatorWidthDrawn > 0 && _indicatorHeight > 0) {
+ g_system->copyRectToScreen((byte *)_renderSurface->getBasePtr(_indicatorX, _indicatorY), _renderSurface->pitch, _indicatorX, _indicatorY, _indicatorWidthDrawn, _indicatorHeight);
+ g_system->updateScreen();
+ }
+ return STATUS_OK;
+}
+
+bool BaseRenderOSystem::forcedFlip() {
+ g_system->copyRectToScreen((byte *)_renderSurface->getPixels(), _renderSurface->pitch, 0, 0, _renderSurface->w, _renderSurface->h);
g_system->updateScreen();
return STATUS_OK;
}
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
index 47099046e9..11987e55e5 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
@@ -69,6 +69,7 @@ public:
bool initRenderer(int width, int height, bool windowed) override;
bool flip() override;
virtual bool indicatorFlip();
+ virtual bool forcedFlip();
bool fill(byte r, byte g, byte b, Common::Rect *rect = nullptr) override;
Graphics::PixelFormat getPixelFormat() const override;
void fade(uint16 alpha) override;
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.h b/engines/wintermute/base/gfx/osystem/base_surface_osystem.h
index 9fbbe1d498..950cabf28c 100644
--- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.h
@@ -81,6 +81,17 @@ public:
}
return _height;
}
+ bool getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a) override {
+ if (!_loaded) {
+ finishLoad();
+ }
+ if (_surface) {
+ uint32 pixel = getPixelAt(_surface, x, y);
+ _surface->format.colorToARGB(pixel, *a, *r, *g, *b);
+ return STATUS_OK;
+ }
+ return STATUS_FAILED;
+ }
Graphics::AlphaType getAlphaType() const { return _alphaType; }
private:
diff --git a/engines/wintermute/base/saveload.cpp b/engines/wintermute/base/saveload.cpp
index 6299cf6e01..1549eac7a8 100644
--- a/engines/wintermute/base/saveload.cpp
+++ b/engines/wintermute/base/saveload.cpp
@@ -159,31 +159,35 @@ void SaveLoad::afterLoadScript(void *script, void *data) {
}
Common::String SaveLoad::getSaveSlotFilename(int slot) {
+ Common::String filename;
BasePersistenceManager *pm = new BasePersistenceManager();
- Common::String filename = pm->getFilenameForSlot(slot);
- delete pm;
+ if (pm) {
+ filename = pm->getFilenameForSlot(slot);
+ delete pm;
+ }
debugC(kWintermuteDebugSaveGame, "getSaveSlotFileName(%d) = %s", slot, filename.c_str());
return filename;
}
-bool SaveLoad::getSaveSlotDescription(int slot, char *buffer) {
- buffer[0] = '\0';
-
+Common::String SaveLoad::getSaveSlotDescription(int slot) {
+ Common::String description;
Common::String filename = getSaveSlotFilename(slot);
BasePersistenceManager *pm = new BasePersistenceManager();
- if (!pm) {
- return false;
+ if ((pm->initLoad(filename))) {
+ description = pm->_savedDescription;
}
+ delete pm;
+ return description;
+}
- if (!(pm->initLoad(filename))) {
- delete pm;
- return false;
+void SaveLoad::getSaveSlotTimestamp(int slot, TimeDate *time) {
+ memset(time, 0, sizeof(TimeDate));
+ Common::String filename = getSaveSlotFilename(slot);
+ BasePersistenceManager *pm = new BasePersistenceManager();
+ if ((pm->initLoad(filename))) {
+ *time = pm->getSavedTimestamp();
}
-
- strcpy(buffer, pm->_savedDescription);
delete pm;
-
- return true;
}
bool SaveLoad::isSaveSlotUsed(int slot) {
diff --git a/engines/wintermute/base/saveload.h b/engines/wintermute/base/saveload.h
index 31f5841f41..295d19d543 100644
--- a/engines/wintermute/base/saveload.h
+++ b/engines/wintermute/base/saveload.h
@@ -37,7 +37,8 @@ class SaveLoad {
public:
static bool emptySaveSlot(int slot);
static bool isSaveSlotUsed(int slot);
- static bool getSaveSlotDescription(int slot, char *buffer);
+ static Common::String getSaveSlotDescription(int slot);
+ static void getSaveSlotTimestamp(int slot, TimeDate *time);
static Common::String getSaveSlotFilename(int slot);
static bool loadGame(const Common::String &filename, BaseGame *gameRef);
diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp
index c13310255d..856584fe72 100644
--- a/engines/wintermute/base/scriptables/script.cpp
+++ b/engines/wintermute/base/scriptables/script.cpp
@@ -29,6 +29,7 @@
#include "engines/wintermute/base/scriptables/script_value.h"
#include "engines/wintermute/base/scriptables/script.h"
#include "engines/wintermute/base/base_game.h"
+#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/scriptables/script_engine.h"
#include "engines/wintermute/base/scriptables/script_stack.h"
#include "common/memstream.h"
@@ -618,8 +619,14 @@ bool ScScript::executeInstruction() {
_state = SCRIPT_WAITING_SCRIPT;
_waitScript->copyParameters(_stack);
}
+#ifdef ENABLE_FOXTAIL
+ } else if (BaseEngine::instance().isFoxTail() && strcmp(methodName, "LoadItems") == 0 && strcmp(_threadEvent,"AfterLoad") == 0) {
+ _stack->correctParams(0);
+ _gameRef->LOG(0, "Method '%s' is called in unbreakable mode of '%s' event and was ignored", methodName, _threadEvent);
+ _stack->pushNULL();
+#endif
} else {
- // can call methods in unbreakable mode
+ // cannot call methods in unbreakable mode
_stack->correctParams(0);
runtimeError("Cannot call method '%s'. Ignored.", methodName);
_stack->pushNULL();
diff --git a/engines/wintermute/base/scriptables/script_ext_array.cpp b/engines/wintermute/base/scriptables/script_ext_array.cpp
index 7431029cbf..05effd991e 100644
--- a/engines/wintermute/base/scriptables/script_ext_array.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_array.cpp
@@ -118,8 +118,7 @@ bool SXArray::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
//////////////////////////////////////////////////////////////////////////
// Pop
//////////////////////////////////////////////////////////////////////////
- if (strcmp(name, "Pop") == 0) {
-
+ else if (strcmp(name, "Pop") == 0) {
stack->correctParams(0);
if (_length > 0) {
@@ -133,7 +132,36 @@ bool SXArray::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
}
return STATUS_OK;
- } else {
+ }
+
+#ifdef ENABLE_FOXTAIL
+ //////////////////////////////////////////////////////////////////////////
+ // [FoxTail] Delete
+ // Removes item from array by index, shifting other elements
+ // Used to shuffle arrays and delete found items in various scripts
+ // Return value is never used
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "Delete") == 0) {
+ stack->correctParams(1);
+
+ int shiftPoint = stack->pop()->getInt(0);
+ char paramNameFrom[20];
+ char paramNameTo[20];
+
+ for (int i = shiftPoint; i < _length - 1 ; i++) {
+ sprintf(paramNameFrom, "%d", i + 1);
+ sprintf(paramNameTo, "%d", i);
+ _values->setProp(paramNameTo, _values->getProp(paramNameFrom), false);
+ }
+ _values->deleteProp(paramNameFrom);
+ _length--;
+ stack->pushNULL();
+
+ return STATUS_OK;
+ }
+#endif
+
+ else {
return STATUS_FAILED;
}
}
diff --git a/engines/wintermute/configure.engine b/engines/wintermute/configure.engine
index 68049684a3..c825845f50 100644
--- a/engines/wintermute/configure.engine
+++ b/engines/wintermute/configure.engine
@@ -1,3 +1,4 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine wintermute "Wintermute" yes "" "" "zlib 16bit highres jpeg png"
+add_engine wintermute "Wintermute" yes "foxtail" "" "zlib 16bit highres jpeg png"
+add_engine foxtail "FoxTail" yes
diff --git a/engines/wintermute/detection_tables.h b/engines/wintermute/detection_tables.h
index 36280574ef..f9d8df081c 100644
--- a/engines/wintermute/detection_tables.h
+++ b/engines/wintermute/detection_tables.h
@@ -74,6 +74,7 @@ static const PlainGameDescriptor wintermuteGames[] = {
{"goldencalf", "The Golden Calf"},
{"hamlet", "Hamlet or the last game without MMORPG features, shaders and product placement"},
{"helga", "Helga Deep In Trouble"},
+ {"hor", "Hor"},
{"jamesperis", "James Peris: No License Nor Control"},
{"knossos", "K'NOSSOS"},
{"kulivocko", "Kulivocko"},
@@ -734,61 +735,242 @@ static const WMEGameDescription gameDescriptions[] = {
WME_WINENTRY("four", "",
WME_ENTRY1s("data.dcp", "ec05cd5e37c9a524053b8859635a4234", 62599855), Common::EN_ANY, ADGF_UNSTABLE, WME_1_9_1),
- // FoxTail (Steam, Feb 26th 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "651ae5b062073021edaca7e1de131eec", 59357572), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1291 (English)
+ WME_WINENTRY("foxtail", "1.2.230.1291",
+ WME_ENTRY1s("data.dcp", "651ae5b062073021edaca7e1de131eec", 59357572), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Mar 1th 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "03ed77b1ac8b94bbd0247324a41621ad", 59357623), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1291 (German)
+ WME_WINENTRY("foxtail", "1.2.230.1291",
+ WME_ENTRY1s("data.dcp", "651ae5b062073021edaca7e1de131eec", 59357572), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Mar 2th A 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "d7287c49210c7c9f9376327c6e224c7b", 59383312), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1291 (Russian)
+ WME_WINENTRY("foxtail", "1.2.230.1291",
+ WME_ENTRY1s("data.dcp", "651ae5b062073021edaca7e1de131eec", 59357572), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Mar 2th B 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "434c4f598582a569972acd4d700a44e5", 59383416), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1291 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.230.1291",
+ WME_ENTRY1s("data.dcp", "651ae5b062073021edaca7e1de131eec", 59357572), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Mar 3th A 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "5aa16c180998f1816a734c58a01ab8b1", 59383306), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1303 (English)
+ WME_WINENTRY("foxtail", "1.2.230.1303",
+ WME_ENTRY1s("data.dcp", "03ed77b1ac8b94bbd0247324a41621ad", 59357623), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Mar 3th B 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "363856606d19fb7e0e3a0a67737697fa", 59382887), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1303 (German)
+ WME_WINENTRY("foxtail", "1.2.230.1303",
+ WME_ENTRY1s("data.dcp", "03ed77b1ac8b94bbd0247324a41621ad", 59357623), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Mar 3th C 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "bbab16777c4bc979c5f773e12b804a63", 59151985), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1303 (Russian)
+ WME_WINENTRY("foxtail", "1.2.230.1303",
+ WME_ENTRY1s("data.dcp", "03ed77b1ac8b94bbd0247324a41621ad", 59357623), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Mar 3th D 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "22e5f634742956b6f4087459a9c8acf4", 59151985), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1303 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.230.1303",
+ WME_ENTRY1s("data.dcp", "03ed77b1ac8b94bbd0247324a41621ad", 59357623), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Mar 20th 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "32fd78f0b1509863f2e91bc7afc633ff", 59630008), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1313 (English)
+ WME_WINENTRY("foxtail", "1.2.230.1313",
+ WME_ENTRY1s("data.dcp", "d7287c49210c7c9f9376327c6e224c7b", 59383312), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, May 30th 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "ca1b0379c8f0dffd3bf8b95e91379b2c", 70132635), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1313 (German)
+ WME_WINENTRY("foxtail", "1.2.230.1313",
+ WME_ENTRY1s("data.dcp", "d7287c49210c7c9f9376327c6e224c7b", 59383312), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, May 31th 2018, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "2c4c744ff103f4fc6e770515e2da8b16", 70124937), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1313 (Russian)
+ WME_WINENTRY("foxtail", "1.2.230.1313",
+ WME_ENTRY1s("data.dcp", "d7287c49210c7c9f9376327c6e224c7b", 59383312), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Jan 17th 2019, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "e0177c5752d067a3e473b86ad40d57c3", 109502449), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1313 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.230.1313",
+ WME_ENTRY1s("data.dcp", "d7287c49210c7c9f9376327c6e224c7b", 59383312), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Feb 22th 2019, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "a940ffa1b4347588d13e4a9756bb0bbd", 109503345), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1315 (English)
+ WME_WINENTRY("foxtail", "1.2.230.1315",
+ WME_ENTRY1s("data.dcp", "434c4f598582a569972acd4d700a44e5", 59383416), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_230),
- // FoxTail (Steam, Mar 22th 2019, Windows/Linux/Mac)
- WME_WINENTRY("foxtail", "",
- WME_ENTRY1s("data.dcp", "e5d06fa058cd9d6f20d6206356e5854d", 109503303), Common::EN_ANY, ADGF_UNSTABLE, WME_LITE),
+ // FoxTail 1.2.230.1315 (German)
+ WME_WINENTRY("foxtail", "1.2.230.1315",
+ WME_ENTRY1s("data.dcp", "434c4f598582a569972acd4d700a44e5", 59383416), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1315 (Russian)
+ WME_WINENTRY("foxtail", "1.2.230.1315",
+ WME_ENTRY1s("data.dcp", "434c4f598582a569972acd4d700a44e5", 59383416), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1315 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.230.1315",
+ WME_ENTRY1s("data.dcp", "434c4f598582a569972acd4d700a44e5", 59383416), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1316 (English)
+ WME_WINENTRY("foxtail", "1.2.230.1316",
+ WME_ENTRY1s("data.dcp", "5aa16c180998f1816a734c58a01ab8b1", 59383306), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1316 (German)
+ WME_WINENTRY("foxtail", "1.2.230.1316",
+ WME_ENTRY1s("data.dcp", "5aa16c180998f1816a734c58a01ab8b1", 59383306), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1316 (Russian)
+ WME_WINENTRY("foxtail", "1.2.230.1316",
+ WME_ENTRY1s("data.dcp", "5aa16c180998f1816a734c58a01ab8b1", 59383306), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1316 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.230.1316",
+ WME_ENTRY1s("data.dcp", "5aa16c180998f1816a734c58a01ab8b1", 59383306), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1318 (English)
+ WME_WINENTRY("foxtail", "1.2.230.1318",
+ WME_ENTRY1s("data.dcp", "363856606d19fb7e0e3a0a67737697fa", 59382887), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1318 (German)
+ WME_WINENTRY("foxtail", "1.2.230.1318",
+ WME_ENTRY1s("data.dcp", "363856606d19fb7e0e3a0a67737697fa", 59382887), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1318 (Russian)
+ WME_WINENTRY("foxtail", "1.2.230.1318",
+ WME_ENTRY1s("data.dcp", "363856606d19fb7e0e3a0a67737697fa", 59382887), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1318 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.230.1318",
+ WME_ENTRY1s("data.dcp", "363856606d19fb7e0e3a0a67737697fa", 59382887), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1321 (English)
+ WME_WINENTRY("foxtail", "1.2.230.1321",
+ WME_ENTRY1s("data.dcp", "bbab16777c4bc979c5f773e12b804a63", 59151985), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1321 (German)
+ WME_WINENTRY("foxtail", "1.2.230.1321",
+ WME_ENTRY1s("data.dcp", "bbab16777c4bc979c5f773e12b804a63", 59151985), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1321 (Russian)
+ WME_WINENTRY("foxtail", "1.2.230.1321",
+ WME_ENTRY1s("data.dcp", "bbab16777c4bc979c5f773e12b804a63", 59151985), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1321 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.230.1321",
+ WME_ENTRY1s("data.dcp", "bbab16777c4bc979c5f773e12b804a63", 59151985), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1322 (English)
+ // not a mistake, data.dcp for 1.2.230.1321 and 1.2.230.1322 have same byte size
+ WME_WINENTRY("foxtail", "1.2.230.1322",
+ WME_ENTRY1s("data.dcp", "22e5f634742956b6f4087459a9c8acf4", 59151985), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1322 (German)
+ WME_WINENTRY("foxtail", "1.2.230.1322",
+ WME_ENTRY1s("data.dcp", "22e5f634742956b6f4087459a9c8acf4", 59151985), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1322 (Russian)
+ WME_WINENTRY("foxtail", "1.2.230.1322",
+ WME_ENTRY1s("data.dcp", "22e5f634742956b6f4087459a9c8acf4", 59151985), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.230.1322 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.230.1322",
+ WME_ENTRY1s("data.dcp", "22e5f634742956b6f4087459a9c8acf4", 59151985), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_230),
+
+ // FoxTail 1.2.304.1571 (English)
+ WME_WINENTRY("foxtail", "1.2.304.1571",
+ WME_ENTRY1s("data.dcp", "32fd78f0b1509863f2e91bc7afc633ff", 59630008), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_304),
+
+ // FoxTail 1.2.304.1571 (German)
+ WME_WINENTRY("foxtail", "1.2.304.1571",
+ WME_ENTRY1s("data.dcp", "32fd78f0b1509863f2e91bc7afc633ff", 59630008), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_304),
+
+ // FoxTail 1.2.304.1571 (Russian)
+ WME_WINENTRY("foxtail", "1.2.304.1571",
+ WME_ENTRY1s("data.dcp", "32fd78f0b1509863f2e91bc7afc633ff", 59630008), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_304),
+
+ // FoxTail 1.2.304.1571 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.304.1571",
+ WME_ENTRY1s("data.dcp", "32fd78f0b1509863f2e91bc7afc633ff", 59630008), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_304),
+
+ // FoxTail 1.2.362.2039 (English)
+ WME_WINENTRY("foxtail", "1.2.362.2039",
+ WME_ENTRY1s("data.dcp", "ca1b0379c8f0dffd3bf8b95e91379b2c", 70132635), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_362),
+
+ // FoxTail 1.2.362.2039 (German)
+ WME_WINENTRY("foxtail", "1.2.362.2039",
+ WME_ENTRY1s("data.dcp", "ca1b0379c8f0dffd3bf8b95e91379b2c", 70132635), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_362),
+
+ // FoxTail 1.2.362.2039 (Russian)
+ WME_WINENTRY("foxtail", "1.2.362.2039",
+ WME_ENTRY1s("data.dcp", "ca1b0379c8f0dffd3bf8b95e91379b2c", 70132635), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_362),
+
+ // FoxTail 1.2.362.2039 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.362.2039",
+ WME_ENTRY1s("data.dcp", "ca1b0379c8f0dffd3bf8b95e91379b2c", 70132635), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_362),
+
+ // FoxTail 1.2.362.2047 (English)
+ WME_WINENTRY("foxtail", "1.2.362.2047",
+ WME_ENTRY1s("data.dcp", "2c4c744ff103f4fc6e770515e2da8b16", 70124937), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_362),
+
+ // FoxTail 1.2.362.2047 (German)
+ WME_WINENTRY("foxtail", "1.2.362.2047",
+ WME_ENTRY1s("data.dcp", "2c4c744ff103f4fc6e770515e2da8b16", 70124937), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_362),
+
+ // FoxTail 1.2.362.2047 (Russian)
+ WME_WINENTRY("foxtail", "1.2.362.2047",
+ WME_ENTRY1s("data.dcp", "2c4c744ff103f4fc6e770515e2da8b16", 70124937), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_362),
+
+ // FoxTail 1.2.362.2047 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.362.2047",
+ WME_ENTRY1s("data.dcp", "2c4c744ff103f4fc6e770515e2da8b16", 70124937), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_362),
+
+ // FoxTail 1.2.527.3377 (English)
+ WME_WINENTRY("foxtail", "1.2.527.3377",
+ WME_ENTRY1s("data.dcp", "e0177c5752d067a3e473b86ad40d57c3", 109502449), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3377 (German)
+ WME_WINENTRY("foxtail", "1.2.527.3377",
+ WME_ENTRY1s("data.dcp", "e0177c5752d067a3e473b86ad40d57c3", 109502449), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3377 (Polish)
+ WME_WINENTRY("foxtail", "1.2.527.3377",
+ WME_ENTRY1s("data.dcp", "e0177c5752d067a3e473b86ad40d57c3", 109502449), Common::PL_POL, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3377 (Russian)
+ WME_WINENTRY("foxtail", "1.2.527.3377",
+ WME_ENTRY1s("data.dcp", "e0177c5752d067a3e473b86ad40d57c3", 109502449), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3377 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.527.3377",
+ WME_ENTRY1s("data.dcp", "e0177c5752d067a3e473b86ad40d57c3", 109502449), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3389 (English)
+ WME_WINENTRY("foxtail", "1.2.527.3389",
+ WME_ENTRY1s("data.dcp", "a940ffa1b4347588d13e4a9756bb0bbd", 109503345), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3389 (German)
+ WME_WINENTRY("foxtail", "1.2.527.3389",
+ WME_ENTRY1s("data.dcp", "a940ffa1b4347588d13e4a9756bb0bbd", 109503345), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3389 (Polish)
+ WME_WINENTRY("foxtail", "1.2.527.3389",
+ WME_ENTRY1s("data.dcp", "a940ffa1b4347588d13e4a9756bb0bbd", 109503345), Common::PL_POL, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3389 (Russian)
+ WME_WINENTRY("foxtail", "1.2.527.3389",
+ WME_ENTRY1s("data.dcp", "a940ffa1b4347588d13e4a9756bb0bbd", 109503345), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3389 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.527.3389",
+ WME_ENTRY1s("data.dcp", "a940ffa1b4347588d13e4a9756bb0bbd", 109503345), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3391 (English)
+ WME_WINENTRY("foxtail", "1.2.527.3391",
+ WME_ENTRY1s("data.dcp", "e5d06fa058cd9d6f20d6206356e5854d", 109503303), Common::EN_ANY, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3391 (German)
+ WME_WINENTRY("foxtail", "1.2.527.3391",
+ WME_ENTRY1s("data.dcp", "e5d06fa058cd9d6f20d6206356e5854d", 109503303), Common::DE_DEU, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3391 (Polish)
+ WME_WINENTRY("foxtail", "1.2.527.3391",
+ WME_ENTRY1s("data.dcp", "e5d06fa058cd9d6f20d6206356e5854d", 109503303), Common::PL_POL, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3391 (Russian)
+ WME_WINENTRY("foxtail", "1.2.527.3391",
+ WME_ENTRY1s("data.dcp", "e5d06fa058cd9d6f20d6206356e5854d", 109503303), Common::RU_RUS, ADGF_UNSTABLE, FOXTAIL_1_2_527),
+
+ // FoxTail 1.2.527.3391 (Ukranian)
+ WME_WINENTRY("foxtail", "1.2.527.3391",
+ WME_ENTRY1s("data.dcp", "e5d06fa058cd9d6f20d6206356e5854d", 109503303), Common::UA_UKR, ADGF_UNSTABLE, FOXTAIL_1_2_527),
// Framed (Beta)
WME_WINENTRY("framed", "Beta",
@@ -887,6 +1069,14 @@ static const WMEGameDescription gameDescriptions[] = {
WME_ENTRY2s("english.dcp", "b3a93e678f0ef97200f691cd1724643f", 135864,
"data.dcp", "45134ed93bc391edf148b79cdcbf2a09", 154266028), Common::EN_ANY, ADGF_UNSTABLE | ADGF_DEMO, WME_1_9_3),
+ // Hor v1.0
+ WME_WINENTRY("hor", "1.0",
+ WME_ENTRY1s("data.dcp", "ae94007f25a21143c028c1b7807dd907", 15077486), Common::UNK_LANG, ADGF_UNSTABLE, WME_1_9_3),
+
+ // Hor v1.3
+ WME_WINENTRY("hor", "1.3",
+ WME_ENTRY1s("data.dcp", "37b0abeb8651b82b9e6327bd10a18185", 15077486), Common::UNK_LANG, ADGF_UNSTABLE, WME_1_9_3),
+
// James Peris: No License Nor Control (English)
WME_WINENTRY("jamesperis", "Version 1.5",
WME_ENTRY1s("data.dcp", "f5635080b65aaf75c3676ce0cd46460b", 225294032), Common::EN_ANY, ADGF_UNSTABLE, WME_1_9_1),
diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp
index 7ee28f0fe2..dec2025346 100644
--- a/engines/wintermute/wintermute.cpp
+++ b/engines/wintermute/wintermute.cpp
@@ -115,6 +115,10 @@ Common::Error WintermuteEngine::run() {
Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0);
if (_gameDescription->adDesc.flags & GF_LOWSPEC_ASSETS) {
initGraphics(320, 240, &format);
+#ifdef ENABLE_FOXTAIL
+ } else if (BaseEngine::isFoxTailCheck(_gameDescription->targetExecutable)) {
+ initGraphics(640, 360, &format);
+#endif
} else {
initGraphics(800, 600, &format);
}
@@ -158,6 +162,17 @@ int WintermuteEngine::init() {
}
#endif
+ // check dependencies for games with FoxTail subengine
+ #if not defined(ENABLE_FOXTAIL)
+ if (BaseEngine::isFoxTailCheck(_gameDescription->targetExecutable)) {
+ GUI::MessageDialog dialog(_("This game requires the FoxTail subengine, which is not compiled in."));
+ dialog.runModal();
+ delete _game;
+ _game = nullptr;
+ return false;
+ }
+ #endif
+
Common::ArchiveMemberList actors3d;
if (BaseEngine::instance().getFileManager()->listMatchingMembers(actors3d, "*.act3d")) {
GUI::MessageDialog dialog(
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 9fd967b89b..9e6c7c1549 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -785,17 +785,22 @@ void Map::load(int mapId) {
}
} else if (File::exists(mobName)) {
// For surrounding maps, set up flags for whether objects are present
- // Load the monster/object data
- File mobFile(mobName);
- XeenSerializer sMob(&mobFile, nullptr);
- MonsterObjectData mobData(_vm);
- mobData.synchronize(sMob, _monsterData);
- mobFile.close();
- mazeDataP->_objectsPresent.resize(mobData._objects.size());
- for (uint objIndex = 0; objIndex < mobData._objects.size(); ++objIndex) {
- const Common::Point &pt = mobData._objects[objIndex]._position;
- mazeDataP->_objectsPresent[objIndex] = ABS(pt.x) != 128 && ABS(pt.y) != 128;
+ // WORKAROUND: In WOX Map 120, one of the maps for Deep Mine Alpha,
+ // has invalid monster data. So to work around it, we just ignore it
+ if (!(mapId == 120 && g_vm->getGameID() == GType_WorldOfXeen)) {
+ // Load the monster/object data
+ File mobFile(mobName);
+ XeenSerializer sMob(&mobFile, nullptr);
+ MonsterObjectData mobData(_vm);
+ mobData.synchronize(sMob, _monsterData);
+ mobFile.close();
+
+ mazeDataP->_objectsPresent.resize(mobData._objects.size());
+ for (uint objIndex = 0; objIndex < mobData._objects.size(); ++objIndex) {
+ const Common::Point &pt = mobData._objects[objIndex]._position;
+ mazeDataP->_objectsPresent[objIndex] = ABS(pt.x) != 128 && ABS(pt.y) != 128;
+ }
}
}
}
diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp
index 4374c36ff4..d901d1bb8c 100644
--- a/graphics/fonts/bdf.cpp
+++ b/graphics/fonts/bdf.cpp
@@ -767,17 +767,17 @@ BdfFont *BdfFont::scaleFont(BdfFont *src, int newSize) {
byte b = 0;
for (int x = 0; x < box.width; x++) {
+ b <<= 1;
+
int sx = (int)((float)x / scale);
if (srcd[sx / 8] & (0x80 >> (sx % 8)))
b |= 1;
- if (!(x % 8) && x) {
+ if (x % 8 == 7) {
*dst++ = b;
b = 0;
}
-
- b <<= 1;
}
if (((box.width - 1) % 8)) {
diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp
index 4264f64649..a32fac710f 100644
--- a/graphics/fonts/macfont.cpp
+++ b/graphics/fonts/macfont.cpp
@@ -25,6 +25,8 @@
#include "graphics/managed_surface.h"
#include "graphics/fonts/macfont.h"
+#define DEBUGSCALING 0
+
namespace Graphics {
enum {
@@ -393,7 +395,14 @@ int MacFONTFont::getKerningOffset(uint32 left, uint32 right) const {
return 0;
}
-MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize) {
+#if DEBUGSCALING
+bool dododo;
+#endif
+
+static void magnifyGray(Surface *src, int *dstGray, int width, int height, float scale);
+static void makeBold(Surface *src, int *dstGray, MacGlyph *glyph, int height);
+
+MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize, bool bold, bool italic) {
if (!src) {
warning("Empty font reference in scale font");
return NULL;
@@ -404,6 +413,12 @@ MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize) {
return NULL;
}
+ Graphics::Surface srcSurf;
+ srcSurf.create(MAX(src->getFontSize() * 2, newSize * 2), MAX(src->getFontSize() * 2, newSize * 2),
+ PixelFormat::createFormatCLUT8());
+ int dstGraySize = newSize * 2 * newSize;
+ int *dstGray = (int *)malloc(dstGraySize * sizeof(int));
+
float scale = (float)newSize / (float)src->getFontSize();
MacFONTdata data;
@@ -427,7 +442,7 @@ MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize) {
data._glyphs.resize(src->_data._glyphs.size());
- // Dtermine width of the bit image table
+ // Determine width of the bit image table
int newBitmapWidth = 0;
for (uint i = 0; i < src->_data._glyphs.size() + 1; i++) {
MacGlyph *glyph = (i == src->_data._glyphs.size()) ? &data._defaultChar : &data._glyphs[i];
@@ -435,10 +450,11 @@ MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize) {
glyph->width = (int)((float)srcglyph->width * scale);
glyph->kerningOffset = (int)((float)srcglyph->kerningOffset * scale);
- glyph->bitmapWidth = (int)((float)srcglyph->bitmapWidth * scale);
+ glyph->bitmapWidth = glyph->width; //(int)((float)srcglyph->bitmapWidth * scale);
glyph->bitmapOffset = newBitmapWidth;
- newBitmapWidth += (glyph->bitmapWidth + 7) & ~0x7;
+ // Align width to a byte
+ newBitmapWidth += (glyph->bitmapWidth + 7 + 2) & ~0x7; // Add 2 pixels for italic and bold
}
data._rowWords = newBitmapWidth;
@@ -446,51 +462,216 @@ MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize) {
uint bitImageSize = data._rowWords * data._fRectHeight;
data._bitImage = new byte[bitImageSize];
- int srcPitch = src->_data._rowWords;
int dstPitch = data._rowWords;
for (uint i = 0; i < src->_data._glyphs.size() + 1; i++) {
const MacGlyph *srcglyph = (i == src->_data._glyphs.size()) ? &src->_data._defaultChar : &src->_data._glyphs[i];
+
+ int grayLevel = src->_data._fRectHeight * srcglyph->width / 4;
+
+#if DEBUGSCALING
+ int ccc = 'c';
+ dododo = i == ccc;
+#endif
+
+ srcSurf.fillRect(Common::Rect(srcSurf.w, srcSurf.h), 0);
+ src->drawChar(&srcSurf, i + src->_data._firstChar, 0, 0, 1);
+ memset(dstGray, 0, dstGraySize * sizeof(int));
+ magnifyGray(&srcSurf, dstGray, srcglyph->width, src->_data._fRectHeight, scale);
+
MacGlyph *glyph = (i == src->_data._glyphs.size()) ? &data._defaultChar : &data._glyphs[i];
+ int *grayPtr = dstGray;
+
+ for (int y = 0; y < data._fRectHeight; y++) {
+ byte *dst = (byte *)srcSurf.getBasePtr(0, y);
+
+ for (int x = 0; x < glyph->width; x++, grayPtr++, dst++) {
+#if DEBUGSCALING
+ if (i == ccc) {
+ if (*grayPtr)
+ debugN(1, "%3d ", *grayPtr);
+ else
+ debugN(1, " ");
+ }
+#endif
+ if (*grayPtr > grayLevel)
+ *dst = 1;
+ else
+ *dst = 0;
+ }
+#if DEBUGSCALING
+ if (i == ccc)
+ debug(1, "");
+#endif
+ }
+
+ if (bold) {
+ memset(dstGray, 0, dstGraySize * sizeof(int));
+ makeBold(&srcSurf, dstGray, glyph, data._fRectHeight);
+
+ for (uint16 y = 0; y < data._fRectHeight; y++) {
+ int *srcPtr = &dstGray[y * glyph->width];
+ byte *dstPtr = (byte *)srcSurf.getBasePtr(0, y);
+
+ for (uint16 x = 0; x < glyph->width; x++, srcPtr++, dstPtr++) {
+ if (*srcPtr)
+ *dstPtr = 1;
+
+#if DEBUGSCALING
+ if (i == ccc)
+ debugN("%c", *srcPtr ? '@' : '.');
+#endif
+ }
+
+#if DEBUGSCALING
+ if (i == ccc)
+ debugN("\n");
+#endif
+ }
+ }
+
byte *ptr = &data._bitImage[glyph->bitmapOffset / 8];
for (int y = 0; y < data._fRectHeight; y++) {
- const byte *srcd = (const byte *)&src->_data._bitImage[((int)((float)y / scale)) * srcPitch];
byte *dst = ptr;
+ byte *srcPtr = (byte *)srcSurf.getBasePtr(0, y);
byte b = 0;
- for (int x = 0; x < glyph->width; x++) {
- int sx = (int)((float)x / scale) + srcglyph->bitmapOffset;
+ for (int x = 0; x < glyph->width; x++, srcPtr++) {
+ b <<= 1;
- if (srcd[sx / 8] & (0x80 >> (sx % 8)))
+ if (*srcPtr == 1)
b |= 1;
- if (!(x % 8) && x) {
+ if (x % 8 == 7) {
*dst++ = b;
b = 0;
}
+ }
- b <<= 1;
+#if DEBUGSCALING
+ if (i == ccc) {
+ debugN(1, "--> %d ", grayLevel);
+
+ grayPtr = &dstGray[y * glyph->width];
+ for (int x = 0; x < glyph->width; x++, grayPtr++)
+ debugN("%c", *grayPtr > grayLevel ? '#' : '.');
}
+#endif
if (((glyph->width - 1) % 8)) {
+#if DEBUGSCALING
+ if (i == ccc)
+ debugN(" --- %02x (w: %d bw: %d << %d)", b, glyph->width, glyph->bitmapWidth, 7 - ((glyph->width - 1) % 8));
+#endif
+
b <<= 7 - ((glyph->width - 1) % 8);
*dst = b;
+
+#if DEBUGSCALING
+ if (i == ccc)
+ debugN(" --- %02x ", b);
+#endif
+ }
+
+#if DEBUGSCALING
+ if (i == ccc) {
+ byte *srcRow = data._bitImage + y * data._rowWords;
+
+ for (uint16 x = 0; x < glyph->bitmapWidth; x++) {
+ uint16 bitmapOffset = glyph->bitmapOffset + x;
+
+ debugN("%c", srcRow[bitmapOffset / 8] & (1 << (7 - (bitmapOffset % 8))) ? '*' : '.');
+ }
+
+ debugN("\n");
}
+#endif
ptr += dstPitch;
}
}
+ srcSurf.free();
+ free(dstGray);
+
return new MacFONTFont(data);
}
+#define howmany(x, y) (((x)+((y)-1))/(y))
+
+static void countupScore(int *dstGray, int x, int y, int bbw, int bbh, float scale) {
+ int newbbw = bbw * scale;
+ int newbbh = bbh * scale;
+ int x_ = x * newbbw;
+ int y_ = y * newbbh;
+ int x1 = x_ + newbbw;
+ int y1 = y_ + newbbh;
+
+ int newxbegin = x_ / bbw;
+ int newybegin = y_ / bbh;
+ int newxend = howmany(x1, bbw);
+ int newyend = howmany(y1, bbh);
+
+ for (int newy = newybegin; newy < newyend; newy++) {
+ for (int newx = newxbegin; newx < newxend; newx++) {
+ int newX = newx * bbw;
+ int newY = newy * bbh;
+ int newX1 = newX + bbw;
+ int newY1 = newY + bbh;
+ dstGray[newy * newbbw + newx] += (MIN(x1, newX1) - MAX(x_, newX)) *
+ (MIN(y1, newY1) - MAX(y_, newY));
+ }
+ }
+}
+
+static void magnifyGray(Surface *src, int *dstGray, int width, int height, float scale) {
+ for (uint16 y = 0; y < height; y++) {
+ for (uint16 x = 0; x < width; x++) {
+ if (*((byte *)src->getBasePtr(x, y)) == 1)
+ countupScore(dstGray, x, y, width, height, scale);
+#if DEBUGSCALING
+ if (dododo)
+ debugN("%c", *((byte *)src->getBasePtr(x, y)) == 1 ? '*' : ' ');
+#endif
+ }
+
+#if DEBUGSCALING
+ if (dododo)
+ debugN("\n");
+#endif
+ }
+}
+
+static void makeBold(Surface *src, int *dstGray, MacGlyph *glyph, int height) {
+ glyph->width++;
+
+ for (uint16 y = 0; y < height; y++) {
+ byte *srcPtr = (byte *)src->getBasePtr(0, y);
+ int *dst = &dstGray[y * glyph->width];
+
+ for (uint16 x = 0; x < glyph->width; x++, srcPtr++, dst++) {
+ bool left = x ? *(srcPtr - 1) == 1 : false;
+ bool center = *srcPtr == 1;
+ bool right = x > glyph->width - 1 ? false : *(srcPtr + 1) == 1;
+
+ bool edge, bold, res;
+
+ bold = center || left;
+ edge = !center && right;
+ res = (bold && !edge);
+
+ *dst = res ? 1 : 0;
+ }
+ }
+}
+
void MacFONTFont::testBlit(const MacFONTFont *src, ManagedSurface *dst, int color, int x0, int y0, int width) {
for (int y = 0; y < src->_data._fRectHeight; y++) {
byte *srcRow = src->_data._bitImage + y * src->_data._rowWords;
for (int x = 0; x < width; x++) {
- uint16 bitmapOffset = x;
+ uint16 bitmapOffset = x + 64;
if (srcRow[bitmapOffset / 8] & (1 << (7 - (bitmapOffset % 8)))) {
if (dst->format.bytesPerPixel == 1)
diff --git a/graphics/fonts/macfont.h b/graphics/fonts/macfont.h
index b2e1fb0d11..cb11304eb2 100644
--- a/graphics/fonts/macfont.h
+++ b/graphics/fonts/macfont.h
@@ -159,7 +159,7 @@ public:
int getFontSize() const { return _data._size; }
- static MacFONTFont *scaleFont(const MacFONTFont *src, int newSize);
+ static MacFONTFont *scaleFont(const MacFONTFont *src, int newSize, bool bold = false, bool italic = false);
static void testBlit(const MacFONTFont *src, ManagedSurface *dst, int color, int x0, int y0, int width);
private:
diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp
index ec6ce6f89a..ad5b36ec23 100644
--- a/graphics/fonts/winfont.cpp
+++ b/graphics/fonts/winfont.cpp
@@ -77,62 +77,20 @@ static WinFontDirEntry readDirEntry(Common::SeekableReadStream &stream) {
}
bool WinFont::loadFromFON(const Common::String &fileName, const WinFontDirEntry &dirEntry) {
- // First try loading via the NE code
- if (loadFromNE(fileName, dirEntry))
- return true;
-
- // Then try loading via the PE code
- return loadFromPE(fileName, dirEntry);
-}
-
-bool WinFont::loadFromNE(const Common::String &fileName, const WinFontDirEntry &dirEntry) {
- Common::NEResources exe;
-
- if (!exe.loadFromEXE(fileName))
- return false;
-
- // Let's pull out the font directory
- Common::SeekableReadStream *fontDirectory = exe.getResource(Common::kWinFontDir, Common::String("FONTDIR"));
- if (!fontDirectory) {
- warning("No font directory in '%s'", fileName.c_str());
- return false;
- }
-
- uint32 fontId = getFontIndex(*fontDirectory, dirEntry);
-
- delete fontDirectory;
-
- // Couldn't match the face name
- if (fontId == 0xffffffff) {
- warning("Could not find face '%s' in '%s'", dirEntry.faceName.c_str(), fileName.c_str());
+ Common::WinResources *exe = Common::WinResources::createFromEXE(fileName);
+ if (!exe)
return false;
- }
-
- // Actually go get our font now...
- Common::SeekableReadStream *fontStream = exe.getResource(Common::kWinFont, fontId);
- if (!fontStream) {
- warning("Could not find font %d in %s", fontId, fileName.c_str());
- return false;
- }
- bool ok = loadFromFNT(*fontStream);
- delete fontStream;
+ bool ok = loadFromEXE(exe, fileName, dirEntry);
+ delete exe;
return ok;
}
-bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry &dirEntry) {
- Common::PEResources *exe = new Common::PEResources();
-
- if (!exe->loadFromEXE(fileName)) {
- delete exe;
- return false;
- }
-
+bool WinFont::loadFromEXE(Common::WinResources *exe, const Common::String &fileName, const WinFontDirEntry &dirEntry) {
// Let's pull out the font directory
Common::SeekableReadStream *fontDirectory = exe->getResource(Common::kWinFontDir, Common::String("FONTDIR"));
if (!fontDirectory) {
warning("No font directory in '%s'", fileName.c_str());
- delete exe;
return false;
}
@@ -143,7 +101,6 @@ bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry &
// Couldn't match the face name
if (fontId == 0xffffffff) {
warning("Could not find face '%s' in '%s'", dirEntry.faceName.c_str(), fileName.c_str());
- delete exe;
return false;
}
@@ -151,13 +108,11 @@ bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry &
Common::SeekableReadStream *fontStream = exe->getResource(Common::kWinFont, fontId);
if (!fontStream) {
warning("Could not find font %d in %s", fontId, fileName.c_str());
- delete exe;
return false;
}
bool ok = loadFromFNT(*fontStream);
delete fontStream;
- delete exe;
return ok;
}
diff --git a/graphics/fonts/winfont.h b/graphics/fonts/winfont.h
index 3354fc2381..f1c661f270 100644
--- a/graphics/fonts/winfont.h
+++ b/graphics/fonts/winfont.h
@@ -28,6 +28,7 @@
namespace Common {
class SeekableReadStream;
+class WinResources;
}
namespace Graphics {
@@ -67,8 +68,7 @@ public:
void drawChar(Surface *dst, uint32 chr, int x, int y, uint32 color) const;
private:
- bool loadFromPE(const Common::String &fileName, const WinFontDirEntry &dirEntry);
- bool loadFromNE(const Common::String &fileName, const WinFontDirEntry &dirEntry);
+ bool loadFromEXE(Common::WinResources *exe, const Common::String &fileName, const WinFontDirEntry &dirEntry);
uint32 getFontIndex(Common::SeekableReadStream &stream, const WinFontDirEntry &dirEntry);
bool loadFromFNT(Common::SeekableReadStream &stream);
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index e8e3d4314b..ff940384c4 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -405,42 +405,67 @@ void MacFontManager::generateFontSubstitute(MacFont &macFont) {
// No simple substitute was found. Looking for neighborhood fonts
// First we gather all font sizes for this font
- Common::Array<int> sizes;
+ Common::Array<MacFont *> sizes;
for (Common::HashMap<Common::String, MacFont *>::iterator i = _fontRegistry.begin(); i != _fontRegistry.end(); ++i) {
if (i->_value->getId() == macFont.getId() && i->_value->getSlant() == macFont.getSlant() && !i->_value->isGenerated())
- sizes.push_back(i->_value->getSize());
+ sizes.push_back(i->_value);
}
if (sizes.empty()) {
- debug(1, "No viable substitute found for font %s", getFontName(macFont).c_str());
- return;
+ if (macFont.getSlant() == kMacFontRegular) {
+ debug(1, "No viable substitute found for font %s", getFontName(macFont).c_str());
+ return;
+ }
+
+ // Now let's try to find a regular font
+ for (Common::HashMap<Common::String, MacFont *>::iterator i = _fontRegistry.begin(); i != _fontRegistry.end(); ++i) {
+ if (i->_value->getId() == macFont.getId() && i->_value->getSlant() == kMacFontRegular && !i->_value->isGenerated())
+ sizes.push_back(i->_value);
+ }
+
+ if (sizes.empty()) {
+ debug(1, "No viable substitute found for font %s", getFontName(macFont).c_str());
+ return;
+ }
}
- // Now looking next larger font, and store the largest one for next check
- int candidate = 1000;
- int maxSize = sizes[0];
+ // Now looking for the next larger font, and store the largest one for next check
+ MacFont *candidate = nullptr;
+ MacFont *maxSize = sizes[0];
for (uint i = 0; i < sizes.size(); i++) {
- if (sizes[i] > macFont.getSize() && sizes[i] < candidate)
+ if (sizes[i]->getSize() == macFont.getSize()) { // Same size but regular slant
+ candidate = sizes[i];
+ break;
+ }
+
+ if (sizes[i]->getSize() > macFont.getSize() && candidate && sizes[i]->getSize() < candidate->getSize())
candidate = sizes[i];
- if (sizes[i] > maxSize)
+ if (sizes[i]->getSize() > maxSize->getSize())
maxSize = sizes[i];
}
- if (candidate != 1000) {
- generateFont(macFont, *_fontRegistry[getFontName(macFont.getId(), candidate, macFont.getSlant())]);
+ if (candidate) {
+ generateFont(macFont, *candidate);
return;
}
// Now next smaller font, which is the biggest we have
- generateFont(macFont, *_fontRegistry[getFontName(macFont.getId(), maxSize, macFont.getSlant())]);
+ generateFont(macFont, *maxSize);
}
void MacFontManager::generateFont(MacFont &toFont, MacFont &fromFont) {
debugN("Found font substitute for font '%s' ", getFontName(toFont).c_str());
debug("as '%s'", getFontName(fromFont).c_str());
- MacFONTFont *font = Graphics::MacFONTFont::scaleFont(fromFont.getFont(), toFont.getSize());
+ bool bold = false, italic = false;
+
+ if (fromFont.getSlant() == kMacFontRegular) {
+ bold = toFont.getSlant() == kMacFontBold;
+ italic = toFont.getSlant() == kMacFontItalic;
+ }
+
+ MacFONTFont *font = Graphics::MacFONTFont::scaleFont(fromFont.getFont(), toFont.getSize(), bold, italic);
if (!font) {
warning("Failed to generate font '%s'", getFontName(toFont).c_str());
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp
index 2c9b3f0902..b79ba8cfbc 100644
--- a/graphics/macgui/macmenu.cpp
+++ b/graphics/macgui/macmenu.cpp
@@ -24,6 +24,7 @@
#include "common/stack.h"
#include "common/keyboard.h"
#include "common/macresman.h"
+#include "common/winexe_pe.h"
#include "graphics/primitives.h"
#include "graphics/font.h"
@@ -200,8 +201,8 @@ static Common::U32String readUnicodeString(Common::SeekableReadStream *stream) {
}
-MacMenu *MacMenu::createMenuFromPEexe(Common::PEResources &exe, MacWindowManager *wm) {
- Common::SeekableReadStream *menuData = exe.getResource(Common::kWinMenu, 128);
+MacMenu *MacMenu::createMenuFromPEexe(Common::PEResources *exe, MacWindowManager *wm) {
+ Common::SeekableReadStream *menuData = exe->getResource(Common::kWinMenu, 128);
if (!menuData)
return nullptr;
diff --git a/graphics/macgui/macmenu.h b/graphics/macgui/macmenu.h
index c8633c0cc7..13d374d084 100644
--- a/graphics/macgui/macmenu.h
+++ b/graphics/macgui/macmenu.h
@@ -24,11 +24,11 @@
#define GRAPHICS_MACGUI_MACMENU_H
#include "common/str-array.h"
-#include "common/winexe_pe.h"
namespace Common {
class U32String;
class MacResManager;
+class PEResources;
}
namespace Graphics {
@@ -51,7 +51,7 @@ public:
~MacMenu();
static Common::StringArray *readMenuFromResource(Common::SeekableReadStream *res);
- static MacMenu *createMenuFromPEexe(Common::PEResources &exe, MacWindowManager *wm);
+ static MacMenu *createMenuFromPEexe(Common::PEResources *exe, MacWindowManager *wm);
void setCommandsCallback(void (*callback)(int, Common::String &, void *), void *data) { _ccallback = callback; _cdata = data; }
void setCommandsCallback(void (*callback)(int, Common::U32String &, void *), void *data) { _unicodeccallback = callback; _cdata = data; }
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 0df403ac8c..2fc9b8dd33 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -69,8 +69,7 @@ MacText::MacText(Common::U32String s, MacWindowManager *wm, const MacFont *macFo
_currentFormatting = _defaultFormatting;
- if (!_str.empty())
- splitString(_str);
+ splitString(_str);
recalcDims();
@@ -101,8 +100,7 @@ MacText::MacText(const Common::String &s, MacWindowManager *wm, const MacFont *m
_currentFormatting = _defaultFormatting;
- if (!_str.empty())
- splitString(_str);
+ splitString(_str);
recalcDims();
@@ -114,13 +112,11 @@ void MacText::setMaxWidth(int maxWidth) {
_textLines.clear();
- if (!_str.empty()) {
- splitString(_str);
+ splitString(_str);
- recalcDims();
+ recalcDims();
- _fullRefresh = true;
- }
+ _fullRefresh = true;
}
static const Common::U32String::value_type *readHex(uint16 *res, const Common::U32String::value_type *s, int len) {
@@ -395,7 +391,7 @@ int MacText::getLineWidth(int line, bool enforce) {
height = MAX(height, _textLines[line].chunks[i].getFont()->getFontHeight());
}
- if (!hastext)
+ if (!hastext && _textLines.size() > 1)
height = height > 3 ? height - 3 : 0;
_textLines[line].width = width;
diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp
index 12cd391f92..19448053a3 100644
--- a/graphics/macgui/macwindowmanager.cpp
+++ b/graphics/macgui/macwindowmanager.cpp
@@ -295,7 +295,7 @@ void macDrawPixel(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))) ?
+ (pat[(yu - p->fillOriginY) % 8] & (1 << (7 - (xu - p->fillOriginX) % 8))) ?
color : p->bgColor;
}
} else {
@@ -310,7 +310,7 @@ void macDrawPixel(int x, int y, int color, void *data) {
uint xu = (uint)x; // for letting compiler optimize it
uint yu = (uint)y;
*((byte *)p->surface->getBasePtr(xu, yu)) =
- (pat[yu % 8] & (1 << (7 - xu % 8))) ?
+ (pat[(yu - p->fillOriginY) % 8] & (1 << (7 - (xu - p->fillOriginX) % 8))) ?
color : p->bgColor;
}
}
@@ -319,7 +319,7 @@ void macDrawPixel(int x, int y, int color, void *data) {
void MacWindowManager::drawDesktop() {
Common::Rect r(_screen->getBounds());
- MacPlotData pd(_screen, &_patterns, kPatternCheckers, 1, _colorWhite);
+ MacPlotData pd(_screen, &_patterns, kPatternCheckers, 0, 0, 1, _colorWhite);
Graphics::drawRoundRect(r, kDesktopArc, _colorBlack, true, macDrawPixel, &pd);
diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h
index c412e64f0a..5846bcba07 100644
--- a/graphics/macgui/macwindowmanager.h
+++ b/graphics/macgui/macwindowmanager.h
@@ -83,11 +83,13 @@ struct MacPlotData {
Graphics::ManagedSurface *surface;
MacPatterns *patterns;
uint fillType;
+ int fillOriginX;
+ int fillOriginY;
int thickness;
uint bgColor;
- MacPlotData(Graphics::ManagedSurface *s, MacPatterns *p, int f, int t, uint bg) :
- surface(s), patterns(p), fillType(f), thickness(t), bgColor(bg) {
+ MacPlotData(Graphics::ManagedSurface *s, MacPatterns *p, uint f, int fx, int fy, int t, uint bg) :
+ surface(s), patterns(p), fillType(f), fillOriginX(fx), fillOriginY(fy), thickness(t), bgColor(bg) {
}
};
diff --git a/graphics/primitives.cpp b/graphics/primitives.cpp
index 60898aa16c..fd6c8fb262 100644
--- a/graphics/primitives.cpp
+++ b/graphics/primitives.cpp
@@ -247,8 +247,8 @@ void drawFilledRect(Common::Rect &rect, int color, void (*plotProc)(int, int, in
void drawRect(Common::Rect &rect, int color, void (*plotProc)(int, int, int, void *), void *data) {
drawHLine(rect.left, rect.right, rect.top, color, plotProc, data);
drawHLine(rect.left, rect.right, rect.bottom, color, plotProc, data);
- drawVLine(rect.top, rect.bottom, rect.left, color, plotProc, data);
- drawVLine(rect.top, rect.bottom, rect.right, color, plotProc, data);
+ drawVLine(rect.left, rect.top, rect.bottom, color, plotProc, data);
+ drawVLine(rect.right, rect.top, rect.bottom, color, plotProc, data);
}
// http://members.chello.at/easyfilter/bresenham.html
diff --git a/graphics/transparent_surface.cpp b/graphics/transparent_surface.cpp
index eb8d3fe5ce..1ad1ed637c 100644
--- a/graphics/transparent_surface.cpp
+++ b/graphics/transparent_surface.cpp
@@ -749,43 +749,30 @@ void TransparentSurface::setAlphaMode(AlphaType mode) {
/*
-
The below two functions are adapted from SDL_rotozoom.c,
taken from SDL_gfx-2.0.18.
-
Its copyright notice:
-
=============================================================================
SDL_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces
-
Copyright (C) 2001-2012 Andreas Schiffler
-
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
-
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
-
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
-
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
-
3. This notice may not be removed or altered from any source
distribution.
-
Andreas Schiffler -- aschiffler at ferzkopp dot net
=============================================================================
-
-
The functions have been adapted for different structures and coordinate
systems.
-
*/
diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp
index 13d9bebfba..7abd1a33ad 100644
--- a/graphics/wincursor.cpp
+++ b/graphics/wincursor.cpp
@@ -23,8 +23,6 @@
#include "common/ptr.h"
#include "common/stream.h"
#include "common/textconsole.h"
-#include "common/winexe_ne.h"
-#include "common/winexe_pe.h"
#include "graphics/wincursor.h"
@@ -242,64 +240,8 @@ WinCursorGroup::~WinCursorGroup() {
delete cursors[i].cursor;
}
-WinCursorGroup *WinCursorGroup::createCursorGroup(Common::NEResources &exe, const Common::WinResourceID &id) {
- Common::ScopedPtr<Common::SeekableReadStream> stream(exe.getResource(Common::kWinGroupCursor, id));
-
- if (!stream || stream->size() <= 6)
- return 0;
-
- stream->skip(4);
- uint32 cursorCount = stream->readUint16LE();
- if ((uint32)stream->size() < (6 + cursorCount * 14))
- return 0;
-
- WinCursorGroup *group = new WinCursorGroup();
- group->cursors.reserve(cursorCount);
-
- for (uint32 i = 0; i < cursorCount; i++) {
- stream->readUint16LE(); // width
- stream->readUint16LE(); // height
-
- // Plane count
- if (stream->readUint16LE() != 1) {
- delete group;
- return 0;
- }
-
- // Bits per pixel
- // NE cursors can only be 1bpp
- if (stream->readUint16LE() != 1) {
- delete group;
- return 0;
- }
-
- stream->readUint32LE(); // data size
- uint32 cursorId = stream->readUint16LE();
-
- Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe.getResource(Common::kWinCursor, cursorId));
- if (!cursorStream) {
- delete group;
- return 0;
- }
-
- WinCursor *cursor = new WinCursor();
- if (!cursor->readFromStream(*cursorStream)) {
- delete cursor;
- delete group;
- return 0;
- }
-
- CursorItem item;
- item.id = cursorId;
- item.cursor = cursor;
- group->cursors.push_back(item);
- }
-
- return group;
-}
-
-WinCursorGroup *WinCursorGroup::createCursorGroup(Common::PEResources &exe, const Common::WinResourceID &id) {
- Common::ScopedPtr<Common::SeekableReadStream> stream(exe.getResource(Common::kWinGroupCursor, id));
+WinCursorGroup *WinCursorGroup::createCursorGroup(Common::WinResources *exe, const Common::WinResourceID &id) {
+ Common::ScopedPtr<Common::SeekableReadStream> stream(exe->getResource(Common::kWinGroupCursor, id));
if (!stream || stream->size() <= 6)
return 0;
@@ -325,7 +267,7 @@ WinCursorGroup *WinCursorGroup::createCursorGroup(Common::PEResources &exe, cons
stream->readUint32LE(); // data size
uint32 cursorId = stream->readUint16LE();
- Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe.getResource(Common::kWinCursor, cursorId));
+ Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe->getResource(Common::kWinCursor, cursorId));
if (!cursorStream) {
delete group;
return 0;
diff --git a/graphics/wincursor.h b/graphics/wincursor.h
index 2780b23a90..77d00d2d69 100644
--- a/graphics/wincursor.h
+++ b/graphics/wincursor.h
@@ -29,8 +29,6 @@
#include "graphics/cursor.h"
namespace Common {
-class NEResources;
-class PEResources;
class SeekableReadStream;
}
@@ -56,10 +54,8 @@ struct WinCursorGroup {
Common::Array<CursorItem> cursors;
- /** Create a cursor group from an NE EXE, returns 0 on failure */
- static WinCursorGroup *createCursorGroup(Common::NEResources &exe, const Common::WinResourceID &id);
- /** Create a cursor group from an PE EXE, returns 0 on failure */
- static WinCursorGroup *createCursorGroup(Common::PEResources &exe, const Common::WinResourceID &id);
+ /** Create a cursor group from an EXE, returns 0 on failure */
+ static WinCursorGroup *createCursorGroup(Common::WinResources *exe, const Common::WinResourceID &id);
};
/**
diff --git a/gui/ThemeLayout.cpp b/gui/ThemeLayout.cpp
index 10347f0ab9..618ecdc1e3 100644
--- a/gui/ThemeLayout.cpp
+++ b/gui/ThemeLayout.cpp
@@ -298,6 +298,7 @@ void ThemeLayoutStacked::reflowLayoutVertical(Widget *widgetChain) {
for (uint i = 0; i < _children.size(); ++i) {
switch (_itemAlign) {
case kItemAlignStart:
+ default:
_children[i]->offsetX(_padding.left);
break;
case kItemAlignCenter:
@@ -385,6 +386,7 @@ void ThemeLayoutStacked::reflowLayoutHorizontal(Widget *widgetChain) {
for (uint i = 0; i < _children.size(); ++i) {
switch (_itemAlign) {
case kItemAlignStart:
+ default:
_children[i]->offsetY(_padding.top);
break;
case kItemAlignCenter:
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index 60feac15d6..449bcc542f 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -341,14 +341,12 @@ void EditGameDialog::open() {
ConfMan.hasKey("speech_volume", _domain);
_globalVolumeOverride->setState(e);
- if (!_guioptions.contains(GUIO_NOMIDI)) {
+ if (!_guioptions.contains(GUIO_NOMIDI) && !_guioptions.contains(GUIO_NOMUSIC)) {
e = ConfMan.hasKey("soundfont", _domain) ||
ConfMan.hasKey("multi_midi", _domain) ||
ConfMan.hasKey("midi_gain", _domain);
_globalMIDIOverride->setState(e);
- }
- if (!_guioptions.contains(GUIO_NOMIDI)) {
e = ConfMan.hasKey("native_mt32", _domain) ||
ConfMan.hasKey("enable_gs", _domain);
_globalMT32Override->setState(e);
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index cca3a4d5b8..d300e91bda 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -372,7 +372,8 @@ enum {
};
SaveLoadChooserSimple::SaveLoadChooserSimple(const String &title, const String &buttonLabel, bool saveMode)
- : SaveLoadChooserDialog("SaveLoadChooser", saveMode), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0) {
+ : SaveLoadChooserDialog("SaveLoadChooser", saveMode), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0),
+ _container(0) {
_backgroundType = ThemeEngine::kDialogBackgroundSpecial;
new StaticTextWidget(this, "SaveLoadChooser.Title", title);
@@ -398,7 +399,18 @@ SaveLoadChooserSimple::SaveLoadChooserSimple(const String &title, const String &
_delSupport = _metaInfoSupport = _thumbnailSupport = false;
- _container = new ContainerWidget(this, "SaveLoadChooser.Thumbnail");
+ addThumbnailContainer();
+}
+
+void SaveLoadChooserSimple::addThumbnailContainer() {
+ // When switching layouts, create / remove the thumbnail container as needed
+ if (g_gui.xmlEval()->getVar("Globals.SaveLoadChooser.ExtInfo.Visible") == 1 && !_container) {
+ _container = new ContainerWidget(this, "SaveLoadChooser.Thumbnail");
+ } else if (g_gui.xmlEval()->getVar("Globals.SaveLoadChooser.ExtInfo.Visible") == 0 && _container) {
+ removeWidget(_container);
+ delete _container;
+ _container = nullptr;
+ }
}
int SaveLoadChooserSimple::runIntern() {
@@ -471,6 +483,8 @@ void SaveLoadChooserSimple::handleCommand(CommandSender *sender, uint32 cmd, uin
}
void SaveLoadChooserSimple::reflowLayout() {
+ addThumbnailContainer();
+
SaveLoadChooserDialog::reflowLayout();
if (g_gui.xmlEval()->getVar("Globals.SaveLoadChooser.ExtInfo.Visible") == 1 && (_thumbnailSupport || _saveDateSupport || _playTimeSupport)) {
@@ -531,7 +545,7 @@ void SaveLoadChooserSimple::reflowLayout() {
updateSelection(false);
} else {
- _container->setVisible(false);
+ if (_container) _container->setVisible(false);
_gfxWidget->setVisible(false);
_date->setVisible(false);
_time->setVisible(false);
diff --git a/gui/saveload-dialog.h b/gui/saveload-dialog.h
index 43721aa270..b4820ff56e 100644
--- a/gui/saveload-dialog.h
+++ b/gui/saveload-dialog.h
@@ -164,6 +164,7 @@ private:
String _resultString;
+ void addThumbnailContainer();
void updateSelection(bool redraw);
};
diff --git a/image/png.cpp b/image/png.cpp
index 1072d41a18..307334a64b 100644
--- a/image/png.cpp
+++ b/image/png.cpp
@@ -283,11 +283,19 @@ bool writePNG(Common::WriteStream &out, const Graphics::Surface &input) {
png_structp pngPtr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!pngPtr) {
+ if (tmp) {
+ tmp->free();
+ delete tmp;
+ }
return false;
}
png_infop infoPtr = png_create_info_struct(pngPtr);
if (!infoPtr) {
png_destroy_write_struct(&pngPtr, NULL);
+ if (tmp) {
+ tmp->free();
+ delete tmp;
+ }
return false;
}
diff --git a/po/he.po b/po/he.po
index 856d8ca084..9b706cb115 100644
--- a/po/he.po
+++ b/po/he.po
@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: ScummVM 2.1.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.scummvm.org\n"
"POT-Creation-Date: 2019-12-14 13:24+0000\n"
-"PO-Revision-Date: 2019-11-04 06:57+0000\n"
-"Last-Translator: Matan Bareket <mataniko@gmail.com>\n"
+"PO-Revision-Date: 2020-01-09 01:27+0000\n"
+"Last-Translator: Niv Baehr <bloop93@gmail.com>\n"
"Language-Team: Hebrew <https://translations.scummvm.org/projects/scummvm/"
"scummvm/he/>\n"
"Language: he\n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n == 1) ? 0 : ((n == 2) ? 1 : ((n > 10 && "
"n % 10 == 0) ? 2 : 3));\n"
-"X-Generator: Weblate 3.7.1\n"
+"X-Generator: Weblate 3.9.1\n"
"X-Language-name: Hebrew\n"
#: gui/about.cpp:102
@@ -36,25 +36,28 @@ msgstr "מנועים זמינים:"
#: gui/browser.cpp:75 backends/dialogs/macosx/macosx-dialogs.mm:87
msgid "Show hidden files"
-msgstr "הצג קבצים מוסתרים"
+msgstr "הצגת קבצים נסתרים"
#: gui/browser.cpp:75
msgid "Show files marked with the hidden attribute"
-msgstr "הצג קבצים עם תכונת הסתרה"
+msgstr "הצגת קבצים שסומנו כנסתרים"
#: gui/browser.cpp:79 gui/remotebrowser.cpp:57
+#, fuzzy
msgid "Go up"
-msgstr "עלה למעלה"
+msgstr "תיקיה למעלה"
#: gui/browser.cpp:79 gui/browser.cpp:81 gui/remotebrowser.cpp:57
#: gui/remotebrowser.cpp:59
+#, fuzzy
msgid "Go to previous directory level"
-msgstr "חזור אל התיקיה הקודמת"
+msgstr "חזרה אל התיקיה הקודמת"
#: gui/browser.cpp:81 gui/remotebrowser.cpp:59
+#, fuzzy
msgctxt "lowres"
msgid "Go up"
-msgstr "עלה למעלה"
+msgstr "תיקיה למעלה"
#: gui/browser.cpp:82 gui/chooser.cpp:46 gui/editgamedialog.cpp:299
#: gui/editrecorddialog.cpp:67 gui/filebrowser-dialog.cpp:65
@@ -87,19 +90,19 @@ msgstr "בחירה"
#: gui/downloaddialog.cpp:49
msgid "Select directory where to download game data"
-msgstr "בחר תיקייה כדי להוריד קבצי משחק"
+msgstr "בחירת תיקיה להורדת נתוני משחק"
#: gui/downloaddialog.cpp:50 gui/editgamedialog.cpp:482 gui/launcher.cpp:210
msgid "Select directory with game data"
-msgstr "בחר תיקייה עם קבצי משחק"
+msgstr "בחירת תיקיה עם נתוני משחק"
#: gui/downloaddialog.cpp:52 gui/downloaddialog.cpp:227
msgid "From: "
-msgstr "מאת: - "
+msgstr "מאת: "
#: gui/downloaddialog.cpp:53 gui/downloaddialog.cpp:228
msgid "To: "
-msgstr "אל: - "
+msgstr "אל: "
#: gui/downloaddialog.cpp:64
msgid "Cancel download"
@@ -112,7 +115,7 @@ msgstr "ביטול הורדה"
#: gui/downloaddialog.cpp:68
msgid "Hide"
-msgstr "הסתר"
+msgstr "הסתרה"
#: gui/downloaddialog.cpp:118
msgid ""
@@ -168,7 +171,7 @@ msgstr ""
#: engines/sword2/animation.cpp:465 engines/sword2/animation.cpp:475
#: engines/zvision/file/save_manager.cpp:230
msgid "OK"
-msgstr "אוקיי"
+msgstr "אישור"
#: gui/downloaddialog.cpp:152
#, c-format
@@ -203,7 +206,7 @@ msgid ""
"Short game identifier used for referring to saved games and running the game "
"from the command line"
msgstr ""
-"תיאור משחק קצר לשימוש כאשר מתייחסים לשמירות וכדי להריץ את המשחק משורת הפקודות"
+"תיאור קצר של המשחק המשמש להפניה למשחקים שמורים ולהרצת המשחק משורת הפקודה"
#: gui/editgamedialog.cpp:140
msgctxt "lowres"
@@ -217,7 +220,7 @@ msgstr "שם:"
#: gui/editgamedialog.cpp:145 gui/editgamedialog.cpp:147
#: gui/editgamedialog.cpp:148
msgid "Full title of the game"
-msgstr "שם מלא של המשחק"
+msgstr "כותרת מלאה של המשחק"
#: gui/editgamedialog.cpp:147
msgctxt "lowres"
@@ -229,10 +232,11 @@ msgid "Language:"
msgstr "שפה:"
#: gui/editgamedialog.cpp:151 gui/editgamedialog.cpp:152
+#, fuzzy
msgid ""
"Language of the game. This will not turn your Spanish game version into "
"English"
-msgstr "שפת המשחק. זה לא יהפוך משחק בטורקית למשחק בעברית"
+msgstr "שפת המשחק. אפשרות זו לא תהפוך משחק בטורקית למשחק בעברית"
#: gui/editgamedialog.cpp:153 gui/editgamedialog.cpp:167 gui/options.cpp:1061
#: gui/options.cpp:1074 gui/options.cpp:1088 gui/options.cpp:1699
@@ -268,7 +272,7 @@ msgstr "תצוגה"
#: gui/editgamedialog.cpp:192
msgid "Override global graphic settings"
-msgstr "בטל הגדרות תצוגה גלובליות"
+msgstr "ביטול הגדרות תצוגה גלובליות"
#: gui/editgamedialog.cpp:194
msgctxt "lowres"
@@ -398,7 +402,7 @@ msgstr "ברירת מחדל"
#: gui/editgamedialog.cpp:462 gui/options.cpp:2282
msgid "Select SoundFont"
-msgstr "בחר SoundFont"
+msgstr "בחירת SoundFont"
#: gui/editgamedialog.cpp:501
msgid "Select additional game directory"
@@ -418,7 +422,7 @@ msgstr ""
#: gui/editgamedialog.cpp:546
msgid "This game ID is already taken. Please choose another one."
-msgstr "מזהה המשחק תפוס. אנא בחר מזהה אחר."
+msgstr "מזהה המשחק כבר תפוס. נא לבחור מזהה אחר."
#: gui/editrecorddialog.cpp:58
msgid "Author:"
@@ -430,15 +434,15 @@ msgstr "הערות:"
#: gui/editrecorddialog.cpp:68 gui/predictivedialog.cpp:74
msgid "Ok"
-msgstr "אוקיי"
+msgstr "אישור"
#: gui/filebrowser-dialog.cpp:50
msgid "Choose file for loading"
-msgstr "בחר קובץ לטעינה"
+msgstr "בחירת קובץ לטעינה"
#: gui/filebrowser-dialog.cpp:50
msgid "Enter filename for saving"
-msgstr "הכנס שם קובץ לשמירה"
+msgstr "יש להזין שם קובץ לשמירה"
#: gui/filebrowser-dialog.cpp:133
msgid "Do you really want to overwrite the file?"
@@ -446,7 +450,7 @@ msgstr "האם באמת להחליף את הקובץ?"
#: gui/fluidsynth-dialog.cpp:69
msgid "Reverb"
-msgstr "הידהוד"
+msgstr "הדהוד"
#: gui/fluidsynth-dialog.cpp:71 gui/fluidsynth-dialog.cpp:103
msgid "Active"
@@ -546,7 +550,7 @@ msgstr "לחיצת עכבר"
#: gui/gui-manager.cpp:130 base/main.cpp:376
msgid "Display keyboard"
-msgstr "הצג מקלדת"
+msgstr "הצגת מקלדת"
#: gui/gui-manager.cpp:134 base/main.cpp:380
msgid "Remap keys"
@@ -599,7 +603,7 @@ msgstr "~א~ודות..."
#: gui/launcher.cpp:145 backends/platform/sdl/macosx/appmenu_osx.mm:203
msgid "About ScummVM"
-msgstr "אודות ScummVM"
+msgstr "על אודות ScummVM"
#: gui/launcher.cpp:146
msgid "~O~ptions..."