Browse Source

Merge pull request #6 from MathemanFlo/fix_material

Fix multibyte characters in material name
Lubos Lenco 4 năm trước cách đây
mục cha
commit
81c2d993fa
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      Sources/arm/format/ObjParser.hx

+ 3 - 3
Sources/arm/format/ObjParser.hx

@@ -481,14 +481,14 @@ class ObjParser {
 	}
 	}
 
 
 	function readString(): String {
 	function readString(): String {
-		var s = "";
+		var begin = pos;
 		while (true) {
 		while (true) {
 			var c = bytes.get(pos);
 			var c = bytes.get(pos);
 			if (c == "\n".code || c == "\r".code || c == " ".code) break;
 			if (c == "\n".code || c == "\r".code || c == " ".code) break;
 			pos++;
 			pos++;
-			s += String.fromCharCode(c);
 		}
 		}
-		return s;
+		
+		return bytes.getString(begin,pos-begin);
 	}
 	}
 
 
 	function nextLine() {
 	function nextLine() {