From 39259d179fc691d52c73526e566f9a756a4397f0 Mon Sep 17 00:00:00 2001 From: Quillraven Date: Tue, 26 Mar 2024 21:14:50 +0100 Subject: [PATCH] change LibKTX to SNAPSHOT release and replace custom extensions with built-in ones --- README.md | 2 +- .../quillyjumper/system/GlProfilerSystem.kt | 2 +- .../github/quillyjumper/system/RenderSystem.kt | 15 +-------------- .../github/quillyjumper/tiled/TiledService.kt | 6 +----- .../quillraven/github/quillyjumper/util/math.kt | 14 -------------- gradle.properties | 2 +- 6 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 core/src/main/kotlin/com/quillraven/github/quillyjumper/util/math.kt diff --git a/README.md b/README.md index ea62667..437101c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Fleks](https://img.shields.io/badge/Fleks-2.7--SNAPSHOT-purple.svg)](http://kotlinlang.org/) [![LibGDX](https://img.shields.io/badge/LibGDX-1.12.1-green.svg)](http://kotlinlang.org/) -[![LibKTX](https://img.shields.io/badge/LibKTX-1.12.1--rc1-blue.svg)](http://kotlinlang.org/) +[![LibKTX](https://img.shields.io/badge/LibKTX-1.12.1--SNAPSHOT-blue.svg)](http://kotlinlang.org/) # Quilly Jumper diff --git a/core/src/main/kotlin/com/quillraven/github/quillyjumper/system/GlProfilerSystem.kt b/core/src/main/kotlin/com/quillraven/github/quillyjumper/system/GlProfilerSystem.kt index 522c5fe..56aace8 100644 --- a/core/src/main/kotlin/com/quillraven/github/quillyjumper/system/GlProfilerSystem.kt +++ b/core/src/main/kotlin/com/quillraven/github/quillyjumper/system/GlProfilerSystem.kt @@ -13,7 +13,7 @@ class GlProfilerSystem : IntervalSystem() { """ |bindings: ${profiler.textureBindings}, |drawCalls: ${profiler.drawCalls}, - |calls: ${profiler.calls} + |calls: ${profiler.calls}, |fps: ${Gdx.app.graphics.framesPerSecond} """.trimMargin().replace(Regex("(\n*)\n"), "$1") ) diff --git a/core/src/main/kotlin/com/quillraven/github/quillyjumper/system/RenderSystem.kt b/core/src/main/kotlin/com/quillraven/github/quillyjumper/system/RenderSystem.kt index d7e5250..f9882d3 100644 --- a/core/src/main/kotlin/com/quillraven/github/quillyjumper/system/RenderSystem.kt +++ b/core/src/main/kotlin/com/quillraven/github/quillyjumper/system/RenderSystem.kt @@ -6,7 +6,6 @@ import com.badlogic.gdx.maps.MapLayer import com.badlogic.gdx.maps.tiled.TiledMap import com.badlogic.gdx.maps.tiled.TiledMapTileLayer import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer -import com.badlogic.gdx.maps.tiled.tiles.AnimatedTiledMapTile import com.badlogic.gdx.scenes.scene2d.Stage import com.badlogic.gdx.utils.viewport.Viewport import com.github.quillraven.fleks.Entity @@ -20,6 +19,7 @@ import com.quillraven.github.quillyjumper.event.GameEvent import com.quillraven.github.quillyjumper.event.GameEventListener import com.quillraven.github.quillyjumper.event.MapChangeEvent import ktx.assets.disposeSafely +import ktx.tiled.use class RenderSystem( private val batch: Batch = inject(), @@ -59,19 +59,6 @@ class RenderSystem( sprite.draw(batch) } - private inline fun OrthogonalTiledMapRenderer.use( - camera: OrthographicCamera, - block: (OrthogonalTiledMapRenderer) -> Unit - ) { - this.setView(camera) - AnimatedTiledMapTile.updateAnimationBaseTime() - this.batch.begin() - - block(this) - - this.batch.end() - } - override fun onEvent(event: GameEvent) { when (event) { is MapChangeEvent -> { diff --git a/core/src/main/kotlin/com/quillraven/github/quillyjumper/tiled/TiledService.kt b/core/src/main/kotlin/com/quillraven/github/quillyjumper/tiled/TiledService.kt index 01163a8..f30bf6e 100644 --- a/core/src/main/kotlin/com/quillraven/github/quillyjumper/tiled/TiledService.kt +++ b/core/src/main/kotlin/com/quillraven/github/quillyjumper/tiled/TiledService.kt @@ -32,14 +32,10 @@ import com.quillraven.github.quillyjumper.component.* import com.quillraven.github.quillyjumper.event.GameEvent import com.quillraven.github.quillyjumper.event.GameEventListener import com.quillraven.github.quillyjumper.event.MapChangeEvent -import com.quillraven.github.quillyjumper.util.component1 -import com.quillraven.github.quillyjumper.util.component2 -import com.quillraven.github.quillyjumper.util.component3 -import com.quillraven.github.quillyjumper.util.component4 import ktx.app.gdxError import ktx.box2d.body import ktx.log.logger -import ktx.math.vec2 +import ktx.math.* import ktx.tiled.* typealias GdxFloatArray = com.badlogic.gdx.utils.FloatArray diff --git a/core/src/main/kotlin/com/quillraven/github/quillyjumper/util/math.kt b/core/src/main/kotlin/com/quillraven/github/quillyjumper/util/math.kt deleted file mode 100644 index 8c5a3c6..0000000 --- a/core/src/main/kotlin/com/quillraven/github/quillyjumper/util/math.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.quillraven.github.quillyjumper.util - -import com.badlogic.gdx.math.Ellipse -import com.badlogic.gdx.math.Rectangle - -operator fun Rectangle.component1(): Float = this.x -operator fun Rectangle.component2(): Float = this.y -operator fun Rectangle.component3(): Float = this.width -operator fun Rectangle.component4(): Float = this.height - -operator fun Ellipse.component1(): Float = this.x -operator fun Ellipse.component2(): Float = this.y -operator fun Ellipse.component3(): Float = this.width -operator fun Ellipse.component4(): Float = this.height diff --git a/gradle.properties b/gradle.properties index e27c613..4d50c14 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms512M -Xmx1G org.gradle.configureondemand=false -ktxVersion=1.12.1-rc1 +ktxVersion=1.12.1-SNAPSHOT kotlinVersion=1.9.23 aiVersion=1.8.2 fleksVersion=2.7-SNAPSHOT