From a8e5e723b7e1891c9b352261a3ee4c3d3563e8cf Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 26 Oct 2025 21:38:22 -0700 Subject: Checkpoint two --- .../kotlin/coffee/liz/abstractionengine/game/Renderer.kt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/game/Renderer.kt') diff --git a/composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/game/Renderer.kt b/composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/game/Renderer.kt index 57511f3..8e28944 100644 --- a/composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/game/Renderer.kt +++ b/composeApp/src/commonMain/kotlin/coffee/liz/abstractionengine/game/Renderer.kt @@ -21,12 +21,14 @@ import kotlin.time.Duration * Depends on AnimationSystem to ensure animations are updated before rendering. */ class Renderer( - private val imageCache: ImageCache + private val imageCache: ImageCache, ) : System { - override val dependencies: Set> = setOf(AnimationSystem::class) - override fun update(world: World, duration: Duration) { + override fun update( + world: World, + duration: Duration, + ) { // Rendering happens in render() method, not here } @@ -34,7 +36,10 @@ class Renderer( * Renders all entities with sprites to the given DrawScope. * This should be called from a Compose Canvas during the draw phase. */ - fun render(world: World, drawScope: DrawScope) { + fun render( + world: World, + drawScope: DrawScope, + ) { // Query all entities that can be rendered world.query(Position::class, SpriteSheet::class, Animator::class).forEach { entity -> val position = entity.get(Position::class) ?: return@forEach @@ -57,7 +62,7 @@ class Renderer( srcOffset = IntOffset(frameRect.x, frameRect.y), srcSize = IntSize(frameRect.width, frameRect.height), dstOffset = IntOffset(position.x.toInt(), position.y.toInt()), - dstSize = IntSize(frameRect.width, frameRect.height) + dstSize = IntSize(frameRect.width, frameRect.height), ) } } -- cgit v1.2.3-70-g09d2