Merge pull request #212 from mad-s/master

Fix falling sliders with new slider style.
This commit is contained in:
Jeffrey Han 2016-12-14 12:55:58 -05:00 committed by GitHub
commit db73fc9e14
2 changed files with 2 additions and 9 deletions

View File

@ -456,7 +456,6 @@ public class CurveRenderState {
GL20.glUseProgram(staticState.program);
GL20.glEnableVertexAttribArray(staticState.attribLoc);
GL20.glEnableVertexAttribArray(staticState.texCoordLoc);
GL20.glUniform2f(staticState.invSSLoc, 2.f/containerWidth, -2.f/containerHeight);
GL20.glUniform1i(staticState.texLoc, 0);
GL20.glUniform4f(staticState.colLoc, color.r, color.g, color.b, color.a);
GL20.glUniform4f(staticState.colBorderLoc, borderColor.r, borderColor.g, borderColor.b, borderColor.a);
@ -501,9 +500,6 @@ public class CurveRenderState {
/** OpenGL shader attribute location of the texture coordinate attribute. */
protected int texCoordLoc = 0;
/** OpenGL shader uniform location of the inverse screen size attribute. */
protected int invSSLoc = 0;
/** OpenGL shader uniform location of the color attribute. */
protected int colLoc = 0;
@ -556,7 +552,6 @@ public class CurveRenderState {
int vtxShdr = GL20.glCreateShader(GL20.GL_VERTEX_SHADER);
int frgShdr = GL20.glCreateShader(GL20.GL_FRAGMENT_SHADER);
GL20.glShaderSource(vtxShdr, "#version 110\n"
+ "uniform vec2 inv_screensize;\n"
+ "\n"
+ "attribute vec4 in_position;\n"
+ "attribute vec2 in_tex_coord;\n"
@ -564,7 +559,7 @@ public class CurveRenderState {
+ "varying vec2 tex_coord;\n"
+ "void main()\n"
+ "{\n"
+ " gl_Position = vec4(vec2(-1.0,1.0)+inv_screensize*in_position.xy,in_position.zw);\n"
+ " gl_Position = gl_ModelViewProjectionMatrix * in_position;\n"
+ " tex_coord = in_tex_coord;\n"
+ "}");
GL20.glCompileShader(vtxShdr);
@ -607,7 +602,6 @@ public class CurveRenderState {
GL20.glDeleteShader(frgShdr);
attribLoc = GL20.glGetAttribLocation(program, "in_position");
texCoordLoc = GL20.glGetAttribLocation(program, "in_tex_coord");
invSSLoc = GL20.glGetUniformLocation(program, "inv_screensize");
texLoc = GL20.glGetUniformLocation(program, "tex");
colLoc = GL20.glGetUniformLocation(program, "col_tint");
colBorderLoc = GL20.glGetUniformLocation(program, "col_border");
@ -628,7 +622,6 @@ public class CurveRenderState {
program = 0;
attribLoc = 0;
texCoordLoc = 0;
invSSLoc = 0;
colLoc = 0;
colBorderLoc = 0;
texLoc = 0;

View File

@ -1507,7 +1507,7 @@ public class Game extends BasicGameState {
// translate and rotate the object
g.translate(0, dt * dt * container.getHeight());
Vec2f rotationCenter = gameObj.getPointAt(beatmap.objects[idx].getTime());
Vec2f rotationCenter = gameObj.getPointAt((beatmap.objects[idx].getTime() + beatmap.objects[idx].getEndTime()) / 2);
g.rotate(rotationCenter.x, rotationCenter.y, rotSpeed * dt);
gameObj.draw(g, trackPosition);