From 6458dc08c6345664c4ccfa467f8a43d78a257467 Mon Sep 17 00:00:00 2001 From: José Ávila Date: Sun, 3 Jul 2005 08:35:50 +0000 Subject: Commiting again --- src/gui/gui.cpp | 27 +++++++++++++++++++++++++++ src/gui/gui.h | 7 +++++++ 2 files changed, 34 insertions(+) (limited to 'src') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index cbfd81b4..35b3c843 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -36,6 +36,11 @@ Graphics *guiGraphics; // Graphics driver gcn::SDLInput *guiInput; // GUI input WindowContainer *guiTop; // The top container +// Fonts used in showing hits +gcn::ImageFont *hitRedFont; +gcn::ImageFont *hitBlueFont; +gcn::ImageFont *hitYellowFont; + Gui::Gui(Graphics *graphics) { // Set graphics @@ -87,11 +92,33 @@ Gui::Gui(Graphics *graphics) logger->error("Unable to load fixedfont.png!"); } + // Set hits' colourful fonts + try { + hitRedFont = new gcn::ImageFont( + TMW_DATADIR "data/graphics/gui/hits_red.png", + "0123456789"); + hitBlueFont = new gcn::ImageFont( + TMW_DATADIR "data/graphics/gui/hits_blue.png", + "0123456789"); + hitYellowFont = new gcn::ImageFont( + TMW_DATADIR "data/graphics/gui/hits_yellow.png", + "mis"); + } + catch (gcn::Exception e) + { + logger->error("Unable to load colored hits' fonts!"); + } + gcn::Widget::setGlobalFont(guiFont); } Gui::~Gui() { + // Fonts used in showing hits + delete hitRedFont; + delete hitBlueFont; + delete hitYellowFont; + delete guiFont; delete guiTop; delete imageLoader; diff --git a/src/gui/gui.h b/src/gui/gui.h index daaaa905..42334ca1 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -89,4 +89,11 @@ extern WindowContainer *guiTop; /**< The top container */ extern Graphics *guiGraphics; /**< Graphics driver */ extern gcn::SDLInput *guiInput; /**< GUI input */ +/** + * Fonts used in showing hits + */ +extern gcn::ImageFont *hitRedFont; +extern gcn::ImageFont *hitBlueFont; +extern gcn::ImageFont *hitYellowFont; + #endif -- cgit v1.2.3-70-g09d2