mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-22 20:08:20 -06:00
wip
This commit is contained in:
parent
ef9e24722a
commit
25238acd9b
|
@ -12,9 +12,9 @@ mod shaders;
|
||||||
mod camera;
|
mod camera;
|
||||||
mod controller;
|
mod controller;
|
||||||
mod world;
|
mod world;
|
||||||
mod chunk;
|
|
||||||
mod blocks;
|
mod blocks;
|
||||||
mod items;
|
mod items;
|
||||||
|
mod options;
|
||||||
|
|
||||||
use assets::Assets;
|
use assets::Assets;
|
||||||
use display::init_display;
|
use display::init_display;
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
pub const CHUNK_SIZE: u8 = 16;
|
|
||||||
pub const CHUNK_HEIGHT: u8 = 255;
|
|
||||||
|
|
||||||
pub struct Chunk {
|
|
||||||
|
|
||||||
}
|
|
3
src/game/options.rs
Normal file
3
src/game/options.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
pub struct GameOptions {
|
||||||
|
pub render_distance: u8,
|
||||||
|
}
|
|
@ -1,6 +1,13 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use crate::game::chunk::Chunk;
|
|
||||||
|
mod chunk;
|
||||||
|
use chunk::Chunk;
|
||||||
|
|
||||||
pub struct World {
|
pub struct World {
|
||||||
chunks: HashMap<(i32, i32), Chunk>
|
chunks: HashMap<(i32, i32), Chunk>
|
||||||
}
|
}
|
||||||
|
impl World {
|
||||||
|
// pub fn update_loaded_chunks(around: ) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
23
src/game/world/chunk.rs
Normal file
23
src/game/world/chunk.rs
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
use glium::VertexBuffer;
|
||||||
|
use crate::game::{
|
||||||
|
blocks::Block,
|
||||||
|
shaders::chunk::Vertex as ChunkVertex
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const CHUNK_SIZE: usize = 16;
|
||||||
|
pub const CHUNK_HEIGHT: usize = 255;
|
||||||
|
|
||||||
|
pub enum ChunkState {
|
||||||
|
//AwaitsLoading,
|
||||||
|
//Loaded,
|
||||||
|
//AwaitsMesh,
|
||||||
|
//Rendered,
|
||||||
|
//AwaitsUnload
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Chunk {
|
||||||
|
pub coords: (i32, i32),
|
||||||
|
pub block_data: Option<[[[Block; CHUNK_SIZE]; CHUNK_HEIGHT]; CHUNK_SIZE]>,
|
||||||
|
pub vertex_buffer: Option<VertexBuffer<ChunkVertex>>,
|
||||||
|
pub state: ChunkState
|
||||||
|
}
|
Loading…
Reference in a new issue