Created
September 7, 2015 16:43
-
-
Save exelotl/b0d1721fe58493fe429c to your computer and use it in GitHub Desktop.
Simple script to fix the GBA tile data output by Pro Motion 6.5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- example usage: | |
-- lua fix_cel_tiles.lua old_tiles.cel new_tiles.cel | |
local inpath, outpath = ... | |
local infile = assert(io.open(inpath, "rb")) | |
local outfile = assert(io.open(outpath,"wb")) | |
local bytes_per_tile = 8 * 8 | |
while true do | |
local tile = infile:read(bytes_per_tile) | |
if tile == nil then | |
break | |
end | |
outfile:write(tile) -- write 1 tile | |
infile:read(3 * bytes_per_tile) -- discard 3 tiles | |
end | |
infile:close() | |
outfile:close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment