summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-01-13 15:00:16 +0000
committertron <tron@openttd.org>2007-01-13 15:00:16 +0000
commite043c6cef7b8afb694a528218c18a15bae3b5315 (patch)
tree9bb1adc7db26f0d3e419320319b33f692cbcb593 /src/fontcache.cpp
parent64f34d322d806e4ff3404b7d4f59a63aed5a82d3 (diff)
downloadopenttd-e043c6cef7b8afb694a528218c18a15bae3b5315.tar.xz
(svn r8097) Replace strlen() {==,!=,>} 0 by the more concise {,!}StrEmpty(). Additionally the test takes O(1) instead of O(n) now
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index ce0a885d5..b44289bc7 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -235,7 +235,7 @@ static void LoadFreeTypeFont(const char *font_name, FT_Face *face, const char *t
{
FT_Error error;
- if (strlen(font_name) == 0) return;
+ if (StrEmpty(font_name)) return;
error = FT_New_Face(_library, font_name, 0, face);
@@ -278,7 +278,7 @@ static void LoadFreeTypeFont(const char *font_name, FT_Face *face, const char *t
void InitFreeType(void)
{
- if (strlen(_freetype.small_font) == 0 && strlen(_freetype.medium_font) == 0 && strlen(_freetype.large_font) == 0) {
+ if (StrEmpty(_freetype.small_font) && StrEmpty(_freetype.medium_font) && StrEmpty(_freetype.large_font)) {
DEBUG(freetype, 1, "No font faces specified, using sprite fonts instead");
return;
}