summaryrefslogtreecommitdiff
path: root/extractor
diff options
context:
space:
mode:
Diffstat (limited to 'extractor')
-rw-r--r--extractor/extractor_interface.gd24
-rw-r--r--extractor/gnd_format.gd6
-rw-r--r--extractor/grf.gd2
-rw-r--r--extractor/rsm_format.gd4
4 files changed, 20 insertions, 16 deletions
diff --git a/extractor/extractor_interface.gd b/extractor/extractor_interface.gd
index 4d74a20..01f6493 100644
--- a/extractor/extractor_interface.gd
+++ b/extractor/extractor_interface.gd
@@ -4,9 +4,9 @@ extends Control
func _ready() -> void:
pass
- var grf = GRF.open("res://client_data/data.grf")
+ #var grf = GRF.open("res://client_data/data.grf")
#grf.extract("res://client_data")
- grf.convert("res://client_data")
+ #grf.convert("res://client_data")
#Sprite.from_bytes(FileAccess.get_file_as_bytes("res://client_data/data/sprite/cursors.spr"))
#ActionFormat.from_bytes(
@@ -24,12 +24,12 @@ func _ready() -> void:
#FileAccess.get_file_as_bytes("res://client_data/data/int_land02.gnd")
#)
#)
- #var rsw = RSWFormat.from_bytes(
- #ByteStream.from_bytes(
- ##FileAccess.get_file_as_bytes("res://client_data/data/int_land02.rsw")
- #FileAccess.get_file_as_bytes("res://client_data/data/pay_dun00.rsw")
- #)
- #)
+ var rsw = RSWFormat.from_bytes(
+ ByteStream.from_bytes(
+ #FileAccess.get_file_as_bytes("res://client_data/data/int_land02.rsw")
+ FileAccess.get_file_as_bytes("res://client_data/data/pay_dun00.rsw")
+ )
+ )
#RSMFormat.from_bytes(
#ByteStream.from_bytes(
##FileAccess.get_file_as_bytes("res://client_data/data/model/prontera/chair_01.rsm")
@@ -39,7 +39,7 @@ func _ready() -> void:
#)
#)
- #var scene_root := rsw.convert("pay_dun00", "res://client_data")
- #var scene := PackedScene.new()
- #scene.pack(scene_root)
- #ResourceSaver.save(scene, "res://extractor/test/pay_dun00.tscn")
+ var scene_root := rsw.convert("pay_dun00", "res://client_data")
+ var scene := PackedScene.new()
+ scene.pack(scene_root)
+ ResourceSaver.save(scene, "res://extractor/test/pay_dun00.tscn")
diff --git a/extractor/gnd_format.gd b/extractor/gnd_format.gd
index c49bce6..d71cd63 100644
--- a/extractor/gnd_format.gd
+++ b/extractor/gnd_format.gd
@@ -91,7 +91,7 @@ static func from_bytes(bytes: ByteStream) -> GNDFormat:
gnd_format.texture_paths = []
for _n in gnd_format.texture_count:
gnd_format.texture_paths.append(
- bytes.get_string_from_ro(gnd_format.texture_path_length)
+ bytes.get_string_from_ro(gnd_format.texture_path_length) # TODO: EUC-KR string is empty and converts to ascii instead. that's wrong.
)
gnd_format.light_map_slice_count = bytes.decode_s32()
@@ -176,10 +176,10 @@ func convert(data_path: String) -> GridMap:
var mesh: ArrayMesh = cube[surface_type].mesh
var material := StandardMaterial3D.new()
material.albedo_texture = load(
- "%s/data/texture/%s" % [
+ ("%s/data/texture/%s" % [
data_path,
texture_paths[cube[surface_type].surface.texture_index]
- ]
+ ]).replace(".bmp", ".png")
)
mesh.surface_set_material(0, material)
diff --git a/extractor/grf.gd b/extractor/grf.gd
index 5b7046f..0788dfb 100644
--- a/extractor/grf.gd
+++ b/extractor/grf.gd
@@ -206,6 +206,7 @@ func extract(destination: String = "user://client_data"):
file.store_buffer(file_entry.get_contents(file_access))
extracted_file.emit(idx)
+ print(file_path)
func convert(destination: String = "res://client_data"):
@@ -286,6 +287,7 @@ func convert(destination: String = "res://client_data"):
static func decode_string(bytes: PackedByteArray):
+ return bytes.get_string_from_ascii()
Engine.print_error_messages = false
var string := bytes.get_string_from_multibyte_char("EUC-KR")
Engine.print_error_messages = true
diff --git a/extractor/rsm_format.gd b/extractor/rsm_format.gd
index 7f16368..30ef3ed 100644
--- a/extractor/rsm_format.gd
+++ b/extractor/rsm_format.gd
@@ -362,7 +362,9 @@ class ModelNode:
node.translate(translation_2)
if rotation_axis != Vector3.ZERO:
- node.rotation = (rotation_axis * rotation_angle) * Vector3(1,-1,1)
+ var quat = Quaternion(rotation_axis, rotation_angle)
+ node.rotation = quat.get_euler()
+ #node.rotation = (rotation_axis * rotation_angle) * Vector3(1,-1,1)
node.scale = scale