wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src dialogs.cpp font.cpp font.hpp intro...


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src dialogs.cpp font.cpp font.hpp intro...
Date: Sat, 27 Nov 2004 05:31:38 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    04/11/27 10:24:50

Modified files:
        src            : dialogs.cpp font.cpp font.hpp intro.cpp 
                         show_dialog.cpp titlescreen.cpp 

Log message:
        Remove unused parameters and enum from font.cpp.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/dialogs.cpp.diff?tr1=1.73&tr2=1.74&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.cpp.diff?tr1=1.92&tr2=1.93&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.hpp.diff?tr1=1.46&tr2=1.47&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/intro.cpp.diff?tr1=1.64&tr2=1.65&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/show_dialog.cpp.diff?tr1=1.103&tr2=1.104&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/titlescreen.cpp.diff?tr1=1.30&tr2=1.31&r1=text&r2=text

Patches:
Index: wesnoth/src/dialogs.cpp
diff -u wesnoth/src/dialogs.cpp:1.73 wesnoth/src/dialogs.cpp:1.74
--- wesnoth/src/dialogs.cpp:1.73        Sat Nov 27 09:49:44 2004
+++ wesnoth/src/dialogs.cpp     Sat Nov 27 10:24:50 2004
@@ -1,4 +1,4 @@
-/* $Id: dialogs.cpp,v 1.73 2004/11/27 09:49:44 silene Exp $ */
+/* $Id: dialogs.cpp,v 1.74 2004/11/27 10:24:50 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -384,7 +384,7 @@
                }
        }
 
-       
font::draw_text(&disp(),area,font::SIZE_SMALL,font::NORMAL_COLOUR,str.str(),area.x,ypos,NULL,true);
+       font::draw_text(&disp(), area, font::SIZE_SMALL, font::NORMAL_COLOUR, 
str.str(), area.x, ypos, true);
 }
 
 } //end anon namespace
Index: wesnoth/src/font.cpp
diff -u wesnoth/src/font.cpp:1.92 wesnoth/src/font.cpp:1.93
--- wesnoth/src/font.cpp:1.92   Thu Nov 18 22:00:12 2004
+++ wesnoth/src/font.cpp        Sat Nov 27 10:24:50 2004
@@ -1,4 +1,4 @@
-/* $Id: font.cpp,v 1.92 2004/11/18 22:00:12 ydirson Exp $ */
+/* $Id: font.cpp,v 1.93 2004/11/27 10:24:50 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -364,7 +364,7 @@
                for(std::vector< surface >::const_iterator i = surfaces.begin(),
                    i_end = surfaces.end(); i != i_end; ++i) {
                        SDL_SetAlpha(*i, 0, 0); // direct blit without alpha 
blending
-                       SDL_Rect dstrect = {0, ypos};
+                       SDL_Rect dstrect = {0, ypos, 0, 0};
                        SDL_BlitSurface(*i, NULL, res, &dstrect);
                        ypos += (*i)->h;
                }
@@ -442,7 +442,7 @@
 
 SDL_Rect draw_text_line(surface gui_surface, const SDL_Rect& area, int size,
                   const SDL_Color& colour, const std::string& text,
-                  int x, int y, surface bg, bool use_tooltips, int style)
+                  int x, int y, bool use_tooltips, int style)
 {
        
        TTF_Font* const font = get_font(size);
@@ -506,7 +506,7 @@
 
 SDL_Rect draw_text_line(display* gui, const SDL_Rect& area, int size,
                         const SDL_Color& colour, const std::string& text,
-                        int x, int y, surface bg, bool use_tooltips, int style)
+                        int x, int y, bool use_tooltips, int style)
 {
        surface surface;
        
@@ -516,19 +516,18 @@
                surface = gui->video().getSurface();
        }
        
-       return draw_text_line(surface, area, size, colour, text, x, y, bg, 
use_tooltips, style);
+       return draw_text_line(surface, area, size, colour, text, x, y, 
use_tooltips, style);
 }
 
 SDL_Rect text_area(const std::string& text, int size, int style)
 {
        const SDL_Rect area = {0,0,10000,10000};
-       return 
draw_text(NULL,area,size,font::NORMAL_COLOUR,text,0,0,NULL,false,USE_MARKUP,style);
+       return draw_text(NULL, area, size, font::NORMAL_COLOUR, text, 0, 0, 
false, style);
 }
 
 SDL_Rect draw_text(display* gui, const SDL_Rect& area, int size,
                    const SDL_Color& colour, const std::string& txt,
-                   int x, int y, surface bg, bool use_tooltips,
-                   MARKUP use_markup, int style)
+                   int x, int y, bool use_tooltips, int style)
 {
        //make sure there's always at least a space, so we can ensure
        //that we can return a rectangle for height
@@ -555,7 +554,7 @@
 
                        config::unescape(new_string);
 
-                       const SDL_Rect rect = 
draw_text_line(gui,area,sz,col,new_string,x,y,bg,use_tooltips,text_style);
+                       const SDL_Rect rect = draw_text_line(gui, area, sz, 
col, new_string, x, y, use_tooltips, text_style);
                        if(rect.w > res.w) {
                                res.w = rect.w;
                        }
@@ -720,10 +719,10 @@
        
        SDL_Rect draw_wrapped_text(display* gui, const SDL_Rect& area, int 
font_size,
                             const SDL_Color& colour, const std::string& text,
-                            int x, int y, int max_width, surface bg)
+                            int x, int y, int max_width)
        {
                std::string wrapped_text = word_wrap_text(text, font_size, 
max_width);
-               return font::draw_text(gui, area, font_size, colour, 
wrapped_text, x, y, bg, false, NO_MARKUP);
+               return font::draw_text(gui, area, font_size, colour, 
wrapped_text, x, y, false);
        }
 
 }
Index: wesnoth/src/font.hpp
diff -u wesnoth/src/font.hpp:1.46 wesnoth/src/font.hpp:1.47
--- wesnoth/src/font.hpp:1.46   Thu Nov  4 20:58:43 2004
+++ wesnoth/src/font.hpp        Sat Nov 27 10:24:50 2004
@@ -1,4 +1,4 @@
-/* $Id: font.hpp,v 1.46 2004/11/04 20:58:43 ydirson Exp $ */
+/* $Id: font.hpp,v 1.47 2004/11/27 10:24:50 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -37,8 +37,6 @@
 extern const SDL_Color NORMAL_COLOUR, GOOD_COLOUR, BAD_COLOUR, BLACK_COLOUR,
                        DARK_COLOUR, YELLOW_COLOUR, BUTTON_COLOUR, TITLE_COLOUR;
 
-enum MARKUP { USE_MARKUP, NO_MARKUP };
-
 //standard markups
 extern const char LARGE_TEXT, SMALL_TEXT, GOOD_TEXT, BAD_TEXT, NORMAL_TEXT, 
BLACK_TEXT, BOLD_TEXT, IMAGE, NULL_MARKUP;
 
@@ -68,8 +66,7 @@
 //at the end of it. If use_tooltips is true, then text with an ellipsis will
 //have a tooltip set for it equivalent to the entire contents of the text.
 //
-//if use_markup is equal to USE_MARKUP, then some very basic 'markup' will
-//be done on the text:
+//some very basic 'markup' will be done on the text:
 // - any line beginning in # will be displayed in BAD_COLOUR
 // - any line beginning in @ will be displayed in GOOD_COLOUR
 // - any line beginning in + will be displayed with size increased by 2
@@ -83,8 +80,7 @@
 
 SDL_Rect draw_text(display* gui, const SDL_Rect& area, int size,
                    const SDL_Color& colour, const std::string& text,
-                   int x, int y, surface bg=NULL,
-                   bool use_tooltips=false, MARKUP use_markup=USE_MARKUP, int 
style=0);
+                   int x, int y, bool use_tooltips = false, int style = 0);
 
 //function which returns the size of text if it were to be drawn.
 SDL_Rect text_area(const std::string& text, int size, int style=0);
@@ -127,7 +123,7 @@
 /// 
 SDL_Rect draw_wrapped_text(display* gui, const SDL_Rect& area, int font_size,
                             const SDL_Color& colour, const std::string& text,
-                            int x, int y, int max_width, surface bg = NULL);
+                            int x, int y, int max_width);
 
 
 /// structure which will hide all current floating labels, and cause floating 
labels
Index: wesnoth/src/intro.cpp
diff -u wesnoth/src/intro.cpp:1.64 wesnoth/src/intro.cpp:1.65
--- wesnoth/src/intro.cpp:1.64  Thu Nov 18 22:00:12 2004
+++ wesnoth/src/intro.cpp       Sat Nov 27 10:24:50 2004
@@ -1,4 +1,4 @@
-/* $Id: intro.cpp,v 1.64 2004/11/18 22:00:12 ydirson Exp $ */
+/* $Id: intro.cpp,v 1.65 2004/11/27 10:24:50 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -245,8 +245,7 @@
                                }
                                const SDL_Rect rect = 
font::draw_text(NULL,screen.screen_area(),
                                                
font::SIZE_PLUS,font::NORMAL_COLOUR,
-                                               word,xpos,ypos,NULL,
-                                               false,font::NO_MARKUP);
+                                               word, xpos, ypos, false);
 
                                if(xpos + rect.w >= max_xpos) {
                                        xpos = textx;
@@ -260,7 +259,7 @@
                        const SDL_Rect rect = font::draw_text(&screen,
                                        screen.screen_area(),font::SIZE_PLUS,
                                        font::NORMAL_COLOUR,*j,xpos,ypos,
-                                       NULL,false,font::NO_MARKUP);
+                                       false);
 
                        if(rect.h > height)
                                height = rect.h;
Index: wesnoth/src/show_dialog.cpp
diff -u wesnoth/src/show_dialog.cpp:1.103 wesnoth/src/show_dialog.cpp:1.104
--- wesnoth/src/show_dialog.cpp:1.103   Thu Nov 18 22:00:12 2004
+++ wesnoth/src/show_dialog.cpp Sat Nov 27 10:24:50 2004
@@ -1,4 +1,4 @@
-/* $Id: show_dialog.cpp,v 1.103 2004/11/18 22:00:12 ydirson Exp $ */
+/* $Id: show_dialog.cpp,v 1.104 2004/11/27 10:24:50 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -205,7 +205,8 @@
                rect = disp->screen_area();
        }
 
-       return 
font::draw_text(disp,rect,font::SIZE_LARGE,font::TITLE_COLOUR,text,x,y+5,NULL,false,font::USE_MARKUP,TTF_STYLE_BOLD);
+       return font::draw_text(disp, rect, font::SIZE_LARGE, font::TITLE_COLOUR,
+                              text, x, y + 5, false, TTF_STYLE_BOLD);
 }
 
 void draw_dialog(int x, int y, int w, int h, display& disp, const std::string& 
title,
@@ -453,13 +454,13 @@
        SDL_Rect text_size = { 0, 0, 0, 0 };
        if(!message.empty()) {
                text_size = font::draw_text(NULL, clipRect, message_font_size,
-                                                           
font::NORMAL_COLOUR, message, 0, 0, NULL);
+                                           font::NORMAL_COLOUR, message, 0, 0);
        }
 
        SDL_Rect caption_size = { 0, 0, 0, 0 };
        if (!caption.empty() && image != NULL) {
                caption_size = font::draw_text(NULL, clipRect, 
caption_font_size,
-                                              
font::NORMAL_COLOUR,caption,0,0,NULL);
+                                              font::NORMAL_COLOUR, caption, 0, 
0);
        }
 
        const char** button_list = NULL;
@@ -700,7 +701,7 @@
                font::draw_text(&disp, clipRect, caption_font_size,
                                font::NORMAL_COLOUR, caption,
                                xloc+image_width+left_padding+image_h_padding,
-                               yloc+top_padding, NULL);
+                               yloc+top_padding);
        }
 
        font::draw_text(&disp, clipRect, message_font_size,
Index: wesnoth/src/titlescreen.cpp
diff -u wesnoth/src/titlescreen.cpp:1.30 wesnoth/src/titlescreen.cpp:1.31
--- wesnoth/src/titlescreen.cpp:1.30    Mon Nov 22 21:36:41 2004
+++ wesnoth/src/titlescreen.cpp Sat Nov 27 10:24:50 2004
@@ -251,7 +251,9 @@
                draw_dialog_frame(area.x,area.y,area.w,area.h,screen,&style);
 
                
font::draw_text(&screen,area,font::SIZE_NORMAL,font::NORMAL_COLOUR,tip_of_day,area.x+pad,area.y+pad);
-               
font::draw_text(&screen,area,font::SIZE_NORMAL,font::NORMAL_COLOUR,tome,area.x+area.w-tome_area.w-pad,next_tip_button.location().y-tome_area.h-pad,NULL,false,font::NO_MARKUP,TTF_STYLE_ITALIC);
+               font::draw_text(&screen, area, font::SIZE_NORMAL, 
font::NORMAL_COLOUR,
+                               tome, area.x + area.w - tome_area.w - pad,
+                               next_tip_button.location().y - tome_area.h - 
pad, false, TTF_STYLE_ITALIC);
        }
 
        events::raise_draw_event();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]