mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 03:54:06 +09:00
audio file reading minor improvement
This commit is contained in:
@@ -145,15 +145,17 @@ class MusicContainer(
|
|||||||
|
|
||||||
var start = bytesRead
|
var start = bytesRead
|
||||||
|
|
||||||
val fullbuf = ByteArray(totalSizeInBytes.toInt())
|
|
||||||
// make full block copies
|
// make full block copies
|
||||||
for (i in 0 until fullCopyCounts) {
|
if (fullCopyCounts > 0) {
|
||||||
|
val fullbuf = ByteArray(totalSizeInBytes.toInt())
|
||||||
|
// only read ONCE, you silly
|
||||||
gdxMusic.forceInvoke<Int>("read", arrayOf(fullbuf))
|
gdxMusic.forceInvoke<Int>("read", arrayOf(fullbuf))
|
||||||
reset()
|
reset()
|
||||||
|
|
||||||
System.arraycopy(fullbuf, 0, buffer, start, fullbuf.size)
|
for (i in 0 until fullCopyCounts) {
|
||||||
|
System.arraycopy(fullbuf, 0, buffer, start, fullbuf.size)
|
||||||
start += totalSizeInBytes.toInt()
|
start += totalSizeInBytes.toInt()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy the remainders from the start of the samples
|
// copy the remainders from the start of the samples
|
||||||
|
|||||||
Reference in New Issue
Block a user