1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 09:39:43 +01:00

Fix moving entities flashing in over 30fps mode

This commit is contained in:
AllyTally 2023-07-03 16:29:23 -03:00 committed by Misa Elizabeth Kai
parent 689768b8ca
commit 63620efac8
3 changed files with 19 additions and 4 deletions

View file

@ -186,17 +186,27 @@ namespace level_debugger
}
}
}
}
void logic(void)
{
if (INBOUNDS_VEC(held_entity, obj.entities))
{
obj.entities[held_entity].xp = key.mx - grabber_offset_x;
obj.entities[held_entity].yp = key.my - grabber_offset_y;
int new_xp = key.mx - grabber_offset_x;
int new_yp = key.my - grabber_offset_y;
if (key.isDown(SDLK_LSHIFT) || key.isDown(SDLK_RSHIFT))
{
obj.entities[held_entity].xp -= obj.entities[held_entity].xp % 8;
obj.entities[held_entity].yp -= obj.entities[held_entity].yp % 8;
new_xp -= new_xp % 8;
new_yp -= new_yp % 8;
}
obj.entities[held_entity].xp = new_xp;
obj.entities[held_entity].yp = new_yp;
obj.entities[held_entity].lerpoldxp = new_xp;
obj.entities[held_entity].lerpoldyp = new_yp;
obj.entities[held_entity].oldxp = new_xp;
obj.entities[held_entity].oldyp = new_yp;
}
if (INBOUNDS_VEC(held_block, obj.blocks))

View file

@ -8,6 +8,7 @@ namespace level_debugger
bool is_pausing(void);
bool is_active(void);
void input(void);
void logic(void);
void render(void);
void set_forced(void);
}

View file

@ -5,6 +5,7 @@
#include "Game.h"
#include "GlitchrunnerMode.h"
#include "Graphics.h"
#include "LevelDebugger.h"
#include "Map.h"
#include "Music.h"
#include "Network.h"
@ -131,6 +132,7 @@ void gamelogic(void)
{
if (game.physics_frozen())
{
level_debugger::logic();
return;
}
@ -1475,4 +1477,6 @@ void gamelogic(void)
#undef gotoroom
#undef GOTOROOM
level_debugger::logic();
}