Author: mordante
Date: Fri Jul 11 18:11:48 2008
New Revision: 27908

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27908&view=rev
Log:
Export the list of fonts available in the game, needed for the new render 
engine.

Modified:
    trunk/src/font.cpp
    trunk/src/font.hpp

Modified: trunk/src/font.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/font.cpp?rev=27908&r1=27907&r2=27908&view=diff
==============================================================================
--- trunk/src/font.cpp (original)
+++ trunk/src/font.cpp Fri Jul 11 18:11:48 2008
@@ -1134,6 +1134,10 @@
 
 namespace font {
 
+namespace {
+       t_string font_order;
+} // namespace
+
 bool load_font_config()
 {
        //read font config separately, so we do not have to re-read the whole
@@ -1158,6 +1162,7 @@
                known_fonts.insert((**child)["name"]);
        }
 
+       font_order = (*fonts_config)["order"];
        const std::vector<std::string> font_order = 
utils::split((*fonts_config)["order"]);
        std::vector<font::subset_descriptor> fontlist;
        std::vector<std::string>::const_iterator font;
@@ -1177,6 +1182,11 @@
        return true;
 }
 
+const t_string& get_fonts()
+{
+       return font_order;
+}
+
 void cache_mode(CACHE mode)
 {
        if(mode == CACHE_LOBBY) {

Modified: trunk/src/font.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/font.hpp?rev=27908&r1=27907&r2=27908&view=diff
==============================================================================
--- trunk/src/font.hpp (original)
+++ trunk/src/font.hpp Fri Jul 11 18:11:48 2008
@@ -18,6 +18,7 @@
 #include "SDL_ttf.h"
 
 class CVideo;
+class t_string;
 #include "sdl_utils.hpp"
 #include "serialization/string_utils.hpp"
 
@@ -148,6 +149,9 @@
 
 bool load_font_config();
 
+/** Returns the currently defined fonts. */
+const t_string& get_fonts();
+
 enum CACHE { CACHE_LOBBY, CACHE_GAME };
 void cache_mode(CACHE mode);
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to