Lubos Lenco 4 rokov pred
rodič
commit
f00c9aaa2c

+ 2 - 2
Sources/arm/format/FbxLibrary.hx

@@ -165,7 +165,7 @@ class FbxTools {
 	}
 
 	public static function getType(n: FbxNode) {
-		if(n.props.length != 3) throw n.name + " is not an object";
+		if (n.props.length != 3) throw n.name + " is not an object";
 		return switch(n.props[2]) {
 			case PString(n): n;
 			default: throw n.name + " is not an object";
@@ -403,7 +403,7 @@ class Parser {
 					pos--;
 					return TLength(Std.parseInt(getBuf(start, pos - start)));
 				default:
-					if((c >= 'a'.code && c <= 'z'.code) || (c >= 'A'.code && c <= 'Z'.code) || c == '_'.code) {
+					if ((c >= 'a'.code && c <= 'z'.code) || (c >= 'A'.code && c <= 'Z'.code) || c == '_'.code) {
 						do {
 							c = nextChar();
 						} while (isIdentChar(c));

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

@@ -349,7 +349,9 @@ class ObjParser {
 				// Split indices per tile
 				udims = [];
 				udimsU = tilesU;
-				for (i in 0...tilesU * tilesV) { udims.push(new kha.arrays.Uint32Array(num[i])); num[i] = 0; }
+				for (i in 0...tilesU * tilesV) {
+					udims.push(new kha.arrays.Uint32Array(num[i])); num[i] = 0;
+				}
 
 				for (i in 0...Std.int(inda.length / 3)) {
 					var i1 = inda[i * 3    ];
@@ -391,7 +393,9 @@ class ObjParser {
 			}
 		}
 		bytes = null;
-		if (!hasNext) { posFirst = norFirst = uvFirst = null; }
+		if (!hasNext) {
+			posFirst = norFirst = uvFirst = null;
+		}
 	}
 
 	function readFaceFast() {
@@ -452,7 +456,10 @@ class ObjParser {
 		var len = bi - 1;
 		for (i in 0...bi - off) {
 			var c = buf[len - i];
-			if (c == ".".code) { dot = dec; continue; }
+			if (c == ".".code) {
+				dot = dec;
+				continue;
+			}
 			res += (c - 48) * dec;
 			dec *= 10;
 		}

+ 2 - 2
Sources/arm/shader/MaterialParser.hx

@@ -1690,10 +1690,10 @@ class MaterialParser {
 			}
 		}
 
-		if (color_space == 1) { //SRGB to linear
+		if (color_space == 1) { // sRGB to linear
 			curshader.write('$tex_store.rgb = pow($tex_store.rgb, vec3(2.2, 2.2, 2.2));');
 		}
-		else if(color_space == 2) { //From DirectX normal map to OpenGl normal map
+		else if (color_space == 2) { // DirectX normal map to OpenGL normal map
 		    curshader.write('$tex_store.y = 1.0 - $tex_store.y;');
 		}
 

+ 1 - 1
Sources/arm/shader/NodesMaterial.hx

@@ -1251,7 +1251,7 @@ class NodesMaterial {
 						name: _tr("Color Space"),
 						type: "ENUM",
 						default_value: 0,
-						data: [_tr("linear"), _tr("srgb"), _tr("DirectX normal map")]
+						data: [_tr("Linear"), _tr("sRGB"), _tr("DirectX Normal Map")]
 					},
 					{
 						name: _tr("Invert Color"),

+ 21 - 7
Sources/arm/sys/Path.hx

@@ -113,13 +113,27 @@ class Path {
 		return false;
 	}
 
-	public static inline function isBaseColorTex(p: String): Bool { return checkExt(p, baseColorExt); }
-	public static inline function isOpacityTex(p: String): Bool { return checkExt(p, opacityExt); }
-	public static inline function isNormalMapTex(p: String): Bool { return checkExt(p, normalMapExt); }
-	public static inline function isOcclusionTex(p: String): Bool { return checkExt(p, occlusionExt); }
-	public static inline function isRoughnessTex(p: String): Bool { return checkExt(p, roughnessExt); }
-	public static inline function isMetallicTex(p: String): Bool { return checkExt(p, metallicExt); }
-	public static inline function isDisplacementTex(p: String): Bool { return checkExt(p, displacementExt); }
+	public static inline function isBaseColorTex(p: String): Bool {
+		return checkExt(p, baseColorExt);
+	}
+	public static inline function isOpacityTex(p: String): Bool {
+		return checkExt(p, opacityExt);
+	}
+	public static inline function isNormalMapTex(p: String): Bool {
+		return checkExt(p, normalMapExt);
+	}
+	public static inline function isOcclusionTex(p: String): Bool {
+		return checkExt(p, occlusionExt);
+	}
+	public static inline function isRoughnessTex(p: String): Bool {
+		return checkExt(p, roughnessExt);
+	}
+	public static inline function isMetallicTex(p: String): Bool {
+		return checkExt(p, metallicExt);
+	}
+	public static inline function isDisplacementTex(p: String): Bool {
+		return checkExt(p, displacementExt);
+	}
 
 	public static function isFolder(p: String): Bool {
 		return p.indexOf(".") == -1;