diff options
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 82d0815..0eb1cb9 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) |