]> git.lizzy.rs Git - dragonblocks_alpha.git/blobdiff - src/node.h
Use proper format for size_t printf
[dragonblocks_alpha.git] / src / node.h
index 2eb4e9d7e7ea5894e76ccda03bc30aed73867ec9..ef2171361cdf942552c8c116aaca5cceb7a29b41 100644 (file)
@@ -2,31 +2,38 @@
 #define _NODE_H_
 
 #include <stdbool.h>
+#include <stddef.h>
 #include "types.h"
 
-typedef enum
-{
-       NODE_INVALID,           // Used for unknown nodes received from server (caused by outdated clients)
+#define NODES_TREE case NODE_OAK_WOOD: case NODE_OAK_LEAVES: case NODE_PINE_WOOD: case NODE_PINE_LEAVES: case NODE_PALM_WOOD: case NODE_PALM_LEAVES:
+
+typedef enum {
+       NODE_UNKNOWN,       // Used for unknown nodes received from server (caused by outdated clients)
        NODE_AIR,
        NODE_GRASS,
        NODE_DIRT,
        NODE_STONE,
        NODE_SNOW,
-       NODE_WOOD,
-       NODE_UNLOADED,          // Used for nodes in unloaded blocks
-} Node;
+       NODE_OAK_WOOD,
+       NODE_OAK_LEAVES,
+       NODE_PINE_WOOD,
+       NODE_PINE_LEAVES,
+       NODE_PALM_WOOD,
+       NODE_PALM_LEAVES,
+       NODE_SAND,
+       NODE_WATER,
+       NODE_LAVA,
+       NODE_VULCANO_STONE,
+       COUNT_NODE,      // Used for nodes in unloaded chunks
+} NodeType;
 
-struct MapNode;
+struct TerrainNode;
 
-typedef struct
-{
-       bool visible;
+typedef struct {
        bool solid;
-       void (*create)(struct MapNode *node);
-       void (*serialize)(struct MapNode *node);
-       void (*deserialize)(struct MapNode *node);
-} NodeDefintion;
+       unsigned long dig_class;
+} NodeDef;
 
-extern NodeDefintion node_definitions[];
+extern NodeDef node_def[];
 
 #endif