aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martínez <jjm@usebox.net>2022-12-24 14:17:13 +0000
committerJuan J. Martínez <jjm@usebox.net>2022-12-24 14:17:13 +0000
commit0c8cdcf03b2708ce2bf33589db32f426048ed378 (patch)
tree0e7e89d44fb100152e1da5041eca5329077f49d1
parent4cd89b82ffbf3c1b83fb2a2221fc33f04f98118a (diff)
parent228007129f9fda791b7c7cf56ebb34a2487e6275 (diff)
downloadubox-msx-lib-0c8cdcf03b2708ce2bf33589db32f426048ed378.tar.gz
ubox-msx-lib-0c8cdcf03b2708ce2bf33589db32f426048ed378.zip
Merge branch 'main' into 'main'
map.py may ignore missing map_conf.json See merge request reidrac/ubox-msx-lib!37
-rw-r--r--docs/tools.md5
-rwxr-xr-xtools/map.py5
2 files changed, 5 insertions, 5 deletions
diff --git a/docs/tools.md b/docs/tools.md
index caf67c4..a0d1237 100644
--- a/docs/tools.md
+++ b/docs/tools.md
@@ -105,8 +105,9 @@ Please check `map.json` of the example game for a reference.
#### Configuration
-The map importer requires a configuration file in JSON format that provides
-information about the valid entities in the map.
+The map importer may require a configuration file in JSON format that provides
+information about the valid entities in the map, but only if the Entities layer
+is used.
For each entity it expects:
diff --git a/tools/map.py b/tools/map.py
index 0ce19fb..9fce018 100755
--- a/tools/map.py
+++ b/tools/map.py
@@ -145,9 +145,6 @@ def main():
args = parser.parse_args()
- with open(args.conf, "rt") as fd:
- conf = json.load(fd)
-
with open(args.map_json, "rt") as fd:
data = json.load(fd)
@@ -226,6 +223,8 @@ def main():
file=sys.stderr,
)
if len(entities_layer) and entities_layer["visible"]:
+ with open(args.conf, "rt") as fd:
+ conf = json.load(fd)
et_names = [d["name"] for d in conf["entities"]]
et_weigths = dict((d["name"], d["w"]) for d in conf["entities"])
et_bytes = dict((d["name"], d["bytes"]) for d in conf["entities"])