mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -122,6 +122,13 @@ void gamecompletelogic2(void)
|
|||||||
|
|
||||||
void gamelogic(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
|
//Misc
|
||||||
if (map.towermode)
|
if (map.towermode)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -91,16 +91,6 @@ static void runscript(void)
|
|||||||
script.run();
|
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)
|
static void teleportermodeinput(void)
|
||||||
{
|
{
|
||||||
if (game.useteleporter)
|
if (game.useteleporter)
|
||||||
@@ -147,7 +137,6 @@ static const inline struct ImplFunc* get_gamestate_funcs(
|
|||||||
|
|
||||||
FUNC_LIST_BEGIN(GAMEMODE)
|
FUNC_LIST_BEGIN(GAMEMODE)
|
||||||
{Func_fixed, runscript},
|
{Func_fixed, runscript},
|
||||||
{Func_fixed, gamemodefunc1},
|
|
||||||
{Func_fixed, gameinput},
|
{Func_fixed, gameinput},
|
||||||
{Func_fixed, gamerenderfixed},
|
{Func_fixed, gamerenderfixed},
|
||||||
{Func_delta, gamerender},
|
{Func_delta, gamerender},
|
||||||
|
|||||||
Reference in New Issue
Block a user