diff options
author | Vincent Petithory <vincent.petithory@gmail.com> | 2013-03-27 21:00:47 +0100 |
---|---|---|
committer | Vincent Petithory <vincent.petithory@gmail.com> | 2013-03-27 21:00:47 +0100 |
commit | 9578db80349045847d9f29093d7047fb88bb6780 (patch) | |
tree | 450f25e48d50586b4d2bd50cf12010fa01c4c21e /tools/minimap-render.py | |
parent | a8d8283a8c2189ad87761b7b1b3d827199987fef (diff) | |
download | clientdata-9578db80349045847d9f29093d7047fb88bb6780.tar.gz clientdata-9578db80349045847d9f29093d7047fb88bb6780.tar.bz2 clientdata-9578db80349045847d9f29093d7047fb88bb6780.tar.xz clientdata-9578db80349045847d9f29093d7047fb88bb6780.zip |
Minimap renderer: add special args:
* "all" to create minimaps of all existing maps
* "update" to update all existing minimaps
Diffstat (limited to 'tools/minimap-render.py')
-rwxr-xr-x | tools/minimap-render.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/minimap-render.py b/tools/minimap-render.py index 33917eed..c9cb4a16 100755 --- a/tools/minimap-render.py +++ b/tools/minimap-render.py @@ -129,12 +129,14 @@ def usage(): Example: $ ./minimap-render.py 007-1 will render the map at maps/007-1.tmx in the graphics/minimaps directory. + $ ./minimap-render.py all + will render all existing maps found in the maps directory. + $ ./minimap-render.py update + will update all existing minimaps found in the graphics/minimaps directory. For convenience, $ ./minimap-render.py 007-1.tmx - is also acceptable, for e.g running things like, - $ ./minimap-render.py $(ls ../maps/) - that would render all existing maps. + is also accepted. \n''' % sys.argv[0]) def main(): @@ -148,7 +150,14 @@ def main(): return 126 status = 0 - for map_name in sys.argv[1:]: + if sys.argv[1].lower() == 'all': + map_names = sorted([os.path.splitext(p)[0] for p in os.listdir(os.path.join(CLIENT_DATA_ROOT, u'maps'))]) + elif sys.argv[1].lower() == 'update': + map_names = sorted([os.path.splitext(p)[0] for p in os.listdir(os.path.join(CLIENT_DATA_ROOT, u'graphics', u'minimaps'))]) + else: + map_names = sys.argv[1:] + + for map_name in map_names: # Render tiles at 1 pixel size map_renderer = MinimapRenderer(map_name, 1, True) status += map_renderer.render() |