[Scummvm-git-logs] scummvm master -> 8558276dd9232c63acc2bf07d3e70c6c2b3d1a98
sev-
noreply at scummvm.org
Tue Mar 22 11:27:19 UTC 2022
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:
8558276dd9 DIRECTOR: additional RearWindow methods
Commit: 8558276dd9232c63acc2bf07d3e70c6c2b3d1a98
https://github.com/scummvm/scummvm/commit/8558276dd9232c63acc2bf07d3e70c6c2b3d1a98
Author: Misty De Meo (mistydemeo at gmail.com)
Date: 2022-03-22T12:27:13+01:00
Commit Message:
DIRECTOR: additional RearWindow methods
Changed paths:
engines/director/lingo/xlibs/winxobj.cpp
engines/director/lingo/xlibs/winxobj.h
graphics/macgui/macwindowmanager.cpp
graphics/macgui/macwindowmanager.h
diff --git a/engines/director/lingo/xlibs/winxobj.cpp b/engines/director/lingo/xlibs/winxobj.cpp
index 1f09582edb2..a9fa379b45a 100644
--- a/engines/director/lingo/xlibs/winxobj.cpp
+++ b/engines/director/lingo/xlibs/winxobj.cpp
@@ -229,6 +229,10 @@ static MethodProto xlibMethods[] = {
{ "PatToWindow", RearWindowXObj::m_patToWindow, 1, 1, 400 }, // D4
{ "IndexColorToWindow", RearWindowXObj::m_indexColorToWindow, 1, 1, 400 }, // D4
{ "RGBColorToWindow", RearWindowXObj::m_rgbColorToWindow, 3, 3, 400 }, // D4
+ { "GetScreenTop", RearWindowXObj::m_getScreenTop, 0, 0, 400 }, // D4
+ { "GetScreenLeft", RearWindowXObj::m_getScreenLeft, 0, 0, 400 }, // D4
+ { "GetScreenBottom", RearWindowXObj::m_getScreenBottom, 0, 0, 400 }, // D4
+ { "GetScreenRight", RearWindowXObj::m_getScreenRight, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
@@ -279,4 +283,20 @@ void RearWindowXObj::m_rgbColorToWindow(int nargs) {
window->setDesktopColor(r.asInt(), g.asInt(), b.asInt());
}
+void RearWindowXObj::m_getScreenTop(int nargs) {
+ g_lingo->push(Datum(0));
+}
+
+void RearWindowXObj::m_getScreenLeft(int nargs) {
+ g_lingo->push(Datum(0));
+}
+
+void RearWindowXObj::m_getScreenBottom(int nargs) {
+ g_lingo->push(Datum(g_director->getMacWindowManager()->getHeight()));
+}
+
+void RearWindowXObj::m_getScreenRight(int nargs) {
+ g_lingo->push(Datum(g_director->getMacWindowManager()->getWidth()));
+}
+
} // End of namespace Director
diff --git a/engines/director/lingo/xlibs/winxobj.h b/engines/director/lingo/xlibs/winxobj.h
index 08f2103b14b..4baebe1e287 100644
--- a/engines/director/lingo/xlibs/winxobj.h
+++ b/engines/director/lingo/xlibs/winxobj.h
@@ -43,6 +43,10 @@ void m_getMemoryNeeded(int nargs);
void m_patToWindow(int nargs);
void m_indexColorToWindow(int nargs);
void m_rgbColorToWindow(int nargs);
+void m_getScreenTop(int nargs);
+void m_getScreenLeft(int nargs);
+void m_getScreenBottom(int nargs);
+void m_getScreenRight(int nargs);
} // End of namespace RearWindowXObj
diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp
index b60192631f0..8502b511f98 100644
--- a/graphics/macgui/macwindowmanager.cpp
+++ b/graphics/macgui/macwindowmanager.cpp
@@ -275,6 +275,14 @@ void MacWindowManager::setScreen(int w, int h) {
drawDesktop();
}
+int MacWindowManager::getWidth() {
+ return _screenDims.width();
+}
+
+int MacWindowManager::getHeight() {
+ return _screenDims.height();
+}
+
void MacWindowManager::resizeScreen(int w, int h) {
if (!_screen)
error("MacWindowManager::resizeScreen(): Trying to creating surface on non-existing screen");
diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h
index 2b96967f6c6..47ff0ef1cc1 100644
--- a/graphics/macgui/macwindowmanager.h
+++ b/graphics/macgui/macwindowmanager.h
@@ -161,6 +161,10 @@ public:
*/
void setScreen(int w, int h);
+ int getWidth();
+
+ int getHeight();
+
/**
* Create a window with the given parameters.
* Note that this method allocates the necessary memory for the window.
More information about the Scummvm-git-logs
mailing list