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