Glitter Editor: Fixed displaying of Selected Mesh Particles

This commit is contained in:
korenkonder
2024-12-12 17:35:54 +03:00
parent 41ffdf9477
commit b52acdf44e
2 changed files with 27 additions and 5 deletions
+21 -4
View File
@@ -1137,7 +1137,6 @@ namespace Glitter {
disp_quad = 0;
disp_line = 0;
disp_locus = 0;
disp_mesh = 0;
Effect* eff = GPM_VAL->selected_effect;
Emitter* emit = GPM_VAL->selected_emitter;
@@ -1889,7 +1888,7 @@ namespace Glitter {
Effect* eff = GPM_VAL->selected_effect;
Emitter* emit = GPM_VAL->selected_emitter;
Particle* ptcl = GPM_VAL->selected_particle;
for (XRenderGroup* i : groups) {
for (XRenderGroup*& i : groups) {
if (!i)
continue;
@@ -2082,18 +2081,36 @@ namespace Glitter {
void XRenderScene::DispMesh(GPM) {
disp_mesh = 0;
Effect* eff = GPM_VAL->selected_effect;
Emitter* emit = GPM_VAL->selected_emitter;
Particle* ptcl = GPM_VAL->selected_particle;
for (XRenderGroup*& i : groups) {
if (!i)
continue;
XRenderGroup* rend_group = i;
if (rend_group->CannotDisp())
if (rend_group->CannotDisp() && !GPM_VAL->draw_all)
continue;
switch (rend_group->type) {
case PARTICLE_MESH:
rend_group->disp = 0;
DispMesh(GPM_VAL, rend_group);
if (!GPM_VAL->draw_selected || !eff) {
DispMesh(GPM_VAL, rend_group);
}
else if ((eff && ptcl) || (eff && !emit)) {
if (!ptcl || rend_group->particle->particle == ptcl)
DispMesh(GPM_VAL, rend_group);
}
else if (emit)
for (Particle*& j : emit->particles) {
if (!j)
continue;
Particle* particle = j;
if (rend_group->particle->particle == particle)
DispMesh(GPM_VAL, rend_group);
}
disp_mesh += rend_group->disp;
break;
}
+6 -1
View File
@@ -182,8 +182,13 @@ namespace Glitter {
return;
for (SceneEffect& i : effects)
if (i.ptr && i.disp)
if (i.ptr && i.disp) {
if (GPM_VAL->draw_selected && GPM_VAL->selected_effect
&& GPM_VAL->selected_effect != i.ptr->effect)
continue;
i.ptr->DispMesh(GPM_VAL);
}
}
size_t Scene::GetCtrlCount(ParticleType ptcl_type) {