make move speed consistent

This commit is contained in:
asrael 2025-11-11 21:35:34 -06:00
parent 34e534b6f2
commit 2e2461c35a
3 changed files with 19 additions and 16 deletions

View file

@ -505,7 +505,6 @@ end
function pxl8.world_apply_textures(world, texture_defs)
local count = #texture_defs
local textures = ffi.new("pxl8_world_texture[?]", count)
local callbacks = {}
for i, def in ipairs(texture_defs) do
local idx = i - 1
@ -513,12 +512,10 @@ function pxl8.world_apply_textures(world, texture_defs)
textures[idx].texture_id = def.texture_id or 0
if def.rule then
local cb = ffi.cast("bool (*)(const pxl8_vec3*, const pxl8_bsp_face*, const pxl8_bsp*)",
textures[idx].rule = ffi.cast("bool (*)(const pxl8_vec3*, const pxl8_bsp_face*, const pxl8_bsp*)",
function(normal, face, bsp)
return def.rule(normal[0], face, bsp)
end)
textures[idx].rule = cb
callbacks[idx + 1] = cb
else
textures[idx].rule = nil
end

View file

@ -57,8 +57,7 @@ static void* sdl3_create(pxl8_color_mode mode, pxl8_resolution resolution,
return NULL;
}
// Disable vsync for benchmarking
if (!SDL_SetRenderVSync(ctx->renderer, 0)) {
if (!SDL_SetRenderVSync(ctx->renderer, 1)) {
pxl8_error("Failed to set vsync: %s", SDL_GetError());
}