mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-10 05:01:50 +09:00
better crt shader
This commit is contained in:
@@ -267,6 +267,7 @@ class AudioAdapter(val vm: VM) : PeriBase(VM.PERITYPE_SOUND) {
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
System.err.println("Dispose AudioAdapter")
|
||||
renderRunnables.forEach { it.stop() }
|
||||
writeQueueingRunnables.forEach { it.stop() }
|
||||
playheads.forEach { it.dispose() }
|
||||
@@ -430,8 +431,9 @@ class AudioAdapter(val vm: VM) : PeriBase(VM.PERITYPE_SOUND) {
|
||||
fun getPcmQueueCapacity() = QUEUE_SIZE[pcmQueueSizeIndex]
|
||||
|
||||
fun dispose() {
|
||||
println("AudioDevice dispose ${parent.renderThreads[index]}")
|
||||
try { audioDevice.dispose() } catch (e: GdxRuntimeException) { println(" "+ e.message) }
|
||||
// audioDevice.dispose() is called by RenderRunnable.stop()
|
||||
// System.err.println("AudioDevice dispose ${parent.renderThreads[index]}")
|
||||
// try { audioDevice.dispose() } catch (e: GdxRuntimeException) { println(" "+ e.message) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.torvald.terrarum.modulecomputers.virtualcomputer.tvd.toUint
|
||||
import org.lwjgl.BufferUtils
|
||||
import org.lwjgl.openal.AL10
|
||||
import org.lwjgl.openal.AL11
|
||||
import java.lang.reflect.InvocationTargetException
|
||||
import java.nio.Buffer
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.IntBuffer
|
||||
@@ -118,9 +119,12 @@ class OpenALBufferedAudioDevice(
|
||||
return obtainSourceMethod.invoke(audio, isMusic) as Int
|
||||
}
|
||||
private fun audioFreeSource(sourceID: Int) {
|
||||
val freeSourceMethod = OpenALLwjgl3Audio::class.java.getDeclaredMethod("freeSource", java.lang.Integer.TYPE)
|
||||
freeSourceMethod.isAccessible = true
|
||||
freeSourceMethod.invoke(audio, sourceID)
|
||||
try {
|
||||
val freeSourceMethod = OpenALLwjgl3Audio::class.java.getDeclaredMethod("freeSource", java.lang.Integer.TYPE)
|
||||
freeSourceMethod.isAccessible = true
|
||||
freeSourceMethod.invoke(audio, sourceID)
|
||||
}
|
||||
catch (_: InvocationTargetException) {}
|
||||
}
|
||||
|
||||
private val alErrors = hashMapOf(
|
||||
|
||||
Reference in New Issue
Block a user