namespace {
-Font* get_font_by_format_char(char format_char) {
+FontPtr get_font_by_format_char(char format_char) {
switch(format_char)
{
case ' ':
font(Resources::normal_font),
color(),
text(text),
- image(0)
+ image()
{
font = get_font_by_format_char(format_char);
lineType = get_linetype_by_format_char(format_char);
// append wrapped parts of line into list
std::string overflow;
do {
- Font* font = get_font_by_format_char(format_char);
+ FontPtr font = get_font_by_format_char(format_char);
std::string s2 = s;
if (font) s2 = font->wrap_to_width(s2, width, &overflow);
lines.push_back(new InfoBoxLine(format_char, s2));
Vector position = bbox.p1;
switch (lineType) {
case IMAGE:
- context.draw_surface(image.get(), Vector( (bbox.p1.x + bbox.p2.x - image->get_width()) / 2, position.y), layer);
+ context.draw_surface(image, Vector( (bbox.p1.x + bbox.p2.x - image->get_width()) / 2, position.y), layer);
break;
case NORMAL_LEFT:
context.draw_text(font, text, Vector(position.x, position.y), ALIGN_LEFT, layer, color);