diff --git a/gba/tools/img2bin.py b/gba/tools/img2bin.py index 1fd95a2..d4c1ad4 100644 --- a/gba/tools/img2bin.py +++ b/gba/tools/img2bin.py @@ -19,9 +19,8 @@ def write_block(f, image, width=8, height=8, offset_x=0, offset_y=0): for x in range(width): val = image.getpixel((x+offset_x, y+offset_y)) f.write(chr(val)) - -if __name__=="__main__": +def main(): tiled, args = gnu_getopt(sys.argv[1:], "t") if len(args) < 2: @@ -53,3 +52,7 @@ if __name__=="__main__": value = (b << 10) + (g << 5) + r pal_output.write(struct.pack("