Skip to content

Commit e3e02b6

Browse files
authored
Remove deprecated function read_tmx (#2528)
1 parent b28844e commit e3e02b6

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

arcade/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ def configure_logging(level: int | None = None):
196196
from .physics_engines import PhysicsEngineSimple
197197

198198
from .tilemap import load_tilemap
199-
from .tilemap import read_tmx
200199
from .tilemap import TileMap
201200

202201
from .pymunk_physics_engine import PymunkPhysicsEngine
@@ -372,7 +371,6 @@ def configure_logging(level: int | None = None):
372371
"open_window",
373372
"print_timings",
374373
"play_sound",
375-
"read_tmx",
376374
"load_tilemap",
377375
"run",
378376
"schedule",

arcade/tilemap/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from __future__ import annotations
22

3-
from .tilemap import TileMap, load_tilemap, read_tmx
3+
from .tilemap import TileMap, load_tilemap
44

5-
__all__ = ["TileMap", "load_tilemap", "read_tmx"]
5+
__all__ = ["TileMap", "load_tilemap"]

arcade/tilemap/tilemap.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
_FLIPPED_VERTICALLY_FLAG = 0x40000000
4949
_FLIPPED_DIAGONALLY_FLAG = 0x20000000
5050

51-
__all__ = ["TileMap", "load_tilemap", "read_tmx"]
51+
__all__ = ["TileMap", "load_tilemap"]
5252

5353
prop_to_float = cast(Callable[[pytiled_parser.Property], float], float)
5454

@@ -237,7 +237,7 @@ def __init__(
237237
) -> None:
238238
if not map_file and not tiled_map:
239239
raise AttributeError(
240-
"Initialized TileMap with an empty map_file or no map_object argument"
240+
"Initialized TileMap with an empty map_file or no tiled_map argument"
241241
)
242242

243243
if tiled_map:
@@ -430,7 +430,7 @@ def _get_tile_by_gid(self, tile_gid: int) -> pytiled_parser.Tile | None:
430430
if existing_ref:
431431
tile_ref = existing_ref
432432
else:
433-
tile_ref = pytiled_parser.Tile(id=(tile_id), image=tileset.image)
433+
tile_ref = pytiled_parser.Tile(id=tile_id, image=tileset.image)
434434
elif tileset.tiles is None and tileset.image is not None:
435435
# Not in this tileset, move to the next
436436
continue
@@ -1075,12 +1075,3 @@ def load_tilemap(
10751075
texture_atlas=texture_atlas,
10761076
lazy=lazy,
10771077
)
1078-
1079-
1080-
def read_tmx(map_file: str | Path) -> pytiled_parser.TiledMap:
1081-
"""
1082-
Deprecated function to raise a warning that it has been removed.
1083-
1084-
Exists to provide info for outdated code bases.
1085-
"""
1086-
raise DeprecationWarning("The read_tmx function has been replaced by the new TileMap class.")

0 commit comments

Comments
 (0)