-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathblock.h
64 lines (51 loc) · 850 Bytes
/
block.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include <stdbool.h>
#include "vmath.h"
typedef struct
{
Vec4i pos;
Vec4f color;
Vec4f normal;
Vec2f texCoord;
}Vertex;
typedef struct
{
int size;
int maxSize;
Vertex* data;
}VertexBuffer;
typedef struct
{
byte id;
byte metadata;
byte light;
byte skyLight;
}Block;
typedef enum
{
DRAW_NONE,
DRAW_BLOCK,
DRAW_CACTI,
DRAW_TREE,
DRAW_GRASS,
DRAW_RAIL,
DRAW_STAIRS,
}DrawMode;
typedef enum
{
COLOR_NONE,
COLOR_GRASS,
COLOR_WOOL,
}ColorMode;
typedef struct
{
const char* name;
bool solid;
bool transparent;
DrawMode draw_mode;
ColorMode color_mode;
int textures[6];
}BlockDefinition;
public BlockDefinition block_definition[256];
typedef struct World World;
void blockDraw(World* world, Vec4i loc, VertexBuffer* buffer);