summaryrefslogtreecommitdiff
path: root/extractor/rsw_format.gd
diff options
context:
space:
mode:
Diffstat (limited to 'extractor/rsw_format.gd')
-rw-r--r--extractor/rsw_format.gd18
1 files changed, 10 insertions, 8 deletions
diff --git a/extractor/rsw_format.gd b/extractor/rsw_format.gd
index 85d873c..7e70850 100644
--- a/extractor/rsw_format.gd
+++ b/extractor/rsw_format.gd
@@ -122,12 +122,14 @@ func convert(name: String, data_path: String) -> Node3D:
if not FileAccess.file_exists(model_file_path):
continue
- var rsm := RSMFormat.from_bytes(ByteStream.from_bytes(FileAccess.get_file_as_bytes(model_file_path)))
+ var rsm := RSMFormat.from_bytes(ByteStream.from_bytes(
+ FileAccess.get_file_as_bytes(model_file_path)
+ ))
var model_root := Node3D.new()
model_root.name = resource.name
model_root.position = resource.get_position() * Vector3(-1, 1, 1)
- model_root.rotation_degrees = resource.get_rotation()
+ model_root.rotation_degrees = resource.get_rotation() * Vector3(-1,1,-1)
model_root.scale = resource.get_scale()
node.add_child(model_root)
@@ -397,11 +399,11 @@ class Animated3DModel extends MapResource:
static func from_bytes(bytes: ByteStream) -> Animated3DModel:
var resource = Animated3DModel.new()
- resource.name = bytes.get_string_from_ascii(40)
+ resource.name = bytes.get_string_from_ro(40)
resource.animation_type = bytes.decode_u32()
resource.animation_speed_percent = bytes.decode_float()
resource.collision_flags = bytes.decode_u32()
- resource.model_file = bytes.get_string_from_ascii(80)
+ resource.model_file = bytes.get_string_from_ro(80)
resource.root_node_name = bytes.get_string_from_utf8(80)
resource.position_x = bytes.decode_float()
resource.position_y = bytes.decode_float()
@@ -462,7 +464,7 @@ class DynamicLightSource extends MapResource:
static func from_bytes(bytes: ByteStream) -> DynamicLightSource:
var resource = DynamicLightSource.new()
- resource.name = bytes.get_string_from_ascii(80)
+ resource.name = bytes.get_string_from_ro(80)
resource.position_x = bytes.decode_float()
resource.position_y = bytes.decode_float()
resource.position_z = bytes.decode_float()
@@ -528,8 +530,8 @@ class SpatialAudioSource extends MapResource:
static func from_bytes(bytes: ByteStream) -> SpatialAudioSource:
var resource = SpatialAudioSource.new()
- resource.name = bytes.get_string_from_ascii(80)
- resource.audio_file = bytes.get_string_from_ascii(80)
+ resource.name = bytes.get_string_from_ro(80)
+ resource.audio_file = bytes.get_string_from_ro(80)
resource.position_x = bytes.decode_float()
resource.position_y = bytes.decode_float()
resource.position_z = bytes.decode_float()
@@ -593,7 +595,7 @@ class ParticleEffectEmitter extends MapResource:
static func from_bytes(bytes: ByteStream) -> ParticleEffectEmitter:
var resource = ParticleEffectEmitter.new()
- resource.name = bytes.get_string_from_ascii(80)
+ resource.name = bytes.get_string_from_ro(80)
resource.position_x = bytes.decode_float()
resource.position_y = bytes.decode_float()
resource.position_z = bytes.decode_float()