summaryrefslogtreecommitdiff
path: root/extractor/grf.gd
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/grf.gd
parenta14e88ff4d0d87841a44254e2bff1784da6e8b48 (diff)
next commit
Diffstat (limited to 'extractor/grf.gd')
-rw-r--r--extractor/grf.gd12
1 files changed, 6 insertions, 6 deletions
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