Code cleanup

This commit is contained in:
Natty 2022-05-07 21:51:54 +02:00
parent c1c248be87
commit d178a303bd
No known key found for this signature in database
GPG Key ID: 40AB22FA416C7019
2 changed files with 10 additions and 5 deletions

View File

@ -87,7 +87,7 @@ abstract class AudioDoubleBufferedSource extends AudioSource
if (this.closed) if (this.closed)
return false; return false;
var state = AL10.alGetSourcei(this.id, AL10.AL_SOURCE_STATE); var state = this.getState();
return switch (state) return switch (state)
{ {
@ -147,7 +147,11 @@ abstract class AudioDoubleBufferedSource extends AudioSource
} }
return unqueued; return unqueued;
}
private int getState()
{
return AL10.alGetSourcei(this.id, AL10.AL_SOURCE_STATE);
} }
public boolean update() public boolean update()
@ -158,7 +162,9 @@ abstract class AudioDoubleBufferedSource extends AudioSource
var unqueued = this.unqueueBuffers(); var unqueued = this.unqueueBuffers();
unqueued.forEach(this::stream); unqueued.forEach(this::stream);
if (AL10.alGetSourcei(this.id, AL10.AL_SOURCE_STATE) == AL10.AL_STOPPED) var sourceState = this.getState();
if (sourceState == AL10.AL_STOPPED)
{ {
if (this.audioBufferDepleted) if (this.audioBufferDepleted)
return false; return false;

View File

@ -25,13 +25,12 @@
package org.plutoengine.graphics.fbo; package org.plutoengine.graphics.fbo;
import org.lwjgl.opengl.GL33; import org.lwjgl.opengl.GL33;
import org.plutoengine.logger.Logger;
import org.plutoengine.logger.SmartSeverity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.plutoengine.logger.Logger;
import org.plutoengine.logger.SmartSeverity;
public class Framebuffer public class Framebuffer
{ {
private int id; private int id;