[Scummvm-git-logs] scummvm master -> f7e2a1932781a8330a7fbabacee37b1ac13d62f3
sev-
noreply at scummvm.org
Tue Mar 25 04:17:44 UTC 2025
This automated email contains information about 17 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6876787d65 DIRECTOR: Add stubs for OpenURL and RolloverToolkit Xtras
0f44adce38 DIRECTOR: XOBJ: Add stubs for GetSoundInLevel and ListDev
9c5443ca9d DIRECTOR: LINGO: Allow setting properties on nonexistent cast members
7ac5047bc7 DIRECTOR: Move _mainArchive handle to DirectorEngine
fdfdd3ae41 DIRECTOR: Force clip dirty rectangles against screen area
427c31acd8 DIRECTOR: LINGO: Limit functions which can be discovered
1d3c6271b2 GRAPHICS: Move Mac gamma curve to header
dd553c4443 DIRECTOR: Add several games to detection table
9d4a64b977 DIRECTOR: Improve accuracy of enterFrame
d1222ab176 DIRECTOR: Fix bounding box when loading pictures into cast members
d433c71154 DIRECTOR: Use maxHeight to determine TextCastMember bounding box
5a6ef0b133 DIRECTOR: LINGO: Improve accuracy of b_integer
255821d1c4 DIRECTOR: LINGO: Improve accuracy of 'the result'
b4c9557086 DIRECTOR: LINGO: Slight improvement in Cosmology of Kyoto patch
2f8426016c DIRECTOR: Add gamma correction for Mac games
f7bc677856 DIRECTOR: Fix regression with video playback
f7e2a19327 DIRECTOR: Fix video palette mismatch in Mac gamma mode
Commit: 6876787d655e85fe182a2671f9ef872cc9932de3
https://github.com/scummvm/scummvm/commit/6876787d655e85fe182a2671f9ef872cc9932de3
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Add stubs for OpenURL and RolloverToolkit Xtras
Changed paths:
A engines/director/lingo/xtras/openurl.cpp
A engines/director/lingo/xtras/openurl.h
A engines/director/lingo/xtras/rtk.cpp
A engines/director/lingo/xtras/rtk.h
engines/director/lingo/lingo-object.cpp
engines/director/module.mk
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 13089b0ac2a..48df334caf5 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -137,7 +137,9 @@
#include "director/lingo/xtras/directsound.h"
#include "director/lingo/xtras/filextra.h"
#include "director/lingo/xtras/keypoll.h"
+#include "director/lingo/xtras/openurl.h"
#include "director/lingo/xtras/qtvrxtra.h"
+#include "director/lingo/xtras/rtk.h"
#include "director/lingo/xtras/scrnutil.h"
#include "director/lingo/xtras/timextra.h"
#include "director/lingo/xtras/xsound.h"
@@ -285,6 +287,7 @@ static const struct XLibProto {
XLIBDEF(MovUtilsXObj, kXObj, 400), // D4
XLIBDEF(MystIsleXObj, kXObj, 400), // D4
XLIBDEF(OpenBleedWindowXCMD,kXObj, 300), // D3
+ XLIBDEF(OpenURLXtra, kXtraObj, 500), // D5
XLIBDEF(OrthoPlayXObj, kXObj, 400), // D4
XLIBDEF(PACoXObj, kXObj, 300), // D3
XLIBDEF(PalXObj, kXObj, 400), // D4
@@ -302,6 +305,7 @@ static const struct XLibProto {
XLIBDEF(RearWindowXObj, kXObj, 400), // D4
XLIBDEF(RegisterComponent, kXObj, 400), // D4
XLIBDEF(RemixXCMD, kXObj, 300), // D3
+ XLIBDEF(RolloverToolkitXtra, kXtraObj, 500), // D5
XLIBDEF(ScrnUtilXtra, kXtraObj, 500), // D5
XLIBDEF(SerialPortXObj, kXObj, 200), // D2
XLIBDEF(SoundJam, kXObj, 400), // D4
diff --git a/engines/director/lingo/xtras/openurl.cpp b/engines/director/lingo/xtras/openurl.cpp
new file mode 100644
index 00000000000..16275b2dec6
--- /dev/null
+++ b/engines/director/lingo/xtras/openurl.cpp
@@ -0,0 +1,107 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/system.h"
+
+#include "director/director.h"
+#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-object.h"
+#include "director/lingo/lingo-utils.h"
+#include "director/lingo/xtras/openurl.h"
+
+/**************************************************
+ *
+ * USED IN:
+ * Cracking the Conspiracy
+ *
+ **************************************************/
+
+/*
+-- xtra OpenURL
+new object me
+
+* gsOpenURL string URL -- opens URL in default browser; returns 1 for success, 0 for failure.
+
+-- Copyright: Gary Smith, 9th August, 1997.
+-- Email: gary at mods.com.au
+-- Web site: http://www.mods.com.au
+-- This Xtra may be freely distributed.
+
+
+ */
+
+namespace Director {
+
+const char *OpenURLXtra::xlibName = "OpenURL";
+const XlibFileDesc OpenURLXtra::fileNames[] = {
+ { "openurl", nullptr },
+ { nullptr, nullptr },
+};
+
+static MethodProto xlibMethods[] = {
+ { "new", OpenURLXtra::m_new, 0, 0, 500 },
+ { nullptr, nullptr, 0, 0, 0 }
+};
+
+static BuiltinProto xlibBuiltins[] = {
+ { "gsOpenURL", OpenURLXtra::m_gsOpenURL, 1, 1, 500, HBLTIN },
+ { nullptr, nullptr, 0, 0, 0, VOIDSYM }
+};
+
+OpenURLXtraObject::OpenURLXtraObject(ObjectType ObjectType) :Object<OpenURLXtraObject>("OpenURL") {
+ _objType = ObjectType;
+}
+
+bool OpenURLXtraObject::hasProp(const Common::String &propName) {
+ return (propName == "name");
+}
+
+Datum OpenURLXtraObject::getProp(const Common::String &propName) {
+ if (propName == "name")
+ return Datum(OpenURLXtra::xlibName);
+ warning("OpenURLXtra::getProp: unknown property '%s'", propName.c_str());
+ return Datum();
+}
+
+void OpenURLXtra::open(ObjectType type, const Common::Path &path) {
+ OpenURLXtraObject::initMethods(xlibMethods);
+ OpenURLXtraObject *xobj = new OpenURLXtraObject(type);
+ if (type == kXtraObj)
+ g_lingo->_openXtras.push_back(xlibName);
+ g_lingo->exposeXObject(xlibName, xobj);
+ g_lingo->initBuiltIns(xlibBuiltins);
+}
+
+void OpenURLXtra::close(ObjectType type) {
+ OpenURLXtraObject::cleanupMethods();
+ g_lingo->_globalvars[xlibName] = Datum();
+
+}
+
+void OpenURLXtra::m_new(int nargs) {
+ g_lingo->printSTUBWithArglist("OpenURLXtra::m_new", nargs);
+ g_lingo->dropStack(nargs);
+ g_lingo->push(g_lingo->_state->me);
+}
+
+XOBJSTUB(OpenURLXtra::m_gsOpenURL, 0)
+
+}
diff --git a/engines/director/lingo/xtras/openurl.h b/engines/director/lingo/xtras/openurl.h
new file mode 100644
index 00000000000..46103e6dba8
--- /dev/null
+++ b/engines/director/lingo/xtras/openurl.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_XTRAS_OPENURL_H
+#define DIRECTOR_LINGO_XTRAS_OPENURL_H
+
+namespace Director {
+
+class OpenURLXtraObject : public Object<OpenURLXtraObject> {
+public:
+ OpenURLXtraObject(ObjectType objType);
+
+ bool hasProp(const Common::String &propName) override;
+ Datum getProp(const Common::String &propName) override;
+};
+
+namespace OpenURLXtra {
+
+extern const char *xlibName;
+extern const XlibFileDesc fileNames[];
+
+void open(ObjectType type, const Common::Path &path);
+void close(ObjectType type);
+
+void m_new(int nargs);
+void m_gsOpenURL(int nargs);
+
+} // End of namespace OpenURLXtra
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/lingo/xtras/rtk.cpp b/engines/director/lingo/xtras/rtk.cpp
new file mode 100644
index 00000000000..2dc6aadf71c
--- /dev/null
+++ b/engines/director/lingo/xtras/rtk.cpp
@@ -0,0 +1,171 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/system.h"
+
+#include "director/director.h"
+#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-object.h"
+#include "director/lingo/lingo-utils.h"
+#include "director/lingo/xtras/rtk.h"
+
+/**************************************************
+ *
+ * USED IN:
+ * Cracking the Conspiracy
+ *
+ **************************************************/
+
+/*
+-- xtra Rollover_Toolkit
+-- Rollover Toolkit (tm)
+-- by Penworks Corporation
+-- Copyright (c) 1996 by Penworks Corporation.
+-- All rights reserved.
+-- Net: admin at penworks.com Web: http://www.penworks.com
+new object me
+* CheckForRollovers * -- Put this in your 'on idle' handler
+* CurrentRollover -- Returns number of sprite rolled over
+* EndAnyRollovers -- Forces all activated rollovers to end
+* ResetRollovers -- Clears any pending rollovers
+* EnableCastmemberDetection -- Takes cast member changes into account
+* DisableCastmemberDetection -- Ignores cast member changes (the default)
+* GetCastmemberDetectionStatus -- Returns TRUE if detecting cast member changes
+* AutoSetSpriteRange -- One-time check to find active sprites
+* MonitorAllSprites -- Watches all sprites (default)
+* MonitorNoSprites -- Watches no sprites
+* MonitorSpriteRange integer, integer -- Set specific range of sprites to check
+* UnMonitorSpriteRange integer, integer -- Frees specific range of sprites from checking
+* MonitorSprite integer -- Watches particular sprite
+* UnMonitorSprite integer -- Removes watch from a particular sprite
+* GetMonitorStatus integer -- Returns TRUE if specified sprite is monitored
+* DumpMonitorStatus -- Dumps the rollover status list to the message window
+* ShowRTKVersion -- Displays the current version number and date of the Toolkit
+* EnableMatteDetection -- Checks for Matte ink rollovers
+* DisableMatteDetection -- Disables Matte ink detection (default)
+* GetMatteDetectionStatus -- Returns TRUE if Matte detection is on
+* rtkRegisterMac string -- Registers for use on Macintosh
+* rtkRegisterX16 string -- Registers for use on 16-bit Windows
+* rtkRegisterX32 string -- Registers for use on 32-bit Windows
+
+ */
+
+namespace Director {
+
+const char *RolloverToolkitXtra::xlibName = "RolloverToolkit";
+const XlibFileDesc RolloverToolkitXtra::fileNames[] = {
+ { "rollover_toolkit", nullptr },
+ { nullptr, nullptr },
+};
+
+static MethodProto xlibMethods[] = {
+ { "new", RolloverToolkitXtra::m_new, 0, 0, 500 },
+ { nullptr, nullptr, 0, 0, 0 }
+};
+
+static BuiltinProto xlibBuiltins[] = {
+ { "CheckForRollovers", RolloverToolkitXtra::m_CheckForRollovers, -1, 0, 500, HBLTIN },
+ { "CurrentRollover", RolloverToolkitXtra::m_CurrentRollover, 0, 0, 500, HBLTIN },
+ { "EndAnyRollovers", RolloverToolkitXtra::m_EndAnyRollovers, 0, 0, 500, HBLTIN },
+ { "ResetRollovers", RolloverToolkitXtra::m_ResetRollovers, 0, 0, 500, HBLTIN },
+ { "EnableCastmemberDetection", RolloverToolkitXtra::m_EnableCastmemberDetection, 0, 0, 500, HBLTIN },
+ { "DisableCastmemberDetection", RolloverToolkitXtra::m_DisableCastmemberDetection, 0, 0, 500, HBLTIN },
+ { "GetCastmemberDetectionStatus", RolloverToolkitXtra::m_GetCastmemberDetectionStatus, 0, 0, 500, HBLTIN },
+ { "AutoSetSpriteRange", RolloverToolkitXtra::m_AutoSetSpriteRange, 0, 0, 500, HBLTIN },
+ { "MonitorAllSprites", RolloverToolkitXtra::m_MonitorAllSprites, 0, 0, 500, HBLTIN },
+ { "MonitorNoSprites", RolloverToolkitXtra::m_MonitorNoSprites, 0, 0, 500, HBLTIN },
+ { "MonitorSpriteRange", RolloverToolkitXtra::m_MonitorSpriteRange, 2, 2, 500, HBLTIN },
+ { "UnMonitorSpriteRange", RolloverToolkitXtra::m_UnMonitorSpriteRange, 2, 2, 500, HBLTIN },
+ { "MonitorSprite", RolloverToolkitXtra::m_MonitorSprite, 1, 1, 500, HBLTIN },
+ { "UnMonitorSprite", RolloverToolkitXtra::m_UnMonitorSprite, 1, 1, 500, HBLTIN },
+ { "GetMonitorStatus", RolloverToolkitXtra::m_GetMonitorStatus, 1, 1, 500, HBLTIN },
+ { "DumpMonitorStatus", RolloverToolkitXtra::m_DumpMonitorStatus, 0, 0, 500, HBLTIN },
+ { "ShowRTKVersion", RolloverToolkitXtra::m_ShowRTKVersion, 0, 0, 500, HBLTIN },
+ { "EnableMatteDetection", RolloverToolkitXtra::m_EnableMatteDetection, 0, 0, 500, HBLTIN },
+ { "DisableMatteDetection", RolloverToolkitXtra::m_DisableMatteDetection, 0, 0, 500, HBLTIN },
+ { "GetMatteDetectionStatus", RolloverToolkitXtra::m_GetMatteDetectionStatus, 0, 0, 500, HBLTIN },
+ { "rtkRegisterMac", RolloverToolkitXtra::m_rtkRegisterMac, 1, 1, 500, HBLTIN },
+ { "rtkRegisterX16", RolloverToolkitXtra::m_rtkRegisterX16, 1, 1, 500, HBLTIN },
+ { "rtkRegisterX32", RolloverToolkitXtra::m_rtkRegisterX32, 1, 1, 500, HBLTIN },
+ { nullptr, nullptr, 0, 0, 0, VOIDSYM }
+};
+
+RolloverToolkitXtraObject::RolloverToolkitXtraObject(ObjectType ObjectType) :Object<RolloverToolkitXtraObject>("RolloverToolkit") {
+ _objType = ObjectType;
+}
+
+bool RolloverToolkitXtraObject::hasProp(const Common::String &propName) {
+ return (propName == "name");
+}
+
+Datum RolloverToolkitXtraObject::getProp(const Common::String &propName) {
+ if (propName == "name")
+ return Datum(RolloverToolkitXtra::xlibName);
+ warning("RolloverToolkitXtra::getProp: unknown property '%s'", propName.c_str());
+ return Datum();
+}
+
+void RolloverToolkitXtra::open(ObjectType type, const Common::Path &path) {
+ RolloverToolkitXtraObject::initMethods(xlibMethods);
+ RolloverToolkitXtraObject *xobj = new RolloverToolkitXtraObject(type);
+ if (type == kXtraObj)
+ g_lingo->_openXtras.push_back(xlibName);
+ g_lingo->exposeXObject(xlibName, xobj);
+ g_lingo->initBuiltIns(xlibBuiltins);
+}
+
+void RolloverToolkitXtra::close(ObjectType type) {
+ RolloverToolkitXtraObject::cleanupMethods();
+ g_lingo->_globalvars[xlibName] = Datum();
+
+}
+
+void RolloverToolkitXtra::m_new(int nargs) {
+ g_lingo->printSTUBWithArglist("RolloverToolkitXtra::m_new", nargs);
+ g_lingo->dropStack(nargs);
+ g_lingo->push(g_lingo->_state->me);
+}
+
+XOBJSTUB(RolloverToolkitXtra::m_CheckForRollovers, 0)
+XOBJSTUB(RolloverToolkitXtra::m_CurrentRollover, 0)
+XOBJSTUB(RolloverToolkitXtra::m_EndAnyRollovers, 0)
+XOBJSTUB(RolloverToolkitXtra::m_ResetRollovers, 0)
+XOBJSTUB(RolloverToolkitXtra::m_EnableCastmemberDetection, 0)
+XOBJSTUB(RolloverToolkitXtra::m_DisableCastmemberDetection, 0)
+XOBJSTUB(RolloverToolkitXtra::m_GetCastmemberDetectionStatus, 0)
+XOBJSTUB(RolloverToolkitXtra::m_AutoSetSpriteRange, 0)
+XOBJSTUB(RolloverToolkitXtra::m_MonitorAllSprites, 0)
+XOBJSTUB(RolloverToolkitXtra::m_MonitorNoSprites, 0)
+XOBJSTUB(RolloverToolkitXtra::m_MonitorSpriteRange, 0)
+XOBJSTUB(RolloverToolkitXtra::m_UnMonitorSpriteRange, 0)
+XOBJSTUB(RolloverToolkitXtra::m_MonitorSprite, 0)
+XOBJSTUB(RolloverToolkitXtra::m_UnMonitorSprite, 0)
+XOBJSTUB(RolloverToolkitXtra::m_GetMonitorStatus, 0)
+XOBJSTUB(RolloverToolkitXtra::m_DumpMonitorStatus, 0)
+XOBJSTUB(RolloverToolkitXtra::m_ShowRTKVersion, 0)
+XOBJSTUB(RolloverToolkitXtra::m_EnableMatteDetection, 0)
+XOBJSTUB(RolloverToolkitXtra::m_DisableMatteDetection, 0)
+XOBJSTUB(RolloverToolkitXtra::m_GetMatteDetectionStatus, 0)
+XOBJSTUB(RolloverToolkitXtra::m_rtkRegisterMac, 0)
+XOBJSTUB(RolloverToolkitXtra::m_rtkRegisterX16, 0)
+XOBJSTUB(RolloverToolkitXtra::m_rtkRegisterX32, 0)
+
+}
diff --git a/engines/director/lingo/xtras/rtk.h b/engines/director/lingo/xtras/rtk.h
new file mode 100644
index 00000000000..2aba0f8066a
--- /dev/null
+++ b/engines/director/lingo/xtras/rtk.h
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_XTRAS_RTK_H
+#define DIRECTOR_LINGO_XTRAS_RTK_H
+
+namespace Director {
+
+class RolloverToolkitXtraObject : public Object<RolloverToolkitXtraObject> {
+public:
+ RolloverToolkitXtraObject(ObjectType objType);
+
+ bool hasProp(const Common::String &propName) override;
+ Datum getProp(const Common::String &propName) override;
+};
+
+namespace RolloverToolkitXtra {
+
+extern const char *xlibName;
+extern const XlibFileDesc fileNames[];
+
+void open(ObjectType type, const Common::Path &path);
+void close(ObjectType type);
+
+void m_new(int nargs);
+void m_CheckForRollovers(int nargs);
+void m_CurrentRollover(int nargs);
+void m_EndAnyRollovers(int nargs);
+void m_ResetRollovers(int nargs);
+void m_EnableCastmemberDetection(int nargs);
+void m_DisableCastmemberDetection(int nargs);
+void m_GetCastmemberDetectionStatus(int nargs);
+void m_AutoSetSpriteRange(int nargs);
+void m_MonitorAllSprites(int nargs);
+void m_MonitorNoSprites(int nargs);
+void m_MonitorSpriteRange(int nargs);
+void m_UnMonitorSpriteRange(int nargs);
+void m_MonitorSprite(int nargs);
+void m_UnMonitorSprite(int nargs);
+void m_GetMonitorStatus(int nargs);
+void m_DumpMonitorStatus(int nargs);
+void m_ShowRTKVersion(int nargs);
+void m_EnableMatteDetection(int nargs);
+void m_DisableMatteDetection(int nargs);
+void m_GetMatteDetectionStatus(int nargs);
+void m_rtkRegisterMac(int nargs);
+void m_rtkRegisterX16(int nargs);
+void m_rtkRegisterX32(int nargs);
+
+} // End of namespace RolloverToolkitXtra
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index 2fc0e018916..29952fb2a3c 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -167,7 +167,9 @@ MODULE_OBJS = \
lingo/xtras/directsound.o \
lingo/xtras/filextra.o \
lingo/xtras/keypoll.o \
+ lingo/xtras/openurl.o \
lingo/xtras/qtvrxtra.o \
+ lingo/xtras/rtk.o \
lingo/xtras/scrnutil.o \
lingo/xtras/timextra.o \
lingo/xtras/xsound.o
Commit: 0f44adce380daf13cb7786cd60a9d10fda68a3f7
https://github.com/scummvm/scummvm/commit/0f44adce380daf13cb7786cd60a9d10fda68a3f7
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: XOBJ: Add stubs for GetSoundInLevel and ListDev
Changed paths:
A engines/director/lingo/xlibs/getsoundinlevel.cpp
A engines/director/lingo/xlibs/getsoundinlevel.h
A engines/director/lingo/xlibs/listdev.cpp
A engines/director/lingo/xlibs/listdev.h
engines/director/lingo/lingo-object.cpp
engines/director/module.mk
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 48df334caf5..4a2fce87ed2 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -73,6 +73,7 @@
#include "director/lingo/xlibs/genutils.h"
#include "director/lingo/xlibs/getscreenrectsxfcn.h"
#include "director/lingo/xlibs/getscreensizexfcn.h"
+#include "director/lingo/xlibs/getsoundinlevel.h"
#include "director/lingo/xlibs/gpid.h"
#include "director/lingo/xlibs/henry.h"
#include "director/lingo/xlibs/hitmap.h"
@@ -83,6 +84,7 @@
#include "director/lingo/xlibs/ispippin.h"
#include "director/lingo/xlibs/jitdraw3.h"
#include "director/lingo/xlibs/labeldrvxobj.h"
+#include "director/lingo/xlibs/listdev.h"
#include "director/lingo/xlibs/maniacbg.h"
#include "director/lingo/xlibs/mapnavigatorxobj.h"
#include "director/lingo/xlibs/memcheckxobj.h"
@@ -261,6 +263,7 @@ static const struct XLibProto {
XLIBDEF(GenUtilsXObj, kXObj, 400), // D4
XLIBDEF(GetScreenRectsXFCN, kXObj, 300), // D3
XLIBDEF(GetScreenSizeXFCN, kXObj, 300), // D3
+ XLIBDEF(GetSoundInLevelXObj, kXObj, 400), // D4
XLIBDEF(GpidXObj, kXObj, 400), // D4
XLIBDEF(HenryXObj, kXObj, 400), // D4
XLIBDEF(HitMap, kXObj, 400), // D4
@@ -272,6 +275,7 @@ static const struct XLibProto {
XLIBDEF(JourneyWareXINIXObj,kXObj, 400), // D4
XLIBDEF(KeypollXtra, kXtraObj, 500), // D5
XLIBDEF(LabelDrvXObj, kXObj, 400), // D4
+ XLIBDEF(ListDevXObj, kXObj, 500), // D5
XLIBDEF(MMovieXObj, kXObj, 400), // D4
XLIBDEF(ManiacBgXObj, kXObj, 300), // D3
XLIBDEF(MapNavigatorXObj, kXObj, 400), // D4
diff --git a/engines/director/lingo/xlibs/getsoundinlevel.cpp b/engines/director/lingo/xlibs/getsoundinlevel.cpp
new file mode 100644
index 00000000000..d98b213b11a
--- /dev/null
+++ b/engines/director/lingo/xlibs/getsoundinlevel.cpp
@@ -0,0 +1,107 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/system.h"
+
+#include "director/director.h"
+#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-object.h"
+#include "director/lingo/lingo-utils.h"
+#include "director/lingo/xlibs/getsoundinlevel.h"
+
+/**************************************************
+ *
+ * USED IN:
+ * Microphone Fiend
+ *
+ **************************************************/
+
+/*
+-- GetSoundInLevel, v1.4 C G.M.Smith 1994/5/6
+I mNew
+I mGetLevel --> I -- Get the sound input current level
+I mGetLeftLevel --> I -- Get the left sound input current level
+I mGetRightLevel --> I -- Get the right sound input current level
+I mGetChannelCount --> I -- Get the number of sound channels
+X mDispose
+--
+-- mNew return error values
+-- -227 Sound input busy
+-- -108 Out of memory, increase partition in info dialog
+-- -10 No stereo input
+-- -20 Cannot access data - odd hardware?
+ */
+
+namespace Director {
+
+const char *GetSoundInLevelXObj::xlibName = "GetSoundInLevel";
+const XlibFileDesc GetSoundInLevelXObj::fileNames[] = {
+ { "GetSoundInLevel", nullptr },
+ { nullptr, nullptr },
+};
+
+static MethodProto xlibMethods[] = {
+ { "new", GetSoundInLevelXObj::m_new, 0, 0, 400 },
+ { "getLevel", GetSoundInLevelXObj::m_getLevel, 0, 0, 400 },
+ { "getLeftLevel", GetSoundInLevelXObj::m_getLeftLevel, 0, 0, 400 },
+ { "getRightLevel", GetSoundInLevelXObj::m_getRightLevel, 0, 0, 400 },
+ { "getChannelCount", GetSoundInLevelXObj::m_getChannelCount, 0, 0, 400 },
+ { "dispose", GetSoundInLevelXObj::m_dispose, 0, 0, 400 },
+ { nullptr, nullptr, 0, 0, 0 }
+};
+
+static BuiltinProto xlibBuiltins[] = {
+
+ { nullptr, nullptr, 0, 0, 0, VOIDSYM }
+};
+
+GetSoundInLevelXObject::GetSoundInLevelXObject(ObjectType ObjectType) :Object<GetSoundInLevelXObject>("GetSoundInLevel") {
+ _objType = ObjectType;
+}
+
+void GetSoundInLevelXObj::open(ObjectType type, const Common::Path &path) {
+ GetSoundInLevelXObject::initMethods(xlibMethods);
+ GetSoundInLevelXObject *xobj = new GetSoundInLevelXObject(type);
+ if (type == kXtraObj)
+ g_lingo->_openXtras.push_back(xlibName);
+ g_lingo->exposeXObject(xlibName, xobj);
+ g_lingo->initBuiltIns(xlibBuiltins);
+}
+
+void GetSoundInLevelXObj::close(ObjectType type) {
+ GetSoundInLevelXObject::cleanupMethods();
+ g_lingo->_globalvars[xlibName] = Datum();
+
+}
+
+void GetSoundInLevelXObj::m_new(int nargs) {
+ g_lingo->printSTUBWithArglist("GetSoundInLevelXObj::m_new", nargs);
+ g_lingo->dropStack(nargs);
+ g_lingo->push(g_lingo->_state->me);
+}
+
+XOBJSTUB(GetSoundInLevelXObj::m_getLevel, 100)
+XOBJSTUB(GetSoundInLevelXObj::m_getLeftLevel, 100)
+XOBJSTUB(GetSoundInLevelXObj::m_getRightLevel, 100)
+XOBJSTUB(GetSoundInLevelXObj::m_getChannelCount, 1)
+XOBJSTUBNR(GetSoundInLevelXObj::m_dispose)
+
+}
diff --git a/engines/director/lingo/xlibs/getsoundinlevel.h b/engines/director/lingo/xlibs/getsoundinlevel.h
new file mode 100644
index 00000000000..fd9bc8308d1
--- /dev/null
+++ b/engines/director/lingo/xlibs/getsoundinlevel.h
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_XLIBS_GETSOUNDINLEVEL_H
+#define DIRECTOR_LINGO_XLIBS_GETSOUNDINLEVEL_H
+
+namespace Director {
+
+class GetSoundInLevelXObject : public Object<GetSoundInLevelXObject> {
+public:
+ GetSoundInLevelXObject(ObjectType objType);
+};
+
+namespace GetSoundInLevelXObj {
+
+extern const char *xlibName;
+extern const XlibFileDesc fileNames[];
+
+void open(ObjectType type, const Common::Path &path);
+void close(ObjectType type);
+
+void m_new(int nargs);
+void m_getLevel(int nargs);
+void m_getLeftLevel(int nargs);
+void m_getRightLevel(int nargs);
+void m_getChannelCount(int nargs);
+void m_dispose(int nargs);
+
+} // End of namespace GetSoundInLevelXObj
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/lingo/xlibs/listdev.cpp b/engines/director/lingo/xlibs/listdev.cpp
new file mode 100644
index 00000000000..b1228154cb4
--- /dev/null
+++ b/engines/director/lingo/xlibs/listdev.cpp
@@ -0,0 +1,91 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/system.h"
+
+#include "director/director.h"
+#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-object.h"
+#include "director/lingo/lingo-utils.h"
+#include "director/lingo/xlibs/listdev.h"
+
+/**************************************************
+ *
+ * USED IN:
+ * Microphone Fiend
+ *
+ **************************************************/
+
+/*
+I mNew
+I mListDev
+I mDispose
+ */
+
+namespace Director {
+
+const char *ListDevXObj::xlibName = "ListDev";
+const XlibFileDesc ListDevXObj::fileNames[] = {
+ { "ListDev", nullptr },
+ { nullptr, nullptr },
+};
+
+static MethodProto xlibMethods[] = {
+ { "new", ListDevXObj::m_new, 0, 0, 500 },
+ { "listDev", ListDevXObj::m_listDev, 0, 0, 500 },
+ { "dispose", ListDevXObj::m_dispose, 0, 0, 500 },
+ { nullptr, nullptr, 0, 0, 0 }
+};
+
+static BuiltinProto xlibBuiltins[] = {
+
+ { nullptr, nullptr, 0, 0, 0, VOIDSYM }
+};
+
+ListDevXObject::ListDevXObject(ObjectType ObjectType) :Object<ListDevXObject>("ListDev") {
+ _objType = ObjectType;
+}
+
+void ListDevXObj::open(ObjectType type, const Common::Path &path) {
+ ListDevXObject::initMethods(xlibMethods);
+ ListDevXObject *xobj = new ListDevXObject(type);
+ if (type == kXtraObj)
+ g_lingo->_openXtras.push_back(xlibName);
+ g_lingo->exposeXObject(xlibName, xobj);
+ g_lingo->initBuiltIns(xlibBuiltins);
+}
+
+void ListDevXObj::close(ObjectType type) {
+ ListDevXObject::cleanupMethods();
+ g_lingo->_globalvars[xlibName] = Datum();
+
+}
+
+void ListDevXObj::m_new(int nargs) {
+ g_lingo->printSTUBWithArglist("ListDevXObj::m_new", nargs);
+ g_lingo->dropStack(nargs);
+ g_lingo->push(g_lingo->_state->me);
+}
+
+XOBJSTUB(ListDevXObj::m_listDev, 0)
+XOBJSTUB(ListDevXObj::m_dispose, 0)
+
+}
diff --git a/engines/director/lingo/xlibs/listdev.h b/engines/director/lingo/xlibs/listdev.h
new file mode 100644
index 00000000000..7fc4136b979
--- /dev/null
+++ b/engines/director/lingo/xlibs/listdev.h
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_XLIBS_LISTDEV_H
+#define DIRECTOR_LINGO_XLIBS_LISTDEV_H
+
+namespace Director {
+
+class ListDevXObject : public Object<ListDevXObject> {
+public:
+ ListDevXObject(ObjectType objType);
+};
+
+namespace ListDevXObj {
+
+extern const char *xlibName;
+extern const XlibFileDesc fileNames[];
+
+void open(ObjectType type, const Common::Path &path);
+void close(ObjectType type);
+
+void m_new(int nargs);
+void m_listDev(int nargs);
+void m_dispose(int nargs);
+
+} // End of namespace ListDevXObj
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index 29952fb2a3c..d996a619963 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -103,6 +103,7 @@ MODULE_OBJS = \
lingo/xlibs/genutils.o \
lingo/xlibs/getscreenrectsxfcn.o \
lingo/xlibs/getscreensizexfcn.o \
+ lingo/xlibs/getsoundinlevel.o \
lingo/xlibs/gpid.o \
lingo/xlibs/henry.o \
lingo/xlibs/hitmap.o \
@@ -113,6 +114,7 @@ MODULE_OBJS = \
lingo/xlibs/jitdraw3.o \
lingo/xlibs/jwxini.o \
lingo/xlibs/labeldrvxobj.o \
+ lingo/xlibs/listdev.o \
lingo/xlibs/maniacbg.o \
lingo/xlibs/mapnavigatorxobj.o \
lingo/xlibs/memcheckxobj.o \
Commit: 9c5443ca9d7599fbb03ab2e50278217d7d11e648
https://github.com/scummvm/scummvm/commit/9c5443ca9d7599fbb03ab2e50278217d7d11e648
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: LINGO: Allow setting properties on nonexistent cast members
Similar to how you can get properties from nonexistent cast members,
Director will allow you to set them. This list was done by manually
checking in Director 4 which was a no-op instead of an exception.
Fixes Psych.
Changed paths:
engines/director/lingo/lingo-the.cpp
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 965ce693793..259bd8d58a9 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -2327,7 +2327,7 @@ void Lingo::getObjectProp(Datum &obj, Common::String &propName) {
break;
case kTheRect:
d = Datum(Common::Rect(0, 0, 0, 0));
- break;
+break;
case kTheRegPoint:
d = Datum(Common::Point(0, 0));
break;
@@ -2441,6 +2441,31 @@ void Lingo::setObjectProp(Datum &obj, Common::String &propName, Datum &val) {
CastMemberID id = *obj.u.cast;
CastMember *member = movie->getCastMember(id);
if (!member) {
+ Common::String key = Common::String::format("%d%s", kTheCast, propName.c_str());
+ bool emptyAllowed = false;
+ if (_theEntityFields.contains(key)) {
+ switch (_theEntityFields[key]->field) {
+ case kTheFileName:
+ case kTheScriptText:
+ case kTheLoaded:
+ case kThePurgePriority:
+ case kTheCenter:
+ case kTheFrameRate:
+ case kThePausedAtStart:
+ case kThePreLoad:
+ case kThePalette:
+ case kTheCrop:
+ case kTheRegPoint:
+ emptyAllowed = true;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (emptyAllowed) {
+ return;
+ }
g_lingo->lingoError("Lingo::setObjectProp(): %s not found", id.asString().c_str());
return;
}
Commit: 7ac5047bc790e7e795f41747092785b4c479f63e
https://github.com/scummvm/scummvm/commit/7ac5047bc790e7e795f41747092785b4c479f63e
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Move _mainArchive handle to DirectorEngine
_mainHandle is a pointer to the projector archive, and is set once at
the start of execution. DirectorEngine is a better place for it rather
than the first Window, as other Windows might try and access it.
Fixes crash when changing the cursor in Microphone Fiend.
Changed paths:
engines/director/director.cpp
engines/director/director.h
engines/director/resource.cpp
engines/director/tests.cpp
engines/director/window.cpp
engines/director/window.h
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 3579f1932f5..3341320ec06 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -83,6 +83,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
memset(_currentPalette, 0, 768);
_currentPaletteLength = 0;
_stage = nullptr;
+ _mainArchive = nullptr;
_currentWindow = nullptr;
_cursorWindow = nullptr;
_lingo = nullptr;
@@ -170,7 +171,6 @@ DirectorEngine::~DirectorEngine() {
clearPalettes();
}
-Archive *DirectorEngine::getMainArchive() const { return _currentWindow->getMainArchive(); }
Movie *DirectorEngine::getCurrentMovie() const { return _currentWindow->getCurrentMovie(); }
Common::String DirectorEngine::getCurrentPath() const { return _currentWindow->getCurrentPath(); }
Common::String DirectorEngine::getCurrentAbsolutePath() {
diff --git a/engines/director/director.h b/engines/director/director.h
index 4f7e47e3066..f316764924a 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -170,7 +170,6 @@ public:
StartMovie getStartMovie() const;
void parseOptions();
Graphics::MacWindowManager *getMacWindowManager() const { return _wm; }
- Archive *getMainArchive() const;
Lingo *getLingo() const { return _lingo; }
Window *getStage() const { return _stage; }
Window *getCurrentWindow() const { return _currentWindow; }
@@ -181,6 +180,8 @@ public:
void setCursorWindow(Window *window) { _cursorWindow = window; }
Movie *getCurrentMovie() const;
void setCurrentMovie(Movie *movie);
+ Archive *getMainArchive() const { return _mainArchive; }
+ void setMainArchive(Archive *archive) { _mainArchive = archive; }
Common::String getCurrentPath() const;
Common::String getCurrentAbsolutePath();
Common::Path getStartupPath() const;
@@ -264,6 +265,7 @@ public:
bool _centerStage;
char _dirSeparator;
bool _fixStageSize;
+ Archive *_mainArchive;
Common::Rect _fixStageRect;
Common::List<Common::String> _extraSearchPath;
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 6376c474ce3..ebde9922819 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -66,13 +66,14 @@ Common::Error Window::loadInitialMovie() {
loadXtrasFromPath();
}
Common::Path path = findPath(movie);
- _mainArchive = g_director->openArchive(path);
+ Archive *mainArchive = g_director->openArchive(path);
- if (!_mainArchive) {
+ if (!mainArchive) {
warning("Window::loadInitialMovie: Cannot open main movie");
return Common::kNoGameDataFoundError;
}
- probeResources(_mainArchive);
+ g_director->setMainArchive(mainArchive);
+ probeResources(mainArchive);
// Load multiple-resources based executable file (Projector)
Common::String rawEXE = _vm->getRawEXEName();
@@ -104,8 +105,8 @@ Common::Error Window::loadInitialMovie() {
stream->read(script, size);
- LingoArchive *mainArchive = g_director->getCurrentMovie()->getMainLingoArch();
- mainArchive->addCode(Common::U32String(script, Common::kMacRoman), kMovieScript, 65535);
+ LingoArchive *mainLingoArchive = g_director->getCurrentMovie()->getMainLingoArch();
+ mainLingoArchive->addCode(Common::U32String(script, Common::kMacRoman), kMovieScript, 65535);
_currentMovie->processEvent(kEventStartUp);
free(script);
@@ -115,7 +116,7 @@ Common::Error Window::loadInitialMovie() {
}
}
- _currentMovie->setArchive(_mainArchive);
+ _currentMovie->setArchive(mainArchive);
_currentMovie->getScore()->_skipTransition = true;
// XLibs are usually loaded in the initial movie.
// These may not be present if a --start-movie is specified, so
diff --git a/engines/director/tests.cpp b/engines/director/tests.cpp
index d9405c0ee50..d8f675ccbc3 100644
--- a/engines/director/tests.cpp
+++ b/engines/director/tests.cpp
@@ -324,13 +324,14 @@ void Window::runTests() {
initGraphics(640, 480);
- _mainArchive = new RIFXArchive();
- g_director->_allSeenResFiles.setVal("test.dir", _mainArchive);
- if (!_mainArchive->openStream(stream, 0)) {
+ Archive *mainArchive = new RIFXArchive();
+ g_director->setMainArchive(mainArchive);
+ g_director->_allSeenResFiles.setVal("test.dir", mainArchive);
+ if (!mainArchive->openStream(stream, 0)) {
error("DirectorEngine::runTests(): Bad movie data");
}
_currentMovie = new Movie(this);
- _currentMovie->setArchive(_mainArchive);
+ _currentMovie->setArchive(mainArchive);
_currentMovie->loadArchive();
if (debugChannelSet(-1, kDebugText)) {
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index d9d17aff167..db933a416b7 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -52,7 +52,6 @@ Window::Window(int id, bool scrollable, bool resizable, bool editable, Graphics:
_lingoPlayState = nullptr;
_currentMovie = nullptr;
- _mainArchive = nullptr;
_nextMovie.frameI = -1;
_newMovieStarted = true;
diff --git a/engines/director/window.h b/engines/director/window.h
index 32d9509d0f1..7a3ccad6fc3 100644
--- a/engines/director/window.h
+++ b/engines/director/window.h
@@ -129,7 +129,6 @@ public:
Common::Point getMousePos();
DirectorEngine *getVM() const { return _vm; }
- Archive *getMainArchive() const { return _mainArchive; }
Movie *getCurrentMovie() const { return _currentMovie; }
Common::String getCurrentPath() const { return _currentPath; }
DirectorSound *getSoundManager() const { return _soundManager; }
@@ -216,7 +215,6 @@ private:
Common::Array<LingoState *> _frozenLingoStates;
LingoState *_lingoPlayState;
bool _isStage;
- Archive *_mainArchive;
Movie *_currentMovie;
Common::String _currentPath;
Common::StringArray _movieQueue;
Commit: fdfdd3ae418f53f7f02b99c47524216eeb09dd0d
https://github.com/scummvm/scummvm/commit/fdfdd3ae418f53f7f02b99c47524216eeb09dd0d
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Force clip dirty rectangles against screen area
Fixes crash in Microphone Fiend.
Changed paths:
engines/director/window.cpp
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index db933a416b7..3877db41bb8 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -164,7 +164,9 @@ bool Window::render(bool forceRedraw, Graphics::ManagedSurface *blitTo) {
debugC(7, kDebugImages, "Window::render(): Updating %d rects", _dirtyRects.size());
for (auto &i : _dirtyRects) {
- const Common::Rect &r = i;
+ Common::Rect r = i;
+ r.clip(getInnerDimensions());
+
_dirtyChannels = _currentMovie->getScore()->getSpriteIntersections(r);
bool shouldClear = true;
Commit: 427c31acd82f211da255236d73dcb6ebf60d2141
https://github.com/scummvm/scummvm/commit/427c31acd82f211da255236d73dcb6ebf60d2141
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: LINGO: Limit functions which can be discovered
Handlers inside scoped script types (e.g. CastScript) should not be
discoverable via getHandler.
Fixes menu screen in Derrat Sorcerum.
Changed paths:
engines/director/lingo/lingo-bytecode.cpp
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index c9856b58142..d87b479ee94 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -1678,9 +1678,11 @@ ScriptContext *LingoCompiler::compileLingoV4(Common::SeekableReadStreamEndian &s
if (!_assemblyContext->isFactory()) {
// Register this context's functions with the containing archive.
- for (auto &it : _assemblyContext->_functionHandlers) {
- if (!_assemblyArchive->functionHandlers.contains(it._key)) {
- _assemblyArchive->functionHandlers[it._key] = it._value;
+ if (scriptType == kScoreScript || scriptType == kMovieScript) {
+ for (auto &it : _assemblyContext->_functionHandlers) {
+ if (!_assemblyArchive->functionHandlers.contains(it._key)) {
+ _assemblyArchive->functionHandlers[it._key] = it._value;
+ }
}
}
}
Commit: 1d3c6271b27bd6798dd75b2c51b877895b11d5e1
https://github.com/scummvm/scummvm/commit/1d3c6271b27bd6798dd75b2c51b877895b11d5e1
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
GRAPHICS: Move Mac gamma curve to header
Changed paths:
A graphics/macgamma.h
engines/scumm/macgui/macgui_impl.cpp
engines/scumm/macgui/macgui_v6.cpp
engines/scumm/palette.cpp
engines/scumm/scumm.h
engines/scumm/smush/smush_player.cpp
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index daa8be4af68..85b814bb753 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -26,6 +26,7 @@
#include "common/str.h"
#include "graphics/cursorman.h"
+#include "graphics/macgamma.h"
#include "graphics/paletteman.h"
#include "graphics/fonts/macfont.h"
#include "graphics/macgui/macwindowmanager.h"
@@ -871,9 +872,9 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createDialog(int dialogId, Common::Rect
byte r, g, b;
palette.get(i, r, g, b);
- r = _vm->_macGammaCorrectionLookUp[r];
- g = _vm->_macGammaCorrectionLookUp[g];
- b = _vm->_macGammaCorrectionLookUp[b];
+ r = Graphics::macGammaCorrectionLookUp[r];
+ g = Graphics::macGammaCorrectionLookUp[g];
+ b = Graphics::macGammaCorrectionLookUp[b];
palette.set(i, r, g, b);
}
}
diff --git a/engines/scumm/macgui/macgui_v6.cpp b/engines/scumm/macgui/macgui_v6.cpp
index 2aaa962f9dd..76189fc389b 100644
--- a/engines/scumm/macgui/macgui_v6.cpp
+++ b/engines/scumm/macgui/macgui_v6.cpp
@@ -30,6 +30,7 @@
#include "engines/savestate.h"
#include "graphics/color_quantizer.h"
+#include "graphics/macgamma.h"
#include "graphics/palette.h"
#include "graphics/paletteman.h"
#include "graphics/macgui/macwindowmanager.h"
@@ -365,9 +366,9 @@ void MacV6Gui::saveScreen() {
byte r, g, b;
palette.get(i, r, g, b);
- r = _vm->_macGammaCorrectionLookUp[r];
- g = _vm->_macGammaCorrectionLookUp[g];
- b = _vm->_macGammaCorrectionLookUp[b];
+ r = Graphics::macGammaCorrectionLookUp[r];
+ g = Graphics::macGammaCorrectionLookUp[g];
+ b = Graphics::macGammaCorrectionLookUp[b];
palette.set(i, r, g, b);
}
}
@@ -564,9 +565,9 @@ void MacV6Gui::runAboutDialog() {
black = i;
if (_vm->_useGammaCorrection) {
- r = _vm->_macGammaCorrectionLookUp[r];
- g = _vm->_macGammaCorrectionLookUp[g];
- b = _vm->_macGammaCorrectionLookUp[b];
+ r = Graphics::macGammaCorrectionLookUp[r];
+ g = Graphics::macGammaCorrectionLookUp[g];
+ b = Graphics::macGammaCorrectionLookUp[b];
}
palette.set(i, r, g, b);
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 72efec68555..62cb4e8d296 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -25,6 +25,7 @@
#include "common/util.h"
#include "graphics/macega.h"
+#include "graphics/macgamma.h"
#include "graphics/paletteman.h"
#include "scumm/resource.h"
@@ -1728,7 +1729,7 @@ void ScummEngine::updatePalette() {
if (_game.platform == Common::kPlatformMacintosh && _game.heversion == 0 && _useGammaCorrection) {
for (int i = 0; i < 3 * num; ++i)
- paletteColors[i] = _macGammaCorrectionLookUp[paletteColors[i]];
+ paletteColors[i] = Graphics::macGammaCorrectionLookUp[paletteColors[i]];
} else if (_game.platform == Common::kPlatformSegaCD && _game.id == GID_MONKEY && _enableSegaShadowMode) {
// Apparently the Sega had only 15 levels of intensity for each
// color component. You might think there would be 16, but the
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 07d01ff9162..9723da6f36c 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -652,26 +652,6 @@ protected:
virtual void setCursorHotspot(int x, int y) {}
virtual void setCursorFromBuffer(const byte *ptr, int width, int height, int pitch, bool preventScale = false) {}
- // Gamma curve lookup, from the Macintosh Quadra/Performa monitor driver
- byte _macGammaCorrectionLookUp[256] = {
- 0x00, 0x05, 0x09, 0x0B, 0x0E, 0x10, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20, 0x22, 0x24,
- 0x25, 0x27, 0x28, 0x2A, 0x2C, 0x2D, 0x2F, 0x30, 0x31, 0x33, 0x34, 0x36, 0x37, 0x38, 0x3A, 0x3B,
- 0x3C, 0x3E, 0x3F, 0x40, 0x42, 0x43, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4D, 0x4E, 0x4F,
- 0x50, 0x51, 0x52, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5E, 0x5F, 0x60, 0x61,
- 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
- 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x80, 0x81,
- 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8C, 0x8D, 0x8E, 0x8F,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9C, 0x9D,
- 0x9E, 0x9F, 0xA0, 0xA1, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB,
- 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8,
- 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC0, 0xC1, 0xC2, 0xC3, 0xC3, 0xC4,
- 0xC5, 0xC6, 0xC7, 0xC7, 0xC8, 0xC9, 0xCA, 0xCA, 0xCB, 0xCC, 0xCD, 0xCD, 0xCE, 0xCF, 0xD0, 0xD0,
- 0xD1, 0xD2, 0xD3, 0xD3, 0xD4, 0xD5, 0xD6, 0xD6, 0xD7, 0xD8, 0xD9, 0xD9, 0xDA, 0xDB, 0xDC, 0xDC,
- 0xDD, 0xDE, 0xDF, 0xDF, 0xE0, 0xE1, 0xE1, 0xE2, 0xE3, 0xE4, 0xE4, 0xE5, 0xE6, 0xE7, 0xE7, 0xE8,
- 0xE9, 0xE9, 0xEA, 0xEB, 0xEC, 0xEC, 0xED, 0xEE, 0xEE, 0xEF, 0xF0, 0xF1, 0xF1, 0xF2, 0xF3, 0xF3,
- 0xF4, 0xF5, 0xF5, 0xF6, 0xF7, 0xF8, 0xF8, 0xF9, 0xFA, 0xFA, 0xFB, 0xFC, 0xFC, 0xFD, 0xFE, 0xFF
- };
-
public:
void pauseGame();
void restart();
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 45108c09133..aa6185f011b 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -28,6 +28,7 @@
#include "audio/mixer.h"
#include "graphics/cursorman.h"
+#include "graphics/macgamma.h"
#include "graphics/paletteman.h"
#include "scumm/file.h"
@@ -717,7 +718,7 @@ void SmushPlayer::handleDeltaPalette(int32 subSize, Common::SeekableReadStream &
b.readUint16LE();
for (int i = 0; i < 768; ++i) {
_shiftedDeltaPal[i] += _deltaPal[i];
-
+
_pal[i] = CLIP<int32>(_shiftedDeltaPal[i] >> 7, 0, 255);
}
@@ -1291,7 +1292,7 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st
if (_vm->_useGammaCorrection) {
for (int i = 0; i < ARRAYSIZE(palette); i++) {
- palette[i] = _vm->_macGammaCorrectionLookUp[_pal[i]];
+ palette[i] = Graphics::macGammaCorrectionLookUp[_pal[i]];
}
}
diff --git a/graphics/macgamma.h b/graphics/macgamma.h
new file mode 100644
index 00000000000..a9bccd4af08
--- /dev/null
+++ b/graphics/macgamma.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef GRAPHICS_MACGAMMA_H
+#define GRAPHICS_MACGAMMA_H
+
+namespace Graphics {
+
+// Gamma curve lookup, from the Macintosh Quadra/Performa monitor driver
+const byte macGammaCorrectionLookUp[256] = {
+ 0x00, 0x05, 0x09, 0x0B, 0x0E, 0x10, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20, 0x22, 0x24,
+ 0x25, 0x27, 0x28, 0x2A, 0x2C, 0x2D, 0x2F, 0x30, 0x31, 0x33, 0x34, 0x36, 0x37, 0x38, 0x3A, 0x3B,
+ 0x3C, 0x3E, 0x3F, 0x40, 0x42, 0x43, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4D, 0x4E, 0x4F,
+ 0x50, 0x51, 0x52, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5E, 0x5F, 0x60, 0x61,
+ 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
+ 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x80, 0x81,
+ 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8C, 0x8D, 0x8E, 0x8F,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9C, 0x9D,
+ 0x9E, 0x9F, 0xA0, 0xA1, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB,
+ 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8,
+ 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC0, 0xC1, 0xC2, 0xC3, 0xC3, 0xC4,
+ 0xC5, 0xC6, 0xC7, 0xC7, 0xC8, 0xC9, 0xCA, 0xCA, 0xCB, 0xCC, 0xCD, 0xCD, 0xCE, 0xCF, 0xD0, 0xD0,
+ 0xD1, 0xD2, 0xD3, 0xD3, 0xD4, 0xD5, 0xD6, 0xD6, 0xD7, 0xD8, 0xD9, 0xD9, 0xDA, 0xDB, 0xDC, 0xDC,
+ 0xDD, 0xDE, 0xDF, 0xDF, 0xE0, 0xE1, 0xE1, 0xE2, 0xE3, 0xE4, 0xE4, 0xE5, 0xE6, 0xE7, 0xE7, 0xE8,
+ 0xE9, 0xE9, 0xEA, 0xEB, 0xEC, 0xEC, 0xED, 0xEE, 0xEE, 0xEF, 0xF0, 0xF1, 0xF1, 0xF2, 0xF3, 0xF3,
+ 0xF4, 0xF5, 0xF5, 0xF6, 0xF7, 0xF8, 0xF8, 0xF9, 0xFA, 0xFA, 0xFB, 0xFC, 0xFC, 0xFD, 0xFE, 0xFF
+};
+
+} // end of namespace Graphics
+
+#endif // GRAPHICS_MACGAMMA_H
Commit: dd553c44431843443230bff649e809ccddefa833
https://github.com/scummvm/scummvm/commit/dd553c44431843443230bff649e809ccddefa833
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Add several games to detection table
Thanks to Tim Reimer for the tipoff.
Changed paths:
engines/director/detection_tables.h
engines/director/lingo/xlibs/fileio.cpp
engines/director/lingo/xtras/keypoll.cpp
engines/director/lingo/xtras/rtk.cpp
diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index ff2ea53e2a8..423f766f4d4 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -93,6 +93,7 @@ static const PlainGameDescriptor directorGames[] = {
{ "blinkyprint", "Print & Play with Blinky Bill" },
{ "blinkyps", "Blinky Bill: Play and Learn - Preschool" },
{ "blinkyy1", "Blinky Bill: Play and Learn - Year 1" },
+ { "blockhead", "Blockhead" },
{ "bobcastle", "Bob the Builder: Bob's Castle Adventure" },
{ "bodypark", "Body Park" },
{ "brer", "Brer Rabbit and the Wonderful Tar Baby" },
@@ -345,6 +346,7 @@ static const PlainGameDescriptor directorGames[] = {
{ "moominhide", "Hide and Seek with Moomin"},
{ "moominparty", "The Great Moomin Party" },
{ "morebugs", "More Bugs in Boxes" },
+ { "mortalus", "Mortalus: The Quest for Immortality" },
{ "mrsquack", "Reading with Peter Cottontail: The Story of Mrs. Quack" },
{ "mummy", "Mummy: Tomb of the Pharaoh" },
{ "muppetkidsearly5", "Muppets Kids Early Learning Series Volume 5: Sound Patterns: Phonics" },
@@ -475,6 +477,7 @@ static const PlainGameDescriptor directorGames[] = {
{ "takeru", "Buichi Terasawa's Takeru: Letter of the Law" },
{ "teamxtreme1", "Operation: Weather Disaster" },
{ "teamxtreme2", "Operation: Eco-Nightmare" },
+ { "teazle", "Teazle" },
{ "the7colors", "The Seven Colors: Legend of PSYã»S City" }, // English fan translation
{ "timmysafari", "Timmy's Safari Adventure" },
{ "tkkg1", "A Case for TKKG 1: Jennifer is Missing" },
@@ -3995,7 +3998,7 @@ static const DirectorGameDescription gameDescriptions[] = {
MACDEMO1("defendinghuman", "Demo", "Donald A Norman", "77f4098988d5386794d1530065f514cd", 301669, 400),
// Mac executable is Derrat Sorcerum⢠v1.0.3
- MACGAME1("derratsorcerum", "", "xn--Derrat Sorcerum v1.0.3-h40n", "a546ef2b921a9b48fd93928f1a505f22", 483506, 404),
+ MACGAME1("derratsorcerum", "", "xn--Derrat Sorcerum v1.0.3 -tnf/xn--Derrat Sorcerum v1.0.3-h40n", "tr:107ae11bce211dc0abd62d9f43184b27", 483506, 404),
MACDEMO1("derratsorcerum", "Demo", "Derrat Sorcerum Demo v1.0.3", "a546ef2b921a9b48fd93928f1a505f22", 483506, 404),
// Both Mac and Win versions require installation to extract executable
@@ -6461,6 +6464,10 @@ static const DirectorGameDescription gameDescriptions[] = {
MACGAME1("blinkyballoon", "", "Balloon", "r:0c0109b03fd29253e5d74c314911fa7f", 719005, 501),
WINGAME1("blinkyballoon", "", "BALLN95.EXE", "t:7a6e8152e71b82816b8742cc8e1cb453", 1427375, 501),
+ // Designed by Arc Media Works
+ MACGAME1("blockhead", "", "BLOCK/Interactive Puzzle Blockhead", "tr:e835f5af0cc44a8bdedd79124a0b89b0", 719005, 500),
+ WINGAME1("blockhead", "", "BLOCK/BLOCK32.EXE", "t:75150c6b4b8951d36c4503ca53830370", 1411181, 501),
+
WINGAME1t_l("bluesango", "", "BLUESANG.EXE", "08e531b980ebfb343201400add17b68e", 2143080, Common::JA_JPN, 501),
// Designed by In Chair Viewing (ICV)
@@ -7023,8 +7030,8 @@ static const DirectorGameDescription gameDescriptions[] = {
MACGAME1_l("mecadrill", "", "xn--2bk5af5f2e0ctd/xn--2bk9a5e9d0bg", "16f51fc148898582fcdb6f58456ceb52", 719636, Common::JA_JPN, 501),
WINGAME1t_l("mecadrill", "", "MECA/MECA95.EXE", "ff76ffa3616a1acb82f6b12bc94bec64", 1390011, Common::JA_JPN, 505),
- MACGAME1_l("microphonefiend", "8", "Microphone Fiend8", "bfd348abd981acae64c13d5e5e4d9540", 719785, Common::JA_JPN, 501),
- MACGAME1_l("microphonefiend", "16", "Microphone Fiend16", "d8f16d8e1dbd01ebf1f74f028b16a126", 117830, Common::JA_JPN, 501),
+ MACGAME1f_l("microphonefiend", "8", "MF8/Microphone Fiend8", "tr:b2229850cb4e8ccb977c2f7c25650d6c", 719785, Common::JA_JPN, 501, GF_DESKTOP|GF_640x480),
+ MACGAME1f_l("microphonefiend", "16", "MF16/Microphone Fiend16", "tr:f2cb0ca9bce3a7fad18ba9f7c8c9f400", 117830, Common::JA_JPN, 501, GF_DESKTOP|GF_640x480),
// On hybrid CD with Joystick (France) covermount
// Original filename is CD Mieux-Mieux N°16
@@ -7093,6 +7100,9 @@ static const DirectorGameDescription gameDescriptions[] = {
WINGAME2_l("moordspel", "32-bit", "32/MOORD32.EXE", "t:a49f750a7fdf751840f6766e9faab17c", 2625425,
"TRAVEL/BAL_GX_F.MOV", "d:93ed396925332df6e302a67af8bc5e13", 139037, Common::NL_NLD, 500),
+ WINGAME1("mortalus", "", "Mortalus.exe", "t:187624cbacaa5bc77af89aefe9fe7345", 1397537, 500),
+ MACGAME1("mortalus", "", "Mortalus", "tr:55f5fbaa02a937ce6346017941e1d439", 705445, 500),
+
WINGAME1("msn", "Preview", "MSNPREV8.EXE", "1a7acbba10a7246ba58c1d53fc7203f5", 5215403, 501),
WINGAME2("muppetkidsearly5", "", "bright32.exe", "1a7acbba10a7246ba58c1d53fc7203f5", 2159587,
@@ -7641,6 +7651,9 @@ static const DirectorGameDescription gameDescriptions[] = {
MACGAME1_l("teddybear", "", "Teddy Bear/Teddy Bear", "r:f117b8395c4859d11b9c02c741e22cea", 704537, Common::FR_FRA, 500),
WINGAME1_l("teddybear", "", "INSTALL/BEAR95.EXE", "t:8a5534267338a82b6fc959037af3df95", 1394051, Common::FR_FRA, 500),
+ WINGAME1("teazle", "", "TEAZLE.EXE", "t:b6d3a1d0f44fa23f544569cf97d98126", 1420271, 500),
+ MACGAME1("teazle", "", "TZPL01", "tr:50b6f06b9dfad624252d34f5ee8cd877", 112402, 500),
+
MACGAME1("tenchijukebox", "8-bit", "Tenchi Muyo Jukebox 8 bit", "r:0c7bbb4b24823e5ab871cb4c1d6f3710", 482610, 404),
MACGAME1("tenchijukebox", "16-bit", "Tenchi Muyo Jukebox 16 bit", "r:0c7bbb4b24823e5ab871cb4c1d6f3710", 482610, 404),
WINGAME1("tenchijukebox", "8-bit", "TEN8.EXE", "t:e5dc70d28dc9e67f60670a20f2f5319e", 4356061, 404),
diff --git a/engines/director/lingo/xlibs/fileio.cpp b/engines/director/lingo/xlibs/fileio.cpp
index c5d95e8d43c..de66d59efc1 100644
--- a/engines/director/lingo/xlibs/fileio.cpp
+++ b/engines/director/lingo/xlibs/fileio.cpp
@@ -143,6 +143,7 @@ const XlibFileDesc FileIO::fileNames[] = {
{ "shFILEIO", nullptr }, // TD loads this up using openXLib("@:shFILEIO.DLL")
{ "FILE", nullptr },
{ "FILEIO16", nullptr },
+ { "FileIOXtraFat", nullptr },
{ nullptr, nullptr },
};
diff --git a/engines/director/lingo/xtras/keypoll.cpp b/engines/director/lingo/xtras/keypoll.cpp
index ba23c9cbb52..b9c21a9ecc8 100644
--- a/engines/director/lingo/xtras/keypoll.cpp
+++ b/engines/director/lingo/xtras/keypoll.cpp
@@ -31,6 +31,7 @@
*
* USED IN:
* Safecracker
+ * Teazle
*
**************************************************/
@@ -53,6 +54,7 @@ namespace Director {
const char *const KeypollXtra::xlibName = "Keypoll";
const XlibFileDesc KeypollXtra::fileNames[] = {
{ "keypoll", nullptr },
+ { "KeyPollFat", nullptr },
{ nullptr, nullptr },
};
diff --git a/engines/director/lingo/xtras/rtk.cpp b/engines/director/lingo/xtras/rtk.cpp
index 2dc6aadf71c..f200c05c151 100644
--- a/engines/director/lingo/xtras/rtk.cpp
+++ b/engines/director/lingo/xtras/rtk.cpp
@@ -72,6 +72,7 @@ namespace Director {
const char *RolloverToolkitXtra::xlibName = "RolloverToolkit";
const XlibFileDesc RolloverToolkitXtra::fileNames[] = {
+ { "RTK", nullptr },
{ "rollover_toolkit", nullptr },
{ nullptr, nullptr },
};
Commit: 9d4a64b9772c06c3c499196628728af6502cae2b
https://github.com/scummvm/scummvm/commit/9d4a64b9772c06c3c499196628728af6502cae2b
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Improve accuracy of enterFrame
Fixes director-tests/D4-unit/T_EVNT19.DIR
Changed paths:
engines/director/score.cpp
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index c7f562f403b..b41814f1b77 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -563,7 +563,7 @@ void Score::update() {
// Don't process frozen script if we use jump instructions
// like "go to frame", or open a new movie.
- if (!_nextFrame || _nextFrame == _curFrameNumber) {
+ if (!_nextFrame) {
processFrozenScripts();
}
return;
@@ -639,7 +639,7 @@ void Score::update() {
if (_vm->getVersion() >= 400 && _window->frozenLingoRecursionCount() >= 2) {
debugC(1, kDebugEvents, "Score::update(): hitting D4 recursion depth limit, defrosting");
processFrozenScripts(true);
- // keep plowing on
+ return;
} else if (_window->frozenLingoStateCount() >= 64) {
warning("Score::update(): Stopping runaway script recursion. By this point D3 will have run out of stack space");
processFrozenScripts();
@@ -667,6 +667,11 @@ void Score::update() {
if (_window->frozenLingoStateCount() > count)
return;
+ // If we've hit the recursion limit, don't enterFrame
+ if (_vm->getVersion() >= 400 && _window->frozenLingoRecursionCount() >= 2) {
+ debugC(1, kDebugEvents, "Score::update: exiting early due to recursion depth limit");
+ return;
+ }
// then call the enterFrame hook (if one exists)
count = _window->frozenLingoStateCount();
Commit: d1222ab176113804e8aa92e24d76868350b1200d
https://github.com/scummvm/scummvm/commit/d1222ab176113804e8aa92e24d76868350b1200d
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Fix bounding box when loading pictures into cast members
Replacing a cast member with a Picture will reset the _initialRect to
a generic one positioned at (0, 0).
Before we do that, untransform the registration offset
so that it remains relative to the image coordinates.
Fixes graphics in Dungeon Street.
Changed paths:
engines/director/castmember/bitmap.cpp
diff --git a/engines/director/castmember/bitmap.cpp b/engines/director/castmember/bitmap.cpp
index 904c29e8ca4..a222e6437c7 100644
--- a/engines/director/castmember/bitmap.cpp
+++ b/engines/director/castmember/bitmap.cpp
@@ -64,6 +64,15 @@ BitmapCastMember::BitmapCastMember(Cast *cast, uint16 castId, Common::SeekableRe
_flags1 = flags1; // region: 0 - auto, 1 - matte, 2 - disabled
_bytes = stream.readUint16();
+ // A little context about how bitmap bounding boxes are stored.
+ // In the Director editor, images can be edited on a big scrolling canvas with
+ // the image in the middle. _initialRect describes the location on that virtual
+ // canvas, with the top-left being the start position of the image.
+ // _regX and _regY is the registration offset, in canvas space.
+ // This means if a bitmap cast member is placed at (64, 64) on the score, the
+ // registration offset of the image is placed at (64, 64).
+ // By default the registration offset is the dead centre of the image.
+ // _boundingRect I think is used internally by the editor and not elsewhere.
_initialRect = Movie::readRect(stream);
_boundingRect = Movie::readRect(stream);
_regY = stream.readSint16();
@@ -925,6 +934,9 @@ bool BitmapCastMember::setField(int field, const Datum &d) {
// This is a random PICT from somewhere,
// set the external flag so we remap the palette.
_external = true;
+ // Remove the canvas-space transformation
+ _regX -= _initialRect.left;
+ _regY -= _initialRect.top;
_initialRect = Common::Rect(_picture->_surface.w, _picture->_surface.h);
return true;
} else {
Commit: d433c7115409f5efe26d2607a79547b2194cd986
https://github.com/scummvm/scummvm/commit/d433c7115409f5efe26d2607a79547b2194cd986
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Use maxHeight to determine TextCastMember bounding box
Fixes inventory list dimensions in Derrat Sorcerum.
Changed paths:
engines/director/castmember/text.cpp
engines/director/castmember/text.h
diff --git a/engines/director/castmember/text.cpp b/engines/director/castmember/text.cpp
index 8ed44a61ba9..a80caff18dd 100644
--- a/engines/director/castmember/text.cpp
+++ b/engines/director/castmember/text.cpp
@@ -299,7 +299,7 @@ bool textWindowCallback(Graphics::WindowClick click, Common::Event &event, void
return g_director->getCurrentMovie()->processEvent(event);
}
-Graphics::MacWidget *TextCastMember::createWindowOrWidget(Common::Rect &bbox, Channel *channel, Common::Rect dims, Graphics::MacFont *macFont) {
+Graphics::MacWidget *TextCastMember::createWindowOrWidget(Common::Rect &bbox, Common::Rect dims, Graphics::MacFont *macFont) {
Graphics::MacWidget *widget = nullptr;
if (_textType == kTextTypeScrolling) {
@@ -323,7 +323,6 @@ Graphics::MacWidget *TextCastMember::createWindowOrWidget(Common::Rect &bbox, Ch
} else {
widget = new Graphics::MacText(g_director->getCurrentWindow(), bbox.left, bbox.top, dims.width(), dims.height(), g_director->_wm, _ftext, macFont, getForeColor(), getBackColor(), _initialRect.width(), getAlignment(), _lineSpacing, _borderSize, _gutterSize, _boxShadow, _textShadow, _textType == kTextTypeFixed);
((Graphics::MacText *)widget)->setSelRange(g_director->getCurrentMovie()->_selStart, g_director->getCurrentMovie()->_selEnd);
- ((Graphics::MacText *)widget)->setEditable(channel->_sprite->_editable);
((Graphics::MacText *)widget)->draw();
}
@@ -351,12 +350,15 @@ Graphics::MacWidget *TextCastMember::createWidget(Common::Rect &bbox, Channel *c
if (_textType == kTextTypeAdjustToFit) {
dims.right = MIN<int>(dims.right, dims.left + _initialRect.width());
dims.bottom = MIN<int>(dims.bottom, dims.top + _initialRect.height());
- } else if (_textType == kTextTypeFixed) {
+ } else if (_textType == kTextTypeFixed || _textType == kTextTypeScrolling) {
// use initialRect to create widget for fixed style text, this maybe related to version.
dims.right = MAX<int>(dims.right, dims.left + _initialRect.width());
- dims.bottom = MAX<int>(dims.bottom, dims.top + _initialRect.height());
+ dims.bottom = MAX<int>(dims.bottom, dims.top + MAX<int>(_initialRect.height(), _maxHeight));
+ }
+ widget = createWindowOrWidget(bbox, dims, macFont);
+ if (_textType != kTextTypeScrolling) {
+ ((Graphics::MacText *)widget)->setEditable(channel->_sprite->_editable);
}
- widget = createWindowOrWidget(bbox, channel, dims, macFont);
// since we disable the ability of setActive in setEdtiable, then we need to set active widget manually
if (channel->_sprite->_editable) {
diff --git a/engines/director/castmember/text.h b/engines/director/castmember/text.h
index 3e6582df9e5..0ad7e2cb835 100644
--- a/engines/director/castmember/text.h
+++ b/engines/director/castmember/text.h
@@ -112,7 +112,7 @@ public:
void setRawText(const Common::String &text);
private:
- Graphics::MacWidget *createWindowOrWidget(Common::Rect &bbox, Channel *channel, Common::Rect dims, Graphics::MacFont *macFont);
+ Graphics::MacWidget *createWindowOrWidget(Common::Rect &bbox, Common::Rect dims, Graphics::MacFont *macFont);
uint32 _bgcolor;
uint32 _fgcolor;
Commit: 5a6ef0b13398a9ba0a20ebd8901da08ac0c2bcab
https://github.com/scummvm/scummvm/commit/5a6ef0b13398a9ba0a20ebd8901da08ac0c2bcab
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: LINGO: Improve accuracy of b_integer
Fixes restoring save games in Derrat Sorcerum.
Changed paths:
engines/director/lingo/lingo-builtins.cpp
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 66a6680bb35..4af59769d6e 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -450,7 +450,18 @@ void LB::b_integer(int nargs) {
Common::String src = d.asString();
char *endPtr = nullptr;
int result = (int)strtol(src.c_str(), &endPtr, 10);
- if (endPtr && endPtr != src.c_str() && (*endPtr == '\0' || *endPtr == ' ')) {
+ // Stop conditions found by probing D4 for windows:
+ // repeat with i = 0 to 255
+ // put i & " = " & integer("12345" & numToChar(i))
+ // end repeat
+ if (endPtr && endPtr != src.c_str() && (
+ (*endPtr >= 0 && *endPtr < 45) ||
+ (*endPtr == 47) ||
+ (*endPtr >= 58 && *endPtr < 65) ||
+ (*endPtr >= 91 && *endPtr < 95) ||
+ (*endPtr == 96) ||
+ (*endPtr >= 123))
+ ) {
res = result;
}
} else {
Commit: 255821d1c492fe89f34a5b063bf55664aa5c7f4b
https://github.com/scummvm/scummvm/commit/255821d1c492fe89f34a5b063bf55664aa5c7f4b
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: LINGO: Improve accuracy of 'the result'
Fixes the dialogue entry box in Cosmology of Kyoto.
Fixes director-tests/D4-unit/T_LING03.DIR
Changed paths:
engines/director/lingo/lingo-builtins.cpp
engines/director/lingo/lingo-code.cpp
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 4af59769d6e..37659ee01ae 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1986,7 +1986,8 @@ void LB::b_return(int nargs) {
Datum retVal;
if (nargs > 0) {
retVal = g_lingo->pop();
- g_lingo->_theResult = retVal; // Store result for possible reference
+ if (retVal.type != VOID && g_lingo->_state->callstack.size() <= 2)
+ g_lingo->_theResult = retVal; // Store result for possible reference
}
// clear any temp values from loops
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index e5b62fe7c2c..abfeca5119f 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1774,19 +1774,11 @@ void LC::call(const Symbol &funcSym, int nargs, bool allowRetVal) {
if (funcSym.u.bltin != LB::b_return && funcSym.u.bltin != LB::b_value) {
if (stackSize == stackSizeBefore + 1) {
- // Set "the result" to return value!, when a method
- // this is for handling result after execution!
- Datum top = g_lingo->peek(0);
- g_lingo->_theResult = top;
-
if (!allowRetVal) {
Datum extra = g_lingo->pop();
warning("Builtin '%s' dropping return value: %s", funcSym.name->c_str(), extra.asString(true).c_str());
}
} else if (stackSize == stackSizeBefore) {
- // No value, hence "the result" is VOID
- g_lingo->_theResult = g_lingo->getVoid();
-
if (allowRetVal)
error("Builtin '%s' did not return value", funcSym.name->c_str());
} else if (stackSize > stackSizeBefore) {
Commit: b4c955708638217551b0f4355b0f008c9d5f4b0c
https://github.com/scummvm/scummvm/commit/b4c955708638217551b0f4355b0f008c9d5f4b0c
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: LINGO: Slight improvement in Cosmology of Kyoto patch
Changed paths:
engines/director/lingo/lingo-patcher.cpp
diff --git a/engines/director/lingo/lingo-patcher.cpp b/engines/director/lingo/lingo-patcher.cpp
index c5f6a902b90..fefbbbbd533 100644
--- a/engines/director/lingo/lingo-patcher.cpp
+++ b/engines/director/lingo/lingo-patcher.cpp
@@ -281,16 +281,16 @@ on checkkaiwa kaiwatrue, kaiwafalse \r\
end if \r\
put \"Original YES options: \" & kaiwatrue \r\
put \"Original NO options: \" & kaiwafalse \r\
- -- pre-scrub all input and choices to remove effect of whitespace/punctuation \r\
- set kaiwaans = scrubInput(field \"KaiwaWindow\") \r\
- set kaiwatrue = scrubInput(kaiwatrue) \r\
- set kaiwafalse = scrubInput(kaiwafalse) \r\
-- yes and no should always give consistent results \r\
if kaiwaans = \"yes\" then \r\
return \"YES\" \r\
else if kaiwaans = \"no\" then \r\
return \"NO\" \r\
end if \r\
+ -- pre-scrub all input and choices to remove effect of whitespace/punctuation \r\
+ set kaiwaans = scrubInput(field \"KaiwaWindow\") \r\
+ set kaiwatrue = scrubInput(kaiwatrue) \r\
+ set kaiwafalse = scrubInput(kaiwafalse) \r\
repeat with y = 1 to the number of items in kaiwatrue \r\
if item y of kaiwatrue starts kaiwaans then \r\
when keyDown then CheckQuit \r\
Commit: 2f8426016ceaa8691238858abe32483a3c3ed42c
https://github.com/scummvm/scummvm/commit/2f8426016ceaa8691238858abe32483a3c3ed42c
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Add gamma correction for Mac games
Changed paths:
engines/director/detection_tables.h
engines/director/director.cpp
engines/director/director.h
engines/director/graphics.cpp
engines/director/metaengine.cpp
diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index 423f766f4d4..e1a2e146e64 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -1853,67 +1853,67 @@ namespace Director {
#define SUPPORT_STATUS ADGF_UNSTABLE
-#define GENGAME1_(t,e,f,m,s,l,p,fl,v) { { t, e, AD_ENTRY1s(f, m, s), l, p, (fl | SUPPORT_STATUS), GUIO1(GUIO_NOASPECT) }, GID_GENERIC, v }
-#define GENGAME1t_(t,e,f,m,s,l,p,fl,v) { { t, e, AD_ENTRY1s(f, m, s), l, p, (fl | SUPPORT_STATUS | ADGF_TAILMD5), GUIO1(GUIO_NOASPECT) }, GID_GENERIC, v }
-#define GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,p,fl,v) { { t, e, AD_ENTRY2s(f1, m1, s1, f2, m2, s2), l, p, (fl | SUPPORT_STATUS), GUIO1(GUIO_NOASPECT) }, GID_GENERIC, v }
-#define GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,l,p,fl,v) { { t, e, AD_ENTRY2s(f1, m1, s1, f2, m2, s2), l, p, (fl | SUPPORT_STATUS | ADGF_TAILMD5), GUIO1(GUIO_NOASPECT) }, GID_GENERIC, v }
-
-#define MACGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
-#define MACGAME1f(t,e,f,m,s,v,fl) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,(fl|ADGF_MACRESFORK),v)
-#define MACGAME1t(t,e,f,m,s,v) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
-#define MACGAME1tf(t,e,f,m,s,v,fl) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,(fl|ADGF_MACRESFORK),v)
-#define PIPGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformPippin,ADGF_MACRESFORK,v)
-#define PIPGAME1f(t,e,f,m,s,v,fl) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformPippin,(fl|ADGF_MACRESFORK),v)
+#define GENGAME1_(t,e,f,m,s,l,p,fl,v) { { t, e, AD_ENTRY1s(f, m, s), l, p, ((fl) | SUPPORT_STATUS), GUIO1(GUIO_NOASPECT) }, GID_GENERIC, v }
+#define GENGAME1t_(t,e,f,m,s,l,p,fl,v) { { t, e, AD_ENTRY1s(f, m, s), l, p, ((fl) | SUPPORT_STATUS | ADGF_TAILMD5), GUIO1(GUIO_NOASPECT) }, GID_GENERIC, v }
+#define GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,p,fl,v) { { t, e, AD_ENTRY2s(f1, m1, s1, f2, m2, s2), l, p, ((fl) | SUPPORT_STATUS), GUIO1(GUIO_NOASPECT) }, GID_GENERIC, v }
+#define GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,l,p,fl,v) { { t, e, AD_ENTRY2s(f1, m1, s1, f2, m2, s2), l, p, ((fl) | SUPPORT_STATUS | ADGF_TAILMD5), GUIO1(GUIO_NOASPECT) }, GID_GENERIC, v }
+
+#define MACGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK),v)
+#define MACGAME1f(t,e,f,m,s,v,fl) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,((fl)|ADGF_MACRESFORK),v)
+#define MACGAME1t(t,e,f,m,s,v) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK),v)
+#define MACGAME1tf(t,e,f,m,s,v,fl) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,(GF_GAMMA|(fl)|ADGF_MACRESFORK),v)
+#define PIPGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformPippin,(GF_GAMMA|ADGF_MACRESFORK),v)
+#define PIPGAME1f(t,e,f,m,s,v,fl) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformPippin,(GF_GAMMA|(fl)|ADGF_MACRESFORK),v)
#define WINGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
-#define WINGAME1f(t,e,f,m,s,v,fl) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,(fl|ADGF_NO_FLAGS),v)
+#define WINGAME1f(t,e,f,m,s,v,fl) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,((fl)|ADGF_NO_FLAGS),v)
#define WINGAME1t(t,e,f,m,s,v) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
-#define WINGAME1tf(t,e,f,m,s,v,fl) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,(fl|ADGF_NO_FLAGS),v)
+#define WINGAME1tf(t,e,f,m,s,v,fl) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,((fl)|ADGF_NO_FLAGS),v)
#define FMTGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformFMTowns,ADGF_NO_FLAGS,v)
#define SHKGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformShockwave,ADGF_NO_FLAGS,v)
-#define MACDEMO1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,(ADGF_MACRESFORK|ADGF_DEMO),v)
-#define MACDEMO1t(t,e,f,m,s,v) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,(ADGF_MACRESFORK|ADGF_DEMO),v)
+#define MACDEMO1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK|ADGF_DEMO),v)
+#define MACDEMO1t(t,e,f,m,s,v) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK|ADGF_DEMO),v)
#define WINDEMO1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_DEMO,v)
#define WINDEMO1t(t,e,f,m,s,v) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_DEMO,v)
-#define MACGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
-#define MACGAME1f_l(t,e,f,m,s,l,v,fl) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(fl|ADGF_MACRESFORK),v)
-#define PIPGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformPippin,ADGF_MACRESFORK,v)
+#define MACGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK),v)
+#define MACGAME1f_l(t,e,f,m,s,l,v,fl) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(GF_GAMMA|(fl)|ADGF_MACRESFORK),v)
+#define PIPGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformPippin,(GF_GAMMA|ADGF_MACRESFORK),v)
#define WINGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
#define WINGAME1f_l(t,e,f,m,s,l,v,fl) GENGAME1_(t,e,f,m,s,l,Common::kPlatformWindows,fl,v)
#define WINGAME1t_l(t,e,f,m,s,l,v) GENGAME1t_(t,e,f,m,s,l,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
#define WINGAME1tf_l(t,e,f,m,s,l,v,fl) GENGAME1t_(t,e,f,m,s,l,Common::kPlatformWindows,fl,v)
-#define MACGAME1t_l(t,e,f,m,s,l,v) GENGAME1t_(t,e,f,m,s,l,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
+#define MACGAME1t_l(t,e,f,m,s,l,v) GENGAME1t_(t,e,f,m,s,l,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK),v)
#define FMTGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformFMTowns,ADGF_NO_FLAGS,v)
#define SHKGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformShockwave,ADGF_NO_FLAGS,v)
-#define MACDEMO1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(ADGF_MACRESFORK|ADGF_DEMO),v)
-#define MACDEMO1f_l(t,e,f,m,s,l,v,fl) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(fl|ADGF_MACRESFORK|ADGF_DEMO),v)
-#define PIPDEMO1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformPippin,(ADGF_MACRESFORK|ADGF_DEMO),v)
+#define MACDEMO1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK|ADGF_DEMO),v)
+#define MACDEMO1f_l(t,e,f,m,s,l,v,fl) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(GF_GAMMA|(fl)|ADGF_MACRESFORK|ADGF_DEMO),v)
+#define PIPDEMO1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformPippin,(GF_GAMMA|ADGF_MACRESFORK|ADGF_DEMO),v)
#define WINDEMO1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformWindows,ADGF_DEMO,v)
#define WINDEMO1t_l(t,e,f,m,s,l,v) GENGAME1t_(t,e,f,m,s,l,Common::kPlatformWindows,ADGF_DEMO,v)
-#define MACGAME2(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
-#define MACGAME2f(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformMacintosh,(fl|ADGF_MACRESFORK),v)
-#define MACGAME2tf(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformMacintosh,(fl|ADGF_MACRESFORK),v)
-#define PIPGAME2(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformPippin,ADGF_MACRESFORK,v)
+#define MACGAME2(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK),v)
+#define MACGAME2f(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformMacintosh,(GF_GAMMA|(fl)|ADGF_MACRESFORK),v)
+#define MACGAME2tf(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformMacintosh,(GF_GAMMA|(fl)|ADGF_MACRESFORK),v)
+#define PIPGAME2(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformPippin,(GF_GAMMA|ADGF_MACRESFORK),v)
#define WINGAME2(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
-#define WINGAME2f(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,(fl|ADGF_NO_FLAGS),v)
-#define WINGAME2f_l(t,e,f1,m1,s1,f2,m2,s2,l,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformWindows,(fl|ADGF_NO_FLAGS),v)
+#define WINGAME2f(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,((fl)|ADGF_NO_FLAGS),v)
+#define WINGAME2f_l(t,e,f1,m1,s1,f2,m2,s2,l,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformWindows,((fl)|ADGF_NO_FLAGS),v)
#define WINGAME2t(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
-#define WINGAME2tf(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,(fl|ADGF_NO_FLAGS),v)
+#define WINGAME2tf(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,((fl)|ADGF_NO_FLAGS),v)
#define FMTGAME2(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformFMTowns,ADGF_NO_FLAGS,v)
-#define MACDEMO2(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformMacintosh,(ADGF_MACRESFORK|ADGF_DEMO),v)
+#define MACDEMO2(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK|ADGF_DEMO),v)
#define WINDEMO2(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,ADGF_DEMO,v)
#define WINDEMO2t(t,e,f1,m1,s1,f2,m2,s2,v) GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,ADGF_DEMO,v)
-#define WINDEMO2f(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,(fl|ADGF_DEMO),v)
-#define MACGAME2_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
-#define PIPGAME2_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformPippin,ADGF_MACRESFORK,v)
+#define WINDEMO2f(t,e,f1,m1,s1,f2,m2,s2,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,Common::EN_ANY,Common::kPlatformWindows,((fl)|ADGF_DEMO),v)
+#define MACGAME2_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK),v)
+#define PIPGAME2_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformPippin,(GF_GAMMA|ADGF_MACRESFORK),v)
#define WINGAME2_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
-#define MACGAME2f_l(t,e,f1,m1,s1,f2,m2,s2,l,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformMacintosh, (fl|ADGF_MACRESFORK), v)
+#define MACGAME2f_l(t,e,f1,m1,s1,f2,m2,s2,l,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformMacintosh, (GF_GAMMA|(fl)|ADGF_MACRESFORK), v)
#define WINGAME2t_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
#define FMTGAME2_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformFMTowns,ADGF_NO_FLAGS,v)
-#define MACDEMO2_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformMacintosh,(ADGF_MACRESFORK|ADGF_DEMO),v)
+#define MACDEMO2_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformMacintosh,(GF_GAMMA|ADGF_MACRESFORK|ADGF_DEMO),v)
#define WINDEMO2_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformWindows,ADGF_DEMO,v)
#define WINDEMO2t_l(t,e,f1,m1,s1,f2,m2,s2,l,v) GENGAME2t_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformWindows,ADGF_DEMO,v)
-#define WINDEMO2f_l(t,e,f1,m1,s1,f2,m2,s2,l,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformWindows,(fl|ADGF_DEMO),v)
+#define WINDEMO2f_l(t,e,f1,m1,s1,f2,m2,s2,l,v,fl) GENGAME2_(t,e,f1,m1,s1,f2,m2,s2,l,Common::kPlatformWindows,((fl)|ADGF_DEMO),v)
static const DirectorGameDescription gameDescriptions[] = {
// Execute all *.lingo files in game directory
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 3341320ec06..e7b8960f673 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -118,7 +118,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
SearchMan.addSubDirectoryMatching(_gameDataDir, directoryGlob, 0, 5);
}
- if (debugChannelSet(-1, kDebug32bpp) || (getGameFlags() & GF_32BPP)) {
+ if (ConfMan.getBool("true_color") || (getGameFlags() & GF_32BPP) || debugChannelSet(-1, kDebug32bpp)) {
#ifdef USE_RGB_COLOR
_colorDepth = 32;
#else
@@ -128,6 +128,11 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
} else {
_colorDepth = 8; // 256-color
}
+ // Enable Macintosh gamma correction. This resolves the issue of Mac games appearing too dark.
+ // Applied by default for Macintosh and Pippin games in the detection list.
+ // Right now only used in 8-bit mode to adjust the palette.
+ // FIXME: How do we add this to true color rendering without a heap of workarounds?
+ _gammaCorrection = ConfMan.getBool("gamma_correction") || (getGameFlags() & GF_GAMMA);
switch (getPlatform()) {
case Common::kPlatformMacintoshII:
@@ -248,7 +253,7 @@ Common::Error DirectorEngine::run() {
_wmMode |= Graphics::kWMModeFullscreen | Graphics::kWMModeNoDesktop;
#ifdef USE_RGB_COLOR
- if (debugChannelSet(-1, kDebug32bpp) || (getGameFlags() & GF_32BPP))
+ if (ConfMan.getBool("true_color") || (getGameFlags() & GF_32BPP) || debugChannelSet(-1, kDebug32bpp))
_wmMode |= Graphics::kWMMode32bpp;
#endif
diff --git a/engines/director/director.h b/engines/director/director.h
index f316764924a..5f9174276a0 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -23,6 +23,7 @@
#define DIRECTOR_DIRECTOR_H
#include "common/hash-ptr.h"
+#include "common/gui_options.h"
#include "graphics/macgui/macwindowmanager.h"
@@ -30,6 +31,9 @@
#include "director/util.h"
#include "director/detection.h"
+#define GAMEOPTION_GAMMA_CORRECTION GUIO_GAMEOPTIONS1
+#define GAMEOPTION_TRUE_COLOR GUIO_GAMEOPTIONS2
+
namespace Common {
class MacResManager;
class SeekableReadStream;
@@ -95,6 +99,7 @@ enum {
GF_DESKTOP = 1 << 0,
GF_640x480 = 1 << 1,
GF_32BPP = 1 << 2,
+ GF_GAMMA = 1 << 3,
};
struct MovieReference {
@@ -193,6 +198,7 @@ public:
bool setPalette(const CastMemberID &id);
void setPalette(const byte *palette, uint16 count);
void shiftPalette(int startIndex, int endIndex, bool reverse);
+ void syncPalette();
void clearPalettes();
PaletteV4 *getPalette(const CastMemberID &id);
bool hasPalette(const CastMemberID &id);
@@ -300,6 +306,7 @@ public:
private:
byte _currentPalette[768];
uint16 _currentPaletteLength;
+ bool _gammaCorrection;
Lingo *_lingo;
uint16 _version;
diff --git a/engines/director/graphics.cpp b/engines/director/graphics.cpp
index 6238303565f..80b3fd52e4a 100644
--- a/engines/director/graphics.cpp
+++ b/engines/director/graphics.cpp
@@ -21,6 +21,7 @@
#include "common/system.h"
#include "common/memstream.h"
+#include "graphics/macgamma.h"
#include "graphics/paletteman.h"
#include "graphics/macgui/macwindowmanager.h"
@@ -182,6 +183,7 @@ void DirectorEngine::setPalette(const byte *palette, uint16 count) {
memset(_currentPalette, 0, 768);
memmove(_currentPalette, palette, count * 3);
_currentPaletteLength = count;
+
if (debugChannelSet(8, kDebugImages)) {
Common::String palData;
for (size_t i = 0; i < (size_t)_currentPaletteLength; i++) {
@@ -190,11 +192,7 @@ void DirectorEngine::setPalette(const byte *palette, uint16 count) {
debugC(8, kDebugImages, "DirectorEngine::setPalette(): Setting current palette: %s", palData.c_str());
}
- // Pass the palette to OSystem only for 8bpp mode
- if (_pixelformat.bytesPerPixel == 1)
- _system->getPaletteManager()->setPalette(_currentPalette, 0, _currentPaletteLength);
-
- _wm->passPalette(_currentPalette, _currentPaletteLength);
+ syncPalette();
}
void DirectorEngine::shiftPalette(int startIndex, int endIndex, bool reverse) {
@@ -228,11 +226,24 @@ void DirectorEngine::shiftPalette(int startIndex, int endIndex, bool reverse) {
debugC(8, kDebugImages, "DirectorEngine::shiftPalette(): Rotating current palette (start: %d, end: %d, reverse: %d): %s", startIndex, endIndex, reverse, palData.c_str());
}
+ syncPalette();
+}
+
+void DirectorEngine::syncPalette() {
+ byte paletteBuf[768];
+ if (_gammaCorrection) {
+ for (size_t i = 0; i < (size_t)_currentPaletteLength*3; i++) {
+ paletteBuf[i] = Graphics::macGammaCorrectionLookUp[_currentPalette[i]];
+ }
+ } else {
+ memcpy(paletteBuf, _currentPalette, _currentPaletteLength*3);
+ }
+
// Pass the palette to OSystem only for 8bpp mode
if (_pixelformat.bytesPerPixel == 1)
- _system->getPaletteManager()->setPalette(_currentPalette, 0, _currentPaletteLength);
+ _system->getPaletteManager()->setPalette(paletteBuf, 0, _currentPaletteLength);
- _wm->passPalette(_currentPalette, _currentPaletteLength);
+ _wm->passPalette(paletteBuf, _currentPaletteLength);
}
void DirectorEngine::clearPalettes() {
diff --git a/engines/director/metaengine.cpp b/engines/director/metaengine.cpp
index 5b3c114c4a1..d3c8ef18719 100644
--- a/engines/director/metaengine.cpp
+++ b/engines/director/metaengine.cpp
@@ -24,6 +24,7 @@
#include "engines/advancedDetector.h"
#include "common/file.h"
+#include "common/translation.h"
#include "director/director.h"
@@ -62,6 +63,32 @@ bool DirectorEngine::hasFeature(EngineFeature f) const {
//(f == kSupportsReturnToLauncher);
}
+static const ADExtraGuiOptionsMap optionsList[] = {
+ {
+ GAMEOPTION_GAMMA_CORRECTION,
+ {
+ _s("Enable gamma correction"),
+ _s("Brighten the graphics to simulate a Macintosh monitor."),
+ "gamma_correction",
+ false,
+ 0,
+ 0
+ }
+ },
+ {
+ GAMEOPTION_TRUE_COLOR,
+ {
+ _s("Force true color"),
+ _s("Use true color graphics mode, even if the game is not designed for it."),
+ "true_color",
+ false,
+ 0,
+ 0
+ }
+ },
+ AD_EXTRA_GUI_OPTIONS_TERMINATOR
+};
+
} // End of Namespace Director
class DirectorMetaEngine : public AdvancedMetaEngine<Director::DirectorGameDescription> {
@@ -71,6 +98,7 @@ public:
}
Common::Error createInstance(OSystem *syst, Engine **engine, const Director::DirectorGameDescription *desc) const override;
+ virtual const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override { return Director::optionsList; }
};
Common::Error DirectorMetaEngine::createInstance(OSystem *syst, Engine **engine, const Director::DirectorGameDescription *desc) const {
Commit: f7bc67785669d93970b92f69d3e6b45e01faa93e
https://github.com/scummvm/scummvm/commit/f7bc67785669d93970b92f69d3e6b45e01faa93e
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Fix regression with video playback
34a60f7911edab06b99b5c7e275c4afae9639b1c introduced a problem with video
playback. For same-frame updates, the choice of redrawing widgets was
left to the channel code, and as the widgets returned by
DigitalVideoCastMember are generic bitmaps, there was no special case to
check if the video had updated.
Fixes intro movie in GADGET: Adventure, Travel and Adventure.
Changed paths:
engines/director/channel.cpp
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 562c2381a37..e483ac3ae9e 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -654,6 +654,10 @@ void Channel::replaceWidget(CastMemberID previousCastId, bool force) {
}
bool Channel::updateWidget() {
+ if (_sprite->_cast && (_sprite->_cast->_type == kCastDigitalVideo) && _sprite->_cast->isModified()) {
+ replaceWidget();
+ return true;
+ }
if (_widget && _widget->needsRedraw()) {
if (_sprite->_cast) {
_sprite->_cast->updateFromWidget(_widget);
Commit: f7e2a1932781a8330a7fbabacee37b1ac13d62f3
https://github.com/scummvm/scummvm/commit/f7e2a1932781a8330a7fbabacee37b1ac13d62f3
Author: Scott Percival (code at moral.net.au)
Date: 2025-03-25T12:17:34+08:00
Commit Message:
DIRECTOR: Fix video palette mismatch in Mac gamma mode
A few places in the code fetch the palette from the window manager. This
is not the source of truth; the WM might have a gamma-converted palette.
Fixes incorrect video colouring in the Mac version of Wrath of the Gods.
Changed paths:
engines/director/castmember/digitalvideo.cpp
engines/director/lingo/xlibs/batqt.cpp
engines/director/lingo/xlibs/moovxobj.cpp
diff --git a/engines/director/castmember/digitalvideo.cpp b/engines/director/castmember/digitalvideo.cpp
index 3878bc102e1..1ab10649ed8 100644
--- a/engines/director/castmember/digitalvideo.cpp
+++ b/engines/director/castmember/digitalvideo.cpp
@@ -188,9 +188,7 @@ bool DigitalVideoCastMember::loadVideo(Common::String path) {
if (result && g_director->_pixelformat.bytesPerPixel == 1) {
// Director supports playing back RGB and paletted video in 256 colour mode.
// In both cases they are dithered to match the Director palette.
- byte palette[256 * 3];
- g_system->getPaletteManager()->grabPalette(palette, 0, 256);
- _video->setDitheringPalette(palette);
+ _video->setDitheringPalette(g_director->getPalette());
}
_duration = getMovieTotalTime();
diff --git a/engines/director/lingo/xlibs/batqt.cpp b/engines/director/lingo/xlibs/batqt.cpp
index bc59f2f7d56..d894070a950 100644
--- a/engines/director/lingo/xlibs/batqt.cpp
+++ b/engines/director/lingo/xlibs/batqt.cpp
@@ -158,9 +158,7 @@ void BatQT::m_open(int nargs) {
if (g_director->_pixelformat.bytesPerPixel == 1) {
// Director supports playing back RGB and paletted video in 256 colour mode.
// In both cases they are dithered to match the Director palette.
- byte palette[256 * 3];
- g_system->getPaletteManager()->grabPalette(palette, 0, 256);
- me->_video->setDitheringPalette(palette);
+ me->_video->setDitheringPalette(g_director->getPalette());
}
} else {
warning("BatQT::m_open: Could not load QT file %s", normPath.toString().c_str());
diff --git a/engines/director/lingo/xlibs/moovxobj.cpp b/engines/director/lingo/xlibs/moovxobj.cpp
index cdf44877318..22dc7690076 100644
--- a/engines/director/lingo/xlibs/moovxobj.cpp
+++ b/engines/director/lingo/xlibs/moovxobj.cpp
@@ -162,9 +162,7 @@ void MoovXObj::m_playMovie(int nargs) {
if (result && g_director->_pixelformat.bytesPerPixel == 1) {
// Director supports playing back RGB and paletted video in 256 colour mode.
// In both cases they are dithered to match the Director palette.
- byte palette[256 * 3];
- g_system->getPaletteManager()->grabPalette(palette, 0, 256);
- me->_video->setDitheringPalette(palette);
+ me->_video->setDitheringPalette(g_director->getPalette());
}
me->_video->start();
}
More information about the Scummvm-git-logs
mailing list