diff options
author | Pixel <pixel@nobis-crew.org> | 2012-10-26 09:06:13 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2012-10-26 09:06:13 -0700 |
commit | 6f37a8a7c34fbbfa62df139bfc904288e319d140 (patch) | |
tree | 2c2c0651e501ae0032210dcd2c8917539efe4cd9 /VP-process.lua | |
parent | d17ccb1258c40fbd6767c4e2c98b6e2462cb8987 (diff) |
And still more script types.
Diffstat (limited to 'VP-process.lua')
-rw-r--r-- | VP-process.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/VP-process.lua b/VP-process.lua index c85cfc5..2861d4e 100644 --- a/VP-process.lua +++ b/VP-process.lua @@ -239,14 +239,12 @@ function process_files(index, map, iso, iso_full, cindex, index_add, jp_in_us) log("JP-in-US: replacing file " .. i .. " by file " .. lookup) file_out = index_add[lookup].cd:cdfile(index_add[lookup].sector, index_add[lookup].size * sec_sizes[mode]) end - elseif not ftype then - file_out = process_single_file("DUMP/" .. dir .. string.format("/%04i", i), file_in, file_in:getsize(), ext) - elseif ftype == "arcgfx" then - file_out = process_arcgfx("DUMP/" .. dir .. string.format("/%04i", i), file_in, file_in:getsize(), ext) - elseif ftype == "arcroom" then - file_out = process_arcroom("DUMP/" .. dir .. string.format("/%04i", i), file_in, file_in:getsize(), ext) + elseif ftype then + local handler = _G["process_" .. ftype] + if not handler then error("Unknown ftype: " .. ftype) end + file_out = handler("DUMP/" .. dir .. string.format("/%04i", i), file_in, file_in:getsize(), ext) else - error("Unknow ftype: " .. ftype) + file_out = process_single_file("DUMP/" .. dir .. string.format("/%04i", i), file_in, file_in:getsize(), ext) end if not file_out then file_out = file_in end file_in:seek(0) |