[Scummvm-git-logs] scummvm master -> 5b25531e96827967c58f26f1aa5f5a3c98a44113

sev- sev at scummvm.org
Sun Oct 20 17:09:41 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:
694ed6e7bc GRAPHICS: MACGUI: Added possibility to render MacText at any desired place
5b25531e96 PINK: Fix text drawing, use absolute coordinates


Commit: 694ed6e7bc2638e0bef340369feb5f2715085e6d
    https://github.com/scummvm/scummvm/commit/694ed6e7bc2638e0bef340369feb5f2715085e6d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-10-20T20:09:28+05:00

Commit Message:
GRAPHICS: MACGUI: Added possibility to render MacText at any desired place

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


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 6dfdee3..9a5de39 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -401,6 +401,29 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int
 										Common::Point(xoff, yoff));
 }
 
+void MacText::drawToPoint(ManagedSurface *g, Common::Rect srcRect, Common::Point dstPoint) {
+	if (_textLines.empty())
+		return;
+
+	render();
+
+	srcRect.clip(_surface->getBounds());
+
+	if (srcRect.isEmpty())
+		return;
+
+	g->blitFrom(*_surface, srcRect, dstPoint);
+}
+
+void MacText::drawToPoint(ManagedSurface *g, Common::Point dstPoint) {
+	if (_textLines.empty())
+		return;
+
+	render();
+
+	g->blitFrom(*_surface, dstPoint);
+}
+
 // Count newline characters in String
 uint getNewlinesInString(const Common::U32String &str) {
 	Common::U32String::const_iterator p = str.begin();
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index e66a394..a9528c2 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -104,6 +104,8 @@ public:
 			}
 
 	void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff);
+	void drawToPoint(ManagedSurface *g, Common::Rect srcRect, Common::Point dstPoint);
+	void drawToPoint(ManagedSurface *g, Common::Point dstPoint);
 	void appendText(Common::U32String str, int fontId = kMacFontChicago, int fontSize = 12, int fontSlant = kMacFontRegular, bool skipAdd = false);
 	void appendText(const Common::String &str, int fontId = kMacFontChicago, int fontSize = 12, int fontSlant = kMacFontRegular, bool skipAdd = false);
 	void appendTextDefault(Common::U32String str, bool skipAdd = false);


Commit: 5b25531e96827967c58f26f1aa5f5a3c98a44113
    https://github.com/scummvm/scummvm/commit/5b25531e96827967c58f26f1aa5f5a3c98a44113
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-10-20T20:09:28+05:00

Commit Message:
PINK: Fix text drawing, use absolute coordinates

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 70aef5b..448756b 100644
--- a/engines/pink/objects/actions/action_text.cpp
+++ b/engines/pink/objects/actions/action_text.cpp
@@ -153,7 +153,7 @@ void ActionText::draw(Graphics::ManagedSurface *surface) {
 	Graphics::MacFont *font = new Graphics::MacFont();
 	Director *director = _actor->getPage()->getGame()->getDirector();
 	Graphics::MacText text(_text, &director->getWndManager(), font, _textColorIndex, _backgroundColorIndex, _xRight - _xLeft, alignment);
-	text.draw(surface, 0, 0, _xRight - _xLeft, _yBottom - _yTop, _xLeft, _yTop);
+	text.drawToPoint(surface, Common::Rect(0, 0, _xRight - _xLeft, _yBottom - _yTop), Common::Point(_xLeft, _yTop));
 }
 
 #define RED(rgb) ((rgb) & 0xFF)





More information about the Scummvm-git-logs mailing list