From c205aa533b142a3abf684d2f3fff47a5b99424a7 Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Sat, 28 Feb 2015 20:41:12 -0500 Subject: [PATCH] Add outline on font for instructions in the overworld, fixing cases where the text is hard to read --- src/guiengine/engine.cpp | 6 ++++++ src/guiengine/engine.hpp | 3 +++ src/states_screens/race_gui_overworld.cpp | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/guiengine/engine.cpp b/src/guiengine/engine.cpp index 2a367198c..37406b954 100644 --- a/src/guiengine/engine.cpp +++ b/src/guiengine/engine.cpp @@ -689,6 +689,7 @@ namespace GUIEngine IGUIEnvironment* g_env; Skin* g_skin = NULL; ScalableFont *g_font; + ScalableFont *g_outline_font; ScalableFont *g_large_font; ScalableFont *g_title_font; ScalableFont *g_small_font; @@ -974,6 +975,8 @@ namespace GUIEngine g_large_font = NULL; g_digit_font->drop(); g_digit_font = NULL; + g_outline_font->drop(); + g_outline_font = NULL; // nothing else to delete for now AFAIK, irrlicht will automatically // kill everything along the device @@ -1080,6 +1083,9 @@ namespace GUIEngine sfont_larger->setKerningHeight(-5); g_large_font = sfont_larger; + g_outline_font = sfont->getHollowCopy(); + g_outline_font->m_black_border = true; + Private::large_font_height = g_large_font->getDimension( L"X" ).Height; ScalableFont* sfont_smaller = sfont->getHollowCopy(); diff --git a/src/guiengine/engine.hpp b/src/guiengine/engine.hpp index 9669503c7..a1c869bd3 100644 --- a/src/guiengine/engine.hpp +++ b/src/guiengine/engine.hpp @@ -83,6 +83,7 @@ namespace GUIEngine extern Skin* g_skin; extern irr::gui::ScalableFont* g_small_font; extern irr::gui::ScalableFont* g_font; + extern irr::gui::ScalableFont* g_outline_font; extern irr::gui::ScalableFont* g_large_font; extern irr::gui::ScalableFont* g_title_font; extern irr::gui::ScalableFont* g_digit_font; @@ -136,6 +137,8 @@ namespace GUIEngine */ inline irr::gui::ScalableFont* getFont() { return Private::g_font; } + inline irr::gui::ScalableFont* getOutlineFont() { return Private::g_outline_font; } + /** * \return the "large" font (useful for text) */ diff --git a/src/states_screens/race_gui_overworld.cpp b/src/states_screens/race_gui_overworld.cpp index c0cc5a82d..6b88045d7 100644 --- a/src/states_screens/race_gui_overworld.cpp +++ b/src/states_screens/race_gui_overworld.cpp @@ -459,7 +459,7 @@ void RaceGUIOverworld::drawGlobalMiniMap() UserConfigParams::m_height - GUIEngine::getFontHeight()*2, UserConfigParams::m_width, UserConfigParams::m_height); - GUIEngine::getFont()->draw(_("Press fire to play the tutorial"), pos2, + GUIEngine::getOutlineFont()->draw(_("Press fire to play the tutorial"), pos2, video::SColor(255,255,150,60), true, true /* vcenter */, NULL); continue; @@ -529,7 +529,7 @@ void RaceGUIOverworld::drawGlobalMiniMap() UserConfigParams::m_height - GUIEngine::getFontHeight()*2, UserConfigParams::m_width, UserConfigParams::m_height); - GUIEngine::getFont()->draw(_("Press fire to start the challenge"), pos2, + GUIEngine::getOutlineFont()->draw(_("Press fire to start the challenge"), pos2, video::SColor(255,255,150,60), true, true /* vcenter */, NULL); }