Skip to content

Instantly share code, notes, and snippets.

@charliegreen
charliegreen / tile_converter.py
Created September 2, 2017 00:12
A quick, messy script to take PNG spritesheets and convert them to Uzebox-usable includable files
#!/usr/bin/env python3
# tile_converter.py: a quick, messy script to take PNG spritesheets and convert them to
# Uzebox-usable includable files.
#
# Usage: python3 tile_converter.py PATH
#
# If PATH is, for example, 'data/foo.png', this will create a file 'data/foo.inc' that may be
# #include'd by Uzebox programs. foo.inc includes:
# * TILETAB_FOO_LENGTH: a macro with the number of tiles defined