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

sev- sev at scummvm.org
Sun Dec 1 20:44:39 UTC 2019


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:
ab9c2631f0 DIRECTOR: Fix fonts in cached texts


Commit: ab9c2631f04559f693f6da53e73dcfcf5f72a8c2
    https://github.com/scummvm/scummvm/commit/ab9c2631f04559f693f6da53e73dcfcf5f72a8c2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-12-01T21:44:12+01:00

Commit Message:
DIRECTOR: Fix fonts in cached texts

Changed paths:
    engines/director/cachedmactext.cpp
    engines/director/cachedmactext.h


diff --git a/engines/director/cachedmactext.cpp b/engines/director/cachedmactext.cpp
index e152974..c89efc4 100644
--- a/engines/director/cachedmactext.cpp
+++ b/engines/director/cachedmactext.cpp
@@ -41,9 +41,13 @@ void CachedMacText::makeMacText() {
 	else
 		_align = (Graphics::TextAlign)((int)_textCast->_textAlign + 1);
 
+	Graphics::MacFont *macFont = new Graphics::MacFont(_textCast->_fontId,
+										_textCast->_fontSize,
+										_textCast->_textSlant);
+
 	_macText = new Graphics::MacText(_textCast->_ftext,
 										_wm,
-										_macFont,
+										macFont,
 										0x00,
 										0xff,
 										_width,
@@ -60,14 +64,8 @@ CachedMacText::CachedMacText(TextCast *const textCast,
 								Graphics::MacWindowManager *const wm
 								)
 	:
-	_surface(NULL), _macFont(NULL),
-	_macText(NULL), _width(defaultWidth), _dirty(true), _textCast(textCast),
-	_wm(wm) {
-	_macFont = new Graphics::MacFont(_textCast->_fontId,
-										_textCast->_fontSize,
-										_textCast->_textSlant);
-	// TODO destroy me
-
+	_surface(NULL), _macText(NULL), _width(defaultWidth), _dirty(true),
+	_textCast(textCast), _wm(wm) {
 	if (_width == -1)  {
 		if (version >= 4) {
 			// This came from frame.cpp
diff --git a/engines/director/cachedmactext.h b/engines/director/cachedmactext.h
index 8adf275..b061462 100644
--- a/engines/director/cachedmactext.h
+++ b/engines/director/cachedmactext.h
@@ -26,7 +26,6 @@
 #include "graphics/font.h"
 
 namespace Graphics {
-class MacFont;
 class ManagedSurface;
 class MacText;
 class MacWindowManager;
@@ -41,7 +40,6 @@ private:
 	int _width;
 	TextCast *const _textCast;
 	Graphics::MacWindowManager *_wm;
-	Graphics::MacFont *_macFont;
 	Graphics::MacText *_macText;
 	Graphics::TextAlign _align;
 	bool _dirty;




More information about the Scummvm-git-logs mailing list