]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/client/client_node.h
8068eca4c6f28d18ed774c2b0915eca4e9605df8
[dragonblocks_alpha.git] / src / client / client_node.h
1 #ifndef _CLIENT_NODE_H_
2 #define _CLIENT_NODE_H_
3
4 #include "client/terrain_gfx.h"
5 #include "client/texture.h"
6 #include "terrain.h"
7
8 typedef enum {
9         VISIBILITY_NONE,
10         VISIBILITY_CLIP,
11         VISIBILITY_BLEND,
12         VISIBILITY_SOLID,
13 } NodeVisibility;
14
15 typedef struct {
16         v3s32 pos;
17         TerrainNode *node;
18         TerrainVertex vertex;
19         unsigned int f, v;
20 } NodeArgsRender;
21
22 typedef struct {
23         struct {
24                 char *paths[6];       // input
25                 int indices[6];       // input
26                 Texture *textures[6]; // output
27         } tiles;
28         NodeVisibility visibility;
29         bool mipmap;
30         void (*render)(NodeArgsRender *args);
31         bool pointable;
32         v3f32 selection_color;
33         char *name;
34 } ClientNodeDef;
35
36 extern ClientNodeDef client_node_def[];
37 void client_node_init();
38
39 void client_node_delete(TerrainNode *node);
40 void client_node_deserialize(TerrainNode *node, Blob buffer);
41
42 #endif // _CLIENT_NODE_H_