Эх сурвалжийг харах

[c][cpp] Ignore return carriage at end of atlas file lines.

badlogic 6 жил өмнө
parent
commit
08694b37b3

+ 2 - 2
spine-c/spine-c/src/spine/Atlas.c

@@ -70,8 +70,8 @@ static void trim(Str* str) {
 		(str->begin)++;
 	if (str->begin == str->end) return;
 	str->end--;
-	/*while (isspace((unsigned char)*str->end) && str->end >= str->begin)
-		str->end--;*/
+	while (((unsigned char)*str->end == '\r') && str->end >= str->begin)
+		str->end--;
 	str->end++;
 }
 

+ 2 - 2
spine-cpp/spine-cpp/src/spine/Atlas.cpp

@@ -249,9 +249,9 @@ void Atlas::trim(Str *str) {
 
 	str->end--;
 
-	/*while (isspace((unsigned char) *str->end) && str->end >= str->begin) {
+	while (((unsigned char)*str->end == '\r') && str->end >= str->begin) {
 		str->end--;
-	}*/
+	}
 
 	str->end++;
 }