Fix B3D & PNG reading on Windows
parent
b7cd469284
commit
25961ad87e
|
@ -19,7 +19,7 @@ return setmetatable({}, {__index = function(self, filename)
|
|||
if filename == "character.b3d" and minetest.sha1(modlib.file.read(path)) == bad_character_b3d_hash then
|
||||
path = fixed_character_b3d_path
|
||||
end
|
||||
local model = io.open(path, "r")
|
||||
local model = io.open(path, "rb")
|
||||
local character = assert(modlib.b3d.read(model))
|
||||
assert(not model:read(1))
|
||||
model:close()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
local media_paths = modlib.minetest.media.paths
|
||||
|
||||
return setmetatable({}, {__index = function(self, texture_name)
|
||||
local file = io.open(media_paths[texture_name], "r")
|
||||
local file = io.open(media_paths[texture_name], "rb")
|
||||
local png = modlib.minetest.decode_png(file)
|
||||
assert(not file:read(1), "EOF expected")
|
||||
file:close()
|
||||
|
|
Loading…
Reference in New Issue