Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tile = get_tile((x, y, l))
if tile:
blit(tile, (x * tw - ltw, y * th - tth))
def redraw(self):
""" redraw the visible portion of the buffer -- it is slow.
"""
queue = product(range(self.view.left, self.view.right),
range(self.view.top, self.view.bottom),
self.data.visible_tile_layers)
self.update_queue(queue)
self.flush()
class ThreadedRenderer(BufferedRenderer):
""" Off-screen tiling is handled in a thread
"""
def __init__(self, *args, **kwargs):
BufferedRenderer.__init__(self, *args, **kwargs)
self.flush_on_draw = False
self.queue = queue.Queue()
self.thread = TileThread(renderer=self)
self.thread.start()
def update(self, dt=None):
pass
def flush(self):
self.queue.join()