replace per-tick allocations in push_text with an arena/bump allocator

This commit is contained in:
2024-09-27 15:02:24 -03:00
parent 0481962859
commit 078e68387b
5 changed files with 101 additions and 26 deletions

View File

@ -371,19 +371,12 @@ static void clean_up(void) {
scripting_deinit(ctx);
*/
input_state_deinit(&ctx.game.input);
/* if you're gonna remove this, it's also being done in rendering.c */
for (size_t i = 0; i < arrlenu(ctx.render_queue_2d); ++i) {
if (ctx.render_queue_2d[i].type == PRIMITIVE_2D_TEXT) {
SDL_free(ctx.render_queue_2d[i].text.text);
}
}
arrfree(ctx.render_queue_2d);
input_state_deinit(&ctx.game.input);
text_cache_deinit(&ctx.text_cache);
textures_cache_deinit(&ctx.texture_cache);
arrfree(ctx.render_queue_2d);
PHYSFS_deinit();
SDL_Quit();
}