Fixed typos and cleaned up code in the Images library #93

Merged
SeaSide53 merged 7 commits from master into master 2023-06-04 21:53:19 +08:00
Showing only changes of commit 5d92bc9703 - Show all commits

View File

@@ -27,24 +27,29 @@ local function loadBBFAsBimg(path)
end end
local function loadImage(path, f, binaryMode) local function loadImage(path, binaryMode)
if(sub(path, -4) == ".bimg")then --Loads the image with the right loader, returns error if the file type is unknown.
if(sub(path, -5) == ".bimg")then
return loadBIMG(path, binaryMode) return loadBIMG(path, binaryMode)
elseif(sub(path, -3) == ".bbf")then elseif(sub(path, -4) == ".bbf")then
return loadBBF(path, binaryMode) return loadBBF(path)
elseif(sub(path, -4) == ".nfp")then
return loadNFP(path)
else else
return loadNFP(path, binaryMode) error("Unknown file type")
end end
-- ...
end end
local function loadImageAsBimg(path) local function loadImageAsBimg(path, binaryMode)
if(path:find(".bimg"))then --Loads the image with the right Bimg loader, returns error if the file type is unknown.
return loadBIMG(path) if(sub(path, -5) == ".bimg")then
elseif(path:find(".bbf"))then return loadBIMG(path, binaryMode)
elseif(sub(path, -4) == ".bbf")then
return loadBBFAsBimg(path) return loadBBFAsBimg(path)
else elseif(sub(path, -4) == ".nfp")then
return loadNFPAsBimg(path) return loadNFPAsBimg(path)
else
error("Unknown file type")
end end
end end