summaryrefslogtreecommitdiff
path: root/VP-process.lua
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2013-06-22 19:16:59 -0700
committerPixel <pixel@nobis-crew.org>2013-06-22 19:16:59 -0700
commit476cf29aca86d8dbace2c4cab7db6a036404b679 (patch)
tree51f36596218206fc7d4e80120b439366935d730a /VP-process.lua
parentb8a9b4f9fa8a75c79ea7d9096e8f5d03514612e1 (diff)
parentad728683a0f8896508bcf24dadf9161b158573af (diff)
Merge branch 'master' of ssh+git://git.grumpycoder.net/pub/repo.git/VP-hack
Diffstat (limited to 'VP-process.lua')
-rw-r--r--VP-process.lua12
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)