dump renderType as int, not string, handle maxLOD=0 in textureAtlas

This commit is contained in:
David Vierra 2015-01-01 05:11:40 -10:00
parent bcf904c548
commit cac8d300f5
3 changed files with 1386 additions and 1384 deletions

View File

@ -58,7 +58,7 @@ class BlockModels(object):
# another optional key is 'uvlock', which needs investigating
variantBlockState = block.resourceVariant
log.debug("Loading %s#%s for %s", block.resourcePath, block.resourceVariant, block)
variantDict = variants[variantBlockState]
if isinstance(variantDict, list):
variantDict = variantDict[0] # do the random pick thing later, if at all

View File

@ -160,15 +160,17 @@ class TextureAtlas(object):
for name, left, top, width, height, data in slot.textures:
log.debug("Texture %s at (%d,%d,%d,%d)", name, left, top, width, height)
texDataView = texData[top:top + height, left:left + width]
texDataView[b:-b, b:-b] = data
if b:
texDataView[b:-b, b:-b] = data
# Wrap texture edges to avoid antialiasing bugs at edges of blocks
texDataView[-b:, b:-b] = data[:b]
texDataView[:b, b:-b] = data[-b:]
texDataView[:, -b:] = texDataView[:, b:2 * b]
texDataView[:, :b] = texDataView[:, -b * 2:-b]
# Wrap texture edges to avoid antialiasing bugs at edges of blocks
texDataView[-b:, b:-b] = data[:b]
texDataView[:b, b:-b] = data[-b:]
texDataView[:, -b:] = texDataView[:, b:2 * b]
texDataView[:, :b] = texDataView[:, -b * 2:-b]
else:
texDataView[:] = data
self.texCoordsByName[name] = left + b, top + b, width - 2 * b, height - 2 * b
def _load():

File diff suppressed because it is too large Load Diff