mirror of
https://github.com/appgurueu/modlib.git
synced 2024-12-22 13:22:27 +01:00
b3d -> glTF: Fix buffer padding
This commit is contained in:
parent
e91a406742
commit
c8738450c7
4
b3d.lua
4
b3d.lua
@ -617,6 +617,10 @@ do
|
||||
func -- `function(write_byte) ... return count, min, max end` to be called to write to the buffer view;
|
||||
-- the count of elements written must be returned; min and max may be returned
|
||||
)
|
||||
-- Always add padding to obtain a multiple of 4
|
||||
-- TODO (?) don't add padding if it isn't required
|
||||
table.insert(buffer_rope, ("\0"):rep(offset % 4))
|
||||
offset = math.ceil(offset / 4) * 4
|
||||
local bytes_written = 0
|
||||
local count, min, max = func(function(byte)
|
||||
table.insert(buffer_rope, string_char(byte))
|
||||
|
Loading…
Reference in New Issue
Block a user