Skip to content

Commit

Permalink
Merge pull request #205 from mad-s/master
Browse files Browse the repository at this point in the history
Improve slider rendering.
  • Loading branch information
itdelatrisu authored Dec 6, 2016
2 parents 79bfa1c + 041014a commit 0b9a0e1
Show file tree
Hide file tree
Showing 3 changed files with 297 additions and 172 deletions.
4 changes: 2 additions & 2 deletions src/itdelatrisu/opsu/GameData.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public void clear() {
if (hitResultList != null) {
for (HitObjectResult hitResult : hitResultList) {
if (hitResult.curve != null)
hitResult.curve.discardCache();
hitResult.curve.discardGeometry();
}
}
hitResultList = new LinkedBlockingDeque<HitObjectResult>();
Expand Down Expand Up @@ -943,7 +943,7 @@ else if (Options.isHitLightingEnabled() && !hitResult.hideResult && hitResult.re
hitResult.alpha = 1 - ((float) (trackPosition - hitResult.time) / HITRESULT_FADE_TIME);
} else {
if (hitResult.curve != null)
hitResult.curve.discardCache();
hitResult.curve.discardGeometry();
iter.remove();
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/itdelatrisu/opsu/objects/curves/Curve.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ public static void init(int width, int height, float circleDiameter, Color borde
Curve.borderColor = borderColor;

ContextCapabilities capabilities = GLContext.getCapabilities();
mmsliderSupported = capabilities.GL_EXT_framebuffer_object;
mmsliderSupported = capabilities.OpenGL20;
if (mmsliderSupported)
CurveRenderState.init(width, height, circleDiameter);
else {
if (Options.getSkin().getSliderStyle() != Skin.STYLE_PEPPYSLIDER)
Log.warn("New slider style requires FBO support.");
Log.warn("New slider style requires OpenGL 2.0.");
}
}

Expand Down Expand Up @@ -172,8 +172,8 @@ public void draw(Color color, float t) {
/**
* Discards the slider cache (only used for mmsliders).
*/
public void discardCache() {
public void discardGeometry() {
if (renderState != null)
renderState.discardCache();
renderState.discardGeometry();
}
}
Loading

0 comments on commit 0b9a0e1

Please sign in to comment.