3 Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef VOXELALGORITHMS_HEADER
21 #define VOXELALGORITHMS_HEADER
29 // TODO: Move unspreadLight and spreadLight from VoxelManipulator to here
31 void setLight(VoxelManipulator &v, VoxelArea a, u8 light,
32 INodeDefManager *ndef);
34 void clearLightAndCollectSources(VoxelManipulator &v, VoxelArea a,
35 enum LightBank bank, INodeDefManager *ndef,
36 core::map<v3s16, bool> & light_sources,
37 core::map<v3s16, u8> & unlight_from);
39 struct SunlightPropagateResult
41 bool bottom_sunlight_valid;
43 SunlightPropagateResult(bool bottom_sunlight_valid_):
44 bottom_sunlight_valid(bottom_sunlight_valid_)
48 SunlightPropagateResult propagateSunlight(VoxelManipulator &v, VoxelArea a,
49 bool inexistent_top_provides_sunlight,
50 core::map<v3s16, bool> & light_sources,
51 INodeDefManager *ndef);
53 } // namespace voxalgo