[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src font.hpp titlescreen.cpp
From: |
Yann Dirson |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src font.hpp titlescreen.cpp |
Date: |
Fri, 24 Sep 2004 19:11:23 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Yann Dirson <address@hidden> 04/09/24 23:04:49
Modified files:
src : font.hpp titlescreen.cpp
Log message:
first stake at centralizing font sizes into font.hpp
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.hpp.diff?tr1=1.39&tr2=1.40&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/titlescreen.cpp.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
Patches:
Index: wesnoth/src/font.hpp
diff -u wesnoth/src/font.hpp:1.39 wesnoth/src/font.hpp:1.40
--- wesnoth/src/font.hpp:1.39 Sun Aug 29 14:58:40 2004
+++ wesnoth/src/font.hpp Fri Sep 24 23:04:49 2004
@@ -1,4 +1,4 @@
-/* $Id: font.hpp,v 1.39 2004/08/29 14:58:40 ydirson Exp $ */
+/* $Id: font.hpp,v 1.40 2004/09/24 23:04:49 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -42,6 +42,11 @@
//standard markups
extern const char LARGE_TEXT, SMALL_TEXT, GOOD_TEXT, BAD_TEXT, NORMAL_TEXT,
BLACK_TEXT, BOLD_TEXT, IMAGE, NULL_MARKUP;
+// font sizes, probably to make theme parameters
+const int SIZE_TITLESCREEN_VERSION = 10,
+ SIZE_TITLESCREEN_TIPOFDAY = 14
+ ;
+
//function to draw text on the screen. The text will be clipped to area.
//If the text runs outside of area horizontally, an ellipsis will be displayed
//at the end of it. If use_tooltips is true, then text with an ellipsis will
Index: wesnoth/src/titlescreen.cpp
diff -u wesnoth/src/titlescreen.cpp:1.18 wesnoth/src/titlescreen.cpp:1.19
--- wesnoth/src/titlescreen.cpp:1.18 Fri Sep 10 17:40:12 2004
+++ wesnoth/src/titlescreen.cpp Fri Sep 24 23:04:49 2004
@@ -145,13 +145,15 @@
const std::string& version_str = _("Version") + std::string(" ") +
game_config::version;
- const SDL_Rect version_area =
font::draw_text(NULL,screen.screen_area(),10,
+ const SDL_Rect version_area = font::draw_text(NULL,screen.screen_area(),
+
font::SIZE_TITLESCREEN_VERSION,
font::NORMAL_COLOUR,version_str,0,0);
const size_t versiony = screen.y() - version_area.h;
if(versiony < size_t(screen.y())) {
font::draw_text(&screen,screen.screen_area(),
-
10,font::NORMAL_COLOUR,version_str,0,versiony);
+ font::SIZE_TITLESCREEN_VERSION,
+ font::NORMAL_COLOUR,version_str,0,versiony);
}
//std::cerr << "drew version number\n";
@@ -200,14 +202,17 @@
std::string tip_of_day = get_tip_of_day(ntip);
if(tip_of_day.empty() == false) {
- tip_of_day =
font::word_wrap_text(tip_of_day,14,(game_config::title_tip_width*screen.x())/1024);
+ tip_of_day =
font::word_wrap_text(tip_of_day,font::SIZE_TITLESCREEN_TIPOFDAY,
+
(game_config::title_tip_width*screen.x())/1024);
- const std::string& tome = font::word_wrap_text(_("-- The Tome
of Wesnoth"),14,(game_config::title_tip_width*screen.x())/1024);
+ const std::string& tome = font::word_wrap_text(_("-- The Tome
of Wesnoth"),
+
font::SIZE_TITLESCREEN_TIPOFDAY,
+
(game_config::title_tip_width*screen.x())/1024);
const int pad = game_config::title_tip_padding;
- SDL_Rect area = font::text_area(tip_of_day,14);
- SDL_Rect tome_area = font::text_area(tome,14,TTF_STYLE_ITALIC);
+ SDL_Rect area =
font::text_area(tip_of_day,font::SIZE_TITLESCREEN_TIPOFDAY);
+ SDL_Rect tome_area =
font::text_area(tome,font::SIZE_TITLESCREEN_TIPOFDAY,TTF_STYLE_ITALIC);
area.w = maximum<size_t>(area.w,tome_area.w) + 2*pad;
area.h += tome_area.h + next_tip_button.location().h + 3*pad;
@@ -218,8 +223,8 @@
draw_dialog_frame(area.x,area.y,area.w,area.h,screen,&style);
-
font::draw_text(&screen,area,14,font::NORMAL_COLOUR,tip_of_day,area.x+pad,area.y+pad);
-
font::draw_text(&screen,area,14,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_TITLESCREEN_TIPOFDAY,font::NORMAL_COLOUR,tip_of_day,area.x+pad,area.y+pad);
+
font::draw_text(&screen,area,font::SIZE_TITLESCREEN_TIPOFDAY,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);
}
events::raise_draw_event();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src font.hpp titlescreen.cpp,
Yann Dirson <=