15 #define GETTEXT_DOMAIN "wesnoth-lib"
48 if(area.w >= 2 && area.h >= 2) {
49 int fcr = 21, fcg = 53, fcb = 80;
50 int bcr = 0, bcg = 0, bcb = 0;
51 int gcr = 255, gcg = 255, gcb = 255;
52 int lightning_thickness = 2;
53 static const SDL_Color selected_text_color = {0xCC,0xCC,0xCC,0};
61 sdl::fill_rect(surf,&inner_area,SDL_MapRGB(surf->format,gcr,gcg,gcb));
63 inner_area.w = (inner_area.w*
progress_)/100;
64 sdl::fill_rect(surf,&inner_area,SDL_MapRGB(surf->format,fcr,fcg,fcb));
66 SDL_Rect lightning = inner_area;
67 lightning.h = lightning_thickness;
69 sdl::fill_rect(surf,&lightning,SDL_MapRGB(surf->format,(fcr*3+255)/4,(fcg*3+255)/4,(fcb*3+255)/4));
70 lightning.y = inner_area.y+inner_area.h-lightning.h;
72 sdl::fill_rect(surf,&lightning,SDL_MapRGB(surf->format,fcr/2,fcg/2,fcb/2));
78 text_area.x = area.x + area.w/2 - text_area.w/2;
79 text_area.y = area.y + area.h/2 - text_area.h/2;
93 SDL_Rect selected_text_location =
location();
94 selected_text_location.w = inner_area.w;
95 selected_text_location.h = inner_area.h;
100 selected_text_location,
SDL_Rect text_area(const std::string &text, int size, int style)
Calculate the size of a text (in pixels) if it were to be drawn.
void fill_rect(surface &dst, SDL_Rect *dst_rect, const Uint32 color)
Fill a rectangle on a given surface.
const SDL_Color BLACK_COLOR
void set_text(const std::string &text)
SDL_Rect draw_text(surface &dst, const SDL_Rect &area, int size, const SDL_Color &color, const std::string &txt, int x, int y, bool use_tooltips, int style)
Function to draw text on a surface.
SDL_Rect create_rect(const int x, const int y, const int w, const int h)
Creates an empty SDL_Rect.
Contains the SDL_Rect helper code.
progress_bar(CVideo &video)
void set_progress_percent(int progress)
void update_rect(const SDL_Rect &)
GLsizei const GLcharARB ** string