MCPcopy Create free account
hub / github.com/Card-Forge/forge / render

Method render

forge-gui-mobile/src/forge/Forge.java:876–996  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

874 }
875
876 @Override
877 public void render() {
878 if (showFPS)
879 frameRate.update(ImageCache.getInstance().counter, getAssets().manager().getMemoryInMegabytes());
880
881 try {
882 ImageCache.getInstance().allowSingleLoad();
883 ForgeAnimation.advanceAll();
884
885 Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // Clear the screen.
886 //set delta for rotation
887 deltaTime += Gdx.graphics.getDeltaTime();
888 if (deltaTime > 22.5f)
889 deltaTime = 0f;
890 hueFragTime += Gdx.graphics.getDeltaTime();
891 if (hueFragTime > 6.29f)
892 hueFragTime = 0f;
893
894 FContainer screen = currentScreen;
895
896 if (closingScreen != null) {
897 screen = closingScreen;
898 } else if (transitionScreen != null) {
899 screen = transitionScreen;
900 } else if (screen == null) {
901 screen = splashScreen;
902 if (screen == null) {
903 if (isMobileAdventureMode) {
904 try {
905 float delta = Gdx.graphics.getDeltaTime();
906 float transitionTime = 0.12f;
907 if (sceneWasSwapped) {
908 sceneWasSwapped = false;
909 animationTimeout = transitionTime;
910 Gdx.gl.glClearColor(0, 0, 0, 1);
911 Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
912 return;
913 }
914 if (animationTimeout >= 0) {
915 Gdx.gl.glClearColor(0, 0, 0, 1);
916 Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
917 animationBatch.begin();
918 animationTimeout -= delta;
919 animationBatch.setColor(1, 1, 1, 1);
920 animationBatch.draw(lastScreenTexture, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
921 animationBatch.setColor(1, 1, 1, 1 - (1 / transitionTime) * animationTimeout);
922 animationBatch.draw(getAssets().fallback_skins().get("transition"), 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
923 animationBatch.end();
924 if (animationTimeout < 0) {
925 currentScene.render();
926 storeScreen();
927 Gdx.gl.glClearColor(0, 0, 0, 1);
928 Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
929 } else {
930 return;
931 }
932 }
933 if (animationTimeout >= -transitionTime) {

Callers 1

writeMethod · 0.45

Calls 15

getInstanceMethod · 0.95
getAssetsMethod · 0.95
advanceAllMethod · 0.95
storeScreenMethod · 0.95
drawMethod · 0.95
getOverlaysMethod · 0.95
isSentryEnabledMethod · 0.95
reportExceptionMethod · 0.95
getMemoryInMegabytesMethod · 0.80
managerMethod · 0.80
allowSingleLoadMethod · 0.80
fallback_skinsMethod · 0.80

Tested by

no test coverage detected