diff options
author | Aaron Marks <nymacro@gmail.com> | 2005-06-17 23:52:01 +0000 |
---|---|---|
committer | Aaron Marks <nymacro@gmail.com> | 2005-06-17 23:52:01 +0000 |
commit | 6e1dbe34d9ef4c5c06887187fa20c5461c159579 (patch) | |
tree | 2ba6811940b0042ab1ea2d87ecd761f34238a003 | |
parent | c702285ab5c288fc65dacdf81b583890d3b99c63 (diff) | |
download | mana-6e1dbe34d9ef4c5c06887187fa20c5461c159579.tar.gz mana-6e1dbe34d9ef4c5c06887187fa20c5461c159579.tar.bz2 mana-6e1dbe34d9ef4c5c06887187fa20c5461c159579.tar.xz mana-6e1dbe34d9ef4c5c06887187fa20c5461c159579.zip |
Updated BrowserBox to work with SDL by using the original font. (the setColor
calls can be ignored, as they have no effect on the font when Guichan is using
SDL).
-rw-r--r-- | src/gui/browserbox.cpp | 5 | ||||
-rw-r--r-- | src/gui/gui.cpp | 7 | ||||
-rw-r--r-- | src/gui/gui.h | 5 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index 06094139..3886a401 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -22,6 +22,7 @@ */ #include "browserbox.h" +#include "gui.h" int BrowserBox::instances = 0; gcn::ImageFont* BrowserBox::browserFont; @@ -38,10 +39,14 @@ BrowserBox::BrowserBox(unsigned int mode): if (instances == 0) { +#ifdef OPENGL_SUPPORT browserFont = new gcn::ImageFont( TMW_DATADIR "data/graphics/gui/browserfont.png", " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567" "89:@!\"$%&/=?^+*#[]{}()<>_;'.,\\|-~`"); +#else + browserFont = gui->getFont(); +#endif } instances++; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index b6562b77..cbfd81b4 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -139,3 +139,10 @@ void Gui::mousePress(int mx, int my, int button) autoTarget = NULL; } } + + +gcn::ImageFont *Gui::getFont() +{ + return guiFont; +} + diff --git a/src/gui/gui.h b/src/gui/gui.h index 1c8ccb34..daaaa905 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -71,6 +71,11 @@ class Gui : public gcn::Gui, public gcn::MouseListener */ void mousePress(int mx, int my, int button); + /** + * Return game font + */ + gcn::ImageFont *getFont(); + private: #ifdef USE_OPENGL gcn::ImageLoader *hostImageLoader; /**< For loading images in GL */ |