You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
GDScript: Enable compression on export
Besides the regular option to export GDScript as binary tokens, this also includes a compression option on top of it. The binary format needs to encode some information which generally makes it bigger than the source text. This option reduces that difference by using Zstandard compression on the buffer.
This commit is contained in:
@@ -365,6 +365,7 @@ Error GDScriptParser::parse(const String &p_source_code, const String &p_script_
|
||||
pop_multiline();
|
||||
|
||||
memdelete(text_tokenizer);
|
||||
tokenizer = nullptr;
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (multiline_stack.size() > 0) {
|
||||
@@ -384,6 +385,7 @@ Error GDScriptParser::parse_binary(const Vector<uint8_t> &p_binary, const String
|
||||
Error err = buffer_tokenizer->set_code_buffer(p_binary);
|
||||
|
||||
if (err) {
|
||||
memdelete(buffer_tokenizer);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -404,6 +406,7 @@ Error GDScriptParser::parse_binary(const Vector<uint8_t> &p_binary, const String
|
||||
pop_multiline();
|
||||
|
||||
memdelete(buffer_tokenizer);
|
||||
tokenizer = nullptr;
|
||||
|
||||
if (errors.is_empty()) {
|
||||
return OK;
|
||||
|
||||
Reference in New Issue
Block a user