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

Method CalcVrect

client/src/main/java/jake2/client/SCR.java:353–372  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

351 * Sets scr_vrect, the coordinates of the rendered window =================
352 */
353 private static void CalcVrect() {
354 int size;
355
356 // bound viewsize
357 if (scr_viewsize.value < 40)
358 Cvar.getInstance().Set("viewsize", "40");
359 if (scr_viewsize.value > 100)
360 Cvar.getInstance().Set("viewsize", "100");
361
362 size = (int) scr_viewsize.value;
363
364 ClientGlobals.scr_vrect.width = ClientGlobals.viddef.getWidth() * size / 100;
365 ClientGlobals.scr_vrect.width &= ~7;
366
367 ClientGlobals.scr_vrect.height = ClientGlobals.viddef.getHeight() * size / 100;
368 ClientGlobals.scr_vrect.height &= ~1;
369
370 ClientGlobals.scr_vrect.x = (ClientGlobals.viddef.getWidth() - ClientGlobals.scr_vrect.width) / 2;
371 ClientGlobals.scr_vrect.y = (ClientGlobals.viddef.getHeight() - ClientGlobals.scr_vrect.height) / 2;
372 }
373
374 /*
375 * ================= SCR_SizeUp_f

Callers 1

UpdateScreen2Method · 0.95

Calls 4

getInstanceMethod · 0.95
SetMethod · 0.80
getWidthMethod · 0.80
getHeightMethod · 0.80

Tested by

no test coverage detected