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.
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user