1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-27 09:24:47 +00:00

Remove unused tImage table and slightly clean code

This commit is contained in:
MineRobber___T 2017-07-17 01:49:14 -04:00 committed by GitHub
parent f785b0a488
commit 2c91c7962f

View File

@ -15,7 +15,6 @@ local function parseLine( tImageArg, sLine )
tLine[x] = tColourLookup[ string.byte(sLine,x,x) ] or 0 tLine[x] = tColourLookup[ string.byte(sLine,x,x) ] or 0
end end
table.insert( tImageArg, tLine ) table.insert( tImageArg, tLine )
return tImageArg
end end
function parseImage( sRawData ) function parseImage( sRawData )
@ -24,7 +23,7 @@ function parseImage( sRawData )
end end
local tImage = {} local tImage = {}
for sLine in ( sRawData .. "\n" ):gmatch( "(.-)\n" ) do -- read each line like original file handling did for sLine in ( sRawData .. "\n" ):gmatch( "(.-)\n" ) do -- read each line like original file handling did
tImage = parseLine( tImage, sLine ) parseLine( tImage, sLine )
end end
return tImage return tImage
end end
@ -35,7 +34,6 @@ function loadImage( sPath )
end end
if fs.exists( sPath ) then if fs.exists( sPath ) then
local tImage = {}
local file = io.open( sPath, "r" ) local file = io.open( sPath, "r" )
local sContent = file:readAll() local sContent = file:readAll()
file:close() file:close()