diff --git a/bemani/format/afp/swf.py b/bemani/format/afp/swf.py index 9c7ecd7..c0b8fad 100644 --- a/bemani/format/afp/swf.py +++ b/bemani/format/afp/swf.py @@ -103,8 +103,8 @@ class AP2PlaceObjectTag(Tag): blend: Optional[int], update: bool, transform: Optional[Matrix], - color: Optional[Color], - alpha_color: Optional[Color], + mult_color: Optional[Color], + add_color: Optional[Color], triggers: Dict[int, List[ByteCode]], ) -> None: # Place Object Tags are not identified by any tag ID. @@ -133,10 +133,10 @@ class AP2PlaceObjectTag(Tag): self.transform = transform # If there is a color to blend with the sprite/shape when drawing. - self.color = color + self.mult_color = mult_color - # If there is an alpha color to draw instead of draing over any other placed object. - self.alpha_color = alpha_color + # If there is a color to add with the sprite/shape when drawing. + self.add_color = add_color # List of triggers for this object, and their respective bytecodes to execute when the trigger # fires. @@ -761,6 +761,7 @@ class SWF(TrackedCoverage, VerboseOutput): unhandled_flags = flags if flags & 0x2: + # Has a shape component. unhandled_flags &= ~0x2 src_tag_id = struct.unpack("> 24) & 0xFF) * 0.003921569 - color.g = float((rgba >> 16) & 0xFF) * 0.003921569 - color.b = float((rgba >> 8) & 0xFF) * 0.003921569 - color.a = float(rgba & 0xFF) * 0.003921569 - self.vprint(f"{prefix} Color: {color}") + multcolor.r = float((rgba >> 24) & 0xFF) * 0.003921569 + multcolor.g = float((rgba >> 16) & 0xFF) * 0.003921569 + multcolor.b = float((rgba >> 8) & 0xFF) * 0.003921569 + multcolor.a = float(rgba & 0xFF) * 0.003921569 + self.vprint(f"{prefix} Mult Color: {multcolor}") if flags & 0x4000: + # Additive color present, smaller integers. unhandled_flags &= ~0x4000 rgba = struct.unpack("> 24) & 0xFF) * 0.003921569 - acolor.g = float((rgba >> 16) & 0xFF) * 0.003921569 - acolor.b = float((rgba >> 8) & 0xFF) * 0.003921569 - acolor.a = float(rgba & 0xFF) * 0.003921569 - self.vprint(f"{prefix} AColor: {color}") + addcolor.r = float((rgba >> 24) & 0xFF) * 0.003921569 + addcolor.g = float((rgba >> 16) & 0xFF) * 0.003921569 + addcolor.b = float((rgba >> 8) & 0xFF) * 0.003921569 + addcolor.a = float(rgba & 0xFF) * 0.003921569 + self.vprint(f"{prefix} Add Color: {addcolor}") bytecodes: Dict[int, List[ByteCode]] = {} if flags & 0x80: @@ -981,14 +991,13 @@ class SWF(TrackedCoverage, VerboseOutput): self.vprint(f"{prefix} Unknown Filter data Count: {count}, Size: {filter_size}") if flags & 0x1000000: - # Some sort of point, perhaps an x, y offset for the object? + # Some sort of point, perhaps an x, y offset for the object or a center point for rotation? unhandled_flags &= ~0x1000000 - x, y = struct.unpack("