Skip to content

Commit

Permalink
Merge pull request #155 from Feodor0090/break-anim-again
Browse files Browse the repository at this point in the history
Fix break animation
  • Loading branch information
Feodor0090 authored Jun 18, 2023
2 parents 93f6e51 + 13b60b8 commit 4e970d3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/nmania/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -787,15 +787,17 @@ public final void Loop() {
} else if (timeleft < 500) {
// fading playfield in (break will end soon)
int fade = scrH * (500 - timeleft) / 500;
g.setClip(0, 0, scrW, fade);
FillBg();
g.setClip(0, 0, scrW, fade); // clip for stage
RedrawAllHUD();
DrawBorders();
for (int i = 0; i < columnsCount; i++) {
DrawKey(i, false);
}
Redraw(true);
RedrawAllHUD();
g.setClip(0, 0, scrW, scrH);
g.setClip(0, 0, scrW, Math.min(kbY, fade)); // clip for notes
RedrawNotes();
g.setClip(0, 0, scrW, scrH); // clip reset
flushGraphics();
} else {
// idle (break is in progress)
g.setClip(0, 0, scrW, scrH);
Expand Down Expand Up @@ -1274,7 +1276,9 @@ private final void Refill() {
}

/**
* Method to redraw hot areas. Called by update loop.
* Method to redraw hot areas. Called by update loop. Performs flush.
*
* @param flushAll True to force fullscreen.
*/
private final void Redraw(boolean flushAll) {
g.setClip(0, 0, scrW, kbY);
Expand Down

0 comments on commit 4e970d3

Please sign in to comment.