From 39d905c4684b474e13ab3298fca08453f4c14834 Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 9 Nov 2011 02:23:21 +0100 Subject: starting work on tile drawing --- src/mapdata.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/mapdata.py') diff --git a/src/mapdata.py b/src/mapdata.py index ad0bef2..550d710 100644 --- a/src/mapdata.py +++ b/src/mapdata.py @@ -25,9 +25,17 @@ class KPLayer(object): self.tileset = '' self.objects = [] self.visible = True - self.cache = [] + self.cache = ['DUMMY_FLAG'] + self.updateCache() def updateCache(self): + if len(self.objects) == 0: + if len(self.cache) != 0: + self.cache = [] + self.cacheBasePos = (0,0) + self.cacheSize = (0,0) + return + x1, x2 = MAP_SIZE_IN_TILES[0] - 1, 0 y1, y2 = MAP_SIZE_IN_TILES[1] - 1, 0 -- cgit v1.2.3