aboutsummaryrefslogtreecommitdiff
path: root/textures/base/pack
diff options
context:
space:
mode:
authorRui914 <rui914t@gmail.com>2016-03-31 17:26:39 +0900
committerkwolekr <kwolekr@minetest.net>2016-04-08 02:25:04 -0400
commit92d4a738435c4b8d5944375c596befcc15b3f47c (patch)
treedd536cc1559cecc52da61c1b87f1519eceb0a664 /textures/base/pack
parent27ee8d8943080a5dd735c9faa47c726604bafdff (diff)
downloadminetest-92d4a738435c4b8d5944375c596befcc15b3f47c.tar.gz
minetest-92d4a738435c4b8d5944375c596befcc15b3f47c.tar.bz2
minetest-92d4a738435c4b8d5944375c596befcc15b3f47c.zip
Mainmenu: Refactor tab UI code
- Use local variables for tabs in place of globals - Merge together if statements where possible - Replace manual table searching code with indexof where possible
Diffstat (limited to 'textures/base/pack')
0 files changed, 0 insertions, 0 deletions
='#n127'>127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
/*
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
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 Lesser General Public License for more details.

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.
*/

#include "voxelalgorithms.h"
#include "nodedef.h"

namespace voxalgo
{

void setLight(VoxelManipulator &v, VoxelArea a, u8 light,
		INodeDefManager *ndef)
{
	for(s32 x=a.MinEdge.X; x<=a.MaxEdge.X; x++)
	for(s32 z=a.MinEdge.Z; z<=a.MaxEdge.Z; z++)
	for(s32 y=a.MinEdge.Y; y<=a.MaxEdge.Y; y++)
	{
		v3s16 p(x,y,z);
		MapNode &n = v.getNodeRefUnsafe(p);
		n.setLight(LIGHTBANK_DAY, light, ndef);
		n.setLight(LIGHTBANK_NIGHT, light, ndef);
	}
}

void clearLightAndCollectSources(VoxelManipulator &v, VoxelArea a,
		enum LightBank bank, INodeDefManager *ndef,
		std::set<v3s16> & light_sources,
		std::map<v3s16, u8> & unlight_from)