[Scummvm-git-logs] scummvm master -> 0bde66b86486ecda9f7dd387196c7b29d80cfb97

sev- noreply at scummvm.org
Sat Jul 8 19:15:45 UTC 2023


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

Summary:
0bde66b864 DIRECTOR: Implement `fileName of window` property


Commit: 0bde66b86486ecda9f7dd387196c7b29d80cfb97
    https://github.com/scummvm/scummvm/commit/0bde66b86486ecda9f7dd387196c7b29d80cfb97
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-07-08T22:15:42+03:00

Commit Message:
DIRECTOR: Implement `fileName of window` property

Normally Director will look for a movie of the same name as the window,
however with `the fileName` property, it can assign name of movie to be
played in the window.

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 fd4b3e97087..fd1988b7fca 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -605,6 +605,8 @@ Datum Window::getField(int field) {
 		return getStageRect();
 	case kTheModal:
 		return getModal();
+	case kTheFileName:
+		return getFileName();
 	default:
 		warning("Window::getField: unhandled field '%s'", g_lingo->field2str(field));
 		return Datum();
@@ -630,6 +632,9 @@ bool Window::setField(int field, const Datum &value) {
 	case kTheModal:
 		setModal((bool)value.asInt());
 		return true;
+	case kTheFileName:
+		setFileName(value.asString());
+		return true;
 	default:
 		warning("Window::setField: unhandled field '%s'", g_lingo->field2str(field));
 		return false;
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index 720e69fa4e2..612bcc4bbba 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -268,6 +268,12 @@ void Window::setModal(bool modal) {
 	setVisible(true); // Activate this window on top
 }
 
+void Window::setFileName(Common::String filename) {
+	setNextMovie(filename);
+
+	setVisible(true); // Activate this window on top
+}
+
 void Window::reset() {
 	resizeInner(_composeSurface->w, _composeSurface->h);
 	_contentIsDirty = true;
diff --git a/engines/director/window.h b/engines/director/window.h
index b704fe99f21..a22dd256a3b 100644
--- a/engines/director/window.h
+++ b/engines/director/window.h
@@ -144,6 +144,8 @@ public:
 	bool setStageRect(Datum datum);
 	void setModal(bool modal);
 	bool getModal() { return _isModal; };
+	void setFileName(Common::String filename);
+	Common::String getFileName() { return getName(); }
 
 	void updateBorderType();
 




More information about the Scummvm-git-logs mailing list