summaryrefslogtreecommitdiff
path: root/extractor
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-12-15 16:53:12 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-12-15 16:53:12 +0100
commit75793bd23d275d10d6a0bd8024a7e412b64557ce (patch)
treeeef8145a645a88c718a4004e3a5e5f8f7700fa47 /extractor
parenta14e88ff4d0d87841a44254e2bff1784da6e8b48 (diff)
next commit
Diffstat (limited to 'extractor')
-rw-r--r--extractor/action_format.gd4
-rw-r--r--extractor/grf.gd12
2 files changed, 8 insertions, 8 deletions
diff --git a/extractor/action_format.gd b/extractor/action_format.gd
index 719bc2d..97f6771 100644
--- a/extractor/action_format.gd
+++ b/extractor/action_format.gd
@@ -302,7 +302,7 @@ class SpriteAnchor:
return Vector2(position_u, position_v)
- static func from_bytes(bytes: ByteStream, version: Version):
+ static func from_bytes(bytes: ByteStream, _version: Version):
var sprite_anchor = SpriteAnchor.new()
sprite_anchor.unused = bytes.get_buffer(4).bytes
@@ -321,7 +321,7 @@ class Event:
var name: String
- static func from_bytes(bytes: ByteStream, version: Version):
+ static func from_bytes(bytes: ByteStream, _version: Version):
var event = Event.new()
event.name = bytes.get_string_from_utf8(BYTE_LENGTH)
diff --git a/extractor/grf.gd b/extractor/grf.gd
index e017bc8..9917a74 100644
--- a/extractor/grf.gd
+++ b/extractor/grf.gd
@@ -220,13 +220,11 @@ func convert(destination: String = "res://data"):
var player_head_path_part = "¸Ó¸®Åë"
var player_body_path_part = "¸öÅë"
- if file_path.ends_with(".spr") and file_path.contains(player_body_path_part) and file_path.contains("NIGHT_WATCH"):
+ if file_path.ends_with(".spr") and file_path.contains(player_head_path_part):
var sprite = SpriteFormat.from_bytes(file_entry.get_contents(file_access))
- print(file_path, (sprite.palette_image_count), sprite.version)
sprite.save_to_file(base_file_directory_path)
- elif file_path.ends_with(".act") and file_path.contains(player_body_path_part):
- continue
+ elif file_path.ends_with(".act") and file_path.contains(player_head_path_part):
if not FileAccess.file_exists("%s/000.png.import" % base_file_directory_path):
continue
@@ -299,8 +297,6 @@ func convert(destination: String = "res://data"):
animation.length = frame_timing_base * action.motion_count
animation_library.add_animation(str(action_idx).pad_zeros(3), animation)
- # TODO: set animation max length
-
# get max number of sprite layers for current action motions
var motion_sprite_layers_max_count = action.motions.reduce(func(accum, motion: ActionFormat.Motion):
return max(accum, motion.sprite_layer_count)
@@ -331,6 +327,10 @@ func convert(destination: String = "res://data"):
for motion_idx in action.motions.size():
var motion: ActionFormat.Motion = action.motions[motion_idx]
+ # TODO: no animations to speak of available ?
+ if motion.event_id == -1:
+ continue
+
var timing = motion_idx * frame_timing_base
var visible_key = 0