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

Method RenderView

client/src/main/java/jake2/client/V.java:312–444  ·  view source on GitHub ↗
(float stereo_separation)

Source from the content-addressed store, hash-verified

310 * ==================
311 */
312 static void RenderView(float stereo_separation) {
313 // extern int entitycmpfnc( const entity_t *, const entity_t * );
314 //
315 if (ClientGlobals.cls.state != ca_active)
316 return;
317
318 if (!ClientGlobals.cl.refresh_prepped)
319 return; // still loading
320
321 if (ClientGlobals.cl_timedemo.value != 0.0f) {
322 if (ClientGlobals.cl.timedemo_start == 0)
323 ClientGlobals.cl.timedemo_start = Timer.Milliseconds();
324 ClientGlobals.cl.timedemo_frames++;
325 }
326
327 // an invalid frame will just use the exact previous refdef
328 // we can't use the old frame if the video mode has changed, though...
329 if (ClientGlobals.cl.frame.valid && (ClientGlobals.cl.force_refdef || ClientGlobals.cl_paused.value == 0.0f)) {
330 ClientGlobals.cl.force_refdef = false;
331
332 V.ClearScene();
333
334 // build a refresh entity list and calc cl.sim*
335 // this also calls CL_CalcViewValues which loads
336 // v_forward, etc.
337 CL_ents.AddEntities();
338
339 if (cl_testparticles.value != 0.0f)
340 TestParticles();
341 if (cl_testentities.value != 0.0f)
342 TestEntities();
343 if (cl_testlights.value != 0.0f)
344 TestLights();
345 if (cl_flashlight.value != 0.0f)
346 FlashLight();
347 if (cl_testblend.value != 0.0f) {
348 ClientGlobals.cl.refdef.blend[0] = 1.0f;
349 ClientGlobals.cl.refdef.blend[1] = 0.5f;
350 ClientGlobals.cl.refdef.blend[2] = 0.25f;
351 ClientGlobals.cl.refdef.blend[3] = 0.5f;
352 }
353
354 // offset vieworg appropriately if we're doing stereo separation
355 if (stereo_separation != 0) {
356 float[] tmp = new float[3];
357
358 Math3D.VectorScale(ClientGlobals.cl.v_right, stereo_separation, tmp);
359 Math3D.VectorAdd(ClientGlobals.cl.refdef.vieworg, tmp, ClientGlobals.cl.refdef.vieworg);
360 }
361
362 // never let it sit exactly on a node line, because a water plane
363 // can
364 // dissapear when viewed with the eye exactly on it.
365 // the server protocol only specifies to 1/8 pixel, so add 1/16 in
366 // each axis
367 ClientGlobals.cl.refdef.vieworg[0] += 1.0 / 16;
368 ClientGlobals.cl.refdef.vieworg[1] += 1.0 / 16;
369 ClientGlobals.cl.refdef.vieworg[2] += 1.0 / 16;

Callers 1

UpdateScreen2Method · 0.95

Calls 15

MillisecondsMethod · 0.95
ClearSceneMethod · 0.95
AddEntitiesMethod · 0.95
TestParticlesMethod · 0.95
TestEntitiesMethod · 0.95
TestLightsMethod · 0.95
FlashLightMethod · 0.95
VectorScaleMethod · 0.95
VectorAddMethod · 0.95
CalcFovMethod · 0.95
VectorCopyMethod · 0.95
VectorClearMethod · 0.95

Tested by

no test coverage detected