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

Fix editor ghosts being added multiple times per frame

This just results in a messy splotchy effect. Instead, move the ghost
adding outside of the render function.
This commit is contained in:
Misa 2020-06-12 17:20:37 -07:00 committed by Ethan Lee
parent 2f447fd794
commit 92ff6ac8fc
2 changed files with 27 additions and 29 deletions

View file

@ -1672,5 +1672,32 @@ void gamelogic()
{
ed.returneditoralpha -= 15;
}
// Editor ghosts!
if (game.ghostsenabled)
{
if (map.custommode && !map.custommodeforreal)
{
if (game.gametimer % 3 == 0)
{
int i = obj.getplayer();
GhostInfo ghost;
ghost.rx = game.roomx-100;
ghost.ry = game.roomy-100;
if (i > -1)
{
ghost.x = obj.entities[i].xp;
ghost.y = obj.entities[i].yp;
ghost.col = obj.entities[i].colour;
ghost.frame = obj.entities[i].drawframe;
}
ed.ghosts.push_back(ghost);
}
if (ed.ghosts.size() > 100)
{
ed.ghosts.erase(ed.ghosts.begin());
}
}
}
#endif
}

View file

@ -1352,35 +1352,6 @@ void gamerender()
{
graphics.drawtowerspikes();
}
#if !defined(NO_CUSTOM_LEVELS)
// Editor ghosts!
if (game.ghostsenabled)
{
if (map.custommode && !map.custommodeforreal)
{
if (game.gametimer % 3 == 0)
{
int i = obj.getplayer();
GhostInfo ghost;
ghost.rx = game.roomx-100;
ghost.ry = game.roomy-100;
if (i > -1)
{
ghost.x = obj.entities[i].xp;
ghost.y = obj.entities[i].yp;
ghost.col = obj.entities[i].colour;
ghost.frame = obj.entities[i].drawframe;
}
ed.ghosts.push_back(ghost);
}
if (ed.ghosts.size() > 100)
{
ed.ghosts.erase(ed.ghosts.begin());
}
}
}
#endif
}
if(map.extrarow==0 || (map.custommode && map.roomname!=""))