From 767913d2d5c7e83e715886910a99dba619b3aeb7 Mon Sep 17 00:00:00 2001 From: lolbot-iichan Date: Mon, 27 Aug 2018 00:52:14 +0300 Subject: WINTERMUTE: Add FoxTail text spacing hack FoxTail fork of WME seems to have hard-coded modifications for getting inter-line and inter-character spaces smaller. --- engines/wintermute/base/font/base_font_bitmap.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'engines/wintermute/base') diff --git a/engines/wintermute/base/font/base_font_bitmap.cpp b/engines/wintermute/base/font/base_font_bitmap.cpp index c33b48d085..fd36de4915 100644 --- a/engines/wintermute/base/font/base_font_bitmap.cpp +++ b/engines/wintermute/base/font/base_font_bitmap.cpp @@ -28,6 +28,7 @@ #include "engines/wintermute/base/font/base_font_bitmap.h" #include "engines/wintermute/utils/string_util.h" +#include "engines/wintermute/base/base_engine.h" #include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_frame.h" #include "engines/wintermute/base/gfx/base_surface.h" @@ -141,6 +142,9 @@ int BaseFontBitmap::textHeightDraw(const byte *text, int x, int y, int width, TT bool done = false; bool newLine = false; bool longLine = false; +#ifdef ENABLE_FOXTAIL + bool minimizeSpacing = BaseEngine::instance().isFoxTail(); +#endif if (draw) { _gameRef->_renderer->startSpriteBatch(); @@ -211,6 +215,11 @@ int BaseFontBitmap::textHeightDraw(const byte *text, int x, int y, int width, TT startX += getCharWidth(str[i]); } y += _tileHeight; +#ifdef ENABLE_FOXTAIL + if (minimizeSpacing) { + y -= 3; + } +#endif last_end = end; if (longLine) { end--; @@ -489,6 +498,14 @@ bool BaseFontBitmap::loadBuffer(char *buffer) { } } +#ifdef ENABLE_FOXTAIL + if (BaseEngine::instance().isFoxTail()) { + for (i = lastWidth; i < NUM_CHARACTERS; i++) { + _widths[i]--; + } + } +#endif + return STATUS_OK; } -- cgit v1.2.3