Fix falling sliders with new slider style.

This commit is contained in:
Matteo Signer 2016-12-14 15:31:41 +01:00
parent 041014ab47
commit 2ade7fa349
2 changed files with 2 additions and 9 deletions

View File

@ -475,7 +475,6 @@ public class CurveRenderState {
GL20.glUseProgram(staticState.program); GL20.glUseProgram(staticState.program);
GL20.glEnableVertexAttribArray(staticState.attribLoc); GL20.glEnableVertexAttribArray(staticState.attribLoc);
GL20.glEnableVertexAttribArray(staticState.texCoordLoc); GL20.glEnableVertexAttribArray(staticState.texCoordLoc);
GL20.glUniform2f(staticState.invSSLoc, 2.f/containerWidth, -2.f/containerHeight);
GL20.glUniform1i(staticState.texLoc, 0); GL20.glUniform1i(staticState.texLoc, 0);
GL20.glUniform4f(staticState.colLoc, color.r, color.g, color.b, color.a); GL20.glUniform4f(staticState.colLoc, color.r, color.g, color.b, color.a);
GL20.glUniform4f(staticState.colBorderLoc, borderColor.r, borderColor.g, borderColor.b, borderColor.a); GL20.glUniform4f(staticState.colBorderLoc, borderColor.r, borderColor.g, borderColor.b, borderColor.a);
@ -522,9 +521,6 @@ public class CurveRenderState {
/** OpenGL shader attribute location of the texture coordinate attribute. */ /** OpenGL shader attribute location of the texture coordinate attribute. */
protected int texCoordLoc = 0; 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. */ /** OpenGL shader uniform location of the color attribute. */
protected int colLoc = 0; protected int colLoc = 0;
@ -577,7 +573,6 @@ public class CurveRenderState {
int vtxShdr = GL20.glCreateShader(GL20.GL_VERTEX_SHADER); int vtxShdr = GL20.glCreateShader(GL20.GL_VERTEX_SHADER);
int frgShdr = GL20.glCreateShader(GL20.GL_FRAGMENT_SHADER); int frgShdr = GL20.glCreateShader(GL20.GL_FRAGMENT_SHADER);
GL20.glShaderSource(vtxShdr, "#version 110\n" GL20.glShaderSource(vtxShdr, "#version 110\n"
+ "uniform vec2 inv_screensize;\n"
+ "\n" + "\n"
+ "attribute vec4 in_position;\n" + "attribute vec4 in_position;\n"
+ "attribute vec2 in_tex_coord;\n" + "attribute vec2 in_tex_coord;\n"
@ -585,7 +580,7 @@ public class CurveRenderState {
+ "varying vec2 tex_coord;\n" + "varying vec2 tex_coord;\n"
+ "void main()\n" + "void main()\n"
+ "{\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" + " tex_coord = in_tex_coord;\n"
+ "}"); + "}");
GL20.glCompileShader(vtxShdr); GL20.glCompileShader(vtxShdr);
@ -628,7 +623,6 @@ public class CurveRenderState {
GL20.glDeleteShader(frgShdr); GL20.glDeleteShader(frgShdr);
attribLoc = GL20.glGetAttribLocation(program, "in_position"); attribLoc = GL20.glGetAttribLocation(program, "in_position");
texCoordLoc = GL20.glGetAttribLocation(program, "in_tex_coord"); texCoordLoc = GL20.glGetAttribLocation(program, "in_tex_coord");
invSSLoc = GL20.glGetUniformLocation(program, "inv_screensize");
texLoc = GL20.glGetUniformLocation(program, "tex"); texLoc = GL20.glGetUniformLocation(program, "tex");
colLoc = GL20.glGetUniformLocation(program, "col_tint"); colLoc = GL20.glGetUniformLocation(program, "col_tint");
colBorderLoc = GL20.glGetUniformLocation(program, "col_border"); colBorderLoc = GL20.glGetUniformLocation(program, "col_border");
@ -649,7 +643,6 @@ public class CurveRenderState {
program = 0; program = 0;
attribLoc = 0; attribLoc = 0;
texCoordLoc = 0; texCoordLoc = 0;
invSSLoc = 0;
colLoc = 0; colLoc = 0;
colBorderLoc = 0; colBorderLoc = 0;
texLoc = 0; texLoc = 0;

View File

@ -1498,7 +1498,7 @@ public class Game extends BasicGameState {
// translate and rotate the object // translate and rotate the object
g.translate(0, dt * dt * container.getHeight()); 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); g.rotate(rotationCenter.x, rotationCenter.y, rotSpeed * dt);
gameObj.draw(g, trackPosition); gameObj.draw(g, trackPosition);