[Scummvm-git-logs] scummvm master -> 1352ab6f9f900f87fdee4e75b690d99489c313f0

djsrv dservilla at gmail.com
Fri Aug 7 17:48:30 UTC 2020


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

Summary:
8bc5e73d0a DIRECTOR: LINGO: Properly implement titleVisible
1352ab6f9f GRAPHICS: MACGUI: Don't draw title on thin border


Commit: 8bc5e73d0ac106023b1ae68b43bf14bf07744e0d
    https://github.com/scummvm/scummvm/commit/8bc5e73d0ac106023b1ae68b43bf14bf07744e0d
Author: djsrv (dservilla at gmail.com)
Date: 2020-08-07T13:40:52-04:00

Commit Message:
DIRECTOR: LINGO: Properly implement titleVisible

Changed paths:
    engines/director/window.cpp
    engines/director/window.h
    graphics/macgui/macwindow.cpp
    graphics/macgui/macwindow.h


diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index 4490129226..09ded6933c 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -57,7 +57,9 @@ Window::Window(int id, bool scrollable, bool resizable, bool editable, Graphics:
 	_objType = kWindowObj;
 	_startFrame = _vm->getStartMovie().startFrame;
 
-	setWindowType(0);
+	_windowType = 0;
+	_titleVisible = true;
+	updateBorderType();
 }
 
 Window::~Window() {
@@ -397,6 +399,8 @@ bool Window::setNextMovie(Common::String &movieFilenameRaw) {
 void Window::updateBorderType() {
 	if (_isStage) {
 		setBorderType(3);
+	} else if (!_titleVisible) {
+		setBorderType(2);
 	} else {
 		setBorderType(MAX(0, MIN(_windowType, 16)));
 	}
diff --git a/engines/director/window.h b/engines/director/window.h
index 525912b4b9..2c1e78ee67 100644
--- a/engines/director/window.h
+++ b/engines/director/window.h
@@ -124,6 +124,8 @@ class Window : public Graphics::MacWindow, public Object<Window> {
 
 	void setWindowType(int type) { _windowType = type; updateBorderType(); }
 	int getWindowType() const { return _windowType; }
+	void setTitleVisible(bool titleVisible) { _titleVisible = titleVisible; updateBorderType(); };
+	bool isTitleVisible() { return _titleVisible; };
 
 	void updateBorderType();
 
@@ -182,6 +184,7 @@ private:
 	int16 _startFrame;
 
 	int _windowType;
+	bool _titleVisible;
 
 private:
 	int preprocessColor(DirectorPlotData *p, int src);
diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index 2b5e3217fc..67dac6151d 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -69,8 +69,6 @@ MacWindow::MacWindow(int id, bool scrollable, bool resizable, bool editable, Mac
 
 	_borderType = -1;
 	_borderWidth = kBorderWidth;
-
-	_titleVisible = true;
 }
 
 static const byte noborderData[3][3] = {
@@ -270,7 +268,7 @@ void MacWindow::drawBorder() {
 		sidesWidth = _borderWidth * 2;
 	}
 
-	if (_titleVisible && !_title.empty()) {
+	if (!_title.empty()) {
 		const Graphics::Font *font = getTitleFont();
 		int yOff = _wm->_fontMan->hasBuiltInFonts() ? 3 : 1;
 
diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h
index dbf7ee90b3..ac9dfe779f 100644
--- a/graphics/macgui/macwindow.h
+++ b/graphics/macgui/macwindow.h
@@ -249,16 +249,6 @@ public:
 	 * @return Title.
 	 */
 	Common::String getTitle() { return _title; };
-	/**
-	 * Mutator to change the visible state of the title.
-	 * @param active Target state.
-	 */
-	void setTitleVisible(bool titleVisible) { _titleVisible = titleVisible; _borderIsDirty = true; };
-	/**
-	 * Accessor to determine whether the title is visible.
-	 * @return True if the title is visible.
-	 */
-	bool isTitleVisible() { return _titleVisible; };
 
 	/**
 	 * Highlight the target part of the window.
@@ -357,7 +347,6 @@ private:
 	float _scrollPos, _scrollSize;
 
 	Common::String _title;
-	bool _titleVisible;
 
 	int _borderType;
 };


Commit: 1352ab6f9f900f87fdee4e75b690d99489c313f0
    https://github.com/scummvm/scummvm/commit/1352ab6f9f900f87fdee4e75b690d99489c313f0
Author: djsrv (dservilla at gmail.com)
Date: 2020-08-07T13:45:55-04:00

Commit Message:
GRAPHICS: MACGUI: Don't draw title on thin border

Changed paths:
    graphics/macgui/macwindow.cpp


diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index 67dac6151d..fec3bc30c3 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -256,6 +256,10 @@ void MacWindow::drawBorder() {
 
 	if (_macBorder.hasBorder(_active)) {
 		drawBorderFromSurface(g);
+
+		if (_macBorder.getOffset().titleTop == -1 && _macBorder.getOffset().titleBottom == -1)
+			return;
+
 		titleColor = _macBorder.getOffset().dark ? _wm->_colorWhite : _wm->_colorBlack;
 		titleY = _macBorder.getOffset().titleTop;
 		titleHeight = _macBorder.getOffset().top - titleY - _macBorder.getOffset().titleBottom;




More information about the Scummvm-git-logs mailing list