From 9fa7e9be8180614b5f7c94440a8243f775e56aef Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 25 Nov 2018 16:34:55 -0800 Subject: GLK: FROTZ: Fix selection of the character graphics font --- engines/glk/frotz/processor_screen.cpp | 6 ++++-- engines/glk/frotz/screen.cpp | 7 ++++++- engines/glk/frotz/screen.h | 5 +++++ 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'engines/glk/frotz') diff --git a/engines/glk/frotz/processor_screen.cpp b/engines/glk/frotz/processor_screen.cpp index 696ce7822a..6a518cf525 100644 --- a/engines/glk/frotz/processor_screen.cpp +++ b/engines/glk/frotz/processor_screen.cpp @@ -352,7 +352,7 @@ void Processor::z_set_text_style() { // not tickle time curstyle |= zargs[0]; - if (h_flags & FIXED_FONT_FLAG || curr_font == FIXED_WIDTH_FONT) + if (h_flags & FIXED_FONT_FLAG || curr_font == FIXED_WIDTH_FONT || curr_font == GRAPHICS_FONT) style = curstyle | FIXED_WIDTH_STYLE; else style = curstyle; @@ -367,7 +367,9 @@ void Processor::z_set_text_style() { } if (style & FIXED_WIDTH_STYLE) { - if (style & BOLDFACE_STYLE && style & EMPHASIS_STYLE) + if (curr_font == GRAPHICS_FONT) + glk_set_style(style_User1); // character graphics + else if (style & BOLDFACE_STYLE && style & EMPHASIS_STYLE) glk_set_style(style_BlockQuote); // monoz else if (style & EMPHASIS_STYLE) glk_set_style(style_Alert); // monoi diff --git a/engines/glk/frotz/screen.cpp b/engines/glk/frotz/screen.cpp index a71217cc26..edd62eb7da 100644 --- a/engines/glk/frotz/screen.cpp +++ b/engines/glk/frotz/screen.cpp @@ -21,12 +21,17 @@ */ #include "glk/frotz/screen.h" +#include "glk/conf.h" #include "common/file.h" #include "image/bmp.h" namespace Glk { namespace Frotz { +FrotzScreen::FrotzScreen() : Glk::Screen() { + g_conf->_tStyles[style_User1].font = CUSTOM; +} + void FrotzScreen::loadFonts(Common::Archive *archive) { Screen::loadFonts(archive); @@ -66,7 +71,7 @@ void BitmapFont::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint const byte *srcP = (const byte *)_surface.getBasePtr(r.left, r.top + yCtr); for (int xCtr = 0; xCtr < r.width(); ++xCtr, ++srcP) { - if (*srcP) + if (!*srcP) dst->hLine(x + xCtr, y + yCtr, x + xCtr, color); } } diff --git a/engines/glk/frotz/screen.h b/engines/glk/frotz/screen.h index d8b2b89a3f..568c3c73bf 100644 --- a/engines/glk/frotz/screen.h +++ b/engines/glk/frotz/screen.h @@ -42,6 +42,11 @@ protected: * Load the fonts */ virtual void loadFonts(Common::Archive *archive) override; +public: + /** + * Constructor + */ + FrotzScreen(); }; /** -- cgit v1.2.3