diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-09 14:25:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-09 14:25:31 +0200 |
commit | 7bb2215ed0d7415179a8b59ad4766a3b573cf696 (patch) | |
tree | 595b16a4ec53b373d44d59ecfae8bec2bd1aab71 /scene/resources/dynamic_font.cpp | |
parent | 7bc984cd67fbc4a76e107d0e6f7d2c3fa2ba9de7 (diff) | |
parent | af5e0fff66d55d07a7910bcd7f170da2f952f7cb (diff) |
Merge pull request #31213 from KoBeWi/explain_scenes
Replace ERR_EXPLAIN in scene/* code
Diffstat (limited to 'scene/resources/dynamic_font.cpp')
-rw-r--r-- | scene/resources/dynamic_font.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 58fd883b0d..df8d4a7fed 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -118,8 +118,7 @@ Error DynamicFontAtSize::_load() { int error = FT_Init_FreeType(&library); - ERR_EXPLAIN(TTR("Error initializing FreeType.")); - ERR_FAIL_COND_V(error != 0, ERR_CANT_CREATE); + ERR_FAIL_COND_V_MSG(error != 0, ERR_CANT_CREATE, "Error initializing FreeType."); // FT_OPEN_STREAM is extremely slow only on Android. if (OS::get_singleton()->get_name() == "Android" && font->font_mem == NULL && font->font_path != String()) { @@ -177,19 +176,18 @@ Error DynamicFontAtSize::_load() { error = FT_Open_Face(library, &fargs, 0, &face); } else { - ERR_EXPLAIN("DynamicFont uninitialized"); - ERR_FAIL_V(ERR_UNCONFIGURED); + ERR_FAIL_V_MSG(ERR_UNCONFIGURED, "DynamicFont uninitialized."); } //error = FT_New_Face( library, src_path.utf8().get_data(),0,&face ); if (error == FT_Err_Unknown_File_Format) { - ERR_EXPLAIN(TTR("Unknown font format.")); + ERR_EXPLAIN("Unknown font format."); FT_Done_FreeType(library); } else if (error) { - ERR_EXPLAIN(TTR("Error loading font.")); + ERR_EXPLAIN("Error loading font."); FT_Done_FreeType(library); } @@ -509,8 +507,7 @@ DynamicFontAtSize::Character DynamicFontAtSize::_bitmap_to_character(FT_Bitmap b } break; // TODO: FT_PIXEL_MODE_LCD default: - ERR_EXPLAIN("Font uses unsupported pixel format: " + itos(bitmap.pixel_mode)); - ERR_FAIL_V(Character::not_found()); + ERR_FAIL_V_MSG(Character::not_found(), "Font uses unsupported pixel format: " + itos(bitmap.pixel_mode) + "."); break; } } |