From 77ff5c7f2521d53e6fa82107c466e7072812376b Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Sun, 26 Jan 2025 11:10:05 +0300 Subject: [PATCH] add TODOs on streaming lua load --- apps/twnlua/game.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/twnlua/game.c b/apps/twnlua/game.c index d06f64c..ace926d 100644 --- a/apps/twnlua/game.c +++ b/apps/twnlua/game.c @@ -37,6 +37,7 @@ static int physfs_loader(lua_State *L) { int64_t buf_size = file_to_bytes(final_path, &buf); free(final_path); + /* TODO: use reader interface for streaming instead */ luaL_loadbuffer(L, (char *)buf, buf_size, name); free(buf); @@ -141,6 +142,7 @@ void game_tick(void) { /* now finally get to running the code */ unsigned char *game_buf = NULL; size_t game_buf_size = file_to_bytes("/scripts/game.lua", &game_buf); + /* TODO: use reader interface for streaming instead */ if (luaL_loadbuffer(state->L, (char *)game_buf, game_buf_size, "game.lua") == LUA_OK) { if (lua_pcall(state->L, 0, 0, 0) != LUA_OK) { log_critical("%s", lua_tostring(state->L, -1));