summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-07-06 18:56:23 +0000
committerfrosch <frosch@openttd.org>2013-07-06 18:56:23 +0000
commit4824cb78863ff8b5ff631631a1fd8b5c8dfba500 (patch)
treedfaeb357932ce8177d66ea3544ce42f8d500cf5f /src/fontcache.cpp
parent72a531bc82d5458d8f3483ffa88332b673a819d4 (diff)
downloadopenttd-4824cb78863ff8b5ff631631a1fd8b5c8dfba500.tar.xz
(svn r25569) -Codechange: Cache all Font instances in a static container.
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index b51cecaf6..9e0fd1e16 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -17,6 +17,7 @@
#include "core/smallmap_type.hpp"
#include "strings_func.h"
#include "zoom_type.h"
+#include "gfx_layout.h"
#include "table/sprites.h"
#include "table/control_codes.h"
@@ -39,6 +40,7 @@ FontCache::FontCache(FontSize fs) : parent(FontCache::Get(fs)), fs(fs), height(_
{
assert(parent == NULL || this->fs == parent->fs);
FontCache::caches[this->fs] = this;
+ Layouter::ResetFontCache(this->fs);
}
/** Clean everything up. */
@@ -46,6 +48,7 @@ FontCache::~FontCache()
{
assert(this->fs == parent->fs);
FontCache::caches[this->fs] = this->parent;
+ Layouter::ResetFontCache(this->fs);
}