Skip to content

Commit

Permalink
Empty textures size fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Dec 22, 2024
1 parent 7a1512d commit eaf8134
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions maps4fs/generator/texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,6 @@ def rotate_textures(self) -> None:
"Skipping rotation of layer %s because it has no tags.", layer.name
)

# base_path = self.game.base_image_path(self.map_directory)
# if base_path:
# base_layer = self.get_base_layer()
# if base_layer:
# base_layer_path = base_layer.get_preview_or_path(self._weights_dir)
# self.logger.debug(
# "Copying base layer to use it later for density map to %s.", base_path
# )
# # Make a copy of a base layer to the fruits density map.
# shutil.copy(base_layer_path, base_path)

# pylint: disable=W0201
def _read_parameters(self) -> None:
"""Reads map parameters from OSM data, such as:
Expand Down Expand Up @@ -316,7 +305,10 @@ def _generate_weights(self, layer: Layer) -> None:
Arguments:
layer (Layer): Layer with textures and tags.
"""
size = (self.map_rotated_size, self.map_rotated_size)
if layer.tags is None:
size = (self.map_size, self.map_size)
else:
size = (self.map_rotated_size, self.map_rotated_size)
postfix = "_weight.png" if not layer.exclude_weight else ".png"
if layer.count == 0:
filepaths = [os.path.join(self._weights_dir, layer.name + postfix)]
Expand Down

0 comments on commit eaf8134

Please sign in to comment.