Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
1b3836ed4c
|
42
Cargo.lock
generated
42
Cargo.lock
generated
@@ -276,7 +276,7 @@ dependencies = [
|
|||||||
"iroh",
|
"iroh",
|
||||||
"iroh-gossip",
|
"iroh-gossip",
|
||||||
"libmarathon",
|
"libmarathon",
|
||||||
"macros",
|
"libmarathon-macros",
|
||||||
"objc",
|
"objc",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
@@ -4535,7 +4535,7 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libmarathon"
|
name = "libmarathon"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-channel",
|
"async-channel",
|
||||||
@@ -4584,7 +4584,7 @@ dependencies = [
|
|||||||
"iroh",
|
"iroh",
|
||||||
"iroh-gossip",
|
"iroh-gossip",
|
||||||
"itertools 0.14.0",
|
"itertools 0.14.0",
|
||||||
"macros",
|
"libmarathon-macros",
|
||||||
"naga",
|
"naga",
|
||||||
"nonmax",
|
"nonmax",
|
||||||
"offset-allocator",
|
"offset-allocator",
|
||||||
@@ -4614,6 +4614,24 @@ dependencies = [
|
|||||||
"winit",
|
"winit",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libmarathon-macros"
|
||||||
|
version = "0.1.1"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"bevy",
|
||||||
|
"bevy_macro_utils",
|
||||||
|
"bytes",
|
||||||
|
"inventory",
|
||||||
|
"libmarathon",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"rkyv",
|
||||||
|
"serde",
|
||||||
|
"syn",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libredox"
|
name = "libredox"
|
||||||
version = "0.1.10"
|
version = "0.1.10"
|
||||||
@@ -4728,24 +4746,6 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "macros"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"bevy",
|
|
||||||
"bevy_macro_utils",
|
|
||||||
"bytes",
|
|
||||||
"inventory",
|
|
||||||
"libmarathon",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"rkyv",
|
|
||||||
"serde",
|
|
||||||
"syn",
|
|
||||||
"tracing",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mainline"
|
name = "mainline"
|
||||||
version = "6.0.1"
|
version = "6.0.1"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ headless = []
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libmarathon = { path = "../libmarathon" }
|
libmarathon = { path = "../libmarathon" }
|
||||||
macros = { path = "../macros" }
|
libmarathon-macros = { path = "../macros" }
|
||||||
inventory.workspace = true
|
inventory.workspace = true
|
||||||
rkyv.workspace = true
|
rkyv.workspace = true
|
||||||
bevy = { version = "0.17.2", default-features = false, features = [
|
bevy = { version = "0.17.2", default-features = false, features = [
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use uuid::Uuid;
|
|||||||
///
|
///
|
||||||
/// This component contains all the data needed for rendering a cube.
|
/// This component contains all the data needed for rendering a cube.
|
||||||
/// The `#[synced]` attribute automatically handles network synchronization.
|
/// The `#[synced]` attribute automatically handles network synchronization.
|
||||||
#[macros::synced]
|
#[libmarathon_macros::synced]
|
||||||
pub struct CubeMarker {
|
pub struct CubeMarker {
|
||||||
/// RGB color values (0.0 to 1.0)
|
/// RGB color values (0.0 to 1.0)
|
||||||
pub color_r: f32,
|
pub color_r: f32,
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "libmarathon"
|
name = "libmarathon"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
description = "A peer-to-peer game engine development kit with CRDT-based state synchronization"
|
||||||
|
license = "MIT"
|
||||||
|
repository = "https://github.com/r3t-studios/marathon"
|
||||||
|
homepage = "https://github.com/r3t-studios/marathon"
|
||||||
|
readme = "../../README.md"
|
||||||
|
keywords = ["gamedev", "p2p", "crdt", "multiplayer", "bevy"]
|
||||||
|
categories = ["game-engines", "network-programming"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
@@ -23,7 +30,7 @@ bevy_math = "0.17.2"
|
|||||||
bevy_mesh = "0.17.2"
|
bevy_mesh = "0.17.2"
|
||||||
bevy_platform = { version = "0.17.2", default-features = false }
|
bevy_platform = { version = "0.17.2", default-features = false }
|
||||||
bevy_reflect = "0.17.2"
|
bevy_reflect = "0.17.2"
|
||||||
macros = { path = "../macros" }
|
libmarathon-macros = { version = "0.1.1", path = "../macros" }
|
||||||
bevy_shader = "0.17.2"
|
bevy_shader = "0.17.2"
|
||||||
bevy_tasks = "0.17.2"
|
bevy_tasks = "0.17.2"
|
||||||
bevy_time = "0.17.2"
|
bevy_time = "0.17.2"
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ pub trait SyncComponent: Component + Reflect + Sized {
|
|||||||
///
|
///
|
||||||
/// ```no_compile
|
/// ```no_compile
|
||||||
/// // Define a synced component with the #[synced] attribute
|
/// // Define a synced component with the #[synced] attribute
|
||||||
/// #[macros::synced]
|
/// #[libmarathon_macros::synced]
|
||||||
/// pub struct CubeMarker {
|
/// pub struct CubeMarker {
|
||||||
/// pub color_r: f32,
|
/// pub color_r: f32,
|
||||||
/// pub size: f32,
|
/// pub size: f32,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use bevy_ecs::{
|
|||||||
};
|
};
|
||||||
use core::{marker::PhantomData, ops::Deref};
|
use core::{marker::PhantomData, ops::Deref};
|
||||||
|
|
||||||
pub use macros::ExtractComponent;
|
pub use libmarathon_macros::ExtractComponent;
|
||||||
|
|
||||||
/// Stores the index of a uniform inside of [`ComponentUniforms`].
|
/// Stores the index of a uniform inside of [`ComponentUniforms`].
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use core::marker::PhantomData;
|
|||||||
|
|
||||||
use bevy_app::{App, Plugin};
|
use bevy_app::{App, Plugin};
|
||||||
use bevy_ecs::prelude::*;
|
use bevy_ecs::prelude::*;
|
||||||
pub use macros::ExtractResource;
|
pub use libmarathon_macros::ExtractResource;
|
||||||
use bevy_utils::once;
|
use bevy_utils::once;
|
||||||
|
|
||||||
use crate::render::{Extract, ExtractSchedule, RenderApp};
|
use crate::render::{Extract, ExtractSchedule, RenderApp};
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ use bevy_ecs::{
|
|||||||
use bevy_image::{Image, TextureFormatPixelInfo};
|
use bevy_image::{Image, TextureFormatPixelInfo};
|
||||||
use bevy_platform::collections::HashMap;
|
use bevy_platform::collections::HashMap;
|
||||||
use bevy_reflect::Reflect;
|
use bevy_reflect::Reflect;
|
||||||
use macros::ExtractComponent;
|
use libmarathon_macros::ExtractComponent;
|
||||||
use encase::internal::ReadFrom;
|
use encase::internal::ReadFrom;
|
||||||
use encase::private::Reader;
|
use encase::private::Reader;
|
||||||
use encase::ShaderType;
|
use encase::ShaderType;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
pub use crate::define_atomic_id;
|
pub use crate::define_atomic_id;
|
||||||
|
|
||||||
// Re-export derive macros from macros
|
// Re-export derive macros from macros
|
||||||
pub use macros::{AsBindGroup, RenderLabel, RenderSubGraph};
|
pub use libmarathon_macros::{AsBindGroup, RenderLabel, RenderSubGraph};
|
||||||
|
|
||||||
#[cfg(target_pointer_width = "16")]
|
#[cfg(target_pointer_width = "16")]
|
||||||
compile_error!("bevy_render cannot compile for a 16-bit platform.");
|
compile_error!("bevy_render cannot compile for a 16-bit platform.");
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use core::fmt::Debug;
|
|||||||
|
|
||||||
use super::{EdgeExistence, InternedRenderLabel, IntoRenderNodeArray};
|
use super::{EdgeExistence, InternedRenderLabel, IntoRenderNodeArray};
|
||||||
|
|
||||||
pub use macros::RenderSubGraph;
|
pub use libmarathon_macros::RenderSubGraph;
|
||||||
|
|
||||||
define_label!(
|
define_label!(
|
||||||
#[diagnostic::on_unimplemented(
|
#[diagnostic::on_unimplemented(
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use downcast_rs::{impl_downcast, Downcast};
|
|||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use variadics_please::all_tuples_with_size;
|
use variadics_please::all_tuples_with_size;
|
||||||
|
|
||||||
pub use macros::RenderLabel;
|
pub use libmarathon_macros::RenderLabel;
|
||||||
|
|
||||||
use super::{InternedRenderSubGraph, RenderSubGraph};
|
use super::{InternedRenderSubGraph, RenderSubGraph};
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ use bevy_ecs::{
|
|||||||
system::{lifetimeless::SRes, SystemParamItem},
|
system::{lifetimeless::SRes, SystemParamItem},
|
||||||
};
|
};
|
||||||
use crate::render::renderer::RenderAdapterInfo;
|
use crate::render::renderer::RenderAdapterInfo;
|
||||||
pub use macros::ShaderLabel;
|
pub use libmarathon_macros::ShaderLabel;
|
||||||
use core::{fmt::Debug, hash::Hash, iter, marker::PhantomData, ops::Range, slice::SliceIndex};
|
use core::{fmt::Debug, hash::Hash, iter, marker::PhantomData, ops::Range, slice::SliceIndex};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use tracing::warn;
|
use tracing::warn;
|
||||||
@@ -85,7 +85,7 @@ define_label!(
|
|||||||
/// A shorthand for `Interned<dyn RenderSubGraph>`.
|
/// A shorthand for `Interned<dyn RenderSubGraph>`.
|
||||||
pub type InternedShaderLabel = Interned<dyn ShaderLabel>;
|
pub type InternedShaderLabel = Interned<dyn ShaderLabel>;
|
||||||
|
|
||||||
pub use macros::DrawFunctionLabel;
|
pub use libmarathon_macros::DrawFunctionLabel;
|
||||||
|
|
||||||
define_label!(
|
define_label!(
|
||||||
#[diagnostic::on_unimplemented(
|
#[diagnostic::on_unimplemented(
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use crate::render::{
|
|||||||
};
|
};
|
||||||
use bevy_derive::{Deref, DerefMut};
|
use bevy_derive::{Deref, DerefMut};
|
||||||
use bevy_ecs::system::{SystemParam, SystemParamItem};
|
use bevy_ecs::system::{SystemParam, SystemParamItem};
|
||||||
pub use macros::AsBindGroup;
|
pub use libmarathon_macros::AsBindGroup;
|
||||||
use core::ops::Deref;
|
use core::ops::Deref;
|
||||||
use encase::ShaderType;
|
use encase::ShaderType;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use core::{hash::Hash, marker::PhantomData};
|
|||||||
use tracing::error;
|
use tracing::error;
|
||||||
use variadics_please::all_tuples;
|
use variadics_please::all_tuples;
|
||||||
|
|
||||||
pub use macros::{Specializer, SpecializerKey};
|
pub use libmarathon_macros::{Specializer, SpecializerKey};
|
||||||
|
|
||||||
/// Defines a type that is able to be "specialized" and cached by creating and transforming
|
/// Defines a type that is able to be "specialized" and cached by creating and transforming
|
||||||
/// its descriptor type. This is implemented for [`RenderPipeline`] and [`ComputePipeline`], and
|
/// its descriptor type. This is implemented for [`RenderPipeline`] and [`ComputePipeline`], and
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use bevy_ecs::{prelude::Component, resource::Resource};
|
|||||||
use bevy_image::BevyDefault;
|
use bevy_image::BevyDefault;
|
||||||
use bevy_math::UVec2;
|
use bevy_math::UVec2;
|
||||||
use bevy_platform::collections::HashMap;
|
use bevy_platform::collections::HashMap;
|
||||||
use macros::ExtractResource;
|
use libmarathon_macros::ExtractResource;
|
||||||
use wgpu::TextureFormat;
|
use wgpu::TextureFormat;
|
||||||
|
|
||||||
use crate::render::render_resource::TextureView;
|
use crate::render::render_resource::TextureView;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ use bevy_image::{BevyDefault as _, ToExtents};
|
|||||||
use bevy_math::{mat3, vec2, vec3, Mat3, Mat4, UVec4, Vec2, Vec3, Vec4, Vec4Swizzles};
|
use bevy_math::{mat3, vec2, vec3, Mat3, Mat4, UVec4, Vec2, Vec3, Vec4, Vec4Swizzles};
|
||||||
use bevy_platform::collections::{hash_map::Entry, HashMap};
|
use bevy_platform::collections::{hash_map::Entry, HashMap};
|
||||||
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
|
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
|
||||||
use macros::ExtractComponent;
|
use libmarathon_macros::ExtractComponent;
|
||||||
use bevy_shader::load_shader_library;
|
use bevy_shader::load_shader_library;
|
||||||
use bevy_transform::components::GlobalTransform;
|
use bevy_transform::components::GlobalTransform;
|
||||||
use core::{
|
use core::{
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use serde::{
|
|||||||
Serialize,
|
Serialize,
|
||||||
};
|
};
|
||||||
// TODO: Re-export the Synced derive macro (not part of bevy_render_macros)
|
// TODO: Re-export the Synced derive macro (not part of bevy_render_macros)
|
||||||
// pub use macros::Synced;
|
// pub use libmarathon_macros::Synced;
|
||||||
|
|
||||||
pub type NodeId = uuid::Uuid;
|
pub type NodeId = uuid::Uuid;
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ use uuid::Uuid;
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
/// Simple position component for testing sync
|
/// Simple position component for testing sync
|
||||||
#[macros::synced]
|
#[libmarathon_macros::synced]
|
||||||
#[derive(Reflect, PartialEq)]
|
#[derive(Reflect, PartialEq)]
|
||||||
#[reflect(Component)]
|
#[reflect(Component)]
|
||||||
struct TestPosition {
|
struct TestPosition {
|
||||||
@@ -79,7 +79,7 @@ struct TestPosition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Simple health component for testing sync
|
/// Simple health component for testing sync
|
||||||
#[macros::synced]
|
#[libmarathon_macros::synced]
|
||||||
#[derive(Reflect, PartialEq)]
|
#[derive(Reflect, PartialEq)]
|
||||||
#[reflect(Component)]
|
#[reflect(Component)]
|
||||||
struct TestHealth {
|
struct TestHealth {
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "macros"
|
name = "libmarathon-macros"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
description = "Procedural macros for the Marathon game engine"
|
||||||
|
license = "MIT"
|
||||||
|
repository = "https://github.com/r3t-studios/marathon"
|
||||||
|
homepage = "https://github.com/r3t-studios/marathon"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ pub fn derive_draw_function_label(input: TokenStream) -> TokenStream {
|
|||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```no_compile
|
/// ```no_compile
|
||||||
/// use macros::synced;
|
/// use libmarathon_macros::synced;
|
||||||
///
|
///
|
||||||
/// #[synced]
|
/// #[synced]
|
||||||
/// pub struct CubeMarker {
|
/// pub struct CubeMarker {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
// Test 1: Basic struct with synced attribute compiles
|
// Test 1: Basic struct with synced attribute compiles
|
||||||
#[macros::synced]
|
#[libmarathon_macros::synced]
|
||||||
struct Health {
|
struct Health {
|
||||||
current: f32,
|
current: f32,
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ fn test_health_is_clone_and_copy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test 2: Struct with multiple fields
|
// Test 2: Struct with multiple fields
|
||||||
#[macros::synced]
|
#[libmarathon_macros::synced]
|
||||||
struct Position {
|
struct Position {
|
||||||
x: f32,
|
x: f32,
|
||||||
y: f32,
|
y: f32,
|
||||||
|
|||||||
Reference in New Issue
Block a user