0

copied DirtyTiles and Tile objects to tileset.py

This commit is contained in:
Andrew Brown
2011-12-22 01:56:43 -05:00
parent 49a840c01b
commit fa18b26eb5
4 changed files with 320 additions and 7 deletions

View File

@@ -26,7 +26,7 @@ import logging
from cStringIO import StringIO
import ctypes
import platform
from itertools import cycle, islice
from itertools import cycle, islice, product
def get_program_path():
if hasattr(sys, "frozen") or imp.is_frozen("__main__"):
@@ -101,6 +101,11 @@ def roundrobin(iterables):
pending -= 1
nexts = cycle(islice(nexts, pending))
def iterate_base4(d):
"""Iterates over a base 4 number with d digits"""
return product(xrange(4), repeat=d)
def convert_coords(chunkx, chunkz):
"""Takes a coordinate (chunkx, chunkz) where chunkx and chunkz are
in the chunk coordinate system, and figures out the row and column