minor cleanup

This commit is contained in:
yugecin 2016-12-18 16:47:55 +01:00
parent 3ca2653197
commit 089ff7d0de

View File

@ -941,39 +941,45 @@ public class GameData {
hitResult.curve.draw(hitResult.color); hitResult.curve.draw(hitResult.color);
Colors.WHITE_FADE.a = oldWhiteAlpha; Colors.WHITE_FADE.a = oldWhiteAlpha;
hitResult.color.a = oldColorAlpha; hitResult.color.a = oldColorAlpha;
return;
}
if (hitResult.result == HIT_MISS) {
return;
}
if (hitResult.hitResultType != HitObjectType.CIRCLE
&& hitResult.hitResultType != HitObjectType.SLIDER_FIRST
&& hitResult.hitResultType != HitObjectType.SLIDER_LAST) {
return;
} }
// circles // circles
if (hitResult.result != HIT_MISS && ( float progress = AnimationEquation.OUT_CUBIC.calc(
hitResult.hitResultType == HitObjectType.CIRCLE || (float) Utils.clamp(trackPosition - hitResult.time, 0, HITCIRCLE_FADE_TIME) / HITCIRCLE_FADE_TIME);
hitResult.hitResultType == HitObjectType.SLIDER_FIRST || float scale = (!hitResult.expand) ? 1f : 1f + (HITCIRCLE_ANIM_SCALE - 1f) * progress;
hitResult.hitResultType == HitObjectType.SLIDER_LAST)) { float alpha = 1f - progress;
float progress = AnimationEquation.OUT_CUBIC.calc(
(float) Utils.clamp(trackPosition - hitResult.time, 0, HITCIRCLE_FADE_TIME) / HITCIRCLE_FADE_TIME);
float scale = (!hitResult.expand) ? 1f : 1f + (HITCIRCLE_ANIM_SCALE - 1f) * progress;
float alpha = 1f - progress;
if (hitResult.result == HIT_SLIDER_REPEAT) { if (hitResult.result == HIT_SLIDER_REPEAT) {
// repeats // repeats
Image scaledRepeat = GameImage.REVERSEARROW.getImage().getScaledCopy(scale); Image scaledRepeat = GameImage.REVERSEARROW.getImage().getScaledCopy(scale);
scaledRepeat.setAlpha(alpha); scaledRepeat.setAlpha(alpha);
float ang; float ang;
if (hitResult.hitResultType == HitObjectType.SLIDER_FIRST) { if (hitResult.hitResultType == HitObjectType.SLIDER_FIRST) {
ang = hitResult.curve.getStartAngle(); ang = hitResult.curve.getStartAngle();
} else { } else {
ang = hitResult.curve.getEndAngle(); ang = hitResult.curve.getEndAngle();
}
scaledRepeat.rotate(ang);
scaledRepeat.drawCentered(hitResult.x, hitResult.y, hitResult.color);
} }
// hit circles scaledRepeat.rotate(ang);
Image scaledHitCircle = GameImage.HITCIRCLE.getImage().getScaledCopy(scale); scaledRepeat.drawCentered(hitResult.x, hitResult.y, hitResult.color);
Image scaledHitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage().getScaledCopy(scale);
scaledHitCircle.setAlpha(alpha);
scaledHitCircleOverlay.setAlpha(alpha);
scaledHitCircle.drawCentered(hitResult.x, hitResult.y, hitResult.color);
scaledHitCircleOverlay.drawCentered(hitResult.x, hitResult.y);
} }
// hit circles
Image scaledHitCircle = GameImage.HITCIRCLE.getImage().getScaledCopy(scale);
Image scaledHitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage().getScaledCopy(scale);
scaledHitCircle.setAlpha(alpha);
scaledHitCircleOverlay.setAlpha(alpha);
scaledHitCircle.drawCentered(hitResult.x, hitResult.y, hitResult.color);
scaledHitCircleOverlay.drawCentered(hitResult.x, hitResult.y);
} }
/** /**