summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-06-20 15:05:59 +0000
committeralberth <alberth@openttd.org>2009-06-20 15:05:59 +0000
commit8aa51823fca66887f21533e0de292faf6c907496 (patch)
tree19f87218810a7d6811cfca2556ba745ba6b6bf20 /src/fontcache.cpp
parent4419366f94f75032b53362e2722b6476beb02866 (diff)
downloadopenttd-8aa51823fca66887f21533e0de292faf6c907496.tar.xz
(svn r16604) -Codechange: Use FS_BEGIN for iterating over fonts.
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index 2b9854b9d..e59104ac6 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -631,14 +631,13 @@ static GlyphEntry **_glyph_ptr[FS_END];
/** Clear the complete cache */
static void ResetGlyphCache()
{
- for (int i = 0; i < FS_END; i++) {
+ for (FontSize i = FS_BEGIN; i < FS_END; i++) {
if (_glyph_ptr[i] == NULL) continue;
for (int j = 0; j < 256; j++) {
if (_glyph_ptr[i][j] == NULL) continue;
for (int k = 0; k < 256; k++) {
- if (_glyph_ptr[i][j][k].sprite == NULL) continue;
free(_glyph_ptr[i][j][k].sprite);
}
@@ -842,11 +841,11 @@ void SetUnicodeGlyph(FontSize size, uint32 key, SpriteID sprite)
void InitializeUnicodeGlyphMap()
{
- for (FontSize size = FS_NORMAL; size != FS_END; size++) {
+ for (FontSize size = FS_BEGIN; size != FS_END; size++) {
/* Clear out existing glyph map if it exists */
if (_unicode_glyph_map[size] != NULL) {
for (uint i = 0; i < 256; i++) {
- if (_unicode_glyph_map[size][i] != NULL) free(_unicode_glyph_map[size][i]);
+ free(_unicode_glyph_map[size][i]);
}
free(_unicode_glyph_map[size]);
_unicode_glyph_map[size] = NULL;