ws-game: image/vtf decodes its uncompressed texel formats through the shared codecs/image/Texel (image/vtf/Texel removed); packed 5/6-bit formats within 1 of srctools' bit replication
This commit is contained in:
1 parent
43df95f6e0
commit
862f8e459a
4 files changed
+55
-161
No files matched your search
@@ -45,7 +45,9 @@ for i, name in enumerate(FMTS):
|
||||
print(json.dumps(out))
|
||||
"""
|
||||
|
||||
TOL = {"DXT1": 8, "DXT3": 8, "DXT5": 8, "DXT1_ONEBITALPHA": 8, "ATI1N": 2, "ATI2N": 2, "RGBA16161616F": 1, "RGBA16161616": 1}
|
||||
# codecs/image/Texel rescales 5 / 6-bit fields with rounding (round(v * 255 / 31)); srctools replicates bits
|
||||
# (v << 3 | v >> 2): within 1
|
||||
TOL = {"RGB565": 1, "BGR565": 1, "BGRX5551": 1, "BGRA5551": 1, "DXT1": 8, "DXT3": 8, "DXT5": 8, "DXT1_ONEBITALPHA": 8, "ATI1N": 2, "ATI2N": 2, "RGBA16161616F": 1, "RGBA16161616": 1}
|
||||
|
||||
|
||||
def own(rng):
|
||||
@@ -80,7 +82,7 @@ def own(rng):
|
||||
px[1] = px[2] = px[0]
|
||||
rgba += bytes(px)
|
||||
data = header(fmt) + struct.pack("<%d%s" % (len(vals), kind), *vals)
|
||||
out.append({"name": name, "data": data, "width": w, "height": h, "frames": 1, "version": "7.2", "rgba": bytes(rgba), "tol": 0, "mips": 1})
|
||||
out.append({"name": name, "data": data, "width": w, "height": h, "frames": 1, "version": "7.2", "rgba": bytes(rgba), "tol": 1 if kind == "H" else 0, "mips": 1})
|
||||
return out
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user