瀏覽代碼

Batching - fallback for 2d skinning with unrigged polys.

In the legacy renderer unrigged polys would display with no transform applied, whereas the software skinning didn't deal with these at all (outputted them with position zero). This PR simply copies the source to destination verts and replicates the legacy behaviour.

(cherry picked from commit 3c68a6d37fcfc0fa2c1a97099b46ac6465b722da)
lawnjelly 4 年之前
父節點
當前提交
3624abd613
共有 1 個文件被更改,包括 15 次插入9 次删除
  1. 15 9
      drivers/gles_common/rasterizer_canvas_batcher.h

+ 15 - 9
drivers/gles_common/rasterizer_canvas_batcher.h

@@ -1885,17 +1885,23 @@ PREAMBLE(bool)::_software_skin_poly(RasterizerCanvas::Item::CommandPolygon *p_po
 			}
 		}
 
-		// software transform with combined matrix?
-		if (p_fill_state.transform_mode != TM_NONE) {
-			for (int n = 0; n < num_verts; n++) {
-				Vector2 &dst_pos = pTemps[n];
-				_software_transform_vertex(dst_pos, p_fill_state.transform_combined);
-			}
-		}
-
 	} // if bone format matches
 	else {
-		// not supported
+		// not rigged properly, just copy the verts directly
+		for (int n = 0; n < num_verts; n++) {
+			const Vector2 &src_pos = p_poly->points[n];
+			Vector2 &dst_pos = pTemps[n];
+
+			dst_pos = src_pos;
+		}
+	}
+
+	// software transform with combined matrix?
+	if (p_fill_state.transform_mode != TM_NONE) {
+		for (int n = 0; n < num_verts; n++) {
+			Vector2 &dst_pos = pTemps[n];
+			_software_transform_vertex(dst_pos, p_fill_state.transform_combined);
+		}
 	}
 
 	// output to the batch verts