Skip to content

Commit

Permalink
fix: Configuration useAtlas was not been propagated correctly everywh…
Browse files Browse the repository at this point in the history
…ere (#2853)

The useAtlas configuration was not being propagated correctly in all of the places. This PR fixes that.
  • Loading branch information
erickzanardo authored Nov 15, 2023
1 parent f733443 commit 2f0dab9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/flame_tiled/lib/src/tile_atlas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ class TiledAtlas {
/// Image key for this atlas.
final String key;

/// If SpriteBatch should use atlas or not.
final bool useAtlas;

/// Track one atlas for all images in the Tiled map.
///
/// See [fromTiledMap] for asynchronous loading.
TiledAtlas._({
required this.atlas,
required this.offsets,
required this.key,
bool useAtlas = true,
this.useAtlas = true,
}) : batch = atlas == null
? null
: SpriteBatch(
Expand All @@ -53,6 +56,7 @@ class TiledAtlas {
atlas: atlas?.clone(),
offsets: offsets,
key: key,
useAtlas: useAtlas,
);

/// Maps of tilesets compiled to [TiledAtlas].
Expand Down Expand Up @@ -167,6 +171,7 @@ class TiledAtlas {
atlas: image,
offsets: {key: Offset.zero},
key: key,
useAtlas: useAtlas,
);
}

Expand Down Expand Up @@ -223,6 +228,7 @@ class TiledAtlas {
atlas: image,
offsets: offsetMap,
key: key,
useAtlas: useAtlas,
);
}

Expand Down

0 comments on commit 2f0dab9

Please sign in to comment.