diff options
author | kitty piapiac <kcp@bsd.computer> | 2023-04-23 21:16:17 -0700 |
---|---|---|
committer | kitty piapiac <kcp@bsd.computer> | 2023-04-23 21:16:17 -0700 |
commit | cec132cde7c25bd41fdd7f8e5f5472e4162120d5 (patch) | |
tree | 74927380a6381751819b13d62b506d36ab01ae27 /scenes.c | |
parent | f54412679c74279d8bcf21bf8ef8bcd8229dc547 (diff) |
block fall & in-floor detection
Diffstat (limited to 'scenes.c')
-rw-r--r-- | scenes.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,3 +1,4 @@ +#include<SDL.h> #include<cglm/affine.h> #include<cglm/cglm.h> #include"mino.h" @@ -6,14 +7,15 @@ #include"input.h" #include"core.h" -_ V game_loop(V){/*prelude*/graph_before(),graph_events();InputPoint p;InputButtons b; +_ V game_loop(F64 dt){/*prelude*/graph_before(),graph_events();InputPoint p;InputButtons b; /*interlude*/ input_update(),p=input_point,b=input_buttons; - core_tick(p,b); + core_tick(p,b,dt); /*postlude*/ graph_after();} -_ Scene*game_run(V){core_init();WH(1,game_loop());R 0;} +_ Scene*game_run(V){U64 prev,now;core_init();prev=SDL_GetPerformanceCounter(); + WH(1,now=SDL_GetPerformanceCounter(),game_loop((now-prev)/(F64)SDL_GetPerformanceFrequency()),prev=now);R 0;} Scene scene_game={"Game",game_run}; _ Scene*title_run(V){R&scene_game;} |