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

Update bevy-track branch to newer bevy commit #330

Merged
merged 1 commit into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ atlas = []
render = []

[dependencies]
bevy = { git = "https://github.com/bevyengine/bevy", rev = "9423cb6a8d0c140e11364eb23c8feb7e576baa8c", default-features = false, features = [
bevy = { git = "https://github.com/bevyengine/bevy", rev = "4bcf49b2ea6fb5f42388b0e15d204020053ee5c7", default-features = false, features = [
"bevy_core_pipeline",
"bevy_render",
"bevy_asset",
Expand All @@ -34,7 +34,7 @@ tiled = { version = "0.9", default-features = false }

[dev-dependencies.bevy]
git = "https://github.com/bevyengine/bevy"
rev = "9423cb6a8d0c140e11364eb23c8feb7e576baa8c"
rev = "4bcf49b2ea6fb5f42388b0e15d204020053ee5c7"
default-features = false
features = [
"bevy_core_pipeline",
Expand All @@ -50,7 +50,7 @@ features = [

[target.'cfg(unix)'.dev-dependencies.bevy]
git = "https://github.com/bevyengine/bevy"
rev = "9423cb6a8d0c140e11364eb23c8feb7e576baa8c"
rev = "4bcf49b2ea6fb5f42388b0e15d204020053ee5c7"
default-features = false
features = [
"bevy_core_pipeline",
Expand Down
25 changes: 15 additions & 10 deletions examples/accessing_tiles.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{prelude::*, render::texture::ImageSettings};
use bevy::prelude::*;
use bevy_ecs_tilemap::prelude::*;

mod helpers;
Expand Down Expand Up @@ -107,7 +107,7 @@ fn update_map(
)>,
mut tile_query: Query<&mut TileTexture>,
) {
let current_time = time.seconds_since_startup();
let current_time = time.elapsed_seconds_f64();
for (mut current_color, mut last_update, tile_storage, tilemap_type) in tilemap_query.iter_mut()
{
if current_time - last_update.0 > 0.1 {
Expand Down Expand Up @@ -144,14 +144,19 @@ fn update_map(

fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Basic Example"),
..Default::default()
})
.insert_resource(ImageSettings::default_nearest())
.add_plugins(DefaultPlugins)
.add_plugins(
DefaultPlugins
.set(WindowPlugin {
window: WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Accessing Tiles Example"),
..Default::default()
},
..default()
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
Expand Down
22 changes: 13 additions & 9 deletions examples/animation.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
prelude::*,
render::texture::ImageSettings,
};
use bevy_ecs_tilemap::prelude::*;
use bevy_ecs_tilemap::tiles::{AnimatedTile, TileBundle, TilePos, TileStorage, TileTexture};
Expand Down Expand Up @@ -123,14 +122,19 @@ fn startup(mut commands: Commands) {

fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Animated Map Example"),
..Default::default()
})
.insert_resource(ImageSettings::default_nearest())
.add_plugins(DefaultPlugins)
.add_plugins(
DefaultPlugins
.set(WindowPlugin {
window: WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Animated Map Example"),
..Default::default()
},
..default()
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(LogDiagnosticsPlugin::default())
.add_plugin(FrameTimeDiagnosticsPlugin::default())
.add_plugin(TilemapPlugin)
Expand Down
23 changes: 12 additions & 11 deletions examples/basic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{prelude::*, render::texture::ImageSettings};
use bevy::prelude::*;
use bevy_ecs_tilemap::prelude::*;

mod helpers;
Expand Down Expand Up @@ -97,16 +97,17 @@ fn swap_texture_or_hide(

fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from(
"Basic Example - Press Space to change Texture and H to show/hide tilemap.",
),
..Default::default()
})
.insert_resource(ImageSettings::default_nearest())
.add_plugins(DefaultPlugins)
.add_plugins(DefaultPlugins.set(WindowPlugin{
window: WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from(
"Basic Example - Press Space to change Texture and H to show/hide tilemap.",
),
..Default::default()
},
..default()
}).set(ImagePlugin::default_nearest()))
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
Expand Down
22 changes: 13 additions & 9 deletions examples/bench.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
prelude::*,
render::texture::ImageSettings,
};
use bevy_ecs_tilemap::prelude::*;

Expand Down Expand Up @@ -40,14 +39,19 @@ fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {

fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Benchmark Example"),
..Default::default()
})
.insert_resource(ImageSettings::default_nearest())
.add_plugins(DefaultPlugins)
.add_plugins(
DefaultPlugins
.set(WindowPlugin {
window: WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Benchmark Example"),
..Default::default()
},
..default()
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(LogDiagnosticsPlugin::default())
.add_plugin(FrameTimeDiagnosticsPlugin::default())
.add_plugin(TilemapPlugin)
Expand Down
23 changes: 14 additions & 9 deletions examples/chunking.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{math::Vec3Swizzles, prelude::*, render::texture::ImageSettings, utils::HashSet};
use bevy::{math::Vec3Swizzles, prelude::*, utils::HashSet};
use bevy_ecs_tilemap::prelude::*;
mod helpers;

Expand Down Expand Up @@ -106,14 +106,19 @@ struct ChunkManager {

fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Basic Chunking Example"),
..Default::default()
})
.insert_resource(ImageSettings::default_nearest())
.add_plugins(DefaultPlugins)
.add_plugins(
DefaultPlugins
.set(WindowPlugin {
window: WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Basic Chunking Example"),
..Default::default()
},
..default()
})
.set(ImagePlugin::default_nearest()),
)
// `TilemapRenderSettings` be added before the `TilemapPlugin`.
.insert_resource(TilemapRenderSettings {
render_chunk_size: RENDER_CHUNK_SIZE,
Expand Down
23 changes: 14 additions & 9 deletions examples/colors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{prelude::*, render::texture::ImageSettings};
use bevy::prelude::*;
use bevy_ecs_tilemap::prelude::*;

mod helpers;
Expand Down Expand Up @@ -92,14 +92,19 @@ fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {

fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Color Example"),
..Default::default()
})
.insert_resource(ImageSettings::default_nearest())
.add_plugins(DefaultPlugins)
.add_plugins(
DefaultPlugins
.set(WindowPlugin {
window: WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Color Example"),
..Default::default()
},
..default()
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
Expand Down
39 changes: 22 additions & 17 deletions examples/frustum_cull_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bevy::log::{Level, LogSettings};
use bevy::{ecs::system::Resource, prelude::*, render::texture::ImageSettings};
use bevy::log::{Level, LogPlugin};
use bevy::{ecs::system::Resource, prelude::*};
use bevy_ecs_tilemap::prelude::*;
use bevy_ecs_tilemap::FrustumCulling;
mod helpers;
Expand Down Expand Up @@ -246,21 +246,26 @@ fn swap_map_type(

fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Frustum cull test"),
..Default::default()
})
// For this example, we want to turn up logging to show trace level events for bevy_ecs_tilemap
.insert_resource(LogSettings {
// Everything else should be set to Level::ERROR
level: Level::ERROR,
// except for bevy_ecs_tilemap
filter: "bevy_ecs_tilemap=trace".into(),
})
.insert_resource(ImageSettings::default_nearest())
.add_plugins(DefaultPlugins)
.add_plugins(
DefaultPlugins
.set(WindowPlugin {
window: WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Frustum cull test"),
..Default::default()
},
..default()
})
.set(ImagePlugin::default_nearest())
// For this example, we want to turn up logging to show trace level events for bevy_ecs_tilemap
.set(LogPlugin {
// Everything else should be set to Level::ERROR
level: Level::ERROR,
// except for bevy_ecs_tilemap
filter: "bevy_ecs_tilemap=trace".into(),
}),
)
.add_plugin(TilemapPlugin)
.add_startup_system_to_stage(StartupStage::PreStartup, spawn_assets)
.add_startup_system_to_stage(StartupStage::Startup, spawn_tilemap)
Expand Down
25 changes: 15 additions & 10 deletions examples/game_of_life.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{prelude::*, render::texture::ImageSettings};
use bevy::prelude::*;
use bevy_ecs_tilemap::prelude::*;

mod helpers;
Expand Down Expand Up @@ -58,7 +58,7 @@ fn update(
mut tile_storage_query: Query<(&TileStorage, &TilemapType, &mut LastUpdate)>,
tile_query: Query<(Entity, &TilePos, &TileVisible)>,
) {
let current_time = time.seconds_since_startup();
let current_time = time.elapsed_seconds_f64();
let (tile_storage, tilemap_type, mut last_update) = tile_storage_query.single_mut();
if current_time - last_update.0 > 0.1 {
for (entity, position, visibility) in tile_query.iter() {
Expand Down Expand Up @@ -93,14 +93,19 @@ fn update(

fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Game of Life Example"),
..Default::default()
})
.insert_resource(ImageSettings::default_nearest())
.add_plugins(DefaultPlugins)
.add_plugins(
DefaultPlugins
.set(WindowPlugin {
window: WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Game of Life Example"),
..Default::default()
},
..default()
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
Expand Down
23 changes: 14 additions & 9 deletions examples/hexagon_column.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{prelude::*, render::texture::ImageSettings};
use bevy::prelude::*;
use bevy_ecs_tilemap::prelude::*;

mod helpers;
Expand Down Expand Up @@ -105,14 +105,19 @@ fn swap_mesh_type(mut query: Query<&mut TilemapType>, keyboard_input: Res<Input<

fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Hexagon Column Example"),
..Default::default()
})
.insert_resource(ImageSettings::default_nearest())
.add_plugins(DefaultPlugins)
.add_plugins(
DefaultPlugins
.set(WindowPlugin {
window: WindowDescriptor {
width: 1270.0,
height: 720.0,
title: String::from("Hexagon Column Example"),
..Default::default()
},
..default()
})
.set(ImagePlugin::default_nearest()),
)
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
Expand Down
Loading