rendering: fix texture animations

This commit is contained in:
Bixilon 2021-04-01 21:45:34 +02:00
parent d9bdd66fd1
commit 046c9b3b4b
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
4 changed files with 10 additions and 15 deletions

View File

@ -223,7 +223,7 @@ class RenderWindow(
// Make the OpenGL context current
glfwMakeContextCurrent(windowId)
// Enable v-sync
glfwSwapInterval(0)
glfwSwapInterval(1)
// Make the window visible

View File

@ -372,8 +372,8 @@ class WorldRenderer(
return divided
}
}
}
private operator fun Int.plus(upOrDown: Directions): Int {
return this + upOrDown.directionVector.y.toInt()
return this + upOrDown.directionVector.y
}
}

View File

@ -10,14 +10,9 @@
*
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
*/
package de.bixilon.minosoft.gui.rendering.exceptions
package de.bixilon.minosoft.gui.rendering.exceptions;
public class ShaderLoadingException extends Exception {
public ShaderLoadingException() {
}
public ShaderLoadingException(String message) {
super(message);
}
class ShaderLoadingException : Exception {
constructor()
constructor(message: String) : super(message)
}

View File

@ -208,8 +208,8 @@ class TextureArray(val allTextures: MutableList<Texture>) {
val arrayOffset = textureAnimation.animationProperties.animationId * INTS_PER_ANIMATED_TEXTURE
animatedData[arrayOffset] = baseAnimatedData or currentFrame.index
animatedData[arrayOffset + 1] = baseAnimatedData or nextFrame.index
animatedData[arrayOffset] = baseAnimatedData + currentFrame.index
animatedData[arrayOffset + 1] = baseAnimatedData + nextFrame.index
animatedData[arrayOffset + 2] = interpolation.toInt()
}