[Super-tux-commit] supertux/lib/video font.cpp,1.3,1.4 font.h,1.4,1.5 screen.cpp,1.3,1.4
Brought to you by:
wkendrick
From: Tobias G. <to...@us...> - 2004-07-26 15:48:47
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv708/lib/video Modified Files: font.cpp font.h screen.cpp Log Message: Made the SuperTux library again a bit more selfstanding. Moved global fonts to src/ and they are handled as static variables inside Menu:: and Button:: . Index: font.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- font.cpp 22 Jul 2004 19:07:51 -0000 1.3 +++ font.cpp 26 Jul 2004 15:48:37 -0000 1.4 @@ -131,7 +131,7 @@ #define SCROLL 60 #define ITEMS_SPACE 4 -void SuperTux::display_text_file(const std::string& file, float scroll_speed) +void SuperTux::display_text_file(const std::string& file, float scroll_speed, Font* heading_font, Font* normal_font, Font* small_font, Font* reference_font ) { std::string text; std::vector<std::string> names; @@ -229,18 +229,18 @@ float y = 0; for(size_t i = 0; i < names.size(); i++) { if(names[i].size() == 0) { - y += white_text->get_height() + ITEMS_SPACE; + y += normal_font->get_height() + ITEMS_SPACE; continue; } Font* font = 0; switch(names[i][0]) { - case ' ': font = white_small_text; break; - case '\t': font = white_text; break; - case '-': font = white_big_text; break; - case '*': font = blue_text; break; - default: font = blue_text; break; + case ' ': font = small_font; break; + case '\t': font = normal_font; break; + case '-': font = heading_font; break; + case '*': font = reference_font; break; + default: font = reference_font; break; } context.draw_text_center(font, Index: font.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- font.h 25 Jul 2004 19:03:35 -0000 1.4 +++ font.h 26 Jul 2004 15:48:38 -0000 1.5 @@ -29,10 +29,6 @@ namespace SuperTux { - /** Reads a text file (using LispReader, so it as to be in its formatting) - and displays it in a StarTrek fashion */ - void display_text_file(const std::string& file, float scroll_speed); - /// Font class Font { @@ -75,6 +71,11 @@ int last_char; }; + + /** Reads a text file (using LispReader, so it as to be in its formatting) + and displays it in a StarTrek fashion */ + void display_text_file(const std::string& file, float scroll_speed, Font* heading_font, Font* normal_font, Font* small_font, Font* reference_font ); + } //namespace SuperTux #endif /*SUPERTUX_FONT_H*/ Index: screen.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/screen.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- screen.cpp 22 Jul 2004 19:07:51 -0000 1.3 +++ screen.cpp 26 Jul 2004 15:48:38 -0000 1.4 @@ -264,11 +264,7 @@ } fillrect(0, 0, screen->w, screen->h, 0, 0, 0, 255); - - DrawingContext context; - context.draw_text_center(white_text, "Loading...", - Vector(0, screen->h/2), LAYER_FOREGROUND1); - context.do_drawing(); + } void SuperTux::shrink_fade(const Vector& point, int fade_time) |