Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Bump to Kotlin 1.7.0-RC2 (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz-invideo authored Jun 1, 2022
1 parent b74cd58 commit 61d5d25
Show file tree
Hide file tree
Showing 21 changed files with 413 additions and 388 deletions.
14 changes: 9 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,15 @@ samples {
project.tasks {
afterEvaluate {
for (kind in listOf("Debug", "Release")) {
val linkExecutableMacosArm64 = project.tasks.findByName("link${kind}ExecutableMacosArm64") as org.jetbrains.kotlin.gradle.tasks.KotlinNativeLink
val runExecutableMacosArm64 = project.tasks.create("run${kind}ExecutableMacosArm64", Exec::class) {
dependsOn(linkExecutableMacosArm64)
group = "run"
commandLine(linkExecutableMacosArm64.binary.outputFile)
val linkTaskName = "link${kind}ExecutableMacosArm64"
val runTaskName = "run${kind}ExecutableMacosArm64"
val linkExecutableMacosArm64 = project.tasks.findByName(linkTaskName) as org.jetbrains.kotlin.gradle.tasks.KotlinNativeLink
if (project.tasks.findByName(runTaskName) == null) {
val runExecutableMacosArm64 = project.tasks.create(runTaskName, Exec::class) {
dependsOn(linkExecutableMacosArm64)
group = "run"
commandLine(linkExecutableMacosArm64.binary.outputFile)
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
jna = "5.11.0"
jcodec = "0.2.5"
proguard-gradle = "6.2.2" # 7.2.0-beta2
kotlin = "1.6.21"
#kotlin = "1.6.21"
kotlin = "1.7.0-RC2"
kotlinx-coroutines = "1.6.1"
kotlinx-serialization = "1.3.2"
node = "16.9.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ internal class PositionSolverManifold {
normal.x *= -1f
normal.y *= -1f
}

else -> {
}
}
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ class BinaryDataParser(pool: BaseObjectPool = BaseObjectPool()) : ObjectDataPa
TimelineType.AnimationParameter -> {
this._animation?.addAnimationTimeline(timelineName, timeline)
}

else -> Unit
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ suspend fun ktreeEditorKorge(
}
}
}
else -> Unit
}
}
up { e ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ class Animation(
val r = bone.data.rotation - bone.rotation
bone.rotation += (r - (16384 - (16384.499999999996 - r / 360).toInt()) * 360) * alpha
}
else -> Unit
}
return
}
Expand Down Expand Up @@ -432,6 +433,7 @@ class Animation(
bone.x += (bone.data.x - bone.x) * alpha
bone.y += (bone.data.y - bone.y) * alpha
}
else -> Unit
}
return
}
Expand Down Expand Up @@ -502,6 +504,7 @@ class Animation(
bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha
bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha
}
else -> Unit
}
return
}
Expand Down Expand Up @@ -605,6 +608,7 @@ class Animation(
bone.shearX += (bone.data.shearX - bone.shearX) * alpha
bone.shearY += (bone.data.shearY - bone.shearY) * alpha
}
else -> Unit
}
return
}
Expand Down Expand Up @@ -692,6 +696,7 @@ class Animation(
color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha,
(setup.a - color.a) * alpha)
}
else -> Unit
}
return
}
Expand Down Expand Up @@ -803,6 +808,7 @@ class Animation(
(setupLight.a - light.a) * alpha)
dark!!.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0f)
}
else -> Unit
}
return
}
Expand Down Expand Up @@ -1014,6 +1020,7 @@ class Animation(
deform[i] *= alpha
}
}
else -> Unit
}
return
}
Expand Down Expand Up @@ -1332,6 +1339,7 @@ class Animation(
constraint.compress = constraint.data.compress
constraint.stretch = constraint.data.stretch
}
else -> Unit
}
return
}
Expand Down Expand Up @@ -1462,6 +1470,7 @@ class Animation(
constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha
constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha
}
else -> Unit
}
return
}
Expand Down Expand Up @@ -1562,6 +1571,7 @@ class Animation(
return
}
first -> constraint.position += (constraint.data.position - constraint.position) * alpha
else -> Unit
}
return
}
Expand Down Expand Up @@ -1613,6 +1623,7 @@ class Animation(
return
}
first -> constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha
else -> Unit
}
return
}
Expand Down Expand Up @@ -1687,6 +1698,7 @@ class Animation(
constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha
constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha
}
else -> Unit
}
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class IkConstraint : Updatable {
tx = targetX - bone.worldX
ty = targetY - bone.worldY
}
else -> Unit
}
val b = bone.data.length * sx
val dd = kotlin.math.sqrt((tx * tx + ty * ty).toDouble()).toFloat()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ private fun <T : View> T.onMouseDragInternal(
MouseDragState.END -> {
dragging = false
}
else -> Unit
}
cx = mousePos.x
cy = mousePos.y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ class MouseEvents(override val view: View) : MouseComponent, Extra by Extra.Mixi
//MouseEvent.Type.CLICK -> this.lastEventClick = event
//MouseEvent.Type.ENTER -> this.lastEventEnter = event
//MouseEvent.Type.EXIT -> this.lastEventExit = event
else -> Unit
}
}

Expand Down
1 change: 1 addition & 0 deletions korgw/src/commonMain/kotlin/com/soywiz/korag/AG.kt
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,7 @@ abstract class AG(val checked: Boolean = false) : AGFeatures, Extra by Extra.Mix
}
}
}
else -> Unit
}
}
//println("useExternalSampler=$useExternalSampler")
Expand Down
3 changes: 2 additions & 1 deletion korgw/src/commonMain/kotlin/com/soywiz/korev/Events.kt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class TouchBuilder {
}
}
}
else -> Unit
}
}

Expand All @@ -179,8 +180,8 @@ class TouchBuilder {
}
}
Mode.IOS -> {

}
else -> Unit
}
new.endFrame()
old.copyFrom(new)
Expand Down
4 changes: 2 additions & 2 deletions korgw/src/jsMain/kotlin/com/soywiz/kgl/KmlGlJsCanvas.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class KmlGlJsCanvas(val canvas: HTMLCanvasElement, val glOpts: dynamic) : KmlGlW
override fun clearStencil(s: Int): Unit = gl.clearStencil(s)
override fun colorMask(red: Boolean, green: Boolean, blue: Boolean, alpha: Boolean): Unit = gl.colorMask(red, green, blue, alpha)
override fun compileShader(shader: Int): Unit = gl.compileShader(shader.get())
override fun compressedTexImage2D(target: Int, level: Int, internalformat: Int, width: Int, height: Int, border: Int, imageSize: Int, data: FBuffer): Unit = gl.compressedTexImage2D(target, level, internalformat, width, height, border, data?.arrayByte)
override fun compressedTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, format: Int, imageSize: Int, data: FBuffer): Unit = gl.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data?.arrayByte)
override fun compressedTexImage2D(target: Int, level: Int, internalformat: Int, width: Int, height: Int, border: Int, imageSize: Int, data: FBuffer): Unit = gl.compressedTexImage2D(target, level, internalformat, width, height, border, data.arrayByte)
override fun compressedTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, format: Int, imageSize: Int, data: FBuffer): Unit = gl.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data.arrayByte)
override fun copyTexImage2D(target: Int, level: Int, internalformat: Int, x: Int, y: Int, width: Int, height: Int, border: Int): Unit = gl.copyTexImage2D(target, level, internalformat, x, y, width, height, border)
override fun copyTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, x: Int, y: Int, width: Int, height: Int): Unit = gl.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height)
override fun createProgram(): Int = gl.createProgram().alloc()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class SdlGameWindowNative : EventLoopGameWindow() {
render(doUpdate = false)
}
SDL_WindowEventID.CLOSE -> close()
else -> Unit
}
}
SDL_EventType.KEYDOWN,
Expand Down Expand Up @@ -167,6 +168,7 @@ class SdlGameWindowNative : EventLoopGameWindow() {

}
// TODO: joystick, controller
else -> Unit
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ fun Paint.toSvg(svg: SvgBuilder): String {
stops
)
}
else -> Unit
}

return "url(#def$id)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class CoreGraphicsRenderer(val bmp: Bitmap32, val antialiasing: Boolean) : com.s
GradientKind.RADIAL -> {
CGContextDrawRadialGradient(ctx, gradient, start, style.r0.cg, end, style.r1.cg, options)
}
else -> Unit
}
}
CGGradientRelease(gradient)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ open class Resources(val coroutineContext: CoroutineContext, val root: VfsFile =
}
open fun add(resource: Resource<*>) {
if (resource.cache == ResourceCache.NONE) return
if (parent != null && resource.cache == ResourceCache.GLOBAL) return parent?.add(resource)
if (parent != null && resource.cache == ResourceCache.GLOBAL) {
parent?.add(resource)
return
}
map[resource.name] = resource
}
@Suppress("UNCHECKED_CAST")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class DarwinSSLSocket {
SSLSessionState.kSSLClosed -> return false
SSLSessionState.kSSLAborted -> return false
SSLSessionState.kSSLConnected -> break
else -> Unit
}
}
return true
Expand Down
Loading

0 comments on commit 61d5d25

Please sign in to comment.