~exarkun/game/network-client-virtualenv-friendly

« back to all changes in this revision

Viewing changes to game/terrain.py

  • Committer: Jean-Paul Calderone
  • Date: 2011-01-23 18:46:01 UTC
  • Revision ID: exarkun@divmod.com-20110123184601-z57skhvic4wt3o8l
Make sure that the voxel used to scale up storage doesn't  actually contribute any terrain data.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    result = Terrain()
62
62
    # Force it to be large enough right away, instead of scaling it up in bits
63
63
    # and pieces which is much slower and fragments memory much more.
 
64
    unknown = zeros((1, 1, 1), 'b')
 
65
    unknown[0, 0, 0] = UNKNOWN
64
66
    result.set(
65
67
        surface.get_width() - 1, 255, surface.get_height() - 1,
66
 
        empty((1, 1, 1), 'b'))
 
68
        unknown)
67
69
    for x in range(surface.get_width()):
68
70
        for z in range(surface.get_height()):
69
71
            r, g, b, a = surface.get_at((x, z))