From 2ad6b0a0277d881045beca4b19309d58f2adbb79 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Wed, 21 Jul 2010 00:01:22 +0000 Subject: [PATCH] Renamed CGUIFont.{h,cpp} to scalable_font.{hc}pp, removed all references to CGUIFont (so that the new mono-space-digits functions can be used everywhere); some code cleanup. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5700 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/Makefile.am | 4 ++-- src/graphics/irr_driver.cpp | 1 + src/guiengine/engine.cpp | 8 ++++---- src/guiengine/engine.hpp | 19 ++++++++++++------ .../{CGUIFont.cpp => scalable_font.cpp} | 20 ++++++------------- .../{CGUIFont.h => scalable_font.hpp} | 0 src/guiengine/skin.cpp | 10 ++++++---- src/guiengine/widget.cpp | 1 + src/guiengine/widgets/label_widget.cpp | 5 ++++- src/guiengine/widgets/ribbon_widget.cpp | 8 ++++---- src/ide/vc9/supertuxkart.vcproj | 16 +++++++-------- src/states_screens/credits.cpp | 9 ++++----- .../dialogs/add_device_dialog.cpp | 5 +++-- .../dialogs/confirm_resolution_dialog.cpp | 5 +++-- .../dialogs/player_info_dialog.cpp | 5 +++-- .../dialogs/race_over_dialog.cpp | 4 +++- .../dialogs/race_paused_dialog.cpp | 6 ++++-- src/states_screens/feature_unlocked.cpp | 5 +++-- src/states_screens/grand_prix_lose.cpp | 7 ++++--- src/states_screens/grand_prix_win.cpp | 7 ++++--- src/states_screens/race_gui.cpp | 12 +++++------ src/states_screens/race_result_gui.cpp | 17 ++++++++-------- src/states_screens/race_result_gui.hpp | 11 ++++++++-- 23 files changed, 104 insertions(+), 81 deletions(-) rename src/guiengine/{CGUIFont.cpp => scalable_font.cpp} (98%) rename src/guiengine/{CGUIFont.h => scalable_font.hpp} (100%) diff --git a/src/Makefile.am b/src/Makefile.am index 960da5bed..fece57c56 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -77,8 +77,6 @@ supertuxkart_SOURCES = \ graphics/stars.hpp \ graphics/water_splash.hpp \ graphics/water_splash.cpp \ - guiengine/CGUIFont.cpp \ - guiengine/CGUIFont.h \ guiengine/CGUISpriteBank.cpp \ guiengine/CGUISpriteBank.h \ guiengine/abstract_state_manager.cpp \ @@ -89,6 +87,8 @@ supertuxkart_SOURCES = \ guiengine/event_handler.hpp \ guiengine/modaldialog.cpp \ guiengine/modaldialog.hpp \ + guiengine/scalable_font.cpp \ + guiengine/scalable_font.hpp \ guiengine/screen_loader.cpp \ guiengine/screen.cpp \ guiengine/screen.hpp \ diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 4a1f2c40e..76bfa01b6 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -24,6 +24,7 @@ #include "graphics/material_manager.hpp" #include "guiengine/engine.hpp" #include "guiengine/modaldialog.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/screen.hpp" #include "io/file_manager.hpp" #include "items/item_manager.hpp" diff --git a/src/guiengine/engine.cpp b/src/guiengine/engine.cpp index 5e3314e90..bc774f21f 100644 --- a/src/guiengine/engine.cpp +++ b/src/guiengine/engine.cpp @@ -409,9 +409,9 @@ #include "io/file_manager.hpp" #include "input/input_manager.hpp" -#include "guiengine/CGUIFont.h" #include "guiengine/event_handler.hpp" #include "guiengine/modaldialog.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/screen.hpp" #include "guiengine/skin.hpp" #include "guiengine/widget.hpp" @@ -427,9 +427,9 @@ namespace GUIEngine { IGUIEnvironment* g_env; Skin* g_skin = NULL; - IGUIFont* g_font; - IGUIFont* g_title_font; - IGUIFont* g_small_font; + ScalableFont* g_font; + ScalableFont* g_title_font; + ScalableFont* g_small_font; IrrlichtDevice* g_device; IVideoDriver* g_driver; diff --git a/src/guiengine/engine.hpp b/src/guiengine/engine.hpp index 063471c94..f2e37a241 100644 --- a/src/guiengine/engine.hpp +++ b/src/guiengine/engine.hpp @@ -29,6 +29,13 @@ #include "utils/constants.hpp" #include "utils/ptr_vector.hpp" +namespace irr +{ + namespace gui + { + class ScalableFont; + } +} /** * \ingroup guiengine @@ -73,9 +80,9 @@ namespace GUIEngine { extern irr::gui::IGUIEnvironment* g_env; extern Skin* g_skin; - extern irr::gui::IGUIFont* g_small_font; - extern irr::gui::IGUIFont* g_font; - extern irr::gui::IGUIFont* g_title_font; + extern irr::gui::ScalableFont* g_small_font; + extern irr::gui::ScalableFont* g_font; + extern irr::gui::ScalableFont* g_title_font; extern irr::IrrlichtDevice* g_device; extern irr::video::IVideoDriver* g_driver; @@ -120,17 +127,17 @@ namespace GUIEngine /** * \return the smaller font (useful for less important messages) */ - inline irr::gui::IGUIFont* getSmallFont() { return Private::g_small_font; } + inline irr::gui::ScalableFont* getSmallFont() { return Private::g_small_font; } /** * \return the "normal" font (useful for text) */ - inline irr::gui::IGUIFont* getFont() { return Private::g_font; } + inline irr::gui::ScalableFont* getFont() { return Private::g_font; } /** * \return the "title" font (it's bigger and orange, useful for headers/captions) */ - inline irr::gui::IGUIFont* getTitleFont() { return Private::g_title_font; } + inline irr::gui::ScalableFont* getTitleFont() { return Private::g_title_font; } /** * \return the currently shown screen, or NULL if none diff --git a/src/guiengine/CGUIFont.cpp b/src/guiengine/scalable_font.cpp similarity index 98% rename from src/guiengine/CGUIFont.cpp rename to src/guiengine/scalable_font.cpp index 73521fa76..04832cf63 100644 --- a/src/guiengine/CGUIFont.cpp +++ b/src/guiengine/scalable_font.cpp @@ -2,14 +2,15 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "CGUIFont.h" +#include "guiengine/scalable_font.hpp" + +#include #include "IGUIEnvironment.h" #include "IXMLReader.h" #include "IReadFile.h" #include "IVideoDriver.h" #include "IGUISpriteBank.h" -#include #include "guiengine/engine.hpp" #include "io/file_manager.hpp" #include "utils/translation.hpp" @@ -340,19 +341,11 @@ core::dimension2d ScalableFont::getDimension(const wchar_t* text) const for (const wchar_t* p = text; *p; ++p) { - bool lineBreak=false; - if (*p == L'\r') // Windows breaks + if (*p == L'\r' || // Windows breaks + *p == L'\n' ) // Unix breaks { - lineBreak = true; - if (p[1] == L'\n') // Windows breaks + if (*p==L'\r' && p[1] == L'\n') // Windows breaks ++p; - } - else if (*p == L'\n') // Unix breaks - { - lineBreak = true; - } - if (lineBreak) - { dim.Height += thisLine.Height; if (dim.Width < thisLine.Width) dim.Width = thisLine.Width; @@ -437,7 +430,6 @@ void ScalableFont::draw(const core::stringw& text, continue; } - bool lineBreak=false; if (c == L'\r' || // Windows breaks c == L'\n' ) // Unix breaks { diff --git a/src/guiengine/CGUIFont.h b/src/guiengine/scalable_font.hpp similarity index 100% rename from src/guiengine/CGUIFont.h rename to src/guiengine/scalable_font.hpp diff --git a/src/guiengine/skin.cpp b/src/guiengine/skin.cpp index 4438729f3..293e96820 100644 --- a/src/guiengine/skin.cpp +++ b/src/guiengine/skin.cpp @@ -15,19 +15,21 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include "guiengine/skin.hpp" + +#include +#include +#include #include "config/user_config.hpp" #include "graphics/irr_driver.hpp" -#include "guiengine/skin.hpp" #include "guiengine/engine.hpp" #include "guiengine/modaldialog.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/screen.hpp" #include "guiengine/widgets.hpp" #include "io/file_manager.hpp" #include "states_screens/state_manager.hpp" -#include -#include -#include using namespace GUIEngine; using namespace irr; diff --git a/src/guiengine/widget.cpp b/src/guiengine/widget.cpp index b3e370730..f0db4e7ab 100644 --- a/src/guiengine/widget.cpp +++ b/src/guiengine/widget.cpp @@ -30,6 +30,7 @@ using namespace gui; #include "graphics/irr_driver.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/screen.hpp" #include "io/file_manager.hpp" #include "utils/string_utils.hpp" diff --git a/src/guiengine/widgets/label_widget.cpp b/src/guiengine/widgets/label_widget.cpp index 80aa511f9..9b0a525c4 100644 --- a/src/guiengine/widgets/label_widget.cpp +++ b/src/guiengine/widgets/label_widget.cpp @@ -15,8 +15,11 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "guiengine/engine.hpp" #include "guiengine/widgets/label_widget.hpp" + +#include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" + using namespace GUIEngine; using namespace irr::core; using namespace irr::gui; diff --git a/src/guiengine/widgets/ribbon_widget.cpp b/src/guiengine/widgets/ribbon_widget.cpp index 92f3d1333..5d1169087 100644 --- a/src/guiengine/widgets/ribbon_widget.cpp +++ b/src/guiengine/widgets/ribbon_widget.cpp @@ -17,17 +17,17 @@ #include "guiengine/widgets/ribbon_widget.hpp" +#include + #include "graphics/irr_driver.hpp" -#include "guiengine/widgets/button_widget.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" +#include "guiengine/widgets/button_widget.hpp" #include "input/input_manager.hpp" #include "io/file_manager.hpp" #include "states_screens/state_manager.hpp" #include "utils/string_utils.hpp" -#include - - using namespace GUIEngine; using namespace irr::core; using namespace irr::gui; diff --git a/src/ide/vc9/supertuxkart.vcproj b/src/ide/vc9/supertuxkart.vcproj index 9de3a4f3d..382553000 100644 --- a/src/ide/vc9/supertuxkart.vcproj +++ b/src/ide/vc9/supertuxkart.vcproj @@ -296,10 +296,6 @@ RelativePath="..\..\guiengine\abstract_state_manager.cpp" > - - @@ -334,6 +330,10 @@ RelativePath="..\..\guiengine\modaldialog.cpp" > + + @@ -1092,10 +1092,6 @@ RelativePath="..\..\guiengine\abstract_state_manager.hpp" > - - @@ -1108,6 +1104,10 @@ RelativePath="..\..\guiengine\modaldialog.hpp" > + + diff --git a/src/states_screens/credits.cpp b/src/states_screens/credits.cpp index 0e1854dea..11b25ea5d 100644 --- a/src/states_screens/credits.cpp +++ b/src/states_screens/credits.cpp @@ -15,10 +15,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "guiengine/screen.hpp" -#include "guiengine/widget.hpp" #include "states_screens/credits.hpp" -#include "states_screens/state_manager.hpp" #include @@ -28,12 +25,14 @@ using irr::core::stringc; #include "config/user_config.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" +#include "guiengine/screen.hpp" +#include "guiengine/widget.hpp" #include "io/file_manager.hpp" +#include "states_screens/state_manager.hpp" DEFINE_SCREEN_SINGLETON( CreditsScreen ); - - using namespace GUIEngine; const float TIME_SECTION_FADE = 0.8f; const float ENTRIES_FADE_TIME = 0.3f; diff --git a/src/states_screens/dialogs/add_device_dialog.cpp b/src/states_screens/dialogs/add_device_dialog.cpp index ef99561ae..39bc8dd60 100644 --- a/src/states_screens/dialogs/add_device_dialog.cpp +++ b/src/states_screens/dialogs/add_device_dialog.cpp @@ -15,14 +15,15 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include "states_screens/dialogs/add_device_dialog.hpp" #include "config/player.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/widget.hpp" #include "guiengine/widgets/button_widget.hpp" #include "input/device_manager.hpp" #include "input/input_manager.hpp" -#include "states_screens/dialogs/add_device_dialog.hpp" #include "states_screens/options_screen_players.hpp" #include "states_screens/options_screen_input.hpp" #include "states_screens/state_manager.hpp" @@ -37,7 +38,7 @@ using namespace irr::core; AddDeviceDialog::AddDeviceDialog() : ModalDialog(0.7f, 0.7f) { - IGUIFont* font = GUIEngine::getFont(); + ScalableFont* font = GUIEngine::getFont(); const int textHeight = GUIEngine::getFontHeight(); const int buttonHeight = textHeight + 10; diff --git a/src/states_screens/dialogs/confirm_resolution_dialog.cpp b/src/states_screens/dialogs/confirm_resolution_dialog.cpp index 5c50e32c1..4cca7f522 100644 --- a/src/states_screens/dialogs/confirm_resolution_dialog.cpp +++ b/src/states_screens/dialogs/confirm_resolution_dialog.cpp @@ -15,14 +15,15 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include "states_screens/dialogs/confirm_resolution_dialog.hpp" #include "config/player.hpp" #include "graphics/irr_driver.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/widgets/button_widget.hpp" #include "input/device_manager.hpp" #include "input/input_manager.hpp" -#include "states_screens/dialogs/confirm_resolution_dialog.hpp" #include "states_screens/state_manager.hpp" #include "utils/string_utils.hpp" #include "utils/translation.hpp" @@ -37,7 +38,7 @@ ConfirmResolutionDialog::ConfirmResolutionDialog() : ModalDialog(0.7f, 0.7f) { m_countdown_message = NULL; - IGUIFont* font = GUIEngine::getFont(); + ScalableFont* font = GUIEngine::getFont(); const int textHeight = GUIEngine::getFontHeight(); const int buttonHeight = textHeight + 10; diff --git a/src/states_screens/dialogs/player_info_dialog.cpp b/src/states_screens/dialogs/player_info_dialog.cpp index f93fc1e90..3f5af2fc8 100644 --- a/src/states_screens/dialogs/player_info_dialog.cpp +++ b/src/states_screens/dialogs/player_info_dialog.cpp @@ -15,11 +15,12 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include "states_screens/dialogs/player_info_dialog.hpp" #include "config/player.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/widgets.hpp" -#include "states_screens/dialogs/player_info_dialog.hpp" #include "states_screens/options_screen_players.hpp" #include "states_screens/state_manager.hpp" #include "utils/string_utils.hpp" @@ -47,7 +48,7 @@ void PlayerInfoDialog::showRegularDialog() const int y3 = m_area.getHeight()*3/6; const int y4 = m_area.getHeight()*5/6; - IGUIFont* font = GUIEngine::getFont(); + ScalableFont* font = GUIEngine::getFont(); const int textHeight = GUIEngine::getFontHeight(); const int buttonHeight = textHeight + 10; diff --git a/src/states_screens/dialogs/race_over_dialog.cpp b/src/states_screens/dialogs/race_over_dialog.cpp index f9576a9cf..91894dabd 100644 --- a/src/states_screens/dialogs/race_over_dialog.cpp +++ b/src/states_screens/dialogs/race_over_dialog.cpp @@ -15,8 +15,11 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include "states_screens/dialogs/race_over_dialog.hpp" + #include "challenges/unlock_manager.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/widgets.hpp" #include "io/file_manager.hpp" #include "input/input_manager.hpp" @@ -26,7 +29,6 @@ #include "modes/world.hpp" #include "network/network_manager.hpp" #include "race/race_manager.hpp" -#include "states_screens/dialogs/race_over_dialog.hpp" #include "states_screens/feature_unlocked.hpp" #include "states_screens/main_menu_screen.hpp" #include "states_screens/race_setup_screen.hpp" diff --git a/src/states_screens/dialogs/race_paused_dialog.cpp b/src/states_screens/dialogs/race_paused_dialog.cpp index f3d3986d7..47e0a528b 100644 --- a/src/states_screens/dialogs/race_paused_dialog.cpp +++ b/src/states_screens/dialogs/race_paused_dialog.cpp @@ -17,7 +17,10 @@ #include "states_screens/dialogs/race_paused_dialog.hpp" +#include + #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/widgets.hpp" #include "input/input_manager.hpp" #include "io/file_manager.hpp" @@ -31,7 +34,6 @@ #include "states_screens/state_manager.hpp" #include "utils/translation.hpp" -#include using namespace GUIEngine; using namespace irr::core; using namespace irr::gui; @@ -43,7 +45,7 @@ RacePausedDialog::RacePausedDialog(const float percentWidth, const float percent { World::getWorld()->pause(WorldStatus::IN_GAME_MENU_PHASE); - IGUIFont* font = GUIEngine::getTitleFont(); + ScalableFont* font = GUIEngine::getTitleFont(); const int text_height = GUIEngine::getFontHeight(); IGUIFont* titlefont = GUIEngine::getTitleFont(); diff --git a/src/states_screens/feature_unlocked.cpp b/src/states_screens/feature_unlocked.cpp index af8068d81..3f74c620d 100644 --- a/src/states_screens/feature_unlocked.cpp +++ b/src/states_screens/feature_unlocked.cpp @@ -1,8 +1,11 @@ #include "states_screens/feature_unlocked.hpp" +#include + #include "challenges/challenge.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "io/file_manager.hpp" #include "items/item_manager.hpp" #include "karts/kart.hpp" @@ -15,8 +18,6 @@ #include "tracks/track_manager.hpp" #include "utils/translation.hpp" -#include - using namespace irr::core; using namespace irr::gui; using namespace irr::video; diff --git a/src/states_screens/grand_prix_lose.cpp b/src/states_screens/grand_prix_lose.cpp index 265ecaeef..4da8f8b94 100644 --- a/src/states_screens/grand_prix_lose.cpp +++ b/src/states_screens/grand_prix_lose.cpp @@ -1,11 +1,15 @@ #include "states_screens/grand_prix_lose.hpp" +#include +#include + #include "audio/music_manager.hpp" #include "audio/sfx_manager.hpp" #include "challenges/unlock_manager.hpp" #include "graphics/irr_driver.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/widgets/label_widget.hpp" #include "io/file_manager.hpp" #include "items/item_manager.hpp" @@ -14,9 +18,6 @@ #include "states_screens/state_manager.hpp" #include "utils/translation.hpp" -#include -#include - using namespace irr::core; using namespace irr::gui; using namespace irr::video; diff --git a/src/states_screens/grand_prix_win.cpp b/src/states_screens/grand_prix_win.cpp index 7d320ff42..748434304 100644 --- a/src/states_screens/grand_prix_win.cpp +++ b/src/states_screens/grand_prix_win.cpp @@ -1,11 +1,15 @@ #include "states_screens/grand_prix_win.hpp" +#include +#include + #include "audio/music_manager.hpp" #include "audio/sfx_manager.hpp" #include "challenges/unlock_manager.hpp" #include "graphics/irr_driver.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/widgets/label_widget.hpp" #include "io/file_manager.hpp" #include "items/item_manager.hpp" @@ -14,9 +18,6 @@ #include "states_screens/state_manager.hpp" #include "utils/translation.hpp" -#include -#include - using namespace irr::core; using namespace irr::gui; using namespace irr::video; diff --git a/src/states_screens/race_gui.cpp b/src/states_screens/race_gui.cpp index 81faab543..d1ba5c3fb 100644 --- a/src/states_screens/race_gui.cpp +++ b/src/states_screens/race_gui.cpp @@ -30,6 +30,7 @@ using namespace irr; #include "graphics/material_manager.hpp" #include "guiengine/engine.hpp" #include "guiengine/modaldialog.hpp" +#include "guiengine/scalable_font.hpp" #include "io/file_manager.hpp" #include "input/input.hpp" #include "input/input_manager.hpp" @@ -316,7 +317,7 @@ void RaceGUI::drawGlobalTimer() pos += core::vector2d(0, UserConfigParams::m_height/2); } - gui::IGUIFont* font = GUIEngine::getFont(); + gui::ScalableFont* font = GUIEngine::getFont(); font->draw(sw.c_str(), pos, time_color); } // DRAWGLOBALTimer @@ -385,8 +386,8 @@ void RaceGUI::drawGlobalPlayerIcons(const KartIconDisplayInfo* info) ICON_PLAYER_WIDTH = 35; } - gui::IGUIFont* font = GUIEngine::getFont(); - World *world = World::getWorld(); + gui::ScalableFont* font = GUIEngine::getFont(); + World *world = World::getWorld(); const unsigned int kart_amount = world->getNumKarts(); for(unsigned int i = 0; i < kart_amount ; i++) { @@ -646,9 +647,8 @@ void RaceGUI::drawLap(const KartIconDisplayInfo* info, const Kart* kart, pos.UpperLeftCorner.X = viewport.UpperLeftCorner.X + (int)(0.05f*UserConfigParams::m_width); } - gui::IGUIFont* font = GUIEngine::getFont(); - - int font_height = (int)(font->getDimension(L"X").Height); + gui::ScalableFont* font = GUIEngine::getFont(); + int font_height = (int)(font->getDimension(L"X").Height); if (kart->hasFinishedRace()) { diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp index d2a8736bd..52b6f9d52 100644 --- a/src/states_screens/race_result_gui.cpp +++ b/src/states_screens/race_result_gui.cpp @@ -20,6 +20,7 @@ #include "states_screens/race_result_gui.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "modes/world.hpp" #include "states_screens/dialogs/race_over_dialog.hpp" #include "utils/string_utils.hpp" @@ -28,19 +29,19 @@ */ RaceResultGUI::RaceResultGUI() { -#undef USE_NEW_RACE_RESULT +#define USE_NEW_RACE_RESULT #ifndef USE_NEW_RACE_RESULT - // FIXME: for now disable the new race result display - // by just firing up the old display (which will make sure - // that the rendering for this object is not called anymore). - new RaceOverDialog(0.6f, 0.9f); - return; + // FIXME: for now disable the new race result display + // by just firing up the old display (which will make sure + // that the rendering for this object is not called anymore). + new RaceOverDialog(0.6f, 0.9f); + return; #else determineLayout(); m_timer = 0; m_animation_state = RR_BEGIN_FIRST_TABLE; -#endif +#endif } // RaceResultGUI //----------------------------------------------------------------------------- @@ -67,7 +68,7 @@ void RaceResultGUI::nextPhase() */ void RaceResultGUI::determineLayout() { - m_font = dynamic_cast(GUIEngine::getFont()); + m_font = GUIEngine::getFont(); assert(m_font); World *world = World::getWorld(); world->raceResultOrder(&m_order); diff --git a/src/states_screens/race_result_gui.hpp b/src/states_screens/race_result_gui.hpp index 5a7bcf159..1b322f829 100644 --- a/src/states_screens/race_result_gui.hpp +++ b/src/states_screens/race_result_gui.hpp @@ -20,11 +20,18 @@ #ifndef HEADER_RACE_RESULT_GUI_HPP #define HEADER_RACE_RESULT_GUI_HPP +#include "states_screens/race_gui_base.hpp" + #include #include -#include "states_screens/race_gui_base.hpp" -#include "guiengine/CGUIFont.h" +namespace irr +{ + namespace gui + { + class ScalableFont; + } +} /** * \brief Displays the results (while the end animation is shown).