Added Flecs, license comments and created the project outline.
This commit is contained in:
parent
d716b6cea7
commit
7be714b81f
16 changed files with 127682 additions and 5 deletions
21
world/chunk.h
Normal file
21
world/chunk.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef CHUNK_H
|
||||
#define CHUNK_H
|
||||
|
||||
#include "block.h"
|
||||
|
||||
#define CHUNK_SIZE 16
|
||||
#define CHUNK_INDEX(x, y, z) (CHUNK_SIZE * CHUNK_SIZE * (x) + CHUNK_SIZE * (y) + (z))
|
||||
|
||||
typedef usize chunk_position[2];
|
||||
|
||||
/*
|
||||
* Chunk are a group of blocks with
|
||||
* size 16x16x16. The world is composed
|
||||
* of infinite chunks in each axis.
|
||||
*/
|
||||
struct chunk {
|
||||
block_id blocks[CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE];
|
||||
chunk_position position;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue