mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 22:16:01 +00:00
Public Release
This commit is contained in:
1 parent
666398e480
commit
61bb497a22
126 files changed
+8435
-1240
No files matched your search
@@ -3,6 +3,8 @@ package com.moulberry.flashback.exporting;
|
||||
import com.mojang.blaze3d.platform.NativeImage;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -37,7 +39,9 @@ public class SaveableFramebufferQueue implements AutoCloseable {
|
||||
this.waiting.add(texture);
|
||||
}
|
||||
|
||||
public @Nullable NativeImage finishDownload(boolean drain) {
|
||||
record DownloadedFrame(NativeImage image, @Nullable FloatBuffer audioBuffer) {}
|
||||
|
||||
public @Nullable DownloadedFrame finishDownload(boolean drain) {
|
||||
if (this.waiting.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@@ -47,9 +51,13 @@ public class SaveableFramebufferQueue implements AutoCloseable {
|
||||
}
|
||||
|
||||
SaveableFramebuffer texture = this.waiting.removeFirst();
|
||||
|
||||
NativeImage nativeImage = texture.finishDownload(this.width, this.height);
|
||||
FloatBuffer audioBuffer = texture.audioBuffer;
|
||||
texture.audioBuffer = null;
|
||||
|
||||
this.available.add(texture);
|
||||
return nativeImage;
|
||||
return new DownloadedFrame(nativeImage, audioBuffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user