mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[godot] Closes #2117, setting meshes of inactive slots invisible breaks draw order.
Since we clear the mesh instances, we can refrain from setting them invisible.
This commit is contained in:
parent
ec034a0654
commit
72c547bd01
@ -532,13 +532,11 @@ void SpineSprite::update_meshes(Ref<SpineSkeleton> skeleton_ref) {
|
|||||||
spine::Slot *slot = skeleton->getDrawOrder()[i];
|
spine::Slot *slot = skeleton->getDrawOrder()[i];
|
||||||
spine::Attachment *attachment = slot->getAttachment();
|
spine::Attachment *attachment = slot->getAttachment();
|
||||||
MeshInstance2D *mesh_instance = mesh_instances[i];
|
MeshInstance2D *mesh_instance = mesh_instances[i];
|
||||||
|
clear_mesh_instance(mesh_instance);
|
||||||
if (!attachment) {
|
if (!attachment) {
|
||||||
mesh_instances[i]->set_visible(false);
|
|
||||||
skeleton_clipper->clipEnd(*slot);
|
skeleton_clipper->clipEnd(*slot);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mesh_instance->set_visible(true);
|
|
||||||
clear_mesh_instance(mesh_instance);
|
|
||||||
|
|
||||||
spine::Color skeleton_color = skeleton->getColor();
|
spine::Color skeleton_color = skeleton->getColor();
|
||||||
spine::Color slot_color = slot->getColor();
|
spine::Color slot_color = slot->getColor();
|
||||||
@ -598,6 +596,7 @@ void SpineSprite::update_meshes(Ref<SpineSkeleton> skeleton_ref) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (indices->size() > 0) {
|
if (indices->size() > 0) {
|
||||||
|
// Set the mesh
|
||||||
size_t num_vertices = vertices->size() / 2;
|
size_t num_vertices = vertices->size() / 2;
|
||||||
scratch_points.resize((int) num_vertices);
|
scratch_points.resize((int) num_vertices);
|
||||||
memcpy(scratch_points.ptrw(), vertices->buffer(), num_vertices * 2 * sizeof(float));
|
memcpy(scratch_points.ptrw(), vertices->buffer(), num_vertices * 2 * sizeof(float));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user