From aae7f6b6ea703ef891c5ae34e708a6b88cfd6a5a Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 23 Apr 2020 12:10:53 -0300 Subject: Make it easier to change when there are screens with width bigger than 1920 --- hercules/tmx_converter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hercules/tmx_converter.py b/hercules/tmx_converter.py index ed9d092..30e1a31 100755 --- a/hercules/tmx_converter.py +++ b/hercules/tmx_converter.py @@ -56,6 +56,7 @@ other_warp_fields = ( ) TILESIZE = 32 +WIDESCREEN=1920 SEPARATOR = '' MESSAGE = 'This file is generated automatically. All manually added changes will be removed when running the Converter.' CLIENT_MAPS = 'maps' @@ -280,9 +281,9 @@ class ContentHandler(xml.sax.ContentHandler): self.state = State.LAYER heigherror=False # Map width must be enough to fill the largest widescreen on market - if (self.width < 1920/TILESIZE): - print('Bad map width: %d (min. %d)' % (self.width, 1920/TILESIZE)) - raise Exception('Invalid map width: %d (min. %d)' % (self.width, 1920/TILESIZE)) + if (self.width < WIDESCREEN/TILESIZE): + print('Bad map width: %d (min. %d)' % (self.width, WIDESCREEN/TILESIZE)) + raise Exception('Invalid map width: %d (min. %d)' % (self.width, WIDESCREEN/TILESIZE)) elif self.state is State.LAYER: if name == u'data': if attr.get(u'encoding','') not in (u'', u'csv'): -- cgit v1.2.3-70-g09d2