Skip to content

Commit 6dbac90

Browse files
committed
up
1 parent e02251d commit 6dbac90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+140
-138
lines changed

build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ import java.net.URL
55

66
plugins {
77
java
8-
kotlin("jvm") version "1.4.10"
8+
kotlin("jvm") version "1.4.0"
99
`maven-publish`
1010
// id "org.jetbrains.kotlin.kapt" version "1.3.10"
11-
id("org.jetbrains.dokka") version "1.4.10"
12-
id("com.github.johnrengelman.shadow") version "6.1.0"
11+
id("org.jetbrains.dokka") version "1.4.0"
12+
id("com.github.johnrengelman.shadow") version "6.0.0"
1313
}
1414

1515
// jitpack
1616
group = "com.github.kotlin_graphics"
1717
val moduleName = "$group.assimp"
1818

19-
val kotestVersion = "4.2.5"
19+
val kotestVersion = "4.2.0"
2020
val kx = "com.github.kotlin-graphics"
2121
val unsignedVersion = "1e2fda82"
2222
val koolVersion = "b393e4c2"
@@ -52,7 +52,8 @@ dependencies {
5252
runtimeOnly("org.lwjgl", "lwjgl$it", classifier = lwjglNatives)
5353
}
5454

55-
implementation("io.github.microutils:kotlin-logging:1.7.8")
55+
// implementation("io.github.microutils:kotlin-logging:1.7.8")
56+
implementation("io.github.microutils:kotlin-logging-jvm:2.0.3")
5657
implementation("org.slf4j:slf4j-api:1.7.29")
5758

5859
testImplementation("org.slf4j:slf4j-simple:1.7.29")

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ unoVersion = d5c433de
88
lwjglVersion = 3.2.3
99
kotestVersion = 4.2.0
1010

11-
org.gradle.jvmargs=-XX:MaxMetaspaceSize=1g
11+
org.gradle.jvmargs=-XX:MaxMetaspaceSize=1g -Xmx16g -XX:MaxPermSize=16g

src/main/java/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
requires com.github.kotlin_graphics.kotlin_unsigned;
1111
requires com.github.kotlin_graphics.kool;
1212

13-
requires kotlin.logging;
13+
requires kotlin.logging.jvm;
1414

1515
exports assimp;
1616
exports assimp.format;

src/main/kotlin/assimp/format/obj/ObjFileImporter.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ class ObjFileImporter : BaseImporter() {
1818
fileExtensions = listOf("obj"))
1919

2020
/** Returns true, if file is an obj file. */
21-
override fun canRead(file: String, ioSystem: IOSystem, checkSig: Boolean): Boolean {
22-
23-
if (!checkSig) //Check File Extension
24-
return file.substring(file.lastIndexOf('.') + 1) == "obj"
25-
else //Check file Header
26-
return false
21+
override fun canRead(file: String, ioSystem: IOSystem, checkSig: Boolean): Boolean = when {
22+
//Check File Extension
23+
!checkSig -> file.substring(file.lastIndexOf('.') + 1) == "obj"
24+
//Check file Header
25+
else -> false
2726
}
2827

2928
// reference to load textures later
@@ -219,7 +218,7 @@ class ObjFileImporter : BaseImporter() {
219218
else if (pMesh.numVertices > AI_MAX_ALLOC(AiVector3D.size))
220219
throw Exception("OBJ:" + pModel.m_ModelName + " | " + pMesh.name + " --> Too many vertices, would run out of memory")
221220

222-
pMesh.vertices = MutableList(pMesh.numVertices, { AiVector3D() })
221+
pMesh.vertices = MutableList(pMesh.numVertices) { AiVector3D() }
223222

224223
// Allocate buffer for normal vectors
225224
if (pModel.m_Normals.isNotEmpty() && pObjMesh.m_hasNormals) {
@@ -232,7 +231,7 @@ class ObjFileImporter : BaseImporter() {
232231
// Allocate buffer for vertex-color vectors
233232

234233
if (pModel.m_VertexColors.isNotEmpty())
235-
pMesh.colors.add(Array(pMesh.numVertices, { AiColor4D() }).toMutableList())
234+
pMesh.colors.add(Array(pMesh.numVertices) { AiColor4D() }.toMutableList())
236235
//pMesh.colors[0] = Array(pMesh.numVertices, { AiColor4D() }).toMutableList()
237236

238237
// Allocate buffer for texture coordinates
@@ -284,7 +283,7 @@ class ObjFileImporter : BaseImporter() {
284283

285284
// Get destination face
286285
val faceIndex = outIndex;
287-
val pDestFace = pMesh.faces.getOrElse(faceIndex, { mutableListOf() })
286+
val pDestFace = pMesh.faces.getOrElse(faceIndex) { mutableListOf() }
288287

289288
val last = vertexIndex == pSourceFace.m_vertices.lastIndex
290289

src/test/kotlin/X/BCN_Epileptic.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package X
22

33
import assimp.*
4-
import io.kotlintest.specs.StringSpec
4+
import io.kotest.core.spec.style.StringSpec
55

66

77

src/test/kotlin/X/Testwuson.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package X
22

33
import assimp.*
4-
import io.kotlintest.specs.StringSpec
4+
import io.kotest.core.spec.style.StringSpec
55

66
class Testwuson : StringSpec() {
77
init {

src/test/kotlin/X/anim_test.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package X
22

33
import assimp.*
4-
import io.kotlintest.specs.StringSpec
4+
import io.kotest.core.spec.style.StringSpec
55

66
class anim_test : StringSpec() {
77

src/test/kotlin/X/helpers.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package X
33
import assimp.*
44
import gli_.Cache
55
import gli_.Texture
6-
import io.kotlintest.*
6+
import io.kotest.matchers.shouldBe
7+
import io.kotest.matchers.shouldNotBe
78

89
val x = "$models/X/"
910
val x_ass = "$models/models-assbin-db/X/"
1011

11-
fun printNodeNames(n : AiNode, done : MutableList<AiNode> = MutableList<AiNode>(0, { AiNode() })) {
12+
fun printNodeNames(n : AiNode, done : MutableList<AiNode> = mutableListOf()) {
1213
println(n.name); done.add(n)
1314
for(a in n.children){
1415
// if(a in done) {
@@ -251,7 +252,7 @@ fun compareAnimations(anim1: AiAnimation, anim2: AiAnimation) {
251252
fun compareMeshMorphAnim(a1: AiMeshMorphAnim, a2: AiMeshMorphAnim) {
252253
a1.name shouldBe a2.name
253254
a1.numKeys shouldBe a2.numKeys
254-
for(i in 0 until a1.keys.size) {
255+
for(i in a1.keys.indices) {
255256
compareMeshMorphKey(a1.keys[i], a2.keys[i])
256257
}
257258
}
@@ -265,7 +266,7 @@ fun compareMeshMorphKey(a1: AiMeshMorphKey, a2: AiMeshMorphKey) {
265266

266267
fun compareIntArray(v1: IntArray, v2: IntArray) {
267268
v1.size shouldBe v2.size
268-
for(i in 0 until v1.size) {
269+
for(i in v1.indices) {
269270
v1[i] shouldBe v2[i]
270271
}
271272
}

src/test/kotlin/X/implementation_test.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package X
22

33
import assimp.format.X.Pointer
44
import assimp.format.X.XFileParser
5-
import io.kotlintest.specs.StringSpec
5+
import io.kotest.core.spec.style.StringSpec
66
import assimp.format.X.fast_atoreal_move
7-
import io.kotlintest.shouldBe
7+
import io.kotest.matchers.shouldBe
88

99
class implementation_test : StringSpec() {
1010

src/test/kotlin/X/kwxport_test_cubewithvcolors.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package X
22

33
import assimp.*
4-
import io.kotlintest.specs.StringSpec
4+
import io.kotest.core.spec.style.StringSpec
55

66
class kwxport_test_cubewithvcolors : StringSpec() {
77
init {

0 commit comments

Comments
 (0)