diff --git a/core/shared/src/main/scala/eu/joaocosta/minart/backend/subsystem/AllSubsystems.scala b/core/shared/src/main/scala/eu/joaocosta/minart/backend/subsystem/AllSubsystems.scala index bfef15a9..9c0cd863 100644 --- a/core/shared/src/main/scala/eu/joaocosta/minart/backend/subsystem/AllSubsystems.scala +++ b/core/shared/src/main/scala/eu/joaocosta/minart/backend/subsystem/AllSubsystems.scala @@ -14,36 +14,9 @@ private[minart] class AllSubsystems(canvas: LowLevelCanvas, audioPlayer: LowLeve with Canvas with AudioPlayer { - // Canvas - def canvasSettings: Canvas.Settings = canvas.canvasSettings - def changeSettings(newSettings: Canvas.Settings): Unit = - canvas.changeSettings(newSettings) - def clear(buffers: Set[Canvas.Buffer]): Unit = canvas.clear(buffers) - def getKeyboardInput(): KeyboardInput = canvas.getKeyboardInput() - def getPointerInput(): PointerInput = canvas.getPointerInput() - def redraw(): Unit = canvas.redraw() + private val _canvas: Canvas = canvas // Export only Canvas methods + export _canvas.* - // MutableSurface - override def fill(color: Color): Unit = canvas.fill(color) - def fillRegion(x: Int, y: Int, w: Int, h: Int, color: Color): Unit = canvas.fillRegion(x, y, w, h, color) - def unsafePutPixel(x: Int, y: Int, color: Color): Unit = canvas.unsafePutPixel(x, y, color) - override def blit( - that: Surface, - blendMode: BlendMode = BlendMode.Copy - )(x: Int, y: Int, cx: Int = 0, cy: Int = 0, cw: Int = that.width, ch: Int = that.height): Unit = - canvas.blit(that, blendMode)(x, y, cx, cy, cw, ch) - - // Surface - override def getPixels(): Vector[Array[Color]] = canvas.getPixels() - def unsafeGetPixel(x: Int, y: Int): Color = canvas.unsafeGetPixel(x, y) - - // AudioPlayer - def isPlaying(): Boolean = audioPlayer.isPlaying() - def isPlaying(channel: Int): Boolean = audioPlayer.isPlaying(channel) - override def play(clip: AudioClip): Unit = audioPlayer.play(clip) - def play(clip: AudioClip, channel: Int): Unit = audioPlayer.play(clip, channel) - override def play(wave: AudioWave): Unit = audioPlayer.play(wave) - override def play(wave: AudioWave, channel: Int): Unit = audioPlayer.play(wave, channel) - def stop(): Unit = audioPlayer.stop() - def stop(channel: Int): Unit = audioPlayer.stop(channel) + private val _audioPlayer: AudioPlayer = audioPlayer // Export only AudioPlayer methods + export _audioPlayer.* }