summaryrefslogtreecommitdiff
path: root/src/fontcache.h
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2021-05-01 08:54:05 +0100
committerPeterN <peter@fuzzle.org>2021-05-01 10:41:39 +0100
commit9c6c0a0966f79996dfb7b5c7097c7d6c04a8d35c (patch)
tree55015f04f1f356f8fdfa60574c73ce5a2908f7c8 /src/fontcache.h
parentce55cd0ce703acb3a731f7d2d783fb3462fab6c8 (diff)
downloadopenttd-9c6c0a0966f79996dfb7b5c7097c7d6c04a8d35c.tar.xz
Codechange: Scale sprite font height once on init instead of every call to GetHeight().
Scaling is not expensive, but it does not change either, and this avoids the need for a virtual method call. This cascades back to all GetCharacterHeight(FS_xxx) and FONT_HEIGHT_xxx calls.
Diffstat (limited to 'src/fontcache.h')
-rw-r--r--src/fontcache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fontcache.h b/src/fontcache.h
index 73675cf44..c3b20cb4f 100644
--- a/src/fontcache.h
+++ b/src/fontcache.h
@@ -45,7 +45,7 @@ public:
* Get the height of the font.
* @return The height of the font.
*/
- virtual int GetHeight() const { return this->height; }
+ inline int GetHeight() const { return this->height; }
/**
* Get the ascender value of the font.