Revert "textures: remove baffling texture generation logic"
This reverts commit 9895fe875b.
The original code was correct, but confusing. Overviewer did regenerate
the texture in each worker process because Python pickling is incredibly
fragile fucking garbage designed by idiots who have no clue of what
a good language looks like.
This commit is contained in:
@@ -94,8 +94,13 @@ class Textures(object):
|
|||||||
##
|
##
|
||||||
|
|
||||||
def __getstate__(self):
|
def __getstate__(self):
|
||||||
|
# we must get rid of the huge image lists, and other images
|
||||||
attributes = self.__dict__.copy()
|
attributes = self.__dict__.copy()
|
||||||
# Get rid of the jar list because file objects aren't pickleable like that
|
for attr in ['blockmap', 'biome_grass_texture', 'watertexture', 'lavatexture', 'firetexture', 'portaltexture', 'lightcolor', 'grasscolor', 'foliagecolor', 'watercolor', 'texture_cache']:
|
||||||
|
try:
|
||||||
|
del attributes[attr]
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
attributes['jars'] = OrderedDict()
|
attributes['jars'] = OrderedDict()
|
||||||
return attributes
|
return attributes
|
||||||
def __setstate__(self, attrs):
|
def __setstate__(self, attrs):
|
||||||
@@ -103,7 +108,7 @@ class Textures(object):
|
|||||||
for attr, val in list(attrs.items()):
|
for attr, val in list(attrs.items()):
|
||||||
setattr(self, attr, val)
|
setattr(self, attr, val)
|
||||||
self.texture_cache = {}
|
self.texture_cache = {}
|
||||||
if not self.generated:
|
if self.generated:
|
||||||
self.generate()
|
self.generate()
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|||||||
Reference in New Issue
Block a user