소스 검색

Minor clean code

borisrp 5 달 전
부모
커밋
94c5a414c0
1개의 변경된 파일9개의 추가작업 그리고 8개의 파일을 삭제
  1. 9 8
      h3d/scene/MeshBatch.hx

+ 9 - 8
h3d/scene/MeshBatch.hx

@@ -529,22 +529,23 @@ class MeshBatch extends MultiMaterial {
 			}
 			var curShader = shaders[p.instance];
 			switch( p.type ) {
-			case TVec(4, _):
-				var v : h3d.Vector4 = curShader.getParamValue(p.index);
-				buf[pos++] = v.x;
-				buf[pos++] = v.y;
-				buf[pos++] = v.z;
-				buf[pos++] = v.w;
 			case TVec(size, _):
-				var v : h3d.Vector = curShader.getParamValue(p.index);
 				switch( size ) {
 				case 2:
+					var v : h3d.Vector = curShader.getParamValue(p.index);
 					buf[pos++] = v.x;
 					buf[pos++] = v.y;
-				default:
+				case 3:
+					var v : h3d.Vector = curShader.getParamValue(p.index);
 					buf[pos++] = v.x;
 					buf[pos++] = v.y;
 					buf[pos++] = v.z;
+				case 4:
+					var v : h3d.Vector4 = curShader.getParamValue(p.index);
+					buf[pos++] = v.x;
+					buf[pos++] = v.y;
+					buf[pos++] = v.z;
+					buf[pos++] = v.w;
 				}
 			case TFloat:
 				buf[pos++] = curShader.getParamFloatValue(p.index);