diff --git a/src/game.c b/src/game.c index ad57f49..b41f220 100644 --- a/src/game.c +++ b/src/game.c @@ -11,6 +11,8 @@ extern int UpdateRects_nr; +static Uint32 timediff; + void game_draw_info () { @@ -90,9 +92,10 @@ game_draw_info () text[strlen(text)] = ']'; sprintf (text, "%s GFX_RECTS:%d", text, UpdateRects_nr); draw_text (0, gfx.res.y - (gfx.font.size.y << 1), text, 1); - - sprintf (text, "TILESET: %s", gfx.tileset); + sprintf (text, "TILESET: %s Timediff: %d", gfx.tileset, timediff); + draw_text (0, gfx.res.y - gfx.font.size.y, text, 1); gfx_AddUpdateRect (0, gfx.res.y - (gfx.font.size.y << 1), gfx.res.x, gfx.font.size.y << 1); + } if (chat.visible == 0) { @@ -215,6 +218,8 @@ game_loop () // calculate time sync. timeloop1 = SDL_GetTicks (); + timediff = timeloop1 - timestamp; // only for debugging needed + while (timeloop1 - timestamp >= 0 && timeloop1 - timestamp < 20) { s_delay (timeloop1 - timestamp - 1); timeloop1 = SDL_GetTicks ();