--print npk file list to file --[[ local M = require("dump_npk_list") local ret = M.dump_npk_file_list( { "D:\\WeGameApps\\地下城与勇士:创新世纪\\ImagePacks2\\sprite_character_archer_effect_air.NPK", "D:\\WeGameApps\\地下城与勇士:创新世纪\\ImagePacks2\\sprite_interface2_event_20160927_national_day_firework.NPK" }, "d:\\output.txt", false, false, false, false, false ) --]] local M={} function M.dump_npk_file_list(npkFileNames, listFileName, npkBase, npkName, fileOffset, fileSize, fileCRC) local finalList = createEmptyFileList() for i,npkFileName in pairs(npkFileNames) do local npk = createNPKFile(); local ret = npk:openPakFile(npkFileName) if(not ret) then return false end local fileList = npk:generateFullInfoList() if(not fileList)then return false end ret = finalList:mergeOtherListInto(fileList, true) if(not ret) then return false end destroyFileList(fileList) npk:closePakFile() destroyNPKFile(npk) end local flags = 0 if fileCRC then flags = 1 end if fileSize then flags = flags + bit.lshift(1, 1) end if fileOffset then flags = flags + bit.lshift(1, 2) end if npkName then flags = flags + bit.lshift(1, 3) end if npkBase then flags = flags + bit.lshift(1, 4) end finalList:dumpToLocalFile(listFileName, flags) destroyFileList(finalList) return true end return M;