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.
This commit is contained in:
lawnjelly 2021-05-11 17:34:14 +01:00
parent 39826d3a94
commit 3c68a6d37f

View file

@ -1881,6 +1881,17 @@ PREAMBLE(bool)::_software_skin_poly(RasterizerCanvas::Item::CommandPolygon *p_po
}
}
} // if bone format matches
else {
// 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++) {
@ -1889,11 +1900,6 @@ PREAMBLE(bool)::_software_skin_poly(RasterizerCanvas::Item::CommandPolygon *p_po
}
}
} // if bone format matches
else {
// not supported
}
// output to the batch verts
for (int n = 0; n < num_inds; n++) {
int ind = p_poly->indices[n];