diff options
Diffstat (limited to 'extractor/grf.gd')
-rw-r--r-- | extractor/grf.gd | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/extractor/grf.gd b/extractor/grf.gd index 84918de..fd0e6f7 100644 --- a/extractor/grf.gd +++ b/extractor/grf.gd @@ -203,13 +203,6 @@ func extract(destination: String = "user://client_data"): base_directory.make_dir_recursive(file_path.get_base_dir()) var file = FileAccess.open("%s/%s" % [destination, file_path], FileAccess.WRITE_READ) - - #if file_path.ends_with(".bmp"): - #var img := Image.create_empty(1, 1, false, Image.FORMAT_RGBA8) - #img.load_bmp_from_buffer(file_entry.get_contents(file_access)) - #img.save_png(file.get_path()) - #return - #else: file.store_buffer(file_entry.get_contents(file_access)) extracted_file.emit(idx) @@ -237,8 +230,13 @@ func convert(destination: String = "res://client_data"): if not FileAccess.file_exists("%s/%s" % [destination, file_path]): continue + # load existing bmp files, so language specific overwrites are kept + + var texture: CompressedTexture2D = load("%s/%s" % [destination, file_path]) + var texture_image := texture.get_image() + texture_image.decompress() var image := BMPTexture.convert_image( - Image.load_from_file("%s/%s" % [destination, file_path]), + texture_image, [Color.MAGENTA] ) image.save_png("%s/%s" % [destination, file_path.replace(".bmp", ".png")]) |