You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Use maximum zlib compression when generating editor translation headers
With comments stripped, this reduces the combined generated translation size from 28.7 MB to 28.4 MB (-240 KB).
This commit is contained in:
@@ -35,7 +35,9 @@ def make_certs_header(target, source, env):
|
|||||||
decomp_size = len(buf)
|
decomp_size = len(buf)
|
||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
buf = zlib.compress(buf)
|
# Use maximum zlib compression level to further reduce file size
|
||||||
|
# (at the cost of initial build times).
|
||||||
|
buf = zlib.compress(buf, zlib.Z_BEST_COMPRESSION)
|
||||||
|
|
||||||
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
|
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
|
||||||
g.write("#ifndef CERTS_COMPRESSED_GEN_H\n")
|
g.write("#ifndef CERTS_COMPRESSED_GEN_H\n")
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ def make_doc_header(target, source, env):
|
|||||||
decomp_size = len(buf)
|
decomp_size = len(buf)
|
||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
buf = zlib.compress(buf)
|
# Use maximum zlib compression level to further reduce file size
|
||||||
|
# (at the cost of initial build times).
|
||||||
|
buf = zlib.compress(buf, zlib.Z_BEST_COMPRESSION)
|
||||||
|
|
||||||
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
|
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
|
||||||
g.write("#ifndef _DOC_DATA_RAW_H\n")
|
g.write("#ifndef _DOC_DATA_RAW_H\n")
|
||||||
@@ -92,7 +94,9 @@ def make_translations_header(target, source, env, category):
|
|||||||
with open(sorted_paths[i], "rb") as f:
|
with open(sorted_paths[i], "rb") as f:
|
||||||
buf = f.read()
|
buf = f.read()
|
||||||
decomp_size = len(buf)
|
decomp_size = len(buf)
|
||||||
buf = zlib.compress(buf)
|
# Use maximum zlib compression level to further reduce file size
|
||||||
|
# (at the cost of initial build times).
|
||||||
|
buf = zlib.compress(buf, zlib.Z_BEST_COMPRESSION)
|
||||||
name = os.path.splitext(os.path.basename(sorted_paths[i]))[0]
|
name = os.path.splitext(os.path.basename(sorted_paths[i]))[0]
|
||||||
|
|
||||||
g.write("static const unsigned char _{}_translation_{}_compressed[] = {{\n".format(category, name))
|
g.write("static const unsigned char _{}_translation_{}_compressed[] = {{\n".format(category, name))
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ def generate_compressed_config(config_src, output_dir):
|
|||||||
decompr_size = len(buf)
|
decompr_size = len(buf)
|
||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
buf = zlib.compress(buf)
|
# Use maximum zlib compression level to further reduce file size
|
||||||
|
# (at the cost of initial build times).
|
||||||
|
buf = zlib.compress(buf, zlib.Z_BEST_COMPRESSION)
|
||||||
compr_size = len(buf)
|
compr_size = len(buf)
|
||||||
|
|
||||||
bytes_seq_str = ""
|
bytes_seq_str = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user