From 8b00cedf270a3ef7f853ea42558d799a7e3f465c Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sun, 13 Dec 2009 22:20:32 +0000 Subject: [PATCH] More use of SurfacePtr SVN-Revision: 6207 --- src/video/font.cpp | 8 ++++---- src/video/font.hpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/font.cpp b/src/video/font.cpp index b7562faed..429b0a199 100644 --- a/src/video/font.cpp +++ b/src/video/font.cpp @@ -163,15 +163,15 @@ Font::loadFontSurface( int char_width ) { - Surface glyph_surface("images/engine/fonts/" + glyphimage); - Surface shadow_surface("images/engine/fonts/" + shadowimage); + SurfacePtr glyph_surface = Surface::create("images/engine/fonts/" + glyphimage); + SurfacePtr shadow_surface = Surface::create("images/engine/fonts/" + shadowimage); int surface_idx = glyph_surfaces.size(); glyph_surfaces.push_back(glyph_surface); shadow_surfaces.push_back(shadow_surface); int row=0, col=0; - int wrap = glyph_surface.get_width() / char_width; + int wrap = glyph_surface->get_width() / char_width; SDL_Surface *surface = NULL; @@ -424,7 +424,7 @@ Font::draw_chars(Renderer *renderer, bool notshadow, const std::string& text, SurfacePartRequest surfacepartrequest; surfacepartrequest.size = glyph.rect.p2 - glyph.rect.p1; surfacepartrequest.source = glyph.rect.p1; - surfacepartrequest.surface = notshadow ? &(glyph_surfaces[glyph.surface_idx]) : &(shadow_surfaces[glyph.surface_idx]); + surfacepartrequest.surface = notshadow ? glyph_surfaces[glyph.surface_idx].get() : shadow_surfaces[glyph.surface_idx].get(); request.request_data = &surfacepartrequest; renderer->draw_surface_part(request); diff --git a/src/video/font.hpp b/src/video/font.hpp index ffd89b80a..4704d76be 100644 --- a/src/video/font.hpp +++ b/src/video/font.hpp @@ -133,8 +133,8 @@ private: private: GlyphWidth glyph_width; - std::vector glyph_surfaces; - std::vector shadow_surfaces; + std::vector glyph_surfaces; + std::vector shadow_surfaces; int char_height; int shadowsize; -- 2.11.0