mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-26 13:48:21 -06:00
remove BlockDescriptorSource
trait
This commit is contained in:
parent
b63f2e4075
commit
dd382c899f
|
@ -31,12 +31,9 @@ pub enum Block {
|
||||||
Cobblestone,
|
Cobblestone,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait BlockDescriptorSource {
|
impl Block {
|
||||||
fn descriptor(self) -> BlockDescriptor;
|
|
||||||
}
|
|
||||||
impl BlockDescriptorSource for Block {
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn descriptor(self) -> BlockDescriptor {
|
pub const fn descriptor(self) -> BlockDescriptor {
|
||||||
match self {
|
match self {
|
||||||
Self::Air => BlockDescriptor {
|
Self::Air => BlockDescriptor {
|
||||||
name: "air",
|
name: "air",
|
||||||
|
@ -124,9 +121,13 @@ impl CubeTexture {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
struct CrossTexture {
|
pub struct CrossTexture {
|
||||||
pub a: BlockTexture,
|
pub a_front: BlockTexture,
|
||||||
pub b: BlockTexture,
|
pub b_front: BlockTexture,
|
||||||
|
pub a_back: BlockTexture,
|
||||||
|
pub b_back: BlockTexture,
|
||||||
|
}
|
||||||
|
impl CrossTexture {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,5 +141,5 @@ pub enum CollisionType {
|
||||||
pub enum RenderType {
|
pub enum RenderType {
|
||||||
None,
|
None,
|
||||||
SolidBlock(CubeTexture),
|
SolidBlock(CubeTexture),
|
||||||
CrossShape,
|
CrossShape(CrossTexture),
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use strum::{EnumIter, IntoEnumIterator};
|
use strum::{EnumIter, IntoEnumIterator};
|
||||||
use glam::{Vec3A, vec3a, IVec3, ivec3};
|
use glam::{Vec3A, vec3a, IVec3, ivec3};
|
||||||
use std::mem::discriminant;
|
use std::mem::discriminant;
|
||||||
use kubi_shared::block::{Block, RenderType, BlockDescriptorSource};
|
use kubi_shared::block::{Block, RenderType};
|
||||||
use super::{chunk::CHUNK_SIZE, };
|
use super::{chunk::CHUNK_SIZE, };
|
||||||
use crate::rendering::world::ChunkVertex;
|
use crate::rendering::world::ChunkVertex;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use glam::{Vec3, IVec3};
|
use glam::{Vec3, IVec3};
|
||||||
use shipyard::{View, Component, ViewMut, IntoIter, UniqueView, track};
|
use shipyard::{View, Component, ViewMut, IntoIter, UniqueView, track};
|
||||||
use kubi_shared::block::{Block, BlockDescriptorSource};
|
use kubi_shared::block::Block;
|
||||||
use crate::transform::Transform;
|
use crate::transform::Transform;
|
||||||
use super::ChunkStorage;
|
use super::ChunkStorage;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue