mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-25 01:31:22 +01:00
Tentative fix for flickering with some custom animated textures
This commit is contained in:
parent
a847e247e5
commit
6e8247ae3a
@ -44,8 +44,10 @@ export class TextureAnimation {
|
||||
this.frameImages = height / width;
|
||||
this.uniforms.animationFrameHeight.value = 1 / this.frameImages;
|
||||
this.frames = this.frameImages;
|
||||
if (this.data.frames) {
|
||||
if (this.data.frames && this.data.frames.length > 0) {
|
||||
this.frames = this.data.frames.length;
|
||||
} else {
|
||||
this.data.frames = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public AnimationMeta read(JsonReader in, Gson gson) throws IOException {
|
||||
}
|
||||
|
||||
private void readFramesList(JsonReader in, AnimationMeta animationMeta) throws IOException {
|
||||
animationMeta.frames = new ArrayList<>();
|
||||
List<FrameMeta> frames = new ArrayList<>();
|
||||
|
||||
in.beginArray();
|
||||
while (in.hasNext()) {
|
||||
@ -122,9 +122,12 @@ private void readFramesList(JsonReader in, AnimationMeta animationMeta) throws I
|
||||
in.endObject();
|
||||
}
|
||||
|
||||
animationMeta.frames.add(new FrameMeta(index, time));
|
||||
frames.add(new FrameMeta(index, time));
|
||||
}
|
||||
in.endArray();
|
||||
|
||||
if (!frames.isEmpty())
|
||||
animationMeta.frames = frames;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user