0

Merge branch 'master' into py-package

This commit is contained in:
Aaron Griffith
2011-06-04 20:05:31 -04:00
7 changed files with 38 additions and 19 deletions

View File

@@ -29,13 +29,13 @@ body {
font-family: monospace;
}
#customControl {
.customControl {
padding: 5px;
height: 15px;
font-family: Arial, sans-serif;
}
#customControl > div#top {
.customControl > div.top {
background-color: #fff;
border: 2px solid #000;
text-align: center;
@@ -45,14 +45,14 @@ body {
cursor: pointer;
}
#customControl > div#dropDown {
.customControl > div.dropDown {
border: 1px solid #000;
font-size: 12px;
background-color: #fff;
display: none;
}
#customControl > div#button {
.customControl > div.button {
border: 1px solid #000;
font-size: 12px;
background-color: #fff;

View File

@@ -560,8 +560,8 @@ var overviewer = {
// Adjust for the fact that we we can't figure out what Y is given
// only latitude and longitude, so assume Y=64.
point.x += 64 + 1;
point.z -= 64 + 2;
point.x += 64;
point.z -= 64;
return point;
},
@@ -585,7 +585,7 @@ var overviewer = {
// Spawn button
var homeControlDiv = document.createElement('DIV');
var homeControl = new overviewer.classes.HomeControl(homeControlDiv);
homeControlDiv.id = 'customControl';
$(homeControlDiv).addClass('customControl');
homeControlDiv.index = 1;
if (overviewerConfig.map.controls.spawn) {
overviewer.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv);
@@ -680,18 +680,18 @@ var overviewer = {
'createDropDown': function(title, items) {
var control = document.createElement('DIV');
// let's let a style sheet do most of the styling here
control.id = 'customControl';
$(control).addClass('customControl');
var controlText = document.createElement('DIV');
controlText.innerHTML = title;
var controlBorder = document.createElement('DIV');
controlBorder.id='top';
$(controlBorder).addClass('top');
control.appendChild(controlBorder);
controlBorder.appendChild(controlText);
var dropdownDiv = document.createElement('DIV');
dropdownDiv.id='dropDown';
$(dropdownDiv).addClass('dropDown');
control.appendChild(dropdownDiv);
dropdownDiv.innerHTML='';
@@ -868,14 +868,14 @@ var overviewer = {
controlDiv.style.padding = '5px';
// Set CSS for the control border
var control = document.createElement('DIV');
control.id='top';
$(control).addClass('top');
control.title = 'Click to center the map on the Spawn';
controlDiv.appendChild(control);
// Set CSS for the control interior
var controlText = document.createElement('DIV');
controlText.innerHTML = 'Spawn';
controlText.id='button';
$(controlText).addClass('button');
control.appendChild(controlText);
// Setup the click event listeners: simply set the map to map center

View File

@@ -45,7 +45,8 @@ def optimize_image(imgpath, imgformat, optimizeimg):
os.rename(imgpath+".tmp", imgpath)
if optimizeimg >= 2:
subprocess.Popen([optipng, imgpath], stderr=subprocess.STDOUT,
# the "-nc" it's needed to no broke the transparency of tiles
subprocess.Popen([optipng, "-nc", imgpath], stderr=subprocess.STDOUT,
stdout=subprocess.PIPE).communicate()[0]
subprocess.Popen([advdef, "-z4",imgpath], stderr=subprocess.STDOUT,
stdout=subprocess.PIPE).communicate()[0]

View File

@@ -49,7 +49,7 @@ def iterate_base4(d):
return itertools.product(xrange(4), repeat=d)
class QuadtreeGen(object):
def __init__(self, worldobj, destdir, bgcolor, depth=None, tiledir=None, imgformat=None, imgquality=95, optimizeimg=None, rendermode="normal"):
def __init__(self, worldobj, destdir, bgcolor, depth=None, tiledir=None, forcerender=False, imgformat=None, imgquality=95, optimizeimg=None, rendermode="normal"):
"""Generates a quadtree from the world given into the
given dest directory
@@ -60,6 +60,7 @@ class QuadtreeGen(object):
"""
assert(imgformat)
self.forcerender = forcerender
self.imgformat = imgformat
self.imgquality = imgquality
self.optimizeimg = optimizeimg
@@ -425,10 +426,17 @@ class QuadtreeGen(object):
needs_rerender = False
get_region_mtime = world.get_region_mtime
for col, row, chunkx, chunky, regionfile in chunks:
# check region file mtime first.
region,regionMtime = get_region_mtime(regionfile)
# don't even check if it's not in the regionlist
if self.world.regionlist and region._filename not in self.world.regionlist:
continue
# bail early if forcerender is set
if self.forcerender:
needs_rerender = True
break
# check region file mtime first.
region,regionMtime = get_region_mtime(regionfile)
if regionMtime <= tile_mtime:
continue