Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-sts committed Mar 9, 2024
1 parent 722a17d commit 19420fb
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import solve.scene.controller.SceneController
import solve.scene.model.VisualizationFrame
import solve.utils.ceilToInt
import java.util.Collections.synchronizedList
import java.util.Date
import kotlin.math.abs
import kotlin.math.min

Expand All @@ -36,8 +35,7 @@ class FramesRenderer(
) : Renderer(window) {
private data class LoadedBufferFrameData(
val textureData: Texture2DData,
val bufferIndex: Int,
val time: Long
val bufferIndex: Int
)

override val maxBatchSize = 1000
Expand Down Expand Up @@ -167,7 +165,7 @@ class FramesRenderer(
}

private fun uploadLoadedFramesToBuffers() {
bufferFramesToUpload.toList().forEach { frame ->
bufferFramesToUpload.forEach { frame ->
synchronized(bufferFramesToUpload) {
bufferFramesToUpload.remove(frame)
}
Expand Down Expand Up @@ -288,7 +286,6 @@ class FramesRenderer(
}

private fun uploadFrameToBuffersArray(frame: VisualizationFrame, index: Int) {
val loadTime = Date().time
framesLoadingCoroutineScope.launch {
val textureData = Texture2D.loadData(frame.imagePath.toString())
if (textureData == null) {
Expand All @@ -297,7 +294,7 @@ class FramesRenderer(
}

synchronized(bufferFramesToUpload) {
bufferFramesToUpload.add(LoadedBufferFrameData(textureData, index, loadTime))
bufferFramesToUpload.add(LoadedBufferFrameData(textureData, index))
}
}
}
Expand Down

0 comments on commit 19420fb

Please sign in to comment.