Better lisibility for animation system update func.

This commit is contained in:
Ulysse Cura 2026-07-22 13:22:30 +02:00
parent d214571ef9
commit 145ea71bd9
1 changed files with 10 additions and 10 deletions

View File

@ -42,15 +42,15 @@ void animation_system_update(component_t *component)
system_data->actual_frame = system_data->actual_frame->prev; system_data->actual_frame = system_data->actual_frame->prev;
system_data->actual_frame_nb--; system_data->actual_frame_nb--;
} }
else if(!system_data->loop) else if(system_data->loop)
{
system_data->play = false;
}
else
{ {
system_data->actual_frame = system_data->frames.last; system_data->actual_frame = system_data->frames.last;
system_data->actual_frame_nb = system_data->frames.size - 1; system_data->actual_frame_nb = system_data->frames.size - 1;
} }
else
{
system_data->play = false;
}
} }
else else
{ {
@ -59,15 +59,15 @@ void animation_system_update(component_t *component)
system_data->actual_frame = system_data->actual_frame->next; system_data->actual_frame = system_data->actual_frame->next;
system_data->actual_frame_nb++; system_data->actual_frame_nb++;
} }
else if(!system_data->loop) else if(system_data->loop)
{
system_data->play = false;
}
else
{ {
system_data->actual_frame = system_data->frames.first; system_data->actual_frame = system_data->frames.first;
system_data->actual_frame_nb = 0; system_data->actual_frame_nb = 0;
} }
else
{
system_data->play = false;
}
} }
} }