mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Fix moving entities flashing in over 30fps mode
This commit is contained in:
parent
689768b8ca
commit
63620efac8
3 changed files with 19 additions and 4 deletions
|
@ -186,17 +186,27 @@ namespace level_debugger
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void logic(void)
|
||||||
|
{
|
||||||
if (INBOUNDS_VEC(held_entity, obj.entities))
|
if (INBOUNDS_VEC(held_entity, obj.entities))
|
||||||
{
|
{
|
||||||
obj.entities[held_entity].xp = key.mx - grabber_offset_x;
|
int new_xp = key.mx - grabber_offset_x;
|
||||||
obj.entities[held_entity].yp = key.my - grabber_offset_y;
|
int new_yp = key.my - grabber_offset_y;
|
||||||
|
|
||||||
if (key.isDown(SDLK_LSHIFT) || key.isDown(SDLK_RSHIFT))
|
if (key.isDown(SDLK_LSHIFT) || key.isDown(SDLK_RSHIFT))
|
||||||
{
|
{
|
||||||
obj.entities[held_entity].xp -= obj.entities[held_entity].xp % 8;
|
new_xp -= new_xp % 8;
|
||||||
obj.entities[held_entity].yp -= obj.entities[held_entity].yp % 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))
|
if (INBOUNDS_VEC(held_block, obj.blocks))
|
||||||
|
|
|
@ -8,6 +8,7 @@ namespace level_debugger
|
||||||
bool is_pausing(void);
|
bool is_pausing(void);
|
||||||
bool is_active(void);
|
bool is_active(void);
|
||||||
void input(void);
|
void input(void);
|
||||||
|
void logic(void);
|
||||||
void render(void);
|
void render(void);
|
||||||
void set_forced(void);
|
void set_forced(void);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "GlitchrunnerMode.h"
|
#include "GlitchrunnerMode.h"
|
||||||
#include "Graphics.h"
|
#include "Graphics.h"
|
||||||
|
#include "LevelDebugger.h"
|
||||||
#include "Map.h"
|
#include "Map.h"
|
||||||
#include "Music.h"
|
#include "Music.h"
|
||||||
#include "Network.h"
|
#include "Network.h"
|
||||||
|
@ -131,6 +132,7 @@ void gamelogic(void)
|
||||||
{
|
{
|
||||||
if (game.physics_frozen())
|
if (game.physics_frozen())
|
||||||
{
|
{
|
||||||
|
level_debugger::logic();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1475,4 +1477,6 @@ void gamelogic(void)
|
||||||
|
|
||||||
#undef gotoroom
|
#undef gotoroom
|
||||||
#undef GOTOROOM
|
#undef GOTOROOM
|
||||||
|
|
||||||
|
level_debugger::logic();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue