mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 10:25:06 -04:00
rendering: fix loading of newer versions
This commit is contained in:
parent
6414ba4462
commit
8b2705a1f5
@ -169,7 +169,6 @@ class MinecraftAssetsManager(
|
||||
return ret.toMap()
|
||||
}
|
||||
|
||||
|
||||
override fun getAssetSize(hash: String): Long {
|
||||
val file = File(FileAssetsManager.getAssetDiskPath(hash))
|
||||
return if (file.exists()) {
|
||||
@ -179,7 +178,6 @@ class MinecraftAssetsManager(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun getAssetSize(resourceLocation: ResourceLocation): Long {
|
||||
return getAssetSize(getAssetHash(resourceLocation))
|
||||
}
|
||||
|
@ -24,20 +24,17 @@ data class HUDAtlasElement(
|
||||
val binding: Vec2Binding,
|
||||
val slots: Map<Int, Vec2Binding> = mapOf(),
|
||||
) : TextureLike {
|
||||
private var _uvStart = Vec2()
|
||||
private var _uvEnd = Vec2()
|
||||
|
||||
override val uvStart: Vec2
|
||||
get() = _uvStart
|
||||
override val uvEnd: Vec2
|
||||
get() = _uvEnd
|
||||
override var uvStart: Vec2 = Vec2()
|
||||
private set
|
||||
override var uvEnd: Vec2 = Vec2()
|
||||
private set
|
||||
override val size: Vec2i
|
||||
get() = binding.size
|
||||
|
||||
|
||||
fun postInit() {
|
||||
_uvStart = Vec2(binding.start) * texture.arraySinglePixelSize
|
||||
_uvEnd = (Vec2(binding.end) - Vec2(0, 1)) * texture.arraySinglePixelSize
|
||||
uvStart = Vec2(binding.start) * texture.arraySinglePixelSize
|
||||
uvEnd = (Vec2(binding.end) - Vec2(0, 1)) * texture.arraySinglePixelSize
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -90,7 +90,15 @@ class Texture(
|
||||
|
||||
companion object {
|
||||
fun getResourceTextureIdentifier(namespace: String = ProtocolDefinition.DEFAULT_NAMESPACE, textureName: String): ResourceLocation {
|
||||
var namespace = namespace
|
||||
var texturePath = textureName
|
||||
|
||||
if (texturePath.contains(":")) {
|
||||
val split = texturePath.split(":")
|
||||
namespace = split[0]
|
||||
texturePath = split[1]
|
||||
}
|
||||
|
||||
texturePath = texturePath.removePrefix("/")
|
||||
|
||||
if (!texturePath.startsWith("textures/")) {
|
||||
|
@ -161,7 +161,7 @@ class TextureArray(val allTextures: MutableList<Texture>) {
|
||||
private set
|
||||
|
||||
fun initBuffer() {
|
||||
animatedData = IntArray(32 * INTS_PER_ANIMATED_TEXTURE) // 4 data ints per entry
|
||||
animatedData = IntArray(128 * INTS_PER_ANIMATED_TEXTURE) // 4 data ints per entry
|
||||
|
||||
|
||||
animatedBufferDataId = glGenBuffers()
|
||||
|
@ -33,7 +33,7 @@ uniform mat4 viewProjectionMatrix;
|
||||
|
||||
layout(std140) uniform AnimatedDataBuffer
|
||||
{
|
||||
uvec4 globalAnimationData[32];// ToDo: WTF. Why 4 values??
|
||||
uvec4 globalAnimationData[128];// ToDo: WTF. Why 4 values??
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user