wip procgen

This commit is contained in:
asrael 2025-11-09 06:30:17 -06:00
parent a653eae745
commit 79a678f162
No known key found for this signature in database
GPG key ID: 2786557804DFAE24
18 changed files with 1317 additions and 127 deletions

View file

@ -147,6 +147,17 @@ pxl8_game_result pxl8_update(pxl8_game* game) {
game->last_time = current_time;
game->time += dt;
game->fps_accumulator += dt;
game->fps_frame_count++;
if (game->fps_accumulator >= 1.0f) {
game->fps = (f32)game->fps_frame_count / game->fps_accumulator;
if (!game->repl_mode) {
pxl8_debug("FPS: %.1f (%.2fms)", game->fps, (game->fps_accumulator / game->fps_frame_count) * 1000.0f);
}
game->fps_accumulator = 0.0f;
game->fps_frame_count = 0;
}
pxl8_script_check_reload(game->script);
if (game->repl_mode && !game->repl_started) {