1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-10 10:59:45 +01:00

Move updating lerpoldxp/yp to start of gamelogic()

The previous location of this loop was placed there because it happened
just after the end of the render function. Now that the loop order is
fixed, the first thing that happens after the render function is the
start of gamelogic(), so this loop should go there now, else entity
positions won't be interpolated.

Also it now preincrements instead of postincrements because I like
preincrements.
This commit is contained in:
Misa 2020-11-07 17:00:42 -08:00 committed by Ethan Lee
parent 585ae47d78
commit 5e2fc6f0fe
2 changed files with 7 additions and 11 deletions

View file

@ -122,6 +122,13 @@ void gamecompletelogic2(void)
void gamelogic(void)
{
/* Update old lerp positions of entities */
{size_t i; for (i = 0; i < obj.entities.size(); ++i)
{
obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp;
}}
//Misc
if (map.towermode)
{

View file

@ -91,16 +91,6 @@ static void runscript(void)
script.run();
}
static void gamemodefunc1(void)
{
//Update old lerp positions of entities - has to be done BEFORE gameinput!
for (size_t i = 0; i < obj.entities.size(); i++)
{
obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp;
}
}
static void teleportermodeinput(void)
{
if (game.useteleporter)
@ -147,7 +137,6 @@ static const inline struct ImplFunc* get_gamestate_funcs(
FUNC_LIST_BEGIN(GAMEMODE)
{Func_fixed, runscript},
{Func_fixed, gamemodefunc1},
{Func_fixed, gameinput},
{Func_fixed, gamerenderfixed},
{Func_delta, gamerender},