Exemplo n.º 1
0
// -----------------------------------------------------------------------------
int LightIncreaseLightVertex(void)
{
	const vmsegptr_t segp = Cursegp;
	set_light_intensity(segp, Curside, Curvert, get_light_intensity(segp, Curside, Curvert) + F1_0 / NUM_LIGHTING_LEVELS);

	return	1;
}
Exemplo n.º 2
0
// -----------------------------------------------------------------------------
int LightSetMaximum(void)
{
	const vmsegptr_t segp = Cursegp;
	range_for (const int v, xrange(4u))
		set_light_intensity(segp, Curside, v, (NUM_LIGHTING_LEVELS - 1) * F1_0 / NUM_LIGHTING_LEVELS);

	return	1;
}
Exemplo n.º 3
0
// -----------------------------------------------------------------------------
int LightSetDefault(void)
{
	const vmsegptr_t segp = Cursegp;
	range_for (const int v, xrange(4u))
		set_light_intensity(segp, Curside, v, DEFAULT_LIGHTING);

	return	1;
}
Exemplo n.º 4
0
// -----------------------------------------------------------------------------
int LightIncreaseLightSide(void)
{
	const vmsegptr_t segp = Cursegp;
	range_for (const int v, xrange(4u))
		set_light_intensity(segp, Curside, v, get_light_intensity(segp, Curside, v) + F1_0 / NUM_LIGHTING_LEVELS);

	return	1;
}
Exemplo n.º 5
0
Arquivo: elight.c Projeto: btb/d2x
// -----------------------------------------------------------------------------
int LightSetMaximum(void)
{
	int	v;

	for (v=0; v<4; v++)
		set_light_intensity(Cursegp, Curside, v, (NUM_LIGHTING_LEVELS-1)*F1_0/NUM_LIGHTING_LEVELS);

	return	1;
}
Exemplo n.º 6
0
Arquivo: elight.c Projeto: btb/d2x
// -----------------------------------------------------------------------------
int LightSetDefault(void)
{
	int	v;

	for (v=0; v<4; v++)
		set_light_intensity(Cursegp, Curside, v, DEFAULT_LIGHTING);

	return	1;
}
Exemplo n.º 7
0
Arquivo: elight.c Projeto: btb/d2x
// -----------------------------------------------------------------------------
int LightIncreaseLightSide(void)
{
	int	v;

	for (v=0; v<4; v++)
		set_light_intensity(Cursegp, Curside, v, get_light_intensity(Cursegp, Curside, v)+F1_0/NUM_LIGHTING_LEVELS);

	return	1;
}
Exemplo n.º 8
0
// -----------------------------------------------------------------------------
int LightIncreaseLightSegment(void)
{
	const vmsegptr_t segp = Cursegp;
	for (int s=0; s<MAX_SIDES_PER_SEGMENT; s++)
		range_for (const int v, xrange(4u))
			set_light_intensity(segp, s, v, get_light_intensity(segp, s, v) + F1_0 / NUM_LIGHTING_LEVELS);

	return	1;
}
Exemplo n.º 9
0
Arquivo: elight.c Projeto: btb/d2x
// -----------------------------------------------------------------------------
int LightIncreaseLightSegment(void)
{
	int	s,v;

	for (s=0; s<MAX_SIDES_PER_SEGMENT; s++)
		for (v=0; v<4; v++)
			set_light_intensity(Cursegp, s, v, get_light_intensity(Cursegp, s, v)+F1_0/NUM_LIGHTING_LEVELS);

	return	1;
}
Exemplo n.º 10
0
Arquivo: elight.c Projeto: btb/d2x
// -----------------------------------------------------------------------------
//	Copy intensity from current vertex to all other vertices on side.
int LightCopyIntensity(void)
{
	int	v,intensity;

	intensity = get_light_intensity(Cursegp, Curside, Curvert);

	for (v=0; v<4; v++)
		if (v != Curvert)
			set_light_intensity(Cursegp, Curside, v, intensity);

	return	1;
}
Exemplo n.º 11
0
Arquivo: elight.c Projeto: btb/d2x
// -----------------------------------------------------------------------------
//	Copy intensity from current vertex to all other vertices on side.
int LightCopyIntensitySegment(void)
{
	int	s,v,intensity;

	intensity = get_light_intensity(Cursegp, Curside, Curvert);

	for (s=0; s<MAX_SIDES_PER_SEGMENT; s++)
		for (v=0; v<4; v++)
			if ((s != Curside) || (v != Curvert))
				set_light_intensity(Cursegp, s, v, intensity);

	return	1;
}
Exemplo n.º 12
0
// -----------------------------------------------------------------------------
//	Copy intensity from current vertex to all other vertices on side.
int LightCopyIntensity(void)
{
	int	intensity;

	const vmsegptr_t segp = Cursegp;
	intensity = get_light_intensity(segp, Curside, Curvert);

	range_for (const int v, xrange(4u))
		if (v != Curvert)
			set_light_intensity(segp, Curside, v, intensity);

	return	1;
}
Exemplo n.º 13
0
// -----------------------------------------------------------------------------
//	Copy intensity from current vertex to all other vertices on side.
int LightCopyIntensitySegment(void)
{
	int	intensity;

	const vmsegptr_t segp = Cursegp;
	intensity = get_light_intensity(segp, Curside, Curvert);

	for (int s=0; s<MAX_SIDES_PER_SEGMENT; s++)
		range_for (const int v, xrange(4u))
			if ((s != Curside) || (v != Curvert))
				set_light_intensity(segp, s, v, intensity);

	return	1;
}
Exemplo n.º 14
0
Arquivo: elight.c Projeto: btb/d2x
// -----------------------------------------------------------------------------
//	Add light intensity to a vertex, saturating in .5 to 15.5
void add_light_intensity(segment *segp, int sidenum, int vert, fix intensity)
{
//	fix	new_intensity;

	set_light_intensity(segp, sidenum, vert, segp->sides[sidenum].uvls[vert].l + intensity);
}
Exemplo n.º 15
0
Arquivo: elight.c Projeto: btb/d2x
// -----------------------------------------------------------------------------
int LightIncreaseLightVertex(void)
{
	set_light_intensity(Cursegp, Curside, Curvert, get_light_intensity(Cursegp, Curside, Curvert)+F1_0/NUM_LIGHTING_LEVELS);

	return	1;
}
Exemplo n.º 16
0
static void set_light_intensity(unique_segment &segp, const uint_fast32_t sidenum, const uint_fast32_t vert, const fix intensity)
{
	Assert(sidenum <= MAX_SIDES_PER_SEGMENT);
	set_light_intensity(segp.sides[sidenum], vert, intensity);
}