X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fvoxel.h;h=b48943624f2a7325ced98a64892c0d9e8a8d0d8e;hb=5bd50a2d9060f265d4c8d2fff062cac106ccab7c;hp=6d1a318f1e9b9f505d1a849d150806664cc67b14;hpb=f37a3a84fafb91bcfc109fed95aa6d42726f1bf7;p=dragonfireclient.git diff --git a/src/voxel.h b/src/voxel.h index 6d1a318f1..b48943624 100644 --- a/src/voxel.h +++ b/src/voxel.h @@ -1,18 +1,18 @@ /* -Minetest-c55 -Copyright (C) 2010 celeron55, Perttu Ahola +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +GNU Lesser General Public License for more details. -You should have received a copy of the GNU General Public License along +You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ @@ -20,11 +20,15 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef VOXEL_HEADER #define VOXEL_HEADER -#include "common_irrlicht.h" +#include "irrlichttypes.h" +#include "irr_v3d.h" +#include #include #include "debug.h" #include "mapnode.h" +class INodeDefManager; + // For VC++ #undef min #undef max @@ -68,7 +72,7 @@ class VoxelArea MaxEdge(p) { } - + /* Modifying methods */ @@ -102,14 +106,14 @@ class VoxelArea if(p.Y > MaxEdge.Y) MaxEdge.Y = p.Y; if(p.Z > MaxEdge.Z) MaxEdge.Z = p.Z; } - + // Pad with d nodes void pad(v3s16 d) { MinEdge -= d; MaxEdge += d; } - + /*void operator+=(v3s16 off) { MinEdge += off; @@ -198,7 +202,7 @@ class VoxelArea } assert(contains(a)); - + // Take back area, XY inclusive { v3s16 min(MinEdge.X, MinEdge.Y, a.MaxEdge.Z+1); @@ -254,7 +258,7 @@ class VoxelArea } } - + /* Translates position from virtual coordinates to array index */ @@ -270,7 +274,7 @@ class VoxelArea { return index(p.X, p.Y, p.Z); } - + // Translate index in the X coordinate void add_x(const v3s16 &extent, u32 &i, s16 a) { @@ -331,6 +335,7 @@ enum VoxelPrintMode VOXELPRINT_NOTHING, VOXELPRINT_MATERIAL, VOXELPRINT_WATERPRESSURE, + VOXELPRINT_LIGHT_DAY, }; class VoxelManipulator /*: public NodeContainer*/ @@ -338,7 +343,7 @@ class VoxelManipulator /*: public NodeContainer*/ public: VoxelManipulator(); virtual ~VoxelManipulator(); - + /* Virtuals from NodeContainer */ @@ -362,11 +367,11 @@ class VoxelManipulator /*: public NodeContainer*/ if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT) { - dstream<<"EXCEPT: VoxelManipulator::getNode(): " + /*dstream<<"EXCEPT: VoxelManipulator::getNode(): " <<"p=("< & light_sources); + core::map & light_sources, INodeDefManager *nodemgr); void unspreadLight(enum LightBank bank, core::map & from_nodes, - core::map & light_sources); - - void spreadLight(enum LightBank bank, v3s16 p); + core::map & light_sources, INodeDefManager *nodemgr); + + void spreadLight(enum LightBank bank, v3s16 p, INodeDefManager *nodemgr); void spreadLight(enum LightBank bank, - core::map & from_nodes); - + core::map & from_nodes, INodeDefManager *nodemgr); + /* Virtual functions */ - + /* Get the contents of the requested area from somewhere. Shall touch only nodes that have VOXELFLAG_NOT_LOADED @@ -541,7 +565,7 @@ class VoxelManipulator /*: public NodeContainer*/ MaxEdge is 1 higher than maximum allowed position */ VoxelArea m_area; - + /* NULL if data size is 0 (extent (0,0,0)) Data is stored as [z*h*w + y*h + x] @@ -552,7 +576,7 @@ class VoxelManipulator /*: public NodeContainer*/ Flags of all nodes */ u8 *m_flags; - + //TODO: Use these or remove them //TODO: Would these make any speed improvement? //bool m_pressure_route_valid;