gpu plugin: fix camera effects used for drunkeness and fishing trawler

Yaw and pitch for these effects is only altered during scene drawing, so we need to cache those values at that point.
This commit is contained in:
trimbe
2019-08-01 10:36:29 -04:00
parent 203251778f
commit f3319df4a1

View File

@@ -207,6 +207,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
private int centerX;
private int centerY;
private int yaw;
private int pitch;
// Uniforms
private int uniUseFog;
@@ -719,6 +721,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
{
centerX = client.getCenterX();
centerY = client.getCenterY();
yaw = client.getCameraYaw();
pitch = client.getCameraPitch();
final Scene scene = client.getScene();
final int drawDistance = Math.max(0, Math.min(MAX_DISTANCE, config.drawDistance()));
@@ -911,8 +915,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
gl.glBindBuffer(gl.GL_UNIFORM_BUFFER, uniformBufferId);
uniformBuffer.clear();
uniformBuffer
.put(client.getCameraYaw())
.put(client.getCameraPitch())
.put(yaw)
.put(pitch)
.put(centerX)
.put(centerY)
.put(client.getScale())