Browse Source

Interiors: get tile sizes from map

Bastien Sevajol 7 years ago
parent
commit
e4d209f59c
1 changed files with 8 additions and 2 deletions
  1. 8 2
      opencombat/gui/base.py

+ 8 - 2
opencombat/gui/base.py View File

76
         self.interior_manager = InteriorManager(TileMap(
76
         self.interior_manager = InteriorManager(TileMap(
77
             layer_manager.middleware.get_map_file_path(),
77
             layer_manager.middleware.get_map_file_path(),
78
         ))
78
         ))
79
+        self.map_tile_width = self.layer_manager.middleware.get_cell_width()
80
+        self.map_tile_height = self.layer_manager.middleware.get_cell_height()
79
 
81
 
80
     def draw(self, *args, **kwargs):
82
     def draw(self, *args, **kwargs):
81
         super().draw(*args, **kwargs)
83
         super().draw(*args, **kwargs)
98
                     'background.png',
100
                     'background.png',
99
                 ))
101
                 ))
100
                 image_fake_file = io.BytesIO()
102
                 image_fake_file = io.BytesIO()
101
-                # FIXME: tile height/width !
102
-                self.interior_manager.update_image_for_interiors(image, interiors, 8, 8)
103
+                self.interior_manager.update_image_for_interiors(
104
+                    image,
105
+                    interiors,
106
+                    self.map_tile_width,
107
+                    self.map_tile_height,
108
+                )
103
                 image.save(image_fake_file, format='PNG')
109
                 image.save(image_fake_file, format='PNG')
104
                 self.background_sprite.image = pyglet.image.load(
110
                 self.background_sprite.image = pyglet.image.load(
105
                     'new_background.png',
111
                     'new_background.png',