Skip to content
Permalink
Browse files

gen-atlas: fix sprite override template generation

  • Loading branch information...
Akaricchi committed May 18, 2019
1 parent 2fec4bf commit c0e8ec85073437544c6f6350f12eb476f777bc1c
Showing with 2 additions and 5 deletions.
  1. +2 −5 scripts/gen-atlas.py
@@ -61,7 +61,7 @@ class ConfigSyntaxError(Exception):
pass


def write_sprite_def(dst, texture, region, size, overrides=None):
def write_sprite_def(dst, texture, region, overrides=None):
dst.parent.mkdir(exist_ok=True, parents=True)

text = (
@@ -71,8 +71,6 @@ def write_sprite_def(dst, texture, region, size, overrides=None):
f'region_y = {region[1]}\n'
f'region_w = {region[2]}\n'
f'region_h = {region[3]}\n'
# f'w = {size[0]}\n'
# f'h = {size[1]}\n'
)

if overrides is not None:
@@ -277,13 +275,12 @@ def get_border(sprite, default_border=border):
override_contents = override_path.read_text()
else:
override_contents = None
write_override_template(override_path, img.size)
write_override_template(override_path, (rect.width - border * 2, rect.height - border * 2))

write_sprite_def(
temp_dst / f'{name}.spr',
textureid,
(rect.x + border, rect.y + border, rect.width - border * 2, rect.height - border * 2),
img.size,
overrides=override_contents
)

0 comments on commit c0e8ec8

Please sign in to comment.
You can’t perform that action at this time.