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
13
world/block.h
Normal file
13
world/block.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#ifdef BLOCK_H
|
||||
#define BLOCK_H
|
||||
|
||||
#include "../types.h"
|
||||
|
||||
typedef u16 block_id;
|
||||
|
||||
#define BLOCK_AIR_ID 0
|
||||
#define BLOCK_STONE_ID 1
|
||||
#define BLOCK_DIRT_ID 1
|
||||
#define BLOCK_GRASS_ID 1
|
||||
|
||||
#endif
|
||||
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