diff options
author | Juan J. Martinez <jjm@usebox.net> | 2021-01-02 21:09:42 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2021-01-02 21:09:42 +0000 |
commit | 86a391103d9b262bdd881ce32af9f13e7c2d8e25 (patch) | |
tree | fa8c72e9807d562a0323b585a6aa856c82ec291a /tools | |
parent | e2462f8cd44c0bd786c9df5d0d922517be966405 (diff) | |
download | ubox-msx-lib-86a391103d9b262bdd881ce32af9f13e7c2d8e25.tar.gz ubox-msx-lib-86a391103d9b262bdd881ce32af9f13e7c2d8e25.zip |
Flicker friendly sorting of entities
It may not make a big difference if entities can move vertically freely,
but in some cases may be better.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/map.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/map.py b/tools/map.py index 5c6e27e..c2e2212 100755 --- a/tools/map.py +++ b/tools/map.py @@ -200,8 +200,10 @@ def main(): parser.error("max_bytes: no 'bytes' found for %r" % name) try: - objs = sorted( - entities_layer["objects"], key=lambda o: et_names.index(o["name"].lower())) + objs = entities_layer["objects"] + objs.sort(key=lambda o: o["y"]) + objs.sort(key=lambda o: o["x"]) + objs.sort(key=lambda o: et_names.index(o["name"].lower())) except ValueError: parser.error("map has an unnamed object") |