浏览代码

fix for BitmapFont::create_from_fnt to allow loading from file in
project root directory.

Ibrahn Sahir 7 年之前
父节点
当前提交
8981924fbe
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      scene/resources/font.cpp

+ 2 - 2
scene/resources/font.cpp

@@ -257,8 +257,8 @@ Error BitmapFont::create_from_fnt(const String &p_file) {
 
 			if (keys.has("file")) {
 
-				String file = keys["file"];
-				file = p_file.get_base_dir() + "/" + file;
+				String base_dir = p_file.get_base_dir();
+				String file = base_dir.plus_file(keys["file"]);
 				Ref<Texture> tex = ResourceLoader::load(file);
 				if (tex.is_null()) {
 					ERR_PRINT("Can't load font texture!");