#ifndef NODEDEF_HEADER
#define NODEDEF_HEADER
-#include "irrlichttypes.h"
+#include "irrlichttypes_bloated.h"
#include <string>
#include <iostream>
#include <map>
#endif
#include "itemgroup.h"
#include "sound.h" // SimpleSoundSpec
+#include "constants.h" // BS
+
class IItemDefManager;
class ITextureSource;
class IGameDef;
enum NodeBoxType
{
NODEBOX_REGULAR, // Regular block; allows buildable_to
- NODEBOX_FIXED, // Static separately defined box
+ NODEBOX_FIXED, // Static separately defined box(es)
NODEBOX_WALLMOUNTED, // Box for wall mounted nodes; (top, bottom, side)
};
enum NodeBoxType type;
// NODEBOX_REGULAR (no parameters)
// NODEBOX_FIXED
- core::aabbox3d<f32> fixed;
+ std::vector<aabb3f> fixed;
// NODEBOX_WALLMOUNTED
- core::aabbox3d<f32> wall_top;
- core::aabbox3d<f32> wall_bottom;
- core::aabbox3d<f32> wall_side; // being at the -X side
-
- NodeBox():
- type(NODEBOX_REGULAR),
- // default is rail-like
- fixed(-BS/2, -BS/2, -BS/2, BS/2, -BS/2+BS/16., BS/2),
- // default is sign/ladder-like
- wall_top(-BS/2, BS/2-BS/16., -BS/2, BS/2, BS/2, BS/2),
- wall_bottom(-BS/2, -BS/2, -BS/2, BS/2, -BS/2+BS/16., BS/2),
- wall_side(-BS/2, -BS/2, -BS/2, -BS/2+BS/16., BS/2, BS/2)
- {}
+ aabb3f wall_top;
+ aabb3f wall_bottom;
+ aabb3f wall_side; // being at the -X side
+
+ NodeBox()
+ { reset(); }
+ void reset();
void serialize(std::ostream &os) const;
void deSerialize(std::istream &is);
};
struct MapNode;
class NodeMetadata;
-struct MaterialSpec
+/*
+ Stand-alone definition of a TileSpec (basically a server-side TileSpec)
+*/
+enum TileAnimationType{
+ TAT_NONE=0,
+ TAT_VERTICAL_FRAMES=1,
+};
+struct TileDef
{
- std::string tname;
- bool backface_culling;
-
- MaterialSpec(const std::string &tname_="", bool backface_culling_=true):
- tname(tname_),
- backface_culling(backface_culling_)
- {}
+ std::string name;
+ bool backface_culling; // Takes effect only in special cases
+ struct{
+ enum TileAnimationType type;
+ int aspect_w; // width for aspect ratio
+ int aspect_h; // height for aspect ratio
+ float length; // seconds
+ } animation;
+
+ TileDef()
+ {
+ name = "";
+ backface_culling = true;
+ animation.type = TAT_NONE;
+ animation.aspect_w = 1;
+ animation.aspect_h = 1;
+ animation.length = 1.0;
+ }
void serialize(std::ostream &os) const;
void deSerialize(std::istream &is);
NDT_PLANTLIKE,
NDT_FENCELIKE,
NDT_RAILLIKE,
+ NDT_NODEBOX,
};
#define CF_SPECIAL_COUNT 2
bool backface_culling;
#endif
+ // Server-side cached callback existence for fast skipping
+ bool has_on_construct;
+ bool has_on_destruct;
+ bool has_after_destruct;
+
/*
Actual data
*/
// Visual definition
enum NodeDrawType drawtype;
float visual_scale; // Misc. scale parameter
- std::string tname_tiles[6];
- MaterialSpec mspec_special[CF_SPECIAL_COUNT]; // Use setter methods
+ TileDef tiledef[6];
+ TileDef tiledef_special[CF_SPECIAL_COUNT]; // eg. flowing liquid
u8 alpha;
// Post effect color, drawn when the camera is inside the node.
// 1 giving almost instantaneous propagation and 7 being
// the slowest possible
u8 liquid_viscosity;
+ // Is liquid renewable (new liquid source will be created between 2 existing)
+ bool liquid_renewable;
// Amount of light the node emits
u8 light_source;
u32 damage_per_second;
+ NodeBox node_box;
NodeBox selection_box;
// Compatibility with old maps
// Set to true if paramtype used to be 'facedir_simple'