[Scummvm-git-logs] scummvm master -> d09571b1d90f065418320e8b8077b2590ac23fb4
sev-
noreply at scummvm.org
Sat Jan 20 22:15:03 UTC 2024
This automated email contains information about 19 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
29ceaeea62 DEVTOOLS: Fix arg parsing in director-generate-xobj-stub
cc5a0615f2 DIRECTOR: LINGO: XOBJ: Add Window and Panel stubs
f4646ab22e DIRECTOR: LINGO: Add more precise behaviour for b_clearGlobals
7cbda5c344 DIRECTOR: Only load frame data if frame has changed
4a37102151 DIRECTOR: LINGO: XOBJ: Add stubs for ProcessXObj
d25b385651 DIRECTOR: Allow b_editableText for D4 and up
a8fe30029d DIRECTOR: Force editable text boxes to be rendered in front
2f16bf2e9f GRAPHICS: MACGUI: Remove pseudotransparency workaround in MacText
b9003c145f GRAPHICS: MACGUI: Fix fgcolor conversion in MacText
5427b3815e DIRECTOR: Set default TextCastMember fgcolor from Stxt
948bf03aed DIRECTOR: LINGO: Fix missing null check in b_spriteBox
7ecda7e3b7 DIRECTOR: Disable Windows keycode table for D4 and up
b4bdc229db DIRECTOR: Use Shift-JIS text decoder when g_lingo->_romanLingo is false
95b47042f0 GRAPHICS: MACGUI: Stop MacTextCanvas::chopChunk from removing last chunk
0562ff567c GRAPHICS: MACGUI: Move paragraph end marker when merging rows
75dd224cf0 DIRECTOR: Clean up event debug messages
c9d1583f17 DIRECTOR: Fix TextCastMember::setRawText for editable fields
331df0a138 DIRECTOR: Adjust freezing logic in func_goto
d09571b1d9 DEVTOOLS: Fix director-generate-xobj-stub to not print method table for XFCN/XCMD
Commit: 29ceaeea6252db4007b6d36f38a8b371d05a3480
https://github.com/scummvm/scummvm/commit/29ceaeea6252db4007b6d36f38a8b371d05a3480
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DEVTOOLS: Fix arg parsing in director-generate-xobj-stub
Changed paths:
devtools/director-generate-xobj-stub.py
diff --git a/devtools/director-generate-xobj-stub.py b/devtools/director-generate-xobj-stub.py
index 6a7bba3e0a6..46d83e6fe2c 100755
--- a/devtools/director-generate-xobj-stub.py
+++ b/devtools/director-generate-xobj-stub.py
@@ -569,8 +569,12 @@ def generate_xobject_stubs(
elems = e.split()
if not elems or elems[0].startswith("--"):
continue
- returnval = elems[0][0]
- args = elems[0][1:]
+
+ first = elems[0]
+ if first.startswith("/"):
+ first = first[1:]
+ returnval = first[0]
+ args = first[1:]
methname = elems[1].split(",")[0]
if methname.startswith("+"):
methname = methname[1:]
@@ -585,7 +589,6 @@ def generate_xobject_stubs(
default='""' if returnval == "S" else "0",
)
)
-
xobject_class = f"{name}XObject"
xobj_class = f"{name}XObj"
Commit: cc5a0615f278b53d72fd38a1175d797dd6cd7c68
https://github.com/scummvm/scummvm/commit/cc5a0615f278b53d72fd38a1175d797dd6cd7c68
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: LINGO: XOBJ: Add Window and Panel stubs
Changed paths:
A engines/director/lingo/xlibs/panel.cpp
A engines/director/lingo/xlibs/panel.h
A engines/director/lingo/xlibs/window.cpp
A engines/director/lingo/xlibs/window.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 1e2658ec906..76af076087d 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -83,6 +83,7 @@
#include "director/lingo/xlibs/movutils.h"
#include "director/lingo/xlibs/orthoplayxobj.h"
#include "director/lingo/xlibs/palxobj.h"
+#include "director/lingo/xlibs/panel.h"
#include "director/lingo/xlibs/popupmenuxobj.h"
#include "director/lingo/xlibs/porta.h"
#include "director/lingo/xlibs/prefpath.h"
@@ -102,6 +103,7 @@
#include "director/lingo/xlibs/vmisonxfcn.h"
#include "director/lingo/xlibs/volumelist.h"
#include "director/lingo/xlibs/widgetxobj.h"
+#include "director/lingo/xlibs/window.h"
#include "director/lingo/xlibs/wininfo.h"
#include "director/lingo/xlibs/winxobj.h"
#include "director/lingo/xlibs/xcmdglue.h"
@@ -202,15 +204,15 @@ static struct XLibProto {
{ FEDraculXObj::fileNames, FEDraculXObj::open, FEDraculXObj::close, kXObj, 400 }, // D4
{ FEIMasksXObj::fileNames, FEIMasksXObj::open, FEIMasksXObj::close, kXObj, 400 }, // D4
{ FEIPrefsXObj::fileNames, FEIPrefsXObj::open, FEIPrefsXObj::close, kXObj, 400 }, // D4
- { FadeGammaDownXCMD::fileNames, FadeGammaDownXCMD::open, FadeGammaDownXCMD::close, kXObj, 400 }, // D4
- { FadeGammaUpXCMD::fileNames, FadeGammaUpXCMD::open, FadeGammaUpXCMD::close, kXObj, 400 }, // D4
- { FadeGammaXCMD::fileNames, FadeGammaXCMD::open, FadeGammaXCMD::close, kXObj, 400 }, // D4
+ { FadeGammaDownXCMD::fileNames, FadeGammaDownXCMD::open, FadeGammaDownXCMD::close, kXObj, 400 }, // D4
+ { FadeGammaUpXCMD::fileNames, FadeGammaUpXCMD::open, FadeGammaUpXCMD::close, kXObj, 400 }, // D4
+ { FadeGammaXCMD::fileNames, FadeGammaXCMD::open, FadeGammaXCMD::close, kXObj, 400 }, // D4
{ FileExists::fileNames, FileExists::open, FileExists::close, kXObj, 300 }, // D3
{ FileIO::fileNames, FileIO::open, FileIO::close, kXObj | kXtraObj, 200 }, // D2
{ FindFolder::fileNames, FindFolder::open, FindFolder::close, kXObj, 300 }, // D3
{ FindSys::fileNames, FindSys::open, FindSys::close, kXObj, 400 }, // D4
{ FindWin::fileNames, FindWin::open, FindWin::close, kXObj, 400 }, // D4
- { FinderEventsXCMD::fileNames, FinderEventsXCMD::open, FinderEventsXCMD::close, kXObj, 400 }, // D4
+ { FinderEventsXCMD::fileNames, FinderEventsXCMD::open, FinderEventsXCMD::close, kXObj, 400 }, // D4
{ FlushXObj::fileNames, FlushXObj::open, FlushXObj::close, kXObj, 300 }, // D3
{ FPlayXObj::fileNames, FPlayXObj::open, FPlayXObj::close, kXObj, 200 }, // D2
{ GpidXObj::fileNames, GpidXObj::open, GpidXObj::close, kXObj, 400 }, // D4
@@ -233,6 +235,7 @@ static struct XLibProto {
{ MovUtilsXObj::fileNames, MovUtilsXObj::open, MovUtilsXObj::close, kXObj, 400 }, // D4
{ OrthoPlayXObj::fileNames, OrthoPlayXObj::open, OrthoPlayXObj::close, kXObj, 400 }, // D4
{ PalXObj::fileNames, PalXObj::open, PalXObj::close, kXObj, 400 }, // D4
+ { PanelXObj::fileNames, PanelXObj::open, PanelXObj::close, kXObj, 200 }, // D2
{ PopUpMenuXObj::fileNames, PopUpMenuXObj::open, PopUpMenuXObj::close, kXObj, 200 }, // D2
{ Porta::fileNames, Porta::open, Porta::close, kXObj, 300 }, // D3
{ PrefPath::fileNames, PrefPath::open, PrefPath::close, kXObj, 400 }, // D4
@@ -248,14 +251,15 @@ static struct XLibProto {
{ SpaceMgr::fileNames, SpaceMgr::open, SpaceMgr::close, kXObj, 400 }, // D4
{ StageTCXObj::fileNames, StageTCXObj::open, StageTCXObj::close, kXObj, 400 }, // D4
{ UnitTest::fileNames, UnitTest::open, UnitTest::close, kXObj, 400 }, // D4
- { VMisOnXFCN::fileNames, VMisOnXFCN::open, VMisOnXFCN::close, kXObj, 400 }, // D4
+ { VMisOnXFCN::fileNames, VMisOnXFCN::open, VMisOnXFCN::close, kXObj, 400 }, // D4
{ ValkyrieXObj::fileNames, ValkyrieXObj::open, ValkyrieXObj::close, kXObj, 400 }, // D4
{ VideodiscXObj::fileNames, VideodiscXObj::open, VideodiscXObj::close, kXObj, 200 }, // D2
{ VolumeList::fileNames, VolumeList::open, VolumeList::close, kXObj, 300 }, // D3
{ WinInfoXObj::fileNames, WinInfoXObj::open, WinInfoXObj::close, kXObj, 400 }, // D4
{ WidgetXObj::fileNames, WidgetXObj::open, WidgetXObj::close, kXObj, 400 }, // D4
+ { WindowXObj::fileNames, WindowXObj::open, WindowXObj::close, kXObj, 200 }, // D2
{ XCMDGlueXObj::fileNames, XCMDGlueXObj::open, XCMDGlueXObj::close, kXObj, 200 }, // D2
- { XSoundXFCN::fileNames, XSoundXFCN::open, XSoundXFCN::close, kXObj, 400 }, // D4
+ { XSoundXFCN::fileNames, XSoundXFCN::open, XSoundXFCN::close, kXObj, 400 }, // D4
{ XioXObj::fileNames, XioXObj::open, XioXObj::close, kXObj, 400 }, // D3
{ XPlayAnim::fileNames, XPlayAnim::open, XPlayAnim::close, kXObj, 300 }, // D3
{ Yasix::fileNames, Yasix::open, Yasix::close, kXObj, 300 }, // D3
diff --git a/engines/director/lingo/xlibs/panel.cpp b/engines/director/lingo/xlibs/panel.cpp
new file mode 100644
index 00000000000..80c7dc6052c
--- /dev/null
+++ b/engines/director/lingo/xlibs/panel.cpp
@@ -0,0 +1,139 @@
+/* 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/panel.h"
+
+/**************************************************
+ *
+ * USED IN:
+ * Standard Macromedia Director XObject
+ *
+ **************************************************/
+
+/*
+--Panel, Tool, 1.0
+--© 1989, 1990 MacroMind, Inc.
+--by John Thompson and Al McNeil
+------------------------------------------------------------------
+------------------------------------------------------------------
+--=METHODS=--
+IISIO mNew, kindSymbol, titleString, myNameSymbol, windowObj --Creates a new instance.
+--kindSymbol is one of: #pushButton, #checkBox, #radioButton, #staticText, #castBitmap
+X mDispose --Disposes of the instance.
+S mName --Returns the XObject's name.
+X mShow --Shows instance.
+X mHide --Hides instance.
+X mUpdate --Updates the instance.
+XII mMove, hpos, vpos ---Moves to h, v.
+XII mSize, width, height --Changes size to the specified width, height.
+XII mDrag, startH, startV
+XI mSetValue, value --Sets panel value.
+I mGetValue --Returns panel value.
+XI mSetHilite, flag --Sets hilite state.
+I mGetHilite --Returns panel hilite state.
+XS mSetTitle, string --Sets title for control.
+S mGetTitle --Returns the control's title string.
+XII mMouseDown, loch, locv --Sends a mousedown at given location in panel.
+/X mBounds, rectPtr --Returns the bounding rect
+ */
+
+namespace Director {
+
+const char *PanelXObj::xlibName = "Panel";
+const char *PanelXObj::fileNames[] = {
+ "Panel",
+ nullptr
+};
+
+static MethodProto xlibMethods[] = {
+ { "new", PanelXObj::m_new, 4, 4, 200 },
+ { "dispose", PanelXObj::m_dispose, 0, 0, 200 },
+ { "name", PanelXObj::m_name, 0, 0, 200 },
+ { "show", PanelXObj::m_show, 0, 0, 200 },
+ { "hide", PanelXObj::m_hide, 0, 0, 200 },
+ { "update", PanelXObj::m_update, 0, 0, 200 },
+ { "move", PanelXObj::m_move, 2, 2, 200 },
+ { "size", PanelXObj::m_size, 2, 2, 200 },
+ { "drag", PanelXObj::m_drag, 2, 2, 200 },
+ { "setValue", PanelXObj::m_setValue, 1, 1, 200 },
+ { "getValue", PanelXObj::m_getValue, 0, 0, 200 },
+ { "setHilite", PanelXObj::m_setHilite, 1, 1, 200 },
+ { "getHilite", PanelXObj::m_getHilite, 0, 0, 200 },
+ { "setTitle", PanelXObj::m_setTitle, 1, 1, 200 },
+ { "getTitle", PanelXObj::m_getTitle, 0, 0, 200 },
+ { "mouseDown", PanelXObj::m_mouseDown, 2, 2, 200 },
+ { "bounds", PanelXObj::m_bounds, 0, 0, 200 },
+ { nullptr, nullptr, 0, 0, 0 }
+};
+
+PanelXObject::PanelXObject(ObjectType ObjectType) :Object<PanelXObject>("PanelXObj") {
+ _objType = ObjectType;
+}
+
+void PanelXObj::open(int type) {
+ if (type == kXObj) {
+ PanelXObject::initMethods(xlibMethods);
+ PanelXObject *xobj = new PanelXObject(kXObj);
+ g_lingo->exposeXObject(xlibName, xobj);
+ } else if (type == kXtraObj) {
+ // TODO - Implement Xtra
+ }
+}
+
+void PanelXObj::close(int type) {
+ if (type == kXObj) {
+ PanelXObject::cleanupMethods();
+ g_lingo->_globalvars[xlibName] = Datum();
+ } else if (type == kXtraObj) {
+ // TODO - Implement Xtra
+ }
+}
+
+void PanelXObj::m_new(int nargs) {
+ g_lingo->printSTUBWithArglist("PanelXObj::m_new", nargs);
+ g_lingo->dropStack(nargs);
+ g_lingo->push(g_lingo->_state->me);
+}
+
+XOBJSTUBNR(PanelXObj::m_dispose)
+XOBJSTUB(PanelXObj::m_name, "")
+XOBJSTUBNR(PanelXObj::m_show)
+XOBJSTUBNR(PanelXObj::m_hide)
+XOBJSTUBNR(PanelXObj::m_update)
+XOBJSTUBNR(PanelXObj::m_move)
+XOBJSTUBNR(PanelXObj::m_size)
+XOBJSTUBNR(PanelXObj::m_drag)
+XOBJSTUBNR(PanelXObj::m_setValue)
+XOBJSTUB(PanelXObj::m_getValue, 0)
+XOBJSTUBNR(PanelXObj::m_setHilite)
+XOBJSTUB(PanelXObj::m_getHilite, 0)
+XOBJSTUBNR(PanelXObj::m_setTitle)
+XOBJSTUB(PanelXObj::m_getTitle, "")
+XOBJSTUBNR(PanelXObj::m_mouseDown)
+XOBJSTUBNR(PanelXObj::m_bounds)
+
+}
diff --git a/engines/director/lingo/xlibs/panel.h b/engines/director/lingo/xlibs/panel.h
new file mode 100644
index 00000000000..fd1b6f6eb2d
--- /dev/null
+++ b/engines/director/lingo/xlibs/panel.h
@@ -0,0 +1,62 @@
+/* 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_PANEL_H
+#define DIRECTOR_LINGO_XLIBS_PANEL_H
+
+namespace Director {
+
+class PanelXObject : public Object<PanelXObject> {
+public:
+ PanelXObject(ObjectType objType);
+};
+
+namespace PanelXObj {
+
+extern const char *xlibName;
+extern const char *fileNames[];
+
+void open(int type);
+void close(int type);
+
+void m_new(int nargs);
+void m_dispose(int nargs);
+void m_name(int nargs);
+void m_show(int nargs);
+void m_hide(int nargs);
+void m_update(int nargs);
+void m_move(int nargs);
+void m_size(int nargs);
+void m_drag(int nargs);
+void m_setValue(int nargs);
+void m_getValue(int nargs);
+void m_setHilite(int nargs);
+void m_getHilite(int nargs);
+void m_setTitle(int nargs);
+void m_getTitle(int nargs);
+void m_mouseDown(int nargs);
+void m_bounds(int nargs);
+
+} // End of namespace PanelXObj
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/lingo/xlibs/window.cpp b/engines/director/lingo/xlibs/window.cpp
new file mode 100644
index 00000000000..090d527fe3d
--- /dev/null
+++ b/engines/director/lingo/xlibs/window.cpp
@@ -0,0 +1,157 @@
+/* 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/window.h"
+
+/**************************************************
+ *
+ * USED IN:
+ * Standard Macromedia Director XObject
+ *
+ **************************************************/
+
+/*
+--Window, Tool, 1.0
+--© 1989, 1990 MacroMind, Inc.
+--by John Thompson
+-----------------------------------------------------------------------
+--NOTE: This XObject will not create a window with scroll bars.--
+-----------------------------------------------------------------------
+-----------------------------------------------------------------------
+--=METHODS=--
+--
+IIS mNew, kind, titleString --Creates a new instance of the XObject.
+--kind: #document #noGrowDoc, #dialog, #roundDialog, #plainDialog, #altDialog
+X mDispose --Disposes of the instance.
+S mName --Returns name of the XObject.
+X mSelect --Brings to the front
+X mShow --Shows instance.
+X mHide --Hides instance.
+XII mMove, hpos, vpos --Moves to hpos, vpos.
+XII mSize, width, height --Changes size to width, height.
+XIO mAddPanel, symbol, panelObj --Adds a panel.
+OI mGetPanel, panelSymbolName --Gets a panel.
+XO mSetHandler, handlerObject --Sets the event handler. Args:
+O mGetHandler --Return the event handler
+/X mIdle
+/XI mActivate, flag
+/X mUpdate
+/XII mMouseUp, eventRecPtr, mdcode
+/XII mMouseDown, eventRecPtr, mdcode
+/XI mKeyDown, theChar
+/X mWindowPtr
+/XX mSetTitle
+X +mDisposeAll --Closes all windows.
+OI +mNthWindow, n --Returns the n'th window.
+ */
+
+namespace Director {
+
+const char *WindowXObj::xlibName = "Window";
+const char *WindowXObj::fileNames[] = {
+ "Window",
+ nullptr
+};
+
+static MethodProto xlibMethods[] = {
+ { "new", WindowXObj::m_new, 2, 2, 200 },
+ { "dispose", WindowXObj::m_dispose, 0, 0, 200 },
+ { "name", WindowXObj::m_name, 0, 0, 200 },
+ { "select", WindowXObj::m_select, 0, 0, 200 },
+ { "show", WindowXObj::m_show, 0, 0, 200 },
+ { "hide", WindowXObj::m_hide, 0, 0, 200 },
+ { "move", WindowXObj::m_move, 2, 2, 200 },
+ { "size", WindowXObj::m_size, 2, 2, 200 },
+ { "addPanel", WindowXObj::m_addPanel, 2, 2, 200 },
+ { "getPanel", WindowXObj::m_getPanel, 1, 1, 200 },
+ { "setHandler", WindowXObj::m_setHandler, 1, 1, 200 },
+ { "getHandler", WindowXObj::m_getHandler, 0, 0, 200 },
+ { "idle", WindowXObj::m_idle, 0, 0, 200 },
+ { "activate", WindowXObj::m_activate, 1, 1, 200 },
+ { "update", WindowXObj::m_update, 0, 0, 200 },
+ { "mouseUp", WindowXObj::m_mouseUp, 2, 2, 200 },
+ { "mouseDown", WindowXObj::m_mouseDown, 2, 2, 200 },
+ { "keyDown", WindowXObj::m_keyDown, 1, 1, 200 },
+ { "windowPtr", WindowXObj::m_windowPtr, 0, 0, 200 },
+ { "setTitle", WindowXObj::m_setTitle, 1, 1, 200 },
+ { "disposeAll", WindowXObj::m_disposeAll, 0, 0, 200 },
+ { "nthWindow", WindowXObj::m_nthWindow, 1, 1, 200 },
+ { nullptr, nullptr, 0, 0, 0 }
+};
+
+WindowXObject::WindowXObject(ObjectType ObjectType) :Object<WindowXObject>("WindowXObj") {
+ _objType = ObjectType;
+}
+
+void WindowXObj::open(int type) {
+ if (type == kXObj) {
+ WindowXObject::initMethods(xlibMethods);
+ WindowXObject *xobj = new WindowXObject(kXObj);
+ g_lingo->exposeXObject(xlibName, xobj);
+ } else if (type == kXtraObj) {
+ // TODO - Implement Xtra
+ }
+}
+
+void WindowXObj::close(int type) {
+ if (type == kXObj) {
+ WindowXObject::cleanupMethods();
+ g_lingo->_globalvars[xlibName] = Datum();
+ } else if (type == kXtraObj) {
+ // TODO - Implement Xtra
+ }
+}
+
+void WindowXObj::m_new(int nargs) {
+ g_lingo->printSTUBWithArglist("WindowXObj::m_new", nargs);
+ g_lingo->dropStack(nargs);
+ g_lingo->push(g_lingo->_state->me);
+}
+
+XOBJSTUBNR(WindowXObj::m_dispose)
+XOBJSTUB(WindowXObj::m_name, "")
+XOBJSTUBNR(WindowXObj::m_select)
+XOBJSTUBNR(WindowXObj::m_show)
+XOBJSTUBNR(WindowXObj::m_hide)
+XOBJSTUBNR(WindowXObj::m_move)
+XOBJSTUBNR(WindowXObj::m_size)
+XOBJSTUBNR(WindowXObj::m_addPanel)
+XOBJSTUB(WindowXObj::m_getPanel, 0)
+XOBJSTUBNR(WindowXObj::m_setHandler)
+XOBJSTUB(WindowXObj::m_getHandler, 0)
+XOBJSTUBNR(WindowXObj::m_idle)
+XOBJSTUBNR(WindowXObj::m_activate)
+XOBJSTUBNR(WindowXObj::m_update)
+XOBJSTUBNR(WindowXObj::m_mouseUp)
+XOBJSTUBNR(WindowXObj::m_mouseDown)
+XOBJSTUBNR(WindowXObj::m_keyDown)
+XOBJSTUBNR(WindowXObj::m_windowPtr)
+XOBJSTUBNR(WindowXObj::m_setTitle)
+XOBJSTUBNR(WindowXObj::m_disposeAll)
+XOBJSTUB(WindowXObj::m_nthWindow, 0)
+
+}
diff --git a/engines/director/lingo/xlibs/window.h b/engines/director/lingo/xlibs/window.h
new file mode 100644
index 00000000000..f39acd05ab8
--- /dev/null
+++ b/engines/director/lingo/xlibs/window.h
@@ -0,0 +1,67 @@
+/* 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_WINDOW_H
+#define DIRECTOR_LINGO_XLIBS_WINDOW_H
+
+namespace Director {
+
+class WindowXObject : public Object<WindowXObject> {
+public:
+ WindowXObject(ObjectType objType);
+};
+
+namespace WindowXObj {
+
+extern const char *xlibName;
+extern const char *fileNames[];
+
+void open(int type);
+void close(int type);
+
+void m_new(int nargs);
+void m_dispose(int nargs);
+void m_name(int nargs);
+void m_select(int nargs);
+void m_show(int nargs);
+void m_hide(int nargs);
+void m_move(int nargs);
+void m_size(int nargs);
+void m_addPanel(int nargs);
+void m_getPanel(int nargs);
+void m_setHandler(int nargs);
+void m_getHandler(int nargs);
+void m_idle(int nargs);
+void m_activate(int nargs);
+void m_update(int nargs);
+void m_mouseUp(int nargs);
+void m_mouseDown(int nargs);
+void m_keyDown(int nargs);
+void m_windowPtr(int nargs);
+void m_setTitle(int nargs);
+void m_disposeAll(int nargs);
+void m_nthWindow(int nargs);
+
+} // End of namespace WindowXObj
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index ae812b388f3..59a72e7485c 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -106,6 +106,7 @@ MODULE_OBJS = \
lingo/xlibs/movutils.o \
lingo/xlibs/orthoplayxobj.o \
lingo/xlibs/palxobj.o \
+ lingo/xlibs/panel.o \
lingo/xlibs/popupmenuxobj.o \
lingo/xlibs/porta.o \
lingo/xlibs/prefpath.o \
@@ -125,6 +126,7 @@ MODULE_OBJS = \
lingo/xlibs/vmisonxfcn.o \
lingo/xlibs/volumelist.o \
lingo/xlibs/widgetxobj.o \
+ lingo/xlibs/window.o \
lingo/xlibs/winxobj.o \
lingo/xlibs/wininfo.o \
lingo/xlibs/xcmdglue.o \
Commit: f4646ab22e209bb72e318691759ba3421ba0f508
https://github.com/scummvm/scummvm/commit/f4646ab22e209bb72e318691759ba3421ba0f508
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: LINGO: Add more precise behaviour for b_clearGlobals
>From testing in D4 with showGlobals, original Director will not delete a
global if it contains a factory object.
Fixes ck_data/opening/id_input.dxr in Cosmology of Kyoto, which creates
a global factory object, calls clearGlobals, then inexplicably expects the
object to still be there.
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 b923c824c6a..0cf36205738 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1890,6 +1890,10 @@ void LB::b_alert(int nargs) {
void LB::b_clearGlobals(int nargs) {
for (auto &it : g_lingo->_globalvars) {
if (!it._value.ignoreGlobal) {
+ // For some reason, factory objects are not removed
+ // by this command.
+ if (it._value.type == OBJECT && it._value.u.obj->getObjType() & (kFactoryObj | kScriptObj))
+ continue;
g_lingo->_globalvars.erase(it._key);
}
}
Commit: 7cbda5c344044607658b13b1b2dca873a44460d3
https://github.com/scummvm/scummvm/commit/7cbda5c344044607658b13b1b2dca873a44460d3
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: Only load frame data if frame has changed
Loading the frame data wipes out e.g. sprites that have been changed
while playback has been paused.
Fixes the buttons on the opening menu screen of Cosmology of Kyoto.
Changed paths:
engines/director/score.cpp
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index cc1d043c3c4..0ed8a8aa687 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -400,6 +400,8 @@ void Score::update() {
for (uint ch = 0; ch < _channels.size(); ch++)
*_currentFrame->_sprites[ch] = *_channels[ch]->_sprite;
+ bool frameChanged = false;
+
if (!_vm->_playbackPaused) {
if (_nextFrame) {
// With the advent of demand loading frames and due to partial updates, we rebuild our channel data
@@ -408,6 +410,7 @@ void Score::update() {
}
else if (!_window->_newMovieStarted)
_curFrameNumber++;
+ frameChanged = true;
}
_nextFrame = 0;
@@ -435,6 +438,7 @@ void Score::update() {
_curFrameNumber = 1;
}
+ frameChanged = true;
}
if (_labels != nullptr) {
@@ -445,7 +449,9 @@ void Score::update() {
}
}
- loadFrame(_curFrameNumber, true);
+ if (frameChanged) {
+ loadFrame(_curFrameNumber, true);
+ }
byte tempo = _currentFrame->_mainChannels.scoreCachedTempo;
// puppetTempo is overridden by changes in score tempo
@@ -1541,8 +1547,8 @@ bool Score::readOneFrame() {
_currentFrame->readChannel(*_framesStream, channelOffset, channelSize, _version);
}
- if (debugChannelSet(4, kDebugLoading)) {
- debugC(4, kDebugLoading, "%s", _currentFrame->formatChannelInfo().c_str());
+ if (debugChannelSet(9, kDebugLoading)) {
+ debugC(9, kDebugLoading, "%s", _currentFrame->formatChannelInfo().c_str());
}
debugC(8, kDebugLoading, "Score::readOneFrame(): Frame %d actionId: %s", _curFrameNumber, _currentFrame->_mainChannels.actionId.asString().c_str());
Commit: 4a371021511d229cf87ee40a98da498166d6b28e
https://github.com/scummvm/scummvm/commit/4a371021511d229cf87ee40a98da498166d6b28e
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: LINGO: XOBJ: Add stubs for ProcessXObj
Fixes quitting the game in Chop Suey for Mac.
Changed paths:
A engines/director/lingo/xlibs/processxobj.cpp
A engines/director/lingo/xlibs/processxobj.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 76af076087d..18a688e5ffb 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -88,6 +88,7 @@
#include "director/lingo/xlibs/porta.h"
#include "director/lingo/xlibs/prefpath.h"
#include "director/lingo/xlibs/printomatic.h"
+#include "director/lingo/xlibs/processxobj.h"
#include "director/lingo/xlibs/qtmovie.h"
#include "director/lingo/xlibs/qtcatmovieplayerxobj.h"
#include "director/lingo/xlibs/qtvr.h"
@@ -240,6 +241,7 @@ static struct XLibProto {
{ Porta::fileNames, Porta::open, Porta::close, kXObj, 300 }, // D3
{ PrefPath::fileNames, PrefPath::open, PrefPath::close, kXObj, 400 }, // D4
{ PrintOMaticXObj::fileNames, PrintOMaticXObj::open, PrintOMaticXObj::close, kXObj, 400 }, // D4
+ { ProcessXObj::fileNames, ProcessXObj::open, ProcessXObj::close, kXObj, 400 }, // D4
{ QTCatMoviePlayerXObj::fileNames, QTCatMoviePlayerXObj::open, QTCatMoviePlayerXObj::close,kXObj, 400 }, // D4
{ QTMovie::fileNames, QTMovie::open, QTMovie::close, kXObj, 400 }, // D4
{ QTVR::fileNames, QTVR::open, QTVR::close, kXObj, 400 }, // D4
diff --git a/engines/director/lingo/xlibs/processxobj.cpp b/engines/director/lingo/xlibs/processxobj.cpp
new file mode 100644
index 00000000000..5d01267f0a4
--- /dev/null
+++ b/engines/director/lingo/xlibs/processxobj.cpp
@@ -0,0 +1,96 @@
+/* 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/processxobj.h"
+
+/**************************************************
+ *
+ * USED IN:
+ * chopsuey
+ *
+ **************************************************/
+
+/*
+-- ProcessXObj, Kills a specified process
+-- ©1994 Image Technologies, Inc.
+-- Written by: Steve Kos
+X mNew -- inits mem space
+X mDispose
+ISS mFindPSN -- finds the psn
+X mKillProcess -- kills this process
+ */
+
+namespace Director {
+
+const char *ProcessXObj::xlibName = "ProcessXObj";
+const char *ProcessXObj::fileNames[] = {
+ "ProcessXObj",
+ nullptr
+};
+
+static MethodProto xlibMethods[] = {
+ { "new", ProcessXObj::m_new, 0, 0, 400 },
+ { "dispose", ProcessXObj::m_dispose, 0, 0, 400 },
+ { "findPSN", ProcessXObj::m_findPSN, 2, 2, 400 },
+ { "killProcess", ProcessXObj::m_killProcess, 0, 0, 400 },
+ { nullptr, nullptr, 0, 0, 0 }
+};
+
+ProcessXObject::ProcessXObject(ObjectType ObjectType) :Object<ProcessXObject>("ProcessXObj") {
+ _objType = ObjectType;
+}
+
+void ProcessXObj::open(int type) {
+ if (type == kXObj) {
+ ProcessXObject::initMethods(xlibMethods);
+ ProcessXObject *xobj = new ProcessXObject(kXObj);
+ g_lingo->exposeXObject(xlibName, xobj);
+ } else if (type == kXtraObj) {
+ // TODO - Implement Xtra
+ }
+}
+
+void ProcessXObj::close(int type) {
+ if (type == kXObj) {
+ ProcessXObject::cleanupMethods();
+ g_lingo->_globalvars[xlibName] = Datum();
+ } else if (type == kXtraObj) {
+ // TODO - Implement Xtra
+ }
+}
+
+void ProcessXObj::m_new(int nargs) {
+ g_lingo->printSTUBWithArglist("ProcessXObj::m_new", nargs);
+ g_lingo->dropStack(nargs);
+ g_lingo->push(g_lingo->_state->me);
+}
+
+XOBJSTUBNR(ProcessXObj::m_dispose)
+XOBJSTUB(ProcessXObj::m_findPSN, 0)
+XOBJSTUBNR(ProcessXObj::m_killProcess)
+
+}
diff --git a/engines/director/lingo/xlibs/processxobj.h b/engines/director/lingo/xlibs/processxobj.h
new file mode 100644
index 00000000000..cf47aefc033
--- /dev/null
+++ b/engines/director/lingo/xlibs/processxobj.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 DIRECTOR_LINGO_XLIBS_PROCESSXOBJ_H
+#define DIRECTOR_LINGO_XLIBS_PROCESSXOBJ_H
+
+namespace Director {
+
+class ProcessXObject : public Object<ProcessXObject> {
+public:
+ ProcessXObject(ObjectType objType);
+};
+
+namespace ProcessXObj {
+
+extern const char *xlibName;
+extern const char *fileNames[];
+
+void open(int type);
+void close(int type);
+
+void m_new(int nargs);
+void m_dispose(int nargs);
+void m_findPSN(int nargs);
+void m_killProcess(int nargs);
+
+} // End of namespace ProcessXObj
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index 59a72e7485c..bc87cdd11cf 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -111,6 +111,7 @@ MODULE_OBJS = \
lingo/xlibs/porta.o \
lingo/xlibs/prefpath.o \
lingo/xlibs/printomatic.o \
+ lingo/xlibs/processxobj.o \
lingo/xlibs/qtcatmovieplayerxobj.o \
lingo/xlibs/qtmovie.o \
lingo/xlibs/qtvr.o \
Commit: d25b3856510b041e734a9debfe7a6b262839ee2a
https://github.com/scummvm/scummvm/commit/d25b3856510b041e734a9debfe7a6b262839ee2a
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: Allow b_editableText for D4 and up
Fixes text widget selection in Cosmology of Kyoto.
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 0cf36205738..ec517eb12ce 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -166,7 +166,7 @@ static BuiltinProto builtins[] = {
{ "constrainV", LB::b_constrainV, 2, 2, 200, FBLTIN }, // D2 f
{ "copyToClipBoard",LB::b_copyToClipBoard,1,1, 400, CBLTIN }, // D4 c
{ "duplicate", LB::b_duplicate, 1, 2, 400, CBLTIN }, // D4 c
- { "editableText", LB::b_editableText, 0, 0, 200, CBLTIN }, // D2, FIXME: the field in D4+
+ { "editableText", LB::b_editableText, 0, 0, 200, CBLTIN }, // D2
{ "erase", LB::b_erase, 1, 1, 400, CBLTIN }, // D4 c
{ "findEmpty", LB::b_findEmpty, 1, 1, 400, FBLTIN }, // D4 f
// go // D2
@@ -2001,6 +2001,8 @@ void LB::b_duplicate(int nargs) {
}
void LB::b_editableText(int nargs) {
+ // editableText is deprecated in D4+ with the addition of "the editableText",
+ // but is still a valid function call.
Score *sc = g_director->getCurrentMovie()->getScore();
if (!sc) {
warning("b_editableText: no score");
@@ -2017,7 +2019,7 @@ void LB::b_editableText(int nargs) {
} else {
warning("b_editableText: sprite index out of bounds");
}
- } else if (nargs == 0 && g_director->getVersion() < 400) {
+ } else if (nargs == 0) {
g_lingo->dropStack(nargs);
if (g_lingo->_currentChannelId == -1) {
Commit: a8fe30029d09ee347c68cdd86975f26d60947f9c
https://github.com/scummvm/scummvm/commit/a8fe30029d09ee347c68cdd86975f26d60947f9c
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: Force editable text boxes to be rendered in front
Editable text boxes don't seem to abide by the channel rendering order;
you can have a bitmap in a higher channel that entirely obscures a text
entry widget, and the widget will still be visible.
Fixes the visibility of the name entry text box in Cosmology of Kyoto.
Changed paths:
engines/director/channel.cpp
engines/director/channel.h
engines/director/score.cpp
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 943165ef670..06ea905cc62 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -470,6 +470,15 @@ void Channel::updateTextCast() {
}
}
+bool Channel::getEditable() {
+ if (_sprite->_cast && _sprite->_cast->_type == kCastText) {
+ if (_widget && (Graphics::MacText *)_widget->isEditable()) {
+ return true;
+ }
+ }
+ return false;
+}
+
void Channel::setEditable(bool editable) {
if (_sprite->_cast && _sprite->_cast->_type == kCastText) {
// if the sprite is editable, then we refresh the selEnd and setStart
diff --git a/engines/director/channel.h b/engines/director/channel.h
index 92d1c786160..ab01d24ad0d 100644
--- a/engines/director/channel.h
+++ b/engines/director/channel.h
@@ -63,6 +63,7 @@ public:
void setPosition(int x, int y, bool force = false);
void setCast(CastMemberID memberID);
void setClean(Sprite *nextSprite, int spriteId, bool partial = false);
+ bool getEditable();
void setEditable(bool editable);
void replaceSprite(Sprite *nextSprite);
void replaceWidget(CastMemberID previousCastId = CastMemberID(0, 0), bool force = false);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 0ed8a8aa687..1dcb20d429d 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1325,11 +1325,22 @@ bool Score::checkSpriteIntersection(uint16 spriteId, Common::Point pos) {
}
Common::List<Channel *> Score::getSpriteIntersections(const Common::Rect &r) {
- Common::List<Channel *>intersections;
+ Common::List<Channel *> intersections;
+ Common::List<Channel *> appendix;
for (uint i = 0; i < _channels.size(); i++) {
- if (!_channels[i]->isEmpty() && !r.findIntersectingRect(_channels[i]->getBbox()).isEmpty())
- intersections.push_back(_channels[i]);
+ if (!_channels[i]->isEmpty() && !r.findIntersectingRect(_channels[i]->getBbox()).isEmpty()) {
+ // Editable text sprites will (more or less) always be rendered in front of other sprites,
+ // regardless of their order in the channel list.
+ if (_channels[i]->getEditable()) {
+ appendix.push_back(_channels[i]);
+ } else {
+ intersections.push_back(_channels[i]);
+ }
+ }
+ }
+ for (auto &ch : appendix) {
+ intersections.push_back(ch);
}
return intersections;
Commit: 2f16bf2e9f24772bd168752a679838094eb7e30b
https://github.com/scummvm/scummvm/commit/2f16bf2e9f24772bd168752a679838094eb7e30b
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
GRAPHICS: MACGUI: Remove pseudotransparency workaround in MacText
Needed in order to e.g. print white text on a black background in
Director.
This reverts 457b09cb4eabab4516230ec4a46d9340bd040bf4
Changed paths:
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 35e3c440a03..103a6ac6746 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -826,8 +826,7 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int
if (_canvas._textShadow)
g->blitFrom(*_canvas._shadowSurface, Common::Rect(MIN<int>(_canvas._surface->w, x), MIN<int>(_canvas._surface->h, y), MIN<int>(_canvas._surface->w, x + w), MIN<int>(_canvas._surface->h, y + h)), Common::Point(xoff + _canvas._textShadow, yoff + _canvas._textShadow));
- uint32 bgcolor = _canvas._tbgcolor < 0xff ? _canvas._tbgcolor : 0;
- g->transBlitFrom(*_canvas._surface, Common::Rect(MIN<int>(_canvas._surface->w, x), MIN<int>(_canvas._surface->h, y), MIN<int>(_canvas._surface->w, x + w), MIN<int>(_canvas._surface->h, y + h)), Common::Point(xoff, yoff), bgcolor);
+ g->transBlitFrom(*_canvas._surface, Common::Rect(MIN<int>(_canvas._surface->w, x), MIN<int>(_canvas._surface->h, y), MIN<int>(_canvas._surface->w, x + w), MIN<int>(_canvas._surface->h, y + h)), Common::Point(xoff, yoff), _canvas._tbgcolor);
_contentIsDirty = false;
_cursorDirty = false;
Commit: b9003c145f0781cbf2bcc2a64acaa362bb776b2f
https://github.com/scummvm/scummvm/commit/b9003c145f0781cbf2bcc2a64acaa362bb776b2f
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
GRAPHICS: MACGUI: Fix fgcolor conversion in MacText
Changed paths:
graphics/macgui/mactext-canvas.cpp
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext-canvas.cpp b/graphics/macgui/mactext-canvas.cpp
index 5952a46e724..ccbad5ad7ff 100644
--- a/graphics/macgui/mactext-canvas.cpp
+++ b/graphics/macgui/mactext-canvas.cpp
@@ -429,7 +429,7 @@ const Common::U32String::value_type *MacTextCanvas::splitString(const Common::U3
D(9, "** splitString[i]: %d%% fname: '%s' alt: '%s' title: '%s' ext: '%s'",
_text[curLine].picpercent,
- _text[curLine].picfname.c_str(), _text[curLine].picalt.encode().c_str(),
+ _text[curLine].picfname.toString().c_str(), _text[curLine].picalt.encode().c_str(),
_text[curLine].pictitle.encode().c_str(), _text[curLine].picext.encode().c_str());
break;
}
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 103a6ac6746..ddf59b8c41c 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -125,7 +125,11 @@ MacText::MacText(MacWidget *parent, int x, int y, int w, int h, MacWindowManager
_defaultFormatting = MacFontRun(_wm);
_defaultFormatting.font = wm->_fontMan->getFont(*macFont);
byte r, g, b;
- _wm->_pixelformat.colorToRGB(fgcolor, r, g, b);
+ if (_wm->_pixelformat.bytesPerPixel == 4) {
+ _wm->decomposeColor<uint32>(fgcolor, r, g, b);
+ } else {
+ _wm->decomposeColor<byte>(fgcolor, r, g, b);
+ }
_defaultFormatting.setValues(_wm, macFont->getId(), macFont->getSlant(), macFont->getSize(), r, g, b);
} else {
_defaultFormatting.font = NULL;
Commit: 5427b3815e11a026232c23303c1ef145f3d5a6a7
https://github.com/scummvm/scummvm/commit/5427b3815e11a026232c23303c1ef145f3d5a6a7
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: Set default TextCastMember fgcolor from Stxt
Needed to e.g. display a white blinking cursor on a black background.
Changed paths:
engines/director/castmember/text.cpp
diff --git a/engines/director/castmember/text.cpp b/engines/director/castmember/text.cpp
index 080636a0f91..8879e9f16d7 100644
--- a/engines/director/castmember/text.cpp
+++ b/engines/director/castmember/text.cpp
@@ -225,6 +225,9 @@ void TextCastMember::importStxt(const Stxt *stxt) {
_fgpalinfo1 = stxt->_style.r;
_fgpalinfo2 = stxt->_style.g;
_fgpalinfo3 = stxt->_style.b;
+ // The default color in the Stxt will override the fgcolor,
+ // e.g. empty editable text boxes will use the Stxt color
+ _fgcolor = g_director->_wm->findBestColor(_fgpalinfo1 >> 8, _fgpalinfo2 >> 8, _fgpalinfo3 >> 8);
_ftext = stxt->_ftext;
_ptext = stxt->_ptext;
_rtext = stxt->_rtext;
Commit: 948bf03aedf0b025f8b7fcbe5868fb6a33fa86a8
https://github.com/scummvm/scummvm/commit/948bf03aedf0b025f8b7fcbe5868fb6a33fa86a8
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: LINGO: Fix missing null check in b_spriteBox
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 ec517eb12ce..989d4495b37 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -2716,7 +2716,8 @@ void LB::b_spriteBox(int nargs) {
g_director->getCurrentWindow()->addDirtyRect(channel->getBbox());
channel->setBbox(l, t, r, b);
- channel->_sprite->_cast->setModified(true);
+ if (channel->_sprite->_cast)
+ channel->_sprite->_cast->setModified(true);
channel->_dirty = true;
}
Commit: 7ecda7e3b78a2586dbf7b8165efd42b24db6ff9d
https://github.com/scummvm/scummvm/commit/7ecda7e3b78a2586dbf7b8165efd42b24db6ff9d
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: Disable Windows keycode table for D4 and up
Fixes keyboard entry in Cosmology of Kyoto for Windows.
Changed paths:
engines/director/util.cpp
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 73e6809f896..e0d2cc28185 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -276,7 +276,9 @@ static struct WinKeyCodeMapping {
};
void DirectorEngine::loadKeyCodes() {
- if (g_director->getPlatform() == Common::kPlatformWindows) {
+ if ((g_director->getPlatform() == Common::kPlatformWindows) && (g_director->getVersion() < 400)) {
+ // Allegedly this keykode list applies for the Windows version of D3.
+ // D4 and D5 for Windows are both confirmed to use the Mac keycode table.
for (WinKeyCodeMapping *k = WinkeyCodeMappings; k->scummvm != Common::KEYCODE_INVALID; k++)
_KeyCodes[k->scummvm] = k->win;
} else {
Commit: b4bdc229db396d707ce3aec199f5d937fc53d2ab
https://github.com/scummvm/scummvm/commit/b4bdc229db396d707ce3aec199f5d937fc53d2ab
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: Use Shift-JIS text decoder when g_lingo->_romanLingo is false
Fixes most of the dialogue interaction scripts in the English version of
Cosmology of Kyoto, which contain plenty of Shift-JIS text.
Changed paths:
engines/director/lingo/lingo.cpp
engines/director/util.cpp
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index bd9000a7cf1..fdfa90ea5aa 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -186,7 +186,7 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
_itemDelimiter = ',';
_exitLock = false;
_preLoadEventAbort = false;
- _romanLingo = (_vm->getLanguage() != Common::JA_JPN); // Japanrdr gamrs typically require 3-byte encodings
+ _romanLingo = (_vm->getLanguage() != Common::JA_JPN); // Japanese games typically require double-byte encoding
_searchPath.type = ARRAY;
_searchPath.u.farr = new FArray;
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index e0d2cc28185..5e5ee913eed 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -1206,6 +1206,12 @@ Common::CodePage getEncoding(Common::Platform platform, Common::Language languag
default:
break;
}
+ // If there's no language override, but there is a Lingo
+ // request for a double-byte interpreter, assume this means
+ // the text cast members contain Shift-JIS.
+ if (!g_lingo->_romanLingo)
+ return Common::kWindows932; // Shift JIS
+
return (platform == Common::kPlatformWindows)
? Common::kWindows1252
: Common::kMacRoman;
Commit: 95b47042f04f91d711287540df54fd16df1d8cdc
https://github.com/scummvm/scummvm/commit/95b47042f04f91d711287540df54fd16df1d8cdc
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
GRAPHICS: MACGUI: Stop MacTextCanvas::chopChunk from removing last chunk
There needs to be at least one chunk per line of text, or else many
basic text operations will cause a crash.
Changed paths:
graphics/macgui/mactext-canvas.cpp
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext-canvas.cpp b/graphics/macgui/mactext-canvas.cpp
index ccbad5ad7ff..27ebff61ac4 100644
--- a/graphics/macgui/mactext-canvas.cpp
+++ b/graphics/macgui/mactext-canvas.cpp
@@ -60,7 +60,7 @@ void MacTextCanvas::chopChunk(const Common::U32String &str, int *curLinePtr, int
// Check if there is nothing to add, then remove the last chunk
// This happens when the previous run is finished only with
// empty formatting, or when we were adding text for the first time
- if (chunk->text.empty() && str.empty()) {
+ if (chunk->text.empty() && str.empty() && (_text[curLine].chunks.size() > 1)) {
D(9, "** chopChunk, replaced formatting, line %d", curLine);
_text[curLine].chunks.pop_back();
@@ -1109,7 +1109,7 @@ void MacTextCanvas::reshuffleParagraph(int *row, int *col, MacFontRun &defaultFo
bool paragraphEnd = _text[end].paragraphEnd;
#if DEBUG
- D(9, "MacTextCanvas::reshuffleParagraph: ppos: %d", ppos);
+ D(9, "MacTextCanvas::reshuffleParagraph: ppos: %d, start: %d, end: %d", ppos, start, end);
debugPrint("MacTextCanvas::reshuffleParagraph(1)");
#endif
@@ -1168,8 +1168,14 @@ void MacTextCanvas::reshuffleParagraph(int *row, int *col, MacFontRun &defaultFo
#if DEBUG
debugPrint("MacTextCanvas::reshuffleParagraph(3)");
+ D(9, "Chunks: ");
+ for (auto &ch : _text[curLine].chunks)
+ ch.debugPrint();
+
+ D(9, "");
#endif
+
// Restore the paragraph marker
_text[curLine].paragraphEnd = paragraphEnd;
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index ddf59b8c41c..a81ec16bef4 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1850,6 +1850,13 @@ void MacText::deletePreviousCharInternal(int *row, int *col) {
*col = _canvas.getLineCharWidth(*row - 1);
(*row)--;
+#if DEBUG
+ D(9, "MacText::deletePreviousCharInternal: Chunks: ");
+ for (auto &ch : _canvas._text[*row].chunks)
+ ch.debugPrint();
+
+ D(9, "");
+#endif
// formatting matches, glue texts as normal
if (_canvas._text[*row].lastChunk().equals(_canvas._text[*row + 1].firstChunk())) {
_canvas._text[*row].lastChunk().text += _canvas._text[*row + 1].firstChunk().text;
@@ -1911,6 +1918,15 @@ void MacText::addNewLine(int *row, int *col) {
MacTextLine *line = &_canvas._text[*row];
int pos = *col;
uint ch = line->getChunkNum(&pos);
+
+#if DEBUG
+ D(9, "MacText::addNewLine: Chunks: ");
+ for (auto &c : line->chunks)
+ c.debugPrint();
+
+ D(9, "");
+#endif
+
MacFontRun newchunk = line->chunks[ch];
MacTextLine newline;
Commit: 0562ff567ce18348cc05175f5a72cf6d038c1704
https://github.com/scummvm/scummvm/commit/0562ff567ce18348cc05175f5a72cf6d038c1704
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
GRAPHICS: MACGUI: Move paragraph end marker when merging rows
Fixes issue where removing an empty line with backspace would remove the
previous empty line also.
Changed paths:
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index a81ec16bef4..c9a74690bd2 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1866,7 +1866,7 @@ void MacText::deletePreviousCharInternal(int *row, int *col) {
_canvas._text[*row].chunks.push_back(MacFontRun(_canvas._text[*row + 1].firstChunk()));
_canvas._text[*row].firstChunk().text.clear();
}
- _canvas._text[*row].paragraphEnd = false;
+ _canvas._text[*row].paragraphEnd = _canvas._text[*row + 1].paragraphEnd;
for (uint i = 1; i < _canvas._text[*row + 1].chunks.size(); i++)
_canvas._text[*row].chunks.push_back(MacFontRun(_canvas._text[*row + 1].chunks[i]));
Commit: 75dd224cf040c14431779664ad08e48b67539cb1
https://github.com/scummvm/scummvm/commit/75dd224cf040c14431779664ad08e48b67539cb1
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: Clean up event debug messages
Changed paths:
engines/director/events.cpp
engines/director/window.cpp
diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index dc1215a874e..fb6416b2655 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -41,9 +41,9 @@ namespace Director {
uint32 DirectorEngine::getMacTicks() { return (g_system->getMillis() * 60 / 1000.) - _tickBaseline; }
bool DirectorEngine::processEvents(bool captureClick) {
- debugC(3, kDebugEvents, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
- debugC(3, kDebugEvents, "@@@@ Processing events");
- debugC(3, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+ debugC(5, kDebugEvents, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ debugC(5, kDebugEvents, "@@@@ Processing events");
+ debugC(5, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
@@ -214,7 +214,7 @@ bool Movie::processEvent(Common::Event &event) {
if (_timeOutMouse)
_lastTimeOut = _lastEventTime;
- debugC(3, kDebugEvents, "event: Button Down @(%d, %d), movie '%s', sprite id: %d", pos.x, pos.y, _macName.c_str(), spriteId);
+ debugC(3, kDebugEvents, "Movie::processEvent(): Button Down @(%d, %d), movie '%s', sprite id: %d", pos.x, pos.y, _macName.c_str(), spriteId);
queueUserEvent(kEventMouseDown, spriteId);
if (sc->_channels[spriteId]->_sprite->_moveable) {
@@ -241,7 +241,7 @@ bool Movie::processEvent(Common::Event &event) {
g_director->_wm->_hilitingWidget = false;
- debugC(3, kDebugEvents, "event: Button Up @(%d, %d), movie '%s', sprite id: %d", pos.x, pos.y, _macName.c_str(), spriteId);
+ debugC(3, kDebugEvents, "Movie::processEvent(): Button Up @(%d, %d), movie '%s', sprite id: %d", pos.x, pos.y, _macName.c_str(), spriteId);
_currentDraggedChannel = nullptr;
@@ -268,7 +268,7 @@ bool Movie::processEvent(Common::Event &event) {
_key = (unsigned char)(event.kbd.ascii & 0xff);
_keyFlags = event.kbd.flags;
- debugC(1, kDebugEvents, "processEvents(): movie '%s', keycode: %d", _macName.c_str(), _keyCode);
+ debugC(1, kDebugEvents, "Movie::processEvent(): movie '%s', keycode: %d", _macName.c_str(), _keyCode);
_lastEventTime = g_director->getMacTicks();
_lastKeyTime = _lastEventTime;
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index e0954e71c6a..abebd3d9793 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -457,9 +457,9 @@ bool Window::loadNextMovie() {
bool Window::step() {
// finish last movie
if (_currentMovie && _currentMovie->getScore()->_playState == kPlayStopped) {
- debugC(3, kDebugEvents, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
- debugC(3, kDebugEvents, "@@@@ Finishing movie '%s' in '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
- debugC(3, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+ debugC(5, kDebugEvents, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ debugC(5, kDebugEvents, "@@@@ Finishing movie '%s' in '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
+ debugC(5, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
_currentMovie->getScore()->stopPlay();
debugC(1, kDebugEvents, "Finished playback of movie '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str());
@@ -517,9 +517,9 @@ bool Window::step() {
}
// fall through
case kPlayStarted:
- debugC(3, kDebugEvents, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
- debugC(3, kDebugEvents, "@@@@ Stepping movie '%s' in '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
- debugC(3, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+ debugC(5, kDebugEvents, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ debugC(5, kDebugEvents, "@@@@ Stepping movie '%s' in '%s'", utf8ToPrintable(_currentMovie->getMacName()).c_str(), _currentPath.c_str());
+ debugC(5, kDebugEvents, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
_currentMovie->getScore()->step();
return true;
default:
Commit: c9d1583f17cbdb2a6c921053b03634633c0a2e7c
https://github.com/scummvm/scummvm/commit/c9d1583f17cbdb2a6c921053b03634633c0a2e7c
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: Fix TextCastMember::setRawText for editable fields
Fixes pressing enter on the password entry screen in Cosmology of Kyoto.
Changed paths:
engines/director/castmember/text.cpp
diff --git a/engines/director/castmember/text.cpp b/engines/director/castmember/text.cpp
index 8879e9f16d7..34051f035b1 100644
--- a/engines/director/castmember/text.cpp
+++ b/engines/director/castmember/text.cpp
@@ -345,7 +345,7 @@ void TextCastMember::importRTE(byte *text) {
void TextCastMember::setRawText(const Common::String &text) {
// Do nothing if text did not change
- if (_rtext.equals(text))
+ if (_ptext.equals(Common::U32String(text)))
return;
_rtext = text;
Commit: 331df0a138fff525b5084776c372bd2868f340d9
https://github.com/scummvm/scummvm/commit/331df0a138fff525b5084776c372bd2868f340d9
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DIRECTOR: Adjust freezing logic in func_goto
- GADGET: Invention Travel and Adventure (D3) has a race condition
where the intro movie won't transition to the title screen if the script
doesn't freeze on frame change.
- Cosmology of Kyoto (D4) has a race condition where the restore game
password screen won't allow a second attempt if the script freezes on
frame change.
>From testing, it would seem that D4 doesn't do a script freeze on a "go
to frame" command. Both D3 and D4 do a script freeze if the target is a
different movie.
Changed paths:
engines/director/lingo/lingo-funcs.cpp
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index d748084a3db..e56006e1f09 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -53,11 +53,11 @@ void Lingo::func_goto(Datum &frame, Datum &movie, bool calledfromgo) {
_vm->_skipFrameAdvance = true;
- // If there isn't already frozen Lingo (e.g. from a previous func_goto we haven't yet unfrozen),
- // freeze this script context. We'll return to it after entering the next frame.
- g_lingo->_freezeState = true;
if (movie.type != VOID) {
+ // If there isn't already frozen Lingo (e.g. from a previous func_goto we haven't yet unfrozen),
+ // freeze this script context. We'll return to it after entering the next movie.
+ g_lingo->_freezeState = true;
Common::String movieFilenameRaw = movie.asString();
if (!stage->setNextMovie(movieFilenameRaw))
@@ -95,6 +95,11 @@ void Lingo::func_goto(Datum &frame, Datum &movie, bool calledfromgo) {
return;
}
+ if (g_director->getVersion() < 400)
+ // If there isn't already frozen Lingo (e.g. from a previous func_goto we haven't yet unfrozen),
+ // freeze this script context. We'll return to it after entering the next frame.
+ g_lingo->_freezeState = true;
+
if (frame.type == STRING) {
debugC(3, kDebugLingoExec, "Lingo::func_goto(): going to frame \"%s\"", frame.u.s->c_str());
score->setStartToLabel(*frame.u.s);
Commit: d09571b1d90f065418320e8b8077b2590ac23fb4
https://github.com/scummvm/scummvm/commit/d09571b1d90f065418320e8b8077b2590ac23fb4
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-20T23:14:52+01:00
Commit Message:
DEVTOOLS: Fix director-generate-xobj-stub to not print method table for XFCN/XCMD
Changed paths:
devtools/director-generate-xobj-stub.py
diff --git a/devtools/director-generate-xobj-stub.py b/devtools/director-generate-xobj-stub.py
index 46d83e6fe2c..c2c855e97ea 100755
--- a/devtools/director-generate-xobj-stub.py
+++ b/devtools/director-generate-xobj-stub.py
@@ -403,8 +403,6 @@ def extract_xcode_macbinary(
for id, data in xobj.items():
print(f"{id} - {data['name']}")
raise ValueError("Need to specify resource ID")
- for entry in xobj[xobj_id]["xmethtable"]:
- print(entry)
type: XCodeType = (
"XFCN"
if xobj_id.startswith("XFCN_")
@@ -412,6 +410,9 @@ def extract_xcode_macbinary(
if xobj_id.startswith("XCMD_")
else "XObject"
)
+ if type == "XObject":
+ for entry in xobj[xobj_id]["xmethtable"]:
+ print(entry)
slug = xobj[xobj_id]["name"].lower()
if type in ["XFCN", "XCMD"]:
slug += type.lower()
More information about the Scummvm-git-logs
mailing list