From d00f587d7aa3e7e26b67d4417541c0561abd966c Mon Sep 17 00:00:00 2001 From: hikerstk Date: Tue, 29 Mar 2011 22:59:32 +0000 Subject: [PATCH] Added disableShadow method to ScalableFont, and added black shadow/outline to text in the race gui. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8107 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/guiengine/scalable_font.cpp | 2 +- src/guiengine/scalable_font.hpp | 3 ++- src/states_screens/minimal_race_gui.cpp | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/guiengine/scalable_font.cpp b/src/guiengine/scalable_font.cpp index 934ea4f67..d7c40bf79 100644 --- a/src/guiengine/scalable_font.cpp +++ b/src/guiengine/scalable_font.cpp @@ -77,7 +77,7 @@ void ScalableFont::updateRTL() m_rtl = translations->isRTLLanguage(); } -void ScalableFont::setShadow(irr::video::SColor col) +void ScalableFont::setShadow(const irr::video::SColor &col) { m_shadow = true; m_shadow_color = col; diff --git a/src/guiengine/scalable_font.hpp b/src/guiengine/scalable_font.hpp index 7eb051f6d..f8df3500f 100644 --- a/src/guiengine/scalable_font.hpp +++ b/src/guiengine/scalable_font.hpp @@ -121,7 +121,8 @@ public: /** Sets if digits are to be mono-spaced. */ void setMonospaceDigits(bool mono) {m_mono_space_digits = mono; } bool getMonospaceDigits() const { return m_mono_space_digits; } - void setShadow(irr::video::SColor col); + void setShadow(const irr::video::SColor &col); + void disableShadow() {m_shadow = false;} //! gets the sprite bank virtual IGUISpriteBank* getSpriteBank() const; diff --git a/src/states_screens/minimal_race_gui.cpp b/src/states_screens/minimal_race_gui.cpp index 6830f8667..82841cacd 100644 --- a/src/states_screens/minimal_race_gui.cpp +++ b/src/states_screens/minimal_race_gui.cpp @@ -580,6 +580,9 @@ void MinimalRaceGUI::drawRankLap(const KartIconDisplayInfo* info, : GUIEngine::getFont()); float scale = font->getScale(); font->setScale(m_font_scale); + // Add a black shadow to make the text better readable on + // 'white' tracks (e.g. with snow and ice). + font->setShadow(video::SColor(255, 0, 0, 0)); static video::SColor color = video::SColor(255, 255, 255, 255); WorldWithRank *world = (WorldWithRank*)(World::getWorld()); @@ -637,7 +640,7 @@ void MinimalRaceGUI::drawRankLap(const KartIconDisplayInfo* info, } } font->setScale(scale); - + font->disableShadow(); } // drawRankLap //-----------------------------------------------------------------------------