Skip to content

Commit

Permalink
Fixed level screen rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Matias Barandiaran committed Aug 7, 2024
1 parent fa4e61d commit 6478335
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion core/src/com/mygdx/Screens/LevelsScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public void handleInput() {
public void dispose() {
stage.dispose();
shapeRenderer.dispose();
levelsTexture.dispose();
}
@Override
public void show() { }
Expand Down
7 changes: 4 additions & 3 deletions core/src/com/mygdx/Screens/ScreenManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@ public void pushScreen(Constants.SCREEN_OP screenType, String flag) {
return;
}

// Dispose resources of the current screen if it exists
// Dispose resources of the previous screen if it exists
if(prevScreen != null) {
prevScreen.dispose();
}

// Dispose resources of the current screen if it exists
// Set previous screen to current
if (currScreen != null) {
prevScreen = currScreen;
}
//if the current screen is a game screen, set the level to the current screen's level

// If the current screen is a game screen, set the level to the current screen's level
if (currScreen instanceof GameScreen) level = ((GameScreen) currScreen).getLevel();

// Set the new screen
Expand Down

0 comments on commit 6478335

Please sign in to comment.