WIP
This commit is contained in:
parent
2b6d041cb6
commit
dc40ac854a
2 changed files with 10 additions and 13 deletions
|
@ -48,6 +48,8 @@ fn generate_shader_bindings() -> PathBuf {
|
||||||
"Quad".into(),
|
"Quad".into(),
|
||||||
"QuadInputIndex".into(),
|
"QuadInputIndex".into(),
|
||||||
"QuadUniforms".into(),
|
"QuadUniforms".into(),
|
||||||
|
"AtlasTile".into(),
|
||||||
|
"MonochromeSprite".into(),
|
||||||
]);
|
]);
|
||||||
config.no_includes = true;
|
config.no_includes = true;
|
||||||
config.enumeration.prefix_with_name = true;
|
config.enumeration.prefix_with_name = true;
|
||||||
|
@ -55,6 +57,7 @@ fn generate_shader_bindings() -> PathBuf {
|
||||||
.with_src(crate_dir.join("src/scene.rs"))
|
.with_src(crate_dir.join("src/scene.rs"))
|
||||||
.with_src(crate_dir.join("src/geometry.rs"))
|
.with_src(crate_dir.join("src/geometry.rs"))
|
||||||
.with_src(crate_dir.join("src/color.rs"))
|
.with_src(crate_dir.join("src/color.rs"))
|
||||||
|
.with_src(crate_dir.join("src/platform.rs"))
|
||||||
.with_src(crate_dir.join("src/platform/mac/metal_renderer.rs"))
|
.with_src(crate_dir.join("src/platform/mac/metal_renderer.rs"))
|
||||||
.with_config(config)
|
.with_config(config)
|
||||||
.generate()
|
.generate()
|
||||||
|
|
|
@ -196,29 +196,23 @@ pub struct AtlasTile {
|
||||||
pub(crate) bounds_in_atlas: Bounds<DevicePixels>,
|
pub(crate) bounds_in_atlas: Bounds<DevicePixels>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Zeroable, Pod)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub(crate) struct AtlasTextureId(pub(crate) usize);
|
pub(crate) struct AtlasTextureId(pub(crate) usize);
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Zeroable, Pod)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub(crate) struct TileId(pub(crate) etagere::AllocId);
|
pub(crate) struct TileId(pub(crate) u32);
|
||||||
|
|
||||||
impl From<etagere::AllocId> for TileId {
|
impl From<etagere::AllocId> for TileId {
|
||||||
fn from(id: etagere::AllocId) -> Self {
|
fn from(id: etagere::AllocId) -> Self {
|
||||||
Self(id)
|
Self(id.serialize())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Ord for TileId {
|
impl From<TileId> for etagere::AllocId {
|
||||||
fn cmp(&self, other: &Self) -> Ordering {
|
fn from(id: TileId) -> Self {
|
||||||
self.0.serialize().cmp(&other.0.serialize())
|
Self::deserialize(id.0)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PartialOrd for TileId {
|
|
||||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
|
||||||
Some(self.cmp(other))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue