mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
audio file reading minor improvement
This commit is contained in:
@@ -145,15 +145,17 @@ class MusicContainer(
|
||||
|
||||
var start = bytesRead
|
||||
|
||||
val fullbuf = ByteArray(totalSizeInBytes.toInt())
|
||||
// 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))
|
||||
reset()
|
||||
|
||||
System.arraycopy(fullbuf, 0, buffer, start, fullbuf.size)
|
||||
|
||||
start += totalSizeInBytes.toInt()
|
||||
for (i in 0 until fullCopyCounts) {
|
||||
System.arraycopy(fullbuf, 0, buffer, start, fullbuf.size)
|
||||
start += totalSizeInBytes.toInt()
|
||||
}
|
||||
}
|
||||
|
||||
// copy the remainders from the start of the samples
|
||||
|
||||
Reference in New Issue
Block a user