X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsupertux%2Finfo_box_line.cpp;h=6a9123a9bd9dd7a8d38b2ac6ecfcbef96f4369c7;hb=21918f9dd888ca5a0b78d4d181e05bf927c7502f;hp=16a69d6f7e7ee86e7ea2e0df1dd0a114af995531;hpb=ff08b8e1983016221967a024dab76799a3d75059;p=supertux.git diff --git a/src/supertux/info_box_line.cpp b/src/supertux/info_box_line.cpp index 16a69d6f7..6a9123a9b 100644 --- a/src/supertux/info_box_line.cpp +++ b/src/supertux/info_box_line.cpp @@ -26,7 +26,7 @@ static const float ITEMS_SPACE = 4; namespace { -Font* get_font_by_format_char(char format_char) { +FontPtr get_font_by_format_char(char format_char) { switch(format_char) { case ' ': @@ -106,7 +106,7 @@ InfoBoxLine::InfoBoxLine(char format_char, const std::string& text) : 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); @@ -157,7 +157,7 @@ InfoBoxLine::split(const std::string& text, float width) // 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)); @@ -174,7 +174,7 @@ InfoBoxLine::draw(DrawingContext& context, const Rectf& bbox, int layer) 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);