0

Merge branch 'master' into rendermode-options

Conflicts:
	overviewer.py
This commit is contained in:
Aaron Griffith
2011-09-06 10:29:15 -04:00
8 changed files with 70 additions and 32 deletions

View File

@@ -11,6 +11,7 @@ class ConfigOptionParser(object):
def __init__(self, **kwargs):
self.cmdParser = optparse.OptionParser(usage=kwargs.get("usage",""))
self.configFile = kwargs.get("config","settings.py")
self.listifyDelimiters = kwargs.get("listdelim", ",:/")
self.configVars = []
self.advancedHelp = []
# these are arguments not understood by OptionParser, so they must be removed
@@ -154,7 +155,12 @@ class ConfigOptionParser(object):
if 'listify' in a.keys():
# this thing may be a list!
if configResults.__dict__[n] != None and type(configResults.__dict__[n]) == str:
configResults.__dict__[n] = configResults.__dict__[n].split(a.get("listdelim",","))
delimiters = a.get("listdelim", self.listifyDelimiters)
# replace the rest of the delimiters with the first
for delim in delimiters[1:]:
configResults.__dict__[n] = configResults.__dict__[n].replace(delim, delimiters[0])
# split at each occurance of the first delimiter
configResults.__dict__[n] = configResults.__dict__[n].split(delimiters[0])
elif type(configResults.__dict__[n]) != list:
configResults.__dict__[n] = [configResults.__dict__[n]]
if 'type' in a.keys() and configResults.__dict__[n] != None:

View File

@@ -223,6 +223,24 @@ do_shading_with_mask(RenderModeLighting *self, RenderState *state,
/* this face isn't visible, so don't draw anything */
return;
}
} else if ((x == -1) && (state->left_blocks != Py_None)) {
unsigned char block = getArrayByte3D(state->left_blocks, 15, state->y, state->z);
if (!is_transparent(block)) {
/* the same thing but for adjacent chunks, this solves an
ugly black doted line between chunks in night rendermode.
This wouldn't be necessary if the textures were truly
tessellate-able */
return;
}
} else if ((y == 16) && (state->right_blocks != Py_None)) {
unsigned char block = getArrayByte3D(state->right_blocks, state->x, 0, state->z);
if (!is_transparent(block)) {
/* the same thing but for adjacent chunks, this solves an
ugly black doted line between chunks in night rendermode.
This wouldn't be necessary if the textures were truly
tessellate-able */
return;
}
}
black_coeff = get_lighting_coefficient(self, state, x, y, z);

View File

@@ -23,6 +23,7 @@ import math
from random import randint
import numpy
from PIL import Image, ImageEnhance, ImageOps, ImageDraw
import logging
import util
import composite
@@ -47,13 +48,13 @@ def _find_file(filename, mode="rb", verbose=False):
if _find_file_local_path:
path = os.path.join(_find_file_local_path, filename)
if os.path.exists(path):
if verbose: print "Found %s in '%s'" % (filename, path)
if verbose: logging.info("Found %s in '%s'", filename, path)
return open(path, mode)
programdir = util.get_program_path()
path = os.path.join(programdir, filename)
if os.path.exists(path):
if verbose: print "Found %s in '%s'" % (filename, path)
if verbose: logging.info("Found %s in '%s'", filename, path)
return open(path, mode)
path = os.path.join(programdir, "overviewer_core", "data", "textures", filename)
@@ -63,13 +64,13 @@ def _find_file(filename, mode="rb", verbose=False):
# windows special case, when the package dir doesn't exist
path = os.path.join(programdir, "textures", filename)
if os.path.exists(path):
if verbose: print "Found %s in '%s'" % (filename, path)
if verbose: logging.info("Found %s in '%s'", filename, path)
return open(path, mode)
if sys.platform == "darwin":
path = os.path.join("/Applications/Minecraft", filename)
if os.path.exists(path):
if verbose: print "Found %s in '%s'" % (filename, path)
if verbose: logging.info("Found %s in '%s'", filename, path)
return open(path, mode)
# Find minecraft.jar.
@@ -82,14 +83,16 @@ def _find_file(filename, mode="rb", verbose=False):
"Application Support", "minecraft","bin","minecraft.jar"))
jarpaths.append(os.path.join(os.environ['HOME'], ".minecraft", "bin",
"minecraft.jar"))
jarpaths.append(programdir)
jarpaths.append(os.getcwd())
jarpaths.append(os.path.join(programdir,"minecraft.jar"))
jarpaths.append(os.path.join(os.getcwd(), "minecraft.jar"))
if _find_file_local_path:
jarpaths.append(os.path.join(_find_file_local_path, "minecraft.jar"))
for jarpath in jarpaths:
if os.path.exists(jarpath):
try:
jar = zipfile.ZipFile(jarpath)
if verbose: print "Found %s in '%s'" % (filename, jarpath)
if verbose: logging.info("Found %s in '%s'", filename, jarpath)
return jar.open(filename)
except (KeyError, IOError):
pass