- const Font* font = 0;
- const Surface* image = 0;
- bool center = true;
- switch(line[0])
- {
- case ' ': font = small_font; break;
- case '\t': font = normal_font; break;
- case '-': font = heading_font; break;
- case '*': font = reference_font; break;
- case '#': font = normal_font; center = false; break;
- case '!': {
- std::string imagename = line.substr(1, line.size()-1);
- image = images[imagename];
- break;
- }
- default:
- std::cerr << "Warning: text contains an unformated line.\n";
- font = normal_font;
- center = false;
- break;
- }
-
- if(font != 0) {
- if(center) {
- context.draw_text(font,
- line.substr(1, line.size()-1),
- Vector(SCREEN_WIDTH/2, SCREEN_HEIGHT + y - scroll),
- CENTER_ALLIGN, LAYER_FOREGROUND1);
- } else {
- context.draw_text(font,
- line.substr(1, line.size()-1),
- Vector(left_border, SCREEN_HEIGHT + y - scroll),
- LEFT_ALLIGN, LAYER_FOREGROUND1);
- }
- y += font->get_height() + ITEMS_SPACE;
- }
- if(image != 0) {
- context.draw_surface(image,
- Vector( (SCREEN_WIDTH - image->w) / 2,
- SCREEN_HEIGHT + y - scroll), 255);
- y += image->h + ITEMS_SPACE;
- }
+ const Font* font = 0;
+ const Surface* image = 0;
+ bool center = true;
+ switch(line[0])
+ {
+ case ' ': font = white_small_text; break;
+ case '\t': font = white_text; break;
+ case '-': font = white_big_text; break;
+ case '*': font = blue_text; break;
+ case '#': font = white_text; center = false; break;
+ case '!': {
+ std::string imagename = line.substr(1, line.size()-1);
+ image = images[imagename];
+ break;
+ }
+ default:
+ log_warning << "text contains an unformated line" << std::endl;
+ font = white_text;
+ center = false;
+ break;