[Scummvm-git-logs] scummvm master -> 3382e493386724218b5ce33f10608fe555a66021

rvanlaar noreply at scummvm.org
Sun Apr 3 10:12:47 UTC 2022


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
db006fac21 DIRECTOR: Add debug option lingostrict
c342819a60 DIRECTOR: LINGO: Implement the rect of the stage
3382e49338 DIRECTOR: LINGO: clearify unknown V4 the entities


Commit: db006fac216bf14822ddf3e03407ec049815cd60
    https://github.com/scummvm/scummvm/commit/db006fac216bf14822ddf3e03407ec049815cd60
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-04-03T11:57:35+02:00

Commit Message:
DIRECTOR: Add debug option lingostrict

`--debugflags=lingostrict` drops into the debugger when hitting a Lingo error.

When encountering a lingo error the current lingo script execution will
stop but the engine continues as much as possible. This is great when
trying to run a game in the best possible way. It's not so great when
debugging issues, since it leaves the game in an unknown state.

The `lingostrict` option makes it clear where a lingo error occurs.

Changed paths:
    engines/director/detection.cpp
    engines/director/director.h
    engines/director/lingo/lingo.cpp


diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp
index 83bb05439e9..4fc08ec9a85 100644
--- a/engines/director/detection.cpp
+++ b/engines/director/detection.cpp
@@ -57,6 +57,7 @@ static const DebugChannelDef debugFlagList[] = {
 	{Director::kDebugFewFramesOnly, "fewframesonly", "Only run the first 10 frames"},
 	{Director::kDebugImages, "images", "Image drawing"},
 	{Director::kDebugLingoExec, "lingoexec", "Lingo Execution"},
+	{Director::kDebugLingoStrict, "lingostrict", "Drop into debugger on Lingo error"},
 	{Director::kDebugLoading, "loading", "Loading"},
 	{Director::kDebugNoBytecode, "nobytecode", "Do not execute Lscr bytecode"},
 	{Director::kDebugNoLoop, "noloop", "Do not loop the playback"},
diff --git a/engines/director/director.h b/engines/director/director.h
index 333f562680f..369015d3a79 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -84,7 +84,8 @@ enum {
 	kDebugScreenshot	= 1 << 14,
 	kDebugDesktop		= 1 << 15,
 	kDebug32bpp			= 1 << 16,
-	kDebugEndVideo		= 1 << 17
+	kDebugEndVideo		= 1 << 17,
+	kDebugLingoStrict	= 1 << 18
 };
 
 struct MovieReference {
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index d68590c7480..0f25c8d1691 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -528,6 +528,9 @@ void Lingo::lingoError(const char *s, ...) {
 		_caughtError = true;
 	} else {
 		warning("BUILDBOT: Uncaught Lingo error: %s", buf);
+		if (debugChannelSet(-1, kDebugLingoStrict)) {
+			error("Uncaught Lingo error");
+		}
 		_abort = true;
 	}
 }


Commit: c342819a6064b3ab2e5ad42a4858f121eddf13b2
    https://github.com/scummvm/scummvm/commit/c342819a6064b3ab2e5ad42a4858f121eddf13b2
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-04-03T12:05:30+02:00

Commit Message:
DIRECTOR: LINGO: Implement the rect of the stage

The rect of stage returns the values of the stage rect.

Changed paths:
    engines/director/lingo/lingo-object.cpp
    engines/director/window.cpp
    engines/director/window.h


diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 2338ab0d4e2..3c3a5aec555 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -480,6 +480,7 @@ bool Window::hasField(int field) {
 	case kTheDrawRect:
 	case kTheFileName:
 	case kTheModal:
+	case kTheRect:
 	case kTheSourceRect:
 	case kTheTitle:
 	case kTheTitleVisible:
@@ -502,6 +503,9 @@ Datum Window::getField(int field) {
 		return isVisible();
 	case kTheWindowType:
 		return getWindowType();
+	case kTheRect:
+		return getStageRect();
+
 	default:
 		warning("Window::getField: unhandled field '%s'", g_lingo->field2str(field));
 		return Datum();
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index a91d29a1571..bc7a864d6ca 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -189,6 +189,18 @@ void Window::setStageColor(uint32 stageColor, bool forceReset) {
 	}
 }
 
+Datum Window::getStageRect() {
+	Graphics::ManagedSurface *surface = getSurface();
+	Datum d;
+	d.type = RECT;
+	d.u.farr = new FArray;
+	d.u.farr->arr.push_back(0);
+	d.u.farr->arr.push_back(0);
+	d.u.farr->arr.push_back(surface->w);
+	d.u.farr->arr.push_back(surface->h);
+	return d;
+}
+
 void Window::reset() {
 	resize(_composeSurface->w, _composeSurface->h, true);
 	_composeSurface->clear(_stageColor);
diff --git a/engines/director/window.h b/engines/director/window.h
index 59d4ab89d71..bc93580c987 100644
--- a/engines/director/window.h
+++ b/engines/director/window.h
@@ -123,6 +123,7 @@ public:
 	int getWindowType() const { return _windowType; }
 	void setTitleVisible(bool titleVisible) { _titleVisible = titleVisible; updateBorderType(); };
 	bool isTitleVisible() { return _titleVisible; };
+	Datum getStageRect();
 
 	void updateBorderType();
 


Commit: 3382e493386724218b5ce33f10608fe555a66021
    https://github.com/scummvm/scummvm/commit/3382e493386724218b5ce33f10608fe555a66021
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-04-03T12:08:59+02:00

Commit Message:
DIRECTOR: LINGO: clearify unknown V4 the entities

The comments are the names taken from Projectorrays.

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 f459f2eaf1e..11b0fa5d9d2 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -220,10 +220,10 @@ static LingoV4TheEntity lingoV4TheEntity[] = {
 	{ 0x07, 0x0a, kTheFullColorPermit,	kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x0b, kTheImageDirect,		kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x0c, kTheDoubleClick,		kTheNOField,		true, kTEANOArgs },
-//	{ 0x07, 0x0d, ???,					kTheNOField,		true, kTEANOArgs },
+//	{ 0x07, 0x0d, ???,					kTheNOField,		true, kTEANOArgs }, // key
 	{ 0x07, 0x0e, kTheLastClick,		kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x0f, kTheLastEvent,		kTheNOField,		true, kTEANOArgs },
-//	{ 0x07, 0x10, ???,					kTheNOField,		true, kTEANOArgs },
+//	{ 0x07, 0x10, ???,					kTheNOField,		true, kTEANOArgs }, // keyCode
 	{ 0x07, 0x11, kTheLastKey,			kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x12, kTheLastRoll,			kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x13, kTheTimeoutLapsed,	kTheNOField,		true, kTEANOArgs },
@@ -235,7 +235,7 @@ static LingoV4TheEntity lingoV4TheEntity[] = {
 	{ 0x07, 0x19, kTheSoundEnabled,		kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x1a, kTheSoundLevel,		kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x1b, kTheStageColor,		kTheNOField,		true, kTEANOArgs },
-//	{ 0x07, 0x1c, ????,					kTheNOField,		true, kTEANOArgs },
+//	{ 0x07, 0x1c, ????,					kTheNOField,		true, kTEANOArgs }, // indicates dontPassEvent was called
 	{ 0x07, 0x1d, kTheSwitchColorDepth,	kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x1e, kTheTimeoutKeyDown,	kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x1f, kTheTimeoutLength,	kTheNOField,		true, kTEANOArgs },




More information about the Scummvm-git-logs mailing list