diff options
author | yenatch <yenatch@gmail.com> | 2015-06-28 23:15:49 -0700 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2015-06-28 23:15:49 -0700 |
commit | b6500c8620f91dff61ecf988b6b36f37dbe56903 (patch) | |
tree | 6a6fce1d5075512f124dee5391f70c79db1c52b5 | |
parent | 661004c96962f8d2191f2868bf0bf9734aec6f06 (diff) |
Fix get_pic_animation.
Fixes aec2e7ff.
-rw-r--r-- | pokemontools/gfx.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pokemontools/gfx.py b/pokemontools/gfx.py index cb251d3..905ee55 100644 --- a/pokemontools/gfx.py +++ b/pokemontools/gfx.py @@ -699,7 +699,6 @@ def read_filename_arguments(filename): 'h': 'height', 't': 'tile_padding', } - # Filename arguments override yaml. arguments = os.path.splitext(filename)[0].lstrip('.').split('.')[1:] for argument in arguments: @@ -873,13 +872,13 @@ def get_pic_animation(tmap, w, h): frame_text += '\tdw .frame{}\n'.format(i + 1) for i, frame in enumerate(frames): - bitmask = map(operator.eq, frame, base) + bitmask = map(operator.ne, frame, base) if bitmask not in bitmasks: bitmasks.append(bitmask) which_bitmask = bitmasks.index(bitmask) mask = iter(bitmask) - masked_frame = filter(mask.next, frame) + masked_frame = filter(lambda _: mask.next(), frame) frame_text += '.frame{}\n'.format(i + 1) frame_text += '\tdb ${:02x} ; bitmask\n'.format(which_bitmask) @@ -887,7 +886,6 @@ def get_pic_animation(tmap, w, h): frame_text += '\tdb {}\n'.format(', '.join( map('${:02x}'.format, masked_frame) )) - frame_text += '\n' for i, bitmask in enumerate(bitmasks): bitmask_text += '; {}\n'.format(i) |