| 
														
															@@ -23,6 +23,7 @@ class LevelModel: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         X, Y, Z = x+1, y+1, z+1 
														 | 
														
														 | 
														
															         X, Y, Z = x+1, y+1, z+1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         tex_coords = ('t2f', (0, 0, 1, 0, 1, 1, 0, 1)) 
														 | 
														
														 | 
														
															         tex_coords = ('t2f', (0, 0, 1, 0, 1, 1, 0, 1)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        white = [255]*4 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.batch.add(4, GL_QUADS, self.wall_textures[wall_tex],   ('v3f', (X, y, z,  x, y, z,  x, Y, z,  X, Y, z)), tex_coords) # back 
														 | 
														
														 | 
														
															         self.batch.add(4, GL_QUADS, self.wall_textures[wall_tex],   ('v3f', (X, y, z,  x, y, z,  x, Y, z,  X, Y, z)), tex_coords) # back 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.batch.add(4, GL_QUADS, self.wall_textures[wall_tex],   ('v3f', (x, y, Z,  X, y, Z,  X, Y, Z,  x, Y, Z)), tex_coords) # front 
														 | 
														
														 | 
														
															         self.batch.add(4, GL_QUADS, self.wall_textures[wall_tex],   ('v3f', (x, y, Z,  X, y, Z,  X, Y, Z,  x, Y, Z)), tex_coords) # front 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -30,15 +31,12 @@ class LevelModel: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.batch.add(4, GL_QUADS, self.wall_textures[wall_tex],   ('v3f', (x, y, z,  x, y, Z,  x, Y, Z,  x, Y, z)), tex_coords)  # left 
														 | 
														
														 | 
														
															         self.batch.add(4, GL_QUADS, self.wall_textures[wall_tex],   ('v3f', (x, y, z,  x, y, Z,  x, Y, Z,  x, Y, z)), tex_coords)  # left 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.batch.add(4, GL_QUADS, self.wall_textures[wall_tex],   ('v3f', (X, y, Z,  X, y, z,  X, Y, z,  X, Y, Z)), tex_coords)  # right 
														 | 
														
														 | 
														
															         self.batch.add(4, GL_QUADS, self.wall_textures[wall_tex],   ('v3f', (X, y, Z,  X, y, z,  X, Y, z,  X, Y, Z)), tex_coords)  # right 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        self.batch.add(4, GL_QUADS, self.bottom, ('v3f', (x, y, z,  X, y, z,  X, y, Z,  x, y, Z)), tex_coords)  # bottom 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        self.batch.add(4, GL_QUADS, self.top,    ('v3f', (x, Y, Z,  X, Y, Z,  X, Y, z,  x, Y, z)), tex_coords)  # top 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        self.batch.add(4, GL_QUADS, None, ('v3f', (x, y, z,  X, y, z,  X, y, Z,  x, y, Z)), ('c4b', white * 4))  # bottom 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        self.batch.add(4, GL_QUADS, None, ('v3f', (x, Y, Z,  X, Y, Z,  X, Y, z,  x, Y, z)), ('c4b', white * 4))  # top 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def __init__(self, basepath): 
														 | 
														
														 | 
														
															     def __init__(self, basepath): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.base_path = basepath 
														 | 
														
														 | 
														
															         self.base_path = basepath 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        self.top = self.get_tex(os.path.join(self.base_path, 'wall_texture0.png')) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        self.bottom = self.get_tex(os.path.join(self.base_path, 'wall_texture0.png')) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.batch = pyglet.graphics.Batch() 
														 | 
														
														 | 
														
															         self.batch = pyglet.graphics.Batch() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         # build list of wall textures 
														 | 
														
														 | 
														
															         # build list of wall textures 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -55,6 +53,8 @@ class LevelModel: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.map = AnarchMap(file) 
														 | 
														
														 | 
														
															         self.map = AnarchMap(file) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        # TODO: set background image (background[0|1|2].png) from "background" + map.backgroundTex + ".png" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         for x in range(64): 
														 | 
														
														 | 
														
															         for x in range(64): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             for y in range(64): 
														 | 
														
														 | 
														
															             for y in range(64): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 item = self.map.levelMap[x][y] 
														 | 
														
														 | 
														
															                 item = self.map.levelMap[x][y] 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -62,7 +62,10 @@ class LevelModel: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     continue 
														 | 
														
														 | 
														
															                     continue 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 else: 
														 | 
														
														 | 
														
															                 else: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     tile_index = self.map.defineName(item[0]) 
														 | 
														
														 | 
														
															                     tile_index = self.map.defineName(item[0]) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    self.add_block(x, y, -1, 0) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    floor_tex = self.map.floorDict[item[0]][0] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    floor_ht = self.map.floorDict[item[0]][1] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    # print("tile: %s, %s, %s" % (tile_index, item[0], floor_ht)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    self.add_block(0-x, floor_ht / 32, 0-y, floor_tex) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def draw(self): 
														 | 
														
														 | 
														
															     def draw(self): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.batch.draw() 
														 | 
														
														 | 
														
															         self.batch.draw() 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -170,6 +173,8 @@ class Window(pyglet.window.Window): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.model.draw() 
														 | 
														
														 | 
														
															         self.model.draw() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         glPopMatrix() 
														 | 
														
														 | 
														
															         glPopMatrix() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 if __name__ == '__main__': 
														 | 
														
														 | 
														
															 if __name__ == '__main__': 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     window = Window(width=400, height=300, caption='AnarchMap', resizable=True) 
														 | 
														
														 | 
														
															     window = Window(width=400, height=300, caption='AnarchMap', resizable=True) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     glClearColor(0.5,0.7,1,1) 
														 | 
														
														 | 
														
															     glClearColor(0.5,0.7,1,1) 
														 |