Reduce duplication in orx build scripts. (#240)

Co-authored-by: hamoid <abe@hamoid.com>
This commit is contained in:
Vechro
2022-06-19 09:06:16 +03:00
committed by GitHub
parent 88719292e9
commit 9f7a4899fa
74 changed files with 646 additions and 812 deletions

View File

@@ -9,9 +9,9 @@ sourceSets {
}
dependencies {
demoImplementation("org.openrndr:openrndr-application:$openrndrVersion")
demoImplementation("org.openrndr:openrndr-extensions:$openrndrVersion")
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
demoImplementation(libs.openrndr.application)
demoImplementation(libs.openrndr.extensions)
demoRuntimeOnly(libs.openrndr.gl3)
demoRuntimeOnly(libs.openrndr.gl3.natives)
demoImplementation(sourceSets.getByName("main").output)
}

View File

@@ -1,9 +1,6 @@
package org.openrndr.extra.kdtree
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.*
import org.openrndr.math.*
import java.util.*
import kotlin.IllegalStateException
@@ -99,6 +96,7 @@ private fun <T> insertItem(root: KDTreeNode<T>, item: T): KDTreeNode<T> {
}
@OptIn(DelicateCoroutinesApi::class)
fun <T> buildKDTree(items: MutableList<T>, dimensions: Int, mapper: (T, Int) -> Double): KDTreeNode<T> {
val root = KDTreeNode<T>(dimensions, mapper)