// Create directly from a nodename
// If name is unknown, sets CONTENT_IGNORE
// Create directly from a nodename
// If name is unknown, sets CONTENT_IGNORE
u8 a_param1, u8 a_param2)
{
content_t id = CONTENT_IGNORE;
u8 a_param1, u8 a_param2)
{
content_t id = CONTENT_IGNORE;
-void MapNode::setLight(enum LightBank bank, u8 a_light, INodeDefManager *nodemgr)
+void MapNode::setLight(enum LightBank bank, u8 a_light,
+ const NodeDefManager *nodemgr)
{
// Select the brightest of [light source, propagated light]
const ContentFeatures &f = nodemgr->get(*this);
{
// Select the brightest of [light source, propagated light]
const ContentFeatures &f = nodemgr->get(*this);
-bool MapNode::getLightBanks(u8 &lightday, u8 &lightnight, INodeDefManager *nodemgr) const
+bool MapNode::getLightBanks(u8 &lightday, u8 &lightnight,
+ const NodeDefManager *nodemgr) const
{
// Select the brightest of [light source, propagated light]
const ContentFeatures &f = nodemgr->get(*this);
{
// Select the brightest of [light source, propagated light]
const ContentFeatures &f = nodemgr->get(*this);
{
const ContentFeatures &f = nodemgr->get(*this);
if (f.param_type_2 == CPT2_FACEDIR ||
f.param_type_2 == CPT2_COLORED_FACEDIR)
return (getParam2() & 0x1F) % 24;
{
const ContentFeatures &f = nodemgr->get(*this);
if (f.param_type_2 == CPT2_FACEDIR ||
f.param_type_2 == CPT2_COLORED_FACEDIR)
return (getParam2() & 0x1F) % 24;
{
std::vector<aabb3f> &boxes = *p_boxes;
if (nodebox.type == NODEBOX_FIXED || nodebox.type == NODEBOX_LEVELED) {
const std::vector<aabb3f> &fixed = nodebox.fixed;
{
std::vector<aabb3f> &boxes = *p_boxes;
if (nodebox.type == NODEBOX_FIXED || nodebox.type == NODEBOX_LEVELED) {
const std::vector<aabb3f> &fixed = nodebox.fixed;
- if (nodebox.type == NODEBOX_LEVELED) {
- box.MaxEdge.Y = -BS/2 + BS*((float)1/LEVELED_MAX) * n.getLevel(nodemgr);
- }
+ if (nodebox.type == NODEBOX_LEVELED)
+ box.MaxEdge.Y = (-0.5f + n.getLevel(nodemgr) / 64.0f) * BS;
Map *map, MapNode n, u8 bitmask, u8 *neighbors)
{
MapNode n2 = map->getNodeNoEx(p);
Map *map, MapNode n, u8 bitmask, u8 *neighbors)
{
MapNode n2 = map->getNodeNoEx(p);
-void MapNode::getNodeBoxes(INodeDefManager *nodemgr, std::vector<aabb3f> *boxes, u8 neighbors)
+void MapNode::getNodeBoxes(const NodeDefManager *nodemgr,
+ std::vector<aabb3f> *boxes, u8 neighbors)
{
const ContentFeatures &f = nodemgr->get(*this);
transformNodeBox(*this, f.node_box, nodemgr, boxes, neighbors);
}
{
const ContentFeatures &f = nodemgr->get(*this);
transformNodeBox(*this, f.node_box, nodemgr, boxes, neighbors);
}
-void MapNode::getCollisionBoxes(INodeDefManager *nodemgr, std::vector<aabb3f> *boxes, u8 neighbors)
+void MapNode::getCollisionBoxes(const NodeDefManager *nodemgr,
+ std::vector<aabb3f> *boxes, u8 neighbors)
transformNodeBox(*this, f.collision_box, nodemgr, boxes, neighbors);
}
transformNodeBox(*this, f.collision_box, nodemgr, boxes, neighbors);
}
-void MapNode::getSelectionBoxes(INodeDefManager *nodemgr, std::vector<aabb3f> *boxes, u8 neighbors)
+void MapNode::getSelectionBoxes(const NodeDefManager *nodemgr,
+ std::vector<aabb3f> *boxes, u8 neighbors)
{
const ContentFeatures &f = nodemgr->get(*this);
transformNodeBox(*this, f.selection_box, nodemgr, boxes, neighbors);
}
{
const ContentFeatures &f = nodemgr->get(*this);
transformNodeBox(*this, f.selection_box, nodemgr, boxes, neighbors);
}
{
const ContentFeatures &f = nodemgr->get(*this);
// todo: after update in all games leave only if (f.param_type_2 ==
{
const ContentFeatures &f = nodemgr->get(*this);
// todo: after update in all games leave only if (f.param_type_2 ==
{
const ContentFeatures &f = nodemgr->get(*this);
// todo: after update in all games leave only if (f.param_type_2 ==
{
const ContentFeatures &f = nodemgr->get(*this);
// todo: after update in all games leave only if (f.param_type_2 ==