diff options
Diffstat (limited to 'extractor')
-rw-r--r-- | extractor/extractor_interface.gd | 4 | ||||
-rw-r--r-- | extractor/grf.gd | 14 | ||||
-rw-r--r-- | extractor/rsm_format.gd | 2 | ||||
-rw-r--r-- | extractor/rsw_format.gd | 4 |
4 files changed, 10 insertions, 14 deletions
diff --git a/extractor/extractor_interface.gd b/extractor/extractor_interface.gd index e987ed3..3afedfd 100644 --- a/extractor/extractor_interface.gd +++ b/extractor/extractor_interface.gd @@ -2,8 +2,8 @@ extends Control func _ready() -> void: - var grf = GRF.open("res://client_data/data.grf") - grf.extract()#"user://client_data") + #var grf = GRF.open("res://client_data/data.grf") + #grf.extract()#"user://client_data") #grf.convert()#"user://client_data") #Sprite.from_bytes(FileAccess.get_file_as_bytes("res://client_data/data/sprite/cursors.spr")) 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")]) diff --git a/extractor/rsm_format.gd b/extractor/rsm_format.gd index 7eb41f0..c01826e 100644 --- a/extractor/rsm_format.gd +++ b/extractor/rsm_format.gd @@ -362,7 +362,7 @@ class ModelNode: node.translate(translation_2) if rotation_axis != Vector3.ZERO: - node.rotate_object_local(rotation_axis, rotation_angle) + node.rotation = rotation_axis * rotation_angle node.scale = scale diff --git a/extractor/rsw_format.gd b/extractor/rsw_format.gd index 1066168..85d873c 100644 --- a/extractor/rsw_format.gd +++ b/extractor/rsw_format.gd @@ -127,9 +127,7 @@ func convert(name: String, data_path: String) -> Node3D: var model_root := Node3D.new() model_root.name = resource.name model_root.position = resource.get_position() * Vector3(-1, 1, 1) - model_root.rotate_x(deg_to_rad(resource.get_rotation().x)) - model_root.rotate_y(deg_to_rad(resource.get_rotation().y)) - model_root.rotate_z(deg_to_rad(resource.get_rotation().z)) + model_root.rotation_degrees = resource.get_rotation() model_root.scale = resource.get_scale() node.add_child(model_root) |