Skip to content
Snippets Groups Projects
Verified Commit aef9b5c6 authored by Louis's avatar Louis :fire:
Browse files

Update required bevy version to 0.11

parent b6c667ee
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
[package]
name = "micro_ldtk"
version = "0.5.0"
version = "0.6.0"
edition = "2021"
authors = [
......@@ -28,7 +28,7 @@ autotile = ["micro_autotile"]
no_panic = []
[dependencies]
bevy = "0.10"
bevy = "0.11"
anyhow = "1.0"
thiserror = "1.0"
log = "0.4"
......
......@@ -16,7 +16,7 @@ mod data_1_2_5;
mod data_1_3_0;
use bevy::asset::{AssetLoader, BoxedFuture, LoadContext, LoadedAsset};
use bevy::reflect::{TypeUuid, Uuid};
use bevy::reflect::{TypePath, TypeUuid, Uuid};
#[cfg(feature = "ldtk_1_0_0")]
pub use data_1_0_0::*;
#[cfg(any(feature = "ldtk_1_1_1", feature = "ldtk_1_1_0"))]
......@@ -43,6 +43,15 @@ pub enum ParseError {
impl TypeUuid for Project {
const TYPE_UUID: Uuid = Uuid::from_u128(87988914102923589138720617793417023455);
}
impl TypePath for Project {
fn type_path() -> &'static str {
"micro_ldtk::ldtk::Project"
}
fn short_type_path() -> &'static str {
"Project"
}
}
impl Project {
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ParseError> {
......@@ -50,7 +59,7 @@ impl Project {
}
pub fn get_all_levels(&self) -> Vec<&Level> {
if self.worlds.len() > 0 {
if !self.worlds.is_empty() {
self.worlds
.iter()
.flat_map(|world| world.levels.iter())
......
......@@ -78,7 +78,7 @@ mod __plugin {
.add_asset_loader(super::ldtk::LdtkLoader)
.init_resource::<super::assets::TilesetIndex>()
.init_resource::<super::assets::LevelIndex>()
.add_system(super::assets::handle_ldtk_project_events);
.add_systems(Update, super::assets::handle_ldtk_project_events);
}
}
}
......@@ -105,9 +105,9 @@ mod __plugin {
for MicroLDTKCameraPlugin<CameraFilter>
{
fn build(&self, app: &mut App) {
app.add_system(
super::camera::lock_camera_to_level::<CameraFilter>
.in_base_set(CoreSet::PostUpdate),
app.add_systems(
PostUpdate,
super::camera::lock_camera_to_level::<CameraFilter>,
);
}
}
......
use std::fmt::Debug;
use std::marker::PhantomData;
use std::str::FromStr;
use bevy::ecs::system::SystemParam;
......
......@@ -8,7 +8,7 @@ use crate::{
pub fn write_layer_to_texture(
layer: &LdtkLayer,
buffer: &mut Vec<u8>,
buffer: &mut [u8],
format: &TextureFormat,
image: &Image,
atlas: &TextureAtlas,
......@@ -62,7 +62,7 @@ pub fn write_layer_to_texture(
pub fn write_map_to_texture(
level: &LdtkLevel,
buffer: &mut Vec<u8>,
buffer: &mut [u8],
format: &TextureFormat,
image: &Image,
atlas: &TextureAtlas,
......@@ -75,7 +75,7 @@ pub fn write_map_to_texture(
pub trait Rasterise {
fn write_to_texture(
&self,
buffer: &mut Vec<u8>,
buffer: &mut [u8],
format: &TextureFormat,
images: &impl SuppliesImage,
atlas: &impl SuppliesTextureAtlas,
......@@ -85,7 +85,7 @@ pub trait Rasterise {
impl Rasterise for LdtkLevel {
fn write_to_texture(
&self,
buffer: &mut Vec<u8>,
buffer: &mut [u8],
format: &TextureFormat,
images: &impl SuppliesImage,
atlas: &impl SuppliesTextureAtlas,
......@@ -98,7 +98,7 @@ impl Rasterise for LdtkLevel {
impl Rasterise for LdtkLayer {
fn write_to_texture(
&self,
buffer: &mut Vec<u8>,
buffer: &mut [u8],
format: &TextureFormat,
images: &impl SuppliesImage,
atlas: &impl SuppliesTextureAtlas,
......
......@@ -4,6 +4,7 @@ use std::ops::{Deref, DerefMut};
use std::path::Path;
use bevy::math::{IVec2, Rect, UVec2, Vec2};
use bevy::prelude::Event;
use num_traits::AsPrimitive;
use quadtree_rs::area::AreaBuilder;
use quadtree_rs::point::Point;
......@@ -15,7 +16,7 @@ use crate::ldtk::{EntityInstance, FieldInstance, LayerInstance, Level, TileInsta
use crate::system::Indexer;
use crate::{get_ldtk_tile_scale, px_to_grid, MapQuery};
#[derive(Default, Clone, Debug, Ord, PartialOrd, PartialEq, Eq)]
#[derive(Default, Clone, Debug, Ord, PartialOrd, PartialEq, Eq, Event)]
pub struct LevelDataUpdated(pub String);
pub struct TileRef<'a> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment