0

Removed filting chunks from render_worldtile since _get_chunks_in_range can do it trivially before constructing the list

This commit is contained in:
Xon
2011-03-23 17:22:57 +08:00
parent dbdd5d0fc8
commit 8cfa50087a
2 changed files with 9 additions and 16 deletions

View File

@@ -80,7 +80,7 @@ class World(object):
mcr = nbt.MCRFileReader(regionfile)
mcr.get_chunk_info()
regions[regionfile] = (mcr,os.path.getmtime(regionfile))
regionfiles[(x,y)] = (x,y,regionfile)
regionfiles[(x,y)] = (x,y,regionfile,mcr)
self.regionfiles = regionfiles
self.regions = regions
logging.debug("Done scanning regions")
@@ -116,7 +116,7 @@ class World(object):
def get_region_path(self, chunkX, chunkY):
"""Returns the path to the region that contains chunk (chunkX, chunkY)
"""
_, _, regionfile = self.regionfiles.get((chunkX//32, chunkY//32),(None,None,None));
_, _, regionfile,_ = self.regionfiles.get((chunkX//32, chunkY//32),(None,None,None,None));
return regionfile
def load_from_region(self,filename, x, y):
@@ -135,7 +135,7 @@ class World(object):
return self.regions[filename][0]
def get_region_mtime(self,filename):
return self.regions[filename][1]
return self.regions[filename]
def convert_coords(self, chunkx, chunky):
"""Takes a coordinate (chunkx, chunky) where chunkx and chunky are