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.
(cherry picked from commit 9c6c0a0966
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
dc746288ce
commit
78ccee01d4
@@ -49,7 +49,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.
|
||||
|
Reference in New Issue
Block a user