Follow-up to #209: minor consistency changes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2016-12-09 23:15:47 -05:00
parent 8186236556
commit e6ca847d17

View File

@ -466,16 +466,16 @@ public class Game extends BasicGameState {
// letterbox effect (black bars on top/bottom) // letterbox effect (black bars on top/bottom)
if (beatmap.letterboxInBreaks && breakLength >= 4000) { if (beatmap.letterboxInBreaks && breakLength >= 4000) {
// let it fade in/out // let it fade in/out
float a = Color.black.a; float a = Colors.BLACK_ALPHA.a;
if (trackPosition - breakTime > breakLength / 2) { if (trackPosition - breakTime > breakLength / 2) {
Color.black.a = (Math.min(500f, breakTime + breakLength - trackPosition)) / 500f; Colors.BLACK_ALPHA.a = (Math.min(500f, breakTime + breakLength - trackPosition)) / 500f;
} else { } else {
Color.black.a = Math.min(500, trackPosition - breakTime) / 500f; Colors.BLACK_ALPHA.a = Math.min(500, trackPosition - breakTime) / 500f;
} }
g.setColor(Color.black); g.setColor(Colors.BLACK_ALPHA);
Color.black.a = a;
g.fillRect(0, 0, width, height * 0.125f); g.fillRect(0, 0, width, height * 0.125f);
g.fillRect(0, height * 0.875f, width, height * 0.125f); g.fillRect(0, height * 0.875f, width, height * 0.125f);
Colors.BLACK_ALPHA.a = a;
} }
data.drawGameElements(g, true, objectIndex == 0); data.drawGameElements(g, true, objectIndex == 0);
@ -873,7 +873,8 @@ public class Game extends BasicGameState {
if (beatmap.breaks != null && breakIndex < beatmap.breaks.size()) { if (beatmap.breaks != null && breakIndex < beatmap.breaks.size()) {
int breakValue = beatmap.breaks.get(breakIndex); int breakValue = beatmap.breaks.get(breakIndex);
if (breakTime > 0) { // in a break period if (breakTime > 0) { // in a break period
if (trackPosition < breakValue && trackPosition < beatmap.objects[objectIndex].getTime() - approachTime) if (trackPosition < breakValue &&
trackPosition < beatmap.objects[objectIndex].getTime() - approachTime)
return; return;
else { else {
// break is over // break is over