From 368c0928b60fb6b60937235c7108543ad791ecc2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 25 Jan 2017 12:23:45 +0100 Subject: DIRECTOR: Added test for drawing scaled MacFonts --- engines/director/director.cpp | 3 +-- engines/director/score.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/director/director.cpp b/engines/director/director.cpp index 527cf7aaa2..3e95d6bcbb 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -119,6 +119,7 @@ Common::Error DirectorEngine::run() { _mainArchive = nullptr; _currentScore = nullptr; + testFontScaling(); testFonts(); _lingo->runTests(); @@ -130,8 +131,6 @@ Common::Error DirectorEngine::run() { //_mainArchive = new RIFFArchive(); //_mainArchive->openFile("bookshelf_example.mmm"); - //testFontScaling(); - if (getPlatform() == Common::kPlatformWindows) _sharedCastFile = "SHARDCST.MMM"; else diff --git a/engines/director/score.cpp b/engines/director/score.cpp index e5e137c881..9864a4c208 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -27,6 +27,7 @@ #include "engines/util.h" #include "graphics/font.h" +#include "graphics/fonts/macfont.h" #include "graphics/palette.h" #include "graphics/macgui/macfontmanager.h" #include "graphics/macgui/macwindowmanager.h" @@ -105,6 +106,19 @@ void DirectorEngine::testFontScaling() { surface.create(w, h); surface.clear(255); + Graphics::MacFont origFont(Graphics::kMacFontNewYork, 18); + + const Graphics::MacFONTFont *font1 = (const Graphics::MacFONTFont *)_wm->_fontMan->getFont(origFont); + + Graphics::MacFONTFont::testBlit(font1, &surface, 0, x, y, 500); + + Graphics::MacFont bigFont(Graphics::kMacFontNewYork, 15); + + font1 = (const Graphics::MacFONTFont *)_wm->_fontMan->getFont(bigFont); + + Graphics::MacFONTFont::testBlit(font1, &surface, 0, x, y + 50, 500); + +#if 0 const char *text = "d"; for (int i = 9; i <= 40; i++) { @@ -121,6 +135,7 @@ void DirectorEngine::testFontScaling() { x += width + 1; } +#endif g_system->copyRectToScreen(surface.getPixels(), surface.pitch, 0, 0, w, h); -- cgit v1.2.3