1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-10 13:09:43 +01:00

Fix animating entities' drawframes not being updated for 1 frame

What happens here is that the entity gets created and then gets
immediately updated on the next frame, but there's no time for their
walkingframe of 0 to be rendered, so it'll look like they have just
started with walkingframe 1. However in the delta-timestep rendering
it'll render with walkingframe 0. So we need to fix their drawframe and
increment it when creating them.
This commit is contained in:
Misa 2020-05-04 11:13:41 -07:00 committed by Ethan Lee
parent b5b958561c
commit eaf9eec3dc

View file

@ -2012,6 +2012,32 @@ void entityclass::createentity( float xp, float yp, int t, float vx /*= 0*/, flo
{
entity.updatecolour();
}
if (entity.type == 1)
{
switch (entity.animate)
{
case 0: // Simple Loop
case 1: // Simple Loop
case 2: // Simpler Loop (just two frames)
case 3: // Simpler Loop (just two frames, but double sized)
case 4: // Simpler Loop (just two frames, but double sized) (as above, but slower)
case 5: // Simpler Loop (just two frames) (slower)
case 6: // Normal Loop (four frames, double sized)
case 7: // Simpler Loop (just two frames) (slower) (with directions!)
case 11: // Conveyor right
entity.drawframe++;
break;
case 10: // Conveyor left
entity.drawframe += 3;
break;
default:
break;
}
}
else if (entity.type == 2 && entity.animate == 2)
{
entity.drawframe++;
}
entities.push_back(entity);
}