Skip to content

Commit 587f42b

Browse files
committed
fix more bugs
1 parent fd21343 commit 587f42b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/kotlin/solve/rendering/engine/rendering/renderers/FramesRenderer.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,13 @@ class FramesRenderer(
158158
private fun reinitializeBuffers() {
159159
bufferFramesArrayTexture?.delete()
160160
initializeTexturesBuffers(frames)
161-
uploadAllFramesToBuffer()
162161
needToReinitializeBuffers = false
163162
}
164163

165164
private fun uploadLoadedFramesToBuffers() {
166165
bufferFramesToUpload.toList().forEach { frame ->
167166
bufferFramesToUpload.remove(frame)
168167
bufferFramesArrayTexture?.uploadTexture(frame.textureData, frame.bufferIndex)
169-
println("Loading: index - ${frame.bufferIndex}")
170168
Texture2D.freeData(frame.textureData)
171169
}
172170
}
@@ -218,7 +216,11 @@ class FramesRenderer(
218216
}
219217

220218
private fun getFramesAtRect(rect: IntRect): List<List<VisualizationFrame>> {
219+
if (selectedFrames.isEmpty())
220+
return emptyList()
221+
221222
val framesRect = mutableListOf<List<VisualizationFrame>>()
223+
222224
for (y in rect.y0 until rect.y0 + rect.height) {
223225
val framesFromIndex = (gridWidth * y + rect.x0).coerceIn(0..selectedFrames.lastIndex)
224226
val framesToIndex = (framesFromIndex + rect.width).coerceIn(0..selectedFrames.count())
@@ -277,7 +279,6 @@ class FramesRenderer(
277279

278280
private fun uploadFrameToBuffersArray(frame: VisualizationFrame, index: Int) {
279281
val loadTime = Date().time
280-
println("Uploading: ${frame.imagePath.fileName}, index - $index")
281282
framesLoadingCoroutineScope.launch {
282283
val textureData = Texture2D.loadData(frame.imagePath.toString())
283284
if (textureData == null) {
@@ -286,7 +287,6 @@ class FramesRenderer(
286287
}
287288

288289
bufferFramesToUpload.add(LoadedBufferFrameData(textureData, index, loadTime))
289-
println("Added: ${frame.imagePath.fileName}, index - $index")
290290
}
291291
}
292292

0 commit comments

Comments
 (0)