summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-02-23 10:50:25 +0000
committerrubidium <rubidium@openttd.org>2009-02-23 10:50:25 +0000
commit0c1b8ea602de72a96573b7e3301589e8e3249ca1 (patch)
treeb1be264cf851bf2b8888a29947b37d3f5539933a /src/fontcache.cpp
parent2433ba042b2e39b0306a04056136a18ca1323136 (diff)
downloadopenttd-0c1b8ea602de72a96573b7e3301589e8e3249ca1.tar.xz
(svn r15555) -Codechange: remove the mallocs + frees for temporary data from loading sprites.
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index fe74e0879..f59d5eff9 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -710,7 +710,7 @@ const Sprite *GetGlyph(FontSize size, WChar key)
height = max(1, slot->bitmap.rows + (size == FS_NORMAL));
/* FreeType has rendered the glyph, now we allocate a sprite and copy the image into it */
- sprite.data = CallocT<SpriteLoader::CommonPixel>(width * height);
+ sprite.AllocateData(width * height);
sprite.width = width;
sprite.height = height;
sprite.x_offs = slot->bitmap_left;
@@ -740,7 +740,6 @@ const Sprite *GetGlyph(FontSize size, WChar key)
}
new_glyph.sprite = BlitterFactoryBase::GetCurrentBlitter()->Encode(&sprite, AllocateFont);
- free(sprite.data);
new_glyph.width = (slot->advance.x >> 6) + (size != FS_NORMAL);
SetGlyphPtr(size, key, &new_glyph);