Source/ThunderBeast/QuakeToonProto1/ref_gl/gl_rsurf.c
glpoly_t *WaterWarpPolyVerts (glpoly_t *p)
{
	int		i;
	float	*v, *nv;
	static byte	buffer[1024];
	glpoly_t *out;

	out = (glpoly_t *)buffer;

	out->numverts = p->numverts;
	v = p->verts[0];
	nv = out->verts[0];
	for (i=0 ; i<p->numverts ; i++, v+= VERTEXSIZE, nv+=VERTEXSIZE)
	{
		nv[0] = v[0] + 4*sin(v[1]*0.05+r_newrefdef.time)*sin(v[2]*0.05+r_newrefdef.time);
		nv[1] = v[1] + 4*sin(v[0]*0.05+r_newrefdef.time)*sin(v[2]*0.05+r_newrefdef.time);

		nv[2] = v[2];
		nv[3] = v[3];
		nv[4] = v[4];
		nv[5] = v[5];
		nv[6] = v[6];
	}

	return out;
}
/*
=================
WaterWarpPolyVerts

Mangles the x and y coordinates in a copy of the poly
so that any drawing routine can be water warped
=================
*/
WaterWarpPolyVerts
Mangles the x and y coordinates in a copy of the poly
so that any drawing routine can be water warped
WaterWarpPolyVerts Mangles the x and y coordinates in a copy of the poly so that any drawing routine can be water warped
glpoly_t *WaterWarpPolyVerts (glpoly_t *p)
{
	int		i;
	float	*v, *nv;
	static byte	buffer[1024];
	glpoly_t *out;
	out = (glpoly_t *)buffer;
	out->numverts = p->numverts;
	v = p->verts[0];
	nv = out->verts[0];
	for (i=0 ; i<p->numverts ; i++, v+= VERTEXSIZE, nv+=VERTEXSIZE)
	{
		nv[0] = v[0] + 4*sin(v[1]*0.05+r_newrefdef.time)*sin(v[2]*0.05+r_newrefdef.time);
		nv[1] = v[1] + 4*sin(v[0]*0.05+r_newrefdef.time)*sin(v[2]*0.05+r_newrefdef.time);
		nv[2] = v[2];
		nv[3] = v[3];
		nv[4] = v[4];
		nv[5] = v[5];
		nv[6] = v[6];
	}
	return out;
}
glpoly_t * WaterWarpPolyVerts ( glpoly_t * p ) { int i ; float * v , * nv ; static byte buffer [ 1024 ] ; glpoly_t * out ; out = ( glpoly_t * ) buffer ; out -> numverts = p -> numverts ; v = p -> verts [ 0 ] ; nv = out -> verts [ 0 ] ; for ( i = 0 ; i < p -> numverts ; i ++ , v += VERTEXSIZE , nv += VERTEXSIZE ) { nv [ 0 ] = v [ 0 ] + 4 * sin ( v [ 1 ] * 0.05 + r_newrefdef . time ) * sin ( v [ 2 ] * 0.05 + r_newrefdef . time ) ; nv [ 1 ] = v [ 1 ] + 4 * sin ( v [ 0 ] * 0.05 + r_newrefdef . time ) * sin ( v [ 2 ] * 0.05 + r_newrefdef . time ) ; nv [ 2 ] = v [ 2 ] ; nv [ 3 ] = v [ 3 ] ; nv [ 4 ] = v [ 4 ] ; nv [ 5 ] = v [ 5 ] ; nv [ 6 ] = v [ 6 ] ; } return out ; }
WaterWarpPolyVerts
Mangles the x and y coordinates in a copy of the poly
so that any drawing routine can be water warped
WaterWarpPolyVerts Mangles the x and y coordinates in a copy of the poly so that any drawing routine can be water warped