MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / updateScene

Method updateScene

src/main/java/fieldbox/ui/Compositor.java:37–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 }
36
37 public void updateScene() {
38 fadeup = fading++ < 50 && Main.os!=Main.OS.mac;
39
40 if (GraphicsContext.isResizing) {
41 for (Layer l : layers.values()) {
42 if (l.fbo.specification.width * l.res != window.getWidth()*window.getRetinaScaleFactor() || l.fbo.specification.height * l.res != window.getHeight()*window.getRetinaScaleFactor()) {
43 l.fbo.finalize();
44 Scene sceneWas = l.fbo.scene;
45 l.fbo = newFBO(l.fbo.specification.unit, l.res);
46 l.fbo.setScene(sceneWas);
47 resizing = true;
48 Log.log("graphics.debug", () -> " scene was :" + sceneWas);
49 }
50 }
51 }
52
53 for (Layer l : layers.values()) {
54 l.needsRedrawing = Math.max(-1, l.needsRedrawing - 1);
55 if (resizing)
56 {
57 System.out.println(" drawing (resizing) :"+l);
58 l.fbo.draw();
59 }
60 else if (l.needsRedrawing > -1 || fadeup) {
61 Log.log("drawing", () -> " drawing dependancies of " + l);
62 l.drawDependancies();
63 Log.log("drawing", () -> " drawing because dirty " + l);
64// System.out.println(" redrawing layer "+l.name+" because "+l.needsRedrawing);
65 l.fbo.draw();
66 }
67 }
68
69 if (fadeup) {
70 window.requestRepaint();
71 }
72 resizing = false;
73 }
74
75 private FBO newFBO() {
76 return newFBO(0);

Callers

nothing calls this directly

Calls 12

newFBOMethod · 0.95
logMethod · 0.95
getRetinaScaleFactorMethod · 0.80
setSceneMethod · 0.80
drawDependanciesMethod · 0.80
drawMethod · 0.65
getWidthMethod · 0.45
getHeightMethod · 0.45
finalizeMethod · 0.45
maxMethod · 0.45
printlnMethod · 0.45
requestRepaintMethod · 0.45

Tested by

no test coverage detected