add TODOs on streaming lua load

This commit is contained in:
veclavtalica 2025-01-26 11:10:05 +03:00
parent bf3eb50b55
commit 77ff5c7f25

View File

@ -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));