make move speed consistent
This commit is contained in:
parent
34e534b6f2
commit
2e2461c35a
3 changed files with 19 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue