From feb013ce131eaf28882afc1e09415782a6a6e402 Mon Sep 17 00:00:00 2001 From: josch Date: Fri, 28 Nov 2008 13:31:31 +0100 Subject: [PATCH] finally fixing overlapping completely - at least as far as i see it... --- lib/mapset.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/mapset.py b/lib/mapset.py index 51abb3c..4e774d9 100644 --- a/lib/mapset.py +++ b/lib/mapset.py @@ -360,21 +360,19 @@ class MapSet(object): self.objects = [i[0] for i in sorted(self.objects, key=lambda i:i[1])] for obj in [i for i in h3m_data["tunedobj"] if i["z"]==0]: - order = obj["y"] + # order objects by row in which they are placed + # 8 levels offset because of objects 6 tiles high + order = obj["y"] + 8 + # if the overlay attribute is set, object is drawn below all + # objects ove it - so substract its hight if self.objects[obj["id"]].overlay: order = order - self.objects[obj["id"]].tex.height // 32 + # each row two levels - woods and mountains in the back and the + # rest in front order *= 2 - if self.objects[obj["id"]].objclass in [5, 6, 17, 20, 26, 33, 34, - 36, 42, 53, 54, 59, 62, 65, - 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 79, 81, - 83, 87, 88, 89, 90, 91, 93, - 98, 112, 113, 162, 163, - 164, 215, 216, 217, 218, - 219, 220, - #here comes new ones: - 100, 16]: - order += 1 + # put wood and mountains behind other objects on the same level + if self.objects[obj["id"]].objclass in [119, 134, 135, 137, 155, 199]: + order -= 1 group = pyglet.graphics.OrderedGroup(order) group = pyglet.graphics.TextureGroup(self.atlases[self.objects[obj["id"]].tex.atlas].texture, parent=group) if group not in self.groups: