Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with 'serde' feature + fix warning + update various dependencies #5

Closed
wants to merge 12 commits into from
16 changes: 10 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,27 @@ render = []
serde = ["dep:serde"]

[dependencies]
bevy = { version = "0.15.0-rc.3", default-features = false, features = [
bevy = { version = "0.15", default-features = false, features = [
"bevy_core_pipeline",
"bevy_render",
"bevy_asset",
"bevy_sprite",
# See Bevy#16563
"png",
] }
log = "0.4"
serde = { version = "1", features = ["derive"], optional = true }

[dev-dependencies]
ldtk_rust = { version = "0.6" }
rand = "0.8"
env_logger = "0.10"
env_logger = "0.11"
serde_json = { version = "1.0" }
tiled = { version = "0.11.0", default-features = false }
thiserror = { version = "1.0" }
tiled = { version = "0.13", default-features = false }
thiserror = { version = "2.0" }

[dev-dependencies.bevy]
version = "0.15.0-rc.3"
version = "0.15"
default-features = false
features = [
"bevy_core_pipeline",
Expand All @@ -43,6 +45,7 @@ features = [
"png",
"ktx2",
"bevy_winit",
"bevy_window",
"bevy_text",
"bevy_sprite",
#"file_watcher",
Expand All @@ -51,7 +54,7 @@ features = [
]

[target.'cfg(unix)'.dev-dependencies.bevy]
version = "0.15.0-rc.3"
version = "0.15"
default-features = false
features = [
"bevy_core_pipeline",
Expand All @@ -60,6 +63,7 @@ features = [
"png",
"ktx2",
"bevy_winit",
"bevy_window",
"wayland",
"x11",
"bevy_text",
Expand Down
2 changes: 1 addition & 1 deletion examples/3d_iso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bevy_ecs_tilemap::prelude::*;
mod helpers;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let map_handle = helpers::tiled::TiledMapHandle(asset_server.load("iso_map.tmx"));

Expand Down
2 changes: 1 addition & 1 deletion examples/accessing_tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct CurrentColor(u16);
struct LastUpdate(f64);

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("tiles.png");

Expand Down
2 changes: 1 addition & 1 deletion examples/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn create_animated_flowers(mut commands: Commands, asset_server: Res<AssetServer
}

fn startup(mut commands: Commands) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);
}

fn main() {
Expand Down
40 changes: 17 additions & 23 deletions examples/basic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{prelude::*, render::sync_world::SyncToRenderWorld};
use bevy::prelude::*;
use bevy_ecs_tilemap::prelude::*;

mod helpers;
Expand All @@ -10,7 +10,7 @@ fn startup(
ArrayTextureLoader,
>,
) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("tiles.png");

Expand All @@ -35,14 +35,11 @@ fn startup(
for y in 0..map_size.y {
let tile_pos = TilePos { x, y };
let tile_entity = commands
.spawn((
TileBundle {
position: tile_pos,
tilemap_id: TilemapId(tilemap_entity),
..Default::default()
},
SyncToRenderWorld,
))
.spawn(TileBundle {
position: tile_pos,
tilemap_id: TilemapId(tilemap_entity),
..Default::default()
})
.id();
tile_storage.set(&tile_pos, tile_entity);
}
Expand All @@ -52,19 +49,16 @@ fn startup(
let grid_size = tile_size.into();
let map_type = TilemapType::default();

commands.entity(tilemap_entity).insert((
TilemapBundle {
grid_size,
map_type,
size: map_size,
storage: tile_storage,
texture: TilemapTexture::Single(texture_handle),
tile_size,
transform: get_tilemap_center_transform(&map_size, &grid_size, &map_type, 0.0),
..Default::default()
},
SyncToRenderWorld,
));
commands.entity(tilemap_entity).insert(TilemapBundle {
grid_size,
map_type,
size: map_size,
storage: tile_storage,
texture: TilemapTexture::Single(texture_handle),
tile_size,
transform: get_tilemap_center_transform(&map_size, &grid_size, &map_type, 0.0),
..Default::default()
});

// Add atlas to array texture loader so it's preprocessed before we need to use it.
// Only used when the atlas feature is off and we are using array textures.
Expand Down
2 changes: 1 addition & 1 deletion examples/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bevy_ecs_tilemap::prelude::*;
mod helpers;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("tiles.png");

Expand Down
2 changes: 1 addition & 1 deletion examples/chunking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn spawn_chunk(commands: &mut Commands, asset_server: &AssetServer, chunk_pos: I
}

fn startup(mut commands: Commands) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);
}

fn camera_pos_to_chunk_pos(camera_pos: &Vec2) -> IVec2 {
Expand Down
2 changes: 1 addition & 1 deletion examples/colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod helpers;
const QUADRANT_SIDE_LENGTH: u32 = 64;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("tiles.png");

Expand Down
2 changes: 1 addition & 1 deletion examples/custom_shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn startup(
asset_server: Res<AssetServer>,
mut materials: ResMut<Assets<MyMaterial>>,
) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let my_material_handle = MaterialTilemapHandle::from(materials.add(MyMaterial {
brightness: 0.5,
Expand Down
2 changes: 1 addition & 1 deletion examples/frustum_cull_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl FromWorld for FontHandle {

// Generates the initial tilemap, which is a square grid.
fn spawn_tilemap(mut commands: Commands, tile_handle_square: Res<TileHandleSquare>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let map_size = TilemapSize {
// Render chunks are of size 64, so let's create two render chunks
Expand Down
2 changes: 1 addition & 1 deletion examples/game_of_life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy_ecs_tilemap::prelude::*;
mod helpers;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("tiles.png");

Expand Down
2 changes: 1 addition & 1 deletion examples/hex_neighbors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl FromWorld for FontHandle {

// Generates the initial tilemap, which is a hex grid.
fn spawn_tilemap(mut commands: Commands, tile_handle_hex_row: Res<TileHandleHexRow>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let map_size = TilemapSize {
x: MAP_SIDE_LENGTH_X,
Expand Down
2 changes: 1 addition & 1 deletion examples/hex_neighbors_radius_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ fn hex_neighbors_radius_from_tile_pos(
}

fn spawn_chunks(mut commands: Commands, tile_handle_hex_row: Res<TileHandleHexRow>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let map_size = TilemapSize {
x: CHUNK_MAP_SIDE_LENGTH_X,
Expand Down
2 changes: 1 addition & 1 deletion examples/hexagon_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod helpers;
const QUADRANT_SIDE_LENGTH: u32 = 80;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("flat_hex_tiles.png");

Expand Down
2 changes: 1 addition & 1 deletion examples/hexagon_generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl FromWorld for FontHandle {

// Generates the initial tilemap, which is a square grid.
fn spawn_tilemap(mut commands: Commands, tile_handle_hex_row: Res<TileHandleHexRow>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let map_size = TilemapSize {
x: MAP_SIDE_LENGTH,
Expand Down
2 changes: 1 addition & 1 deletion examples/hexagon_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod helpers;
const QUADRANT_SIDE_LENGTH: u32 = 80;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("pointy_hex_tiles.png");

Expand Down
2 changes: 1 addition & 1 deletion examples/iso_diamond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod helpers;
const QUADRANT_SIDE_LENGTH: u32 = 80;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("iso_color.png");

Expand Down
2 changes: 1 addition & 1 deletion examples/iso_staggered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod helpers;
const QUADRANT_SIDE_LENGTH: u32 = 80;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("iso_color.png");

Expand Down
2 changes: 1 addition & 1 deletion examples/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bevy_ecs_tilemap::prelude::*;
mod helpers;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let texture_handle: Handle<Image> = asset_server.load("tiles.png");

Expand Down
2 changes: 1 addition & 1 deletion examples/ldtk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use bevy_ecs_tilemap::*;
mod helpers;

fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
commands.spawn(Camera2d);

let handle = helpers::ldtk::LdtkMapHandle(asset_server.load("map.ldtk"));

Expand Down
Loading