0

fixed minor inlining error in commit d547727

fixes regression in issue #320
<https://github.com/brownan/Minecraft-Overviewer/issues/320>
This commit is contained in:
Aaron Griffith
2011-04-10 03:44:06 -04:00
parent b75fb04719
commit 22fc77308e
2 changed files with 7 additions and 37 deletions

View File

@@ -129,38 +129,6 @@ fluid_blocks = set([8,9,10,11])
# (glass, half blocks) # (glass, half blocks)
nospawn_blocks = set([20,44]) nospawn_blocks = set([20,44])
# chunkcoords should be the coordinates of a possible chunk. it may not exist
def render_to_image(chunkcoords, img, imgcoords, quadtreeobj, cave=False, queue=None):
"""Used to render a chunk to a tile in quadtree.py.
chunkcoords is a tuple: (chunkX, chunkY)
imgcoords is as well: (imgX, imgY), which represents the "origin"
to use for drawing.
If the chunk doesn't exist, return False.
Else, returns True."""
a = ChunkRenderer(chunkcoords, quadtreeobj.world, quadtreeobj.rendermode, queue)
try:
a.chunk_render(img, imgcoords[0], imgcoords[1], cave)
return True
except ChunkCorrupt:
# This should be non-fatal, but should print a warning
pass
except Exception, e:
import traceback
traceback.print_exc()
raise
except KeyboardInterrupt:
print
print "You pressed Ctrl-C. Exiting..."
# Raise an exception that is an instance of Exception. Unlike
# KeyboardInterrupt, this will re-raise in the parent, killing the
# entire program, instead of this process dying and the parent waiting
# forever for it to finish.
raise Exception()
return False
class ChunkCorrupt(Exception): class ChunkCorrupt(Exception):
pass pass

View File

@@ -453,11 +453,13 @@ class QuadtreeGen(object):
ypos = -96 + (row-rowstart)*96 ypos = -96 + (row-rowstart)*96
# draw the chunk! # draw the chunk!
a = chunk.ChunkRenderer((chunkx, chunky), world, rendermode, poi_queue) try:
a.chunk_render(tileimg, xpos, ypos, None) a = chunk.ChunkRenderer((chunkx, chunky), world, rendermode, poi_queue)
# chunk.render_to_image((chunkx, chunky), tileimg, (xpos, ypos), self, False, None) a.chunk_render(tileimg, xpos, ypos, None)
except chunk.ChunkCorrupt:
# an error was already printed
pass
# Save them # Save them
tileimg.save(imgpath) tileimg.save(imgpath)