MCPcopy Create free account
hub / github.com/demoth/jake2 / EmitWaterPolys

Method EmitWaterPolys

client/src/main/java/jake2/client/render/fast/Warp.java:277–312  ·  view source on GitHub ↗

EmitWaterPolys Does a water warp on the pre-fragmented glpoly_t chain

(msurface_t fa)

Source from the content-addressed store, hash-verified

275 * Does a water warp on the pre-fragmented glpoly_t chain
276 */
277 void EmitWaterPolys(msurface_t fa)
278 {
279 float rdt = r_newrefdef.time;
280
281 float scroll;
282 if ((fa.texinfo.flags & Defines.SURF_FLOWING) != 0)
283 scroll = -64 * ( (r_newrefdef.time*0.5f) - (int)(r_newrefdef.time*0.5f) );
284 else
285 scroll = 0;
286
287 int i;
288 float s, t, os, ot;
289 glpoly_t p, bp;
290 for (bp = fa.polys; bp != null; bp = bp.next) {
291 p = bp;
292
293 gl.glBegin(GL_TRIANGLE_FAN);
294 for (i = 0; i < p.numverts; i++) {
295 os = p.s1(i);
296 ot = p.t1(i);
297
298 s = os
299 + Warp.SIN[(int) ((ot * 0.125f + r_newrefdef.time) * TURBSCALE) & 255];
300 s += scroll;
301 s *= (1.0f / 64);
302
303 t = ot
304 + Warp.SIN[(int) ((os * 0.125f + rdt) * TURBSCALE) & 255];
305 t *= (1.0f / 64);
306
307 gl.glTexCoord2f(s, t);
308 gl.glVertex3f(p.x(i), p.y(i), p.z(i));
309 }
310 gl.glEnd();
311 }
312 }
313
314// ===================================================================
315

Callers

nothing calls this directly

Calls 9

s1Method · 0.95
t1Method · 0.95
xMethod · 0.95
yMethod · 0.95
zMethod · 0.95
glBeginMethod · 0.65
glTexCoord2fMethod · 0.65
glVertex3fMethod · 0.65
glEndMethod · 0.65

Tested by

no test coverage detected