merge ws/source: VBSP v19-21, VMF, KeyValues / data/vdf, codecs/model/Displacement (with ws/quake's Brush / Patch / Miptex)
This commit is contained in:
commit
e100366cb8
44 files changed
+18855
-1508
No files matched your search
@@ -219,6 +219,26 @@ do
|
||||
end)
|
||||
end
|
||||
|
||||
-- ws-source: KeyValues text (a 1 MB file of nested blocks) and an entity lump
|
||||
do
|
||||
local KeyValues = require("@rosetta/codecs/text/KeyValues")
|
||||
local parts = { '"root"\n{\n' }
|
||||
local ents = {}
|
||||
for i = 1, 6000 do
|
||||
table.insert(parts, string.format('\t"block%d"\n\t{\n\t\t"name"\t"item %d"\n\t\t"origin"\t"%d 0 64"\n\t\t"path"\t"models/props/x\\\\y.mdl"\n\t}\n', i, i, i))
|
||||
table.insert(ents, string.format('{\n"origin" "%d 0 64"\n"classname" "prop_dynamic"\n"OnTrigger" "a,b,,0,-1"\n}\n', i))
|
||||
end
|
||||
table.insert(parts, "}\n")
|
||||
local text, lump = table.concat(parts), table.concat(ents)
|
||||
assert(KeyValues.parse(text))
|
||||
bench("keyvalues parse", 5, #text, function()
|
||||
KeyValues.parse(text)
|
||||
end)
|
||||
bench("keyvalues entity lump", 5, #lump, function()
|
||||
KeyValues.entities(lump)
|
||||
end)
|
||||
end
|
||||
|
||||
-- ws-arch codecs: zstd, brotli, bzip2, xz / lzma
|
||||
do
|
||||
local Zstd = require("@rosetta/codecs/compress/Zstd")
|
||||
|
||||
Reference in new issue
Block a user