Example #1
0
/**
 * @brief Adds elements for the specified blended surfaces lists.
 */
static void R_AddBspSurfaceElements(const r_bsp_surfaces_t *surfs, const r_element_type_t type) {
	static r_element_t e;

	uint16_t i;
	for (i = 0; i < surfs->count; i++) {

		const r_bsp_surface_t *s = surfs->surfaces[i];

		if (s->frame == r_locals.frame) {

			e.type = type;
			e.element = (const void *) s;
			e.origin = (const vec_t *) s->center;

			R_AddElement(&e);
		}
	}
}
Example #2
0
/*
 * @brief Copies the specified particle into the view structure, provided it
 * passes a basic visibility test.
 */
void R_AddParticle(const r_particle_t *p) {
	static r_element_t e;

	if (r_view.num_particles >= MAX_PARTICLES)
		return;

	if (p->type != PARTICLE_BEAM) {
		if (R_LeafForPoint(p->org, NULL)->vis_frame != r_locals.vis_frame) {
			return;
		}
	}

	r_view.particles[r_view.num_particles++] = *p;

	e.type = ELEMENT_PARTICLE;

	e.element = (const void *) p;
	e.origin = (const vec_t *) p->org;

	R_AddElement(&e);
}