0

Fix regions being shifted by one during rotation

This fixes exaggerated tile counts in progress updates,
reduces the calls to rendernode (for a small performance
increase), and shifts the problem of unclickable signs in
UR orientation further away.
This commit is contained in:
Ryan Rector
2011-08-03 14:37:04 -06:00
parent 5728bc4051
commit 4ac5dfc2a8
3 changed files with 20 additions and 20 deletions

View File

@@ -1788,18 +1788,18 @@ def getBiomeData(worlddir, chunkX, chunkY):
biomeY = chunkY // 32 biomeY = chunkY // 32
rots = 0 rots = 0
if _north == 'upper-right': if _north == 'upper-right':
biomeX = -biomeX biomeX = -biomeX-1
biomeY = -biomeY biomeY = -biomeY-1
rots = 2 rots = 2
elif _north == 'lower-right': elif _north == 'lower-right':
temp = biomeX temp = biomeX
biomeX = -biomeY biomeX = -biomeY-1
biomeY = temp biomeY = temp
rots = 1 rots = 1
elif _north == 'upper-left': elif _north == 'upper-left':
temp = biomeX temp = biomeX
biomeX = biomeY biomeX = biomeY
biomeY = -temp biomeY = -temp-1
rots = 3 rots = 3
biomeFile = "b.%d.%d.biome" % (biomeX, biomeY) biomeFile = "b.%d.%d.biome" % (biomeX, biomeY)

View File

@@ -493,16 +493,16 @@ var overviewer = {
Math.pow(2, overviewerConfig.map.maxZoom)); Math.pow(2, overviewerConfig.map.maxZoom));
if(overviewerConfig.map.north_direction == 'upper-right'){ if(overviewerConfig.map.north_direction == 'upper-right'){
x = -x-1+512; x = -x-1;
y = -y-1+512; y = -y-1;
} else if(overviewerConfig.map.north_direction == 'upper-left'){ } else if(overviewerConfig.map.north_direction == 'upper-left'){
temp = x; temp = x;
x = -y-1+512; x = -y-1;
y = temp; y = temp;
} else if(overviewerConfig.map.north_direction == 'lower-right'){ } else if(overviewerConfig.map.north_direction == 'lower-right'){
temp = x; temp = x;
x = y; x = y;
y = -temp-1+512; y = -temp-1;
} }
// This information about where the center column is may change with // This information about where the center column is may change with
@@ -578,16 +578,16 @@ var overviewer = {
point.z -= 64; point.z -= 64;
if(overviewerConfig.map.north_direction == 'upper-right'){ if(overviewerConfig.map.north_direction == 'upper-right'){
point.x = -point.x+512; point.x = -point.x;
point.z = -point.z+512; point.z = -point.z;
} else if(overviewerConfig.map.north_direction == 'upper-left'){ } else if(overviewerConfig.map.north_direction == 'upper-left'){
temp = point.z; temp = point.z;
point.z = -point.x+512; point.z = -point.x;
point.x = temp; point.x = temp;
} else if(overviewerConfig.map.north_direction == 'lower-right'){ } else if(overviewerConfig.map.north_direction == 'lower-right'){
temp = point.z; temp = point.z;
point.z = point.x; point.z = point.x;
point.x = -temp+512; point.x = -temp;
} }
return point; return point;

View File

@@ -318,16 +318,16 @@ class World(object):
x = int(p[1]) x = int(p[1])
y = int(p[2]) y = int(p[2])
if self.north_direction == 'upper-right': if self.north_direction == 'upper-right':
x = -x x = -x-1
y = -y y = -y-1
elif self.north_direction == 'upper-left': elif self.north_direction == 'upper-left':
temp = x temp = x
x = -y x = -y-1
y = temp y = temp
elif self.north_direction == 'lower-right': elif self.north_direction == 'lower-right':
temp = x temp = x
x = y x = y
y = -temp y = -temp-1
yield (x, y, join(self.worlddir, 'region', f)) yield (x, y, join(self.worlddir, 'region', f))
else: else:
logging.warning("Ignore path '%s' in regionlist", f) logging.warning("Ignore path '%s' in regionlist", f)
@@ -339,16 +339,16 @@ class World(object):
x = int(p[1]) x = int(p[1])
y = int(p[2]) y = int(p[2])
if self.north_direction == 'upper-right': if self.north_direction == 'upper-right':
x = -x x = -x-1
y = -y y = -y-1
elif self.north_direction == 'upper-left': elif self.north_direction == 'upper-left':
temp = x temp = x
x = -y x = -y-1
y = temp y = temp
elif self.north_direction == 'lower-right': elif self.north_direction == 'lower-right':
temp = x temp = x
x = y x = y
y = -temp y = -temp-1
yield (x, y, join(dirpath, f)) yield (x, y, join(dirpath, f))
def get_save_dir(): def get_save_dir():