[Scummvm-git-logs] scummvm master -> c5f3e126165815c67c2fba1f7c9cc0faa84a4384

sev- sev at scummvm.org
Fri Oct 4 19:10:16 CEST 2019


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:
93e8109cdf GRAPHICS: MACGUI: Add possibility to pass borders as a surface
c5f3e12616 PINK: Add built-in empty border and use for texts


Commit: 93e8109cdfd37a5e5cc55eeba4d0e9aa9dcefca2
    https://github.com/scummvm/scummvm/commit/93e8109cdfd37a5e5cc55eeba4d0e9aa9dcefca2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-10-04T19:10:03+02:00

Commit Message:
GRAPHICS: MACGUI: Add possibility to pass borders as a surface

Changed paths:
    graphics/macgui/macwindow.cpp
    graphics/macgui/macwindow.h


diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index f41378b..e100820 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -336,6 +336,14 @@ void MacWindow::loadBorder(Common::SeekableReadStream &file, bool active, int lo
 
 	surface->create(source->w, source->h, surface->getSupportedPixelFormat());
 	surface->copyFrom(*source);
+
+	source->free();
+	delete source;
+
+	setBorder(surface, active, lo, ro, to, bo);
+}
+
+void MacWindow::setBorder(Graphics::TransparentSurface *surface, bool active, int lo, int ro, int to, int bo) {
 	surface->applyColorKey(255, 0, 255, false);
 
 	if (active)
@@ -350,8 +358,6 @@ void MacWindow::loadBorder(Common::SeekableReadStream &file, bool active, int lo
 	}
 
 	updateInnerDims();
-	source->free();
-	delete source;
 }
 
 void MacWindow::setCloseable(bool closeable) {
diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h
index fdf750c..94d6e94 100644
--- a/graphics/macgui/macwindow.h
+++ b/graphics/macgui/macwindow.h
@@ -277,7 +277,7 @@ public:
 	 * @param bo Width of the bottom side of the border, in pixels.
 	 */
 	void loadBorder(Common::SeekableReadStream &file, bool active, int lo = -1, int ro = -1, int to = -1, int bo = -1);
-	//void setBorder(TransparentSurface &border, bool active);
+	void setBorder(TransparentSurface *border, bool active, int lo = -1, int ro = -1, int to = -1, int bo = -1);
 
 	/**
 	 * Indicate whether the window can be closed (false by default).


Commit: c5f3e126165815c67c2fba1f7c9cc0faa84a4384
    https://github.com/scummvm/scummvm/commit/c5f3e126165815c67c2fba1f7c9cc0faa84a4384
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-10-04T19:10:03+02:00

Commit Message:
PINK: Add built-in empty border and use for texts

Changed paths:
    engines/pink/objects/actions/action_text.cpp


diff --git a/engines/pink/objects/actions/action_text.cpp b/engines/pink/objects/actions/action_text.cpp
index 0b2e886..2010380 100644
--- a/engines/pink/objects/actions/action_text.cpp
+++ b/engines/pink/objects/actions/action_text.cpp
@@ -23,6 +23,8 @@
 #include "common/debug.h"
 #include "common/substream.h"
 
+#include "graphics/transparent_surface.h"
+
 #include "pink/archive.h"
 #include "pink/director.h"
 #include "pink/pink.h"
@@ -73,6 +75,12 @@ void ActionText::toConsole() {
 		  _name.c_str(), _fileName.c_str(), _xLeft, _yTop, _xRight, _yBottom, _centered, _scrollBar, _textRGB, _backgroundRGB);
 }
 
+static const byte noborderData[3][3] = {
+	{ 0, 1, 0 },
+	{ 1, 0, 1 },
+	{ 0, 1, 0 },
+};
+
 void ActionText::start() {
 	findColorsInPalette();
 	Director *director = _actor->getPage()->getGame()->getDirector();
@@ -90,19 +98,16 @@ void ActionText::start() {
 		_txtWnd->move(_xLeft, _yTop);
 		_txtWnd->resize(_xRight - _xLeft, _yBottom - _yTop);
 
-		Common::File f;
+		Graphics::TransparentSurface *noborder = new Graphics::TransparentSurface();
+		noborder->create(3, 3, noborder->getSupportedPixelFormat());
+		uint32 colorBlack = noborder->getSupportedPixelFormat().RGBToColor(0, 0, 0);
+		uint32 colorPink = noborder->getSupportedPixelFormat().RGBToColor(255, 0, 255);
 
-		f.open("ScrollbarOnlyWin95active.bmp");
-		if (f.isOpen()) {
-			_txtWnd->loadBorder(f, true);
-			f.close();
-		}
+		for (int y = 0; y < 4; y++)
+			for (int x = 0; x < 4; x++)
+				*((uint32 *)noborder->getBasePtr(x, y)) = noborderData[y][x] ? colorBlack : colorPink;
 
-		f.open("ScrollbarOnlyWin95inactive.bmp");
-		if (f.isOpen()) {
-			_txtWnd->loadBorder(f, false);
-			f.close();
-		}
+		_txtWnd->setBorder(noborder, true);
 
 		if (_actor->getPage()->getGame()->getLanguage() == Common::EN_ANY)
 			_txtWnd->appendText(str, font);





More information about the Scummvm-git-logs mailing list