mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
limit delta to 1 second
It doesn't make much sense to react to bugger deltas; especially that looping over Gamestate_Tick may take significant amount of time in such cases.
This commit is contained in:
parent
5ca9d844b8
commit
1807fe256e
1 changed files with 4 additions and 0 deletions
|
@ -90,6 +90,10 @@ SYMBOL_INTERNAL void DrawGamestates(struct Game* game) {
|
|||
|
||||
SYMBOL_INTERNAL void LogicGamestates(struct Game* game, double delta) {
|
||||
struct Gamestate* tmp = game->_priv.gamestates;
|
||||
if (delta > 1) {
|
||||
PrintConsole(game, "delta > 1 second!");
|
||||
delta = 1;
|
||||
}
|
||||
int ticks = (int)(floor((game->time + delta) / ALLEGRO_BPS_TO_SECS(60.0)) - floor(game->time / ALLEGRO_BPS_TO_SECS(60.0)));
|
||||
game->time += delta;
|
||||
if (game->_priv.params.handlers.prelogic) {
|
||||
|
|
Loading…
Reference in a new issue