Skip to content

Commit

Permalink
Replace mod_() calls with mod()
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinRNDR committed Apr 29, 2023
1 parent 175200a commit ccd7a98
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion orx-fx/src/jvmDemo/kotlin/DemoColorDuotone01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fun main() {

extend {

duotone.labInterpolation = seconds.mod_(2.0) < 1.0
duotone.labInterpolation = seconds.mod(2.0) < 1.0
duotone.apply(image, filteredImage)
drawer.image(filteredImage)

Expand Down
2 changes: 1 addition & 1 deletion orx-fx/src/jvmDemo/kotlin/DemoDitherLumaHalftone01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fun main() {
lumaHalftone.phase0 = seconds*0.1
lumaHalftone.phase1 = -seconds*0.1
lumaHalftone.apply(image, filteredImage)
lumaHalftone.invert = seconds.mod_(2.0) < 1.0
lumaHalftone.invert = seconds.mod(2.0) < 1.0
drawer.image(filteredImage)
}
}
Expand Down
2 changes: 1 addition & 1 deletion orx-jvm/orx-dnk3/src/demo/kotlin/DemoAnimations01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun main() = application {
fov = 40.0
}
extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}
Expand Down
2 changes: 1 addition & 1 deletion orx-jvm/orx-dnk3/src/demo/kotlin/DemoCamera01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fun main() = application {
val cameras = scene.root.findContent { this as? PerspectiveCamera }

extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.view = cameras[0].content.viewMatrix
drawer.projection = cameras[0].content.projectionMatrix
drawer.clear(ColorRGBa.PINK)
Expand Down
2 changes: 1 addition & 1 deletion orx-jvm/orx-dnk3/src/demo/kotlin/DemoLights01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun main() = application {
camera.setView(Vector3.ZERO, Spherical(30.50, 26.0, 5.6), 40.0)
}
extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}
Expand Down
2 changes: 1 addition & 1 deletion orx-jvm/orx-dnk3/src/demo/kotlin/DemoLights02.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun main() = application {
camera.setView(Vector3(-0.514, -0.936, -1.122), Spherical(454.346, 25.0, 8.444), 40.0)
}
extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}
Expand Down
2 changes: 1 addition & 1 deletion orx-jvm/orx-dnk3/src/demo/kotlin/DemoLights03.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun main() = application {
}

extend {
sceneData.animations[0].applyToTargets(seconds.mod_(sceneData.animations[0].duration))
sceneData.animations[0].applyToTargets(seconds.mod(sceneData.animations[0].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}
Expand Down
2 changes: 1 addition & 1 deletion orx-jvm/orx-dnk3/src/demo/kotlin/DemoSegmentContours01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun main() = application {
}

extend {
sceneData.animations[2].applyToTargets(seconds.mod_(sceneData.animations[2].duration))
sceneData.animations[2].applyToTargets(seconds.mod(sceneData.animations[2].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}
Expand Down
2 changes: 1 addition & 1 deletion orx-jvm/orx-dnk3/src/demo/kotlin/DemoSkinning01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fun main() = application {
}

extend {
sceneData.animations[2].applyToTargets(seconds.mod_(sceneData.animations[2].duration))
sceneData.animations[2].applyToTargets(seconds.mod(sceneData.animations[2].duration))
drawer.clear(ColorRGBa.PINK)
renderer.draw(drawer, scene)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ class ControlManager : Extension {

target = if (target != null) {
if (KeyModifier.SHIFT in event.modifiers) {
focusableControls[(index - 1).mod_(focusableControls.size)]
focusableControls[(index - 1).mod(focusableControls.size)]
} else {
focusableControls[(index + 1).mod_(focusableControls.size)]
focusableControls[(index + 1).mod(focusableControls.size)]
}
} else {
lastTarget ?: focusableControls[0]
Expand Down
6 changes: 3 additions & 3 deletions orx-noise/src/commonMain/kotlin/Functions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ fun ((Int, Double) -> Double).crossFade(
width: Double = 0.5
): (Int, Double) -> Double {
return { seed, t ->
val a = t.map(start, end, 0.0, 1.0).mod_(1.0)
val a = t.map(start, end, 0.0, 1.0).mod(1.0)
val f = (a / width).coerceAtMost(1.0)
val o = this(seed, a.map(0.0, 1.0, start, end)) * f
val s = this(seed, (a + 1.0).map(0.0, 1.0, start, end)) * (1.0 - f)
Expand All @@ -281,7 +281,7 @@ fun ((Int, Double, Double) -> Double).crossFade(
width: Double = 0.5
): (Int, Double, Double) -> Double {
return { seed, x, t ->
val a = t.map(start, end, 0.0, 1.0).mod_(1.0)
val a = t.map(start, end, 0.0, 1.0).mod(1.0)
val f = (a / width).coerceAtMost(1.0)
val o = this(seed, x, a.map(0.0, 1.0, start, end)) * f
val s = this(seed, x, (a + 1.0).map(0.0, 1.0, start, end)) * (1.0 - f)
Expand All @@ -295,7 +295,7 @@ fun ((Int, Double, Double, Double) -> Double).crossFade(
width: Double = 0.5
): (Int, Double, Double, Double) -> Double {
return { seed, x, y, t ->
val a = t.map(start, end, 0.0, 1.0).mod_(1.0)
val a = t.map(start, end, 0.0, 1.0).mod(1.0)
val f = (a / width).coerceAtMost(1.0)
val o = this(seed, x, y, a.map(0.0, 1.0, start, end)) * f
val s = this(seed, x, y, (a + 1.0).map(0.0, 1.0, start, end)) * (1.0 - f)
Expand Down
2 changes: 1 addition & 1 deletion orx-noise/src/jvmDemo/kotlin/DemoScatter01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fun main() {
drawer.fill = ColorRGBa.PINK
drawer.circles(points, 4.0)

if (seconds.mod_(2.0) < 1.0) {
if (seconds.mod(2.0) < 1.0) {
drawer.stroke = ColorRGBa.PINK
drawer.fill = null
drawer.shape(shape)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ fun ShapeContour.bulgeSegments(distortion: Double) =
bulgeSegments { _, _ -> distortion }

fun ShapeContour.bulgeSegments(distortion: List<Double>) =
bulgeSegments { index, _ -> distortion[index.mod_(distortion.size)] }
bulgeSegments { index, _ -> distortion[index.mod(distortion.size)] }
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ fun ShapeContour.arcCorners(lengths: List<Double>,

private class Ring<T>(private val x: List<T>) : List<T> by x {
override operator fun get(index: Int): T {
return x[index.mod_(x.size)]
return x[index.mod(x.size)]
}
}

Expand Down

0 comments on commit ccd7a98

Please sign in to comment.