diff --git a/src/net/torvald/terrarum/PostProcessor.kt b/src/net/torvald/terrarum/PostProcessor.kt index f1094ecb4..a08cca457 100644 --- a/src/net/torvald/terrarum/PostProcessor.kt +++ b/src/net/torvald/terrarum/PostProcessor.kt @@ -13,6 +13,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer import com.badlogic.gdx.math.Matrix4 import net.torvald.terrarum.gamecontroller.KeyToggler import net.torvald.terrarum.ui.BasicDebugInfoWindow +import net.torvald.terrarum.worlddrawer.BlocksDrawer /** * Must be called by the App Loader @@ -37,6 +38,8 @@ object PostProcessor { private val debugUI = BasicDebugInfoWindow() + private var functionRowHelper = Texture(Gdx.files.internal("assets/graphics/function_row_help.png")) + fun dispose() { batch.dispose() shapeRenderer.dispose() @@ -78,6 +81,25 @@ object PostProcessor { drawSafeArea() } + if (KeyToggler.isOn(Input.Keys.F1)) { + batch.color = Color.WHITE + batch.inUse { + it.draw(functionRowHelper, + (AppLoader.screenW - functionRowHelper.width) / 2f, + functionRowHelper.height.toFloat(), + functionRowHelper.width.toFloat(), + functionRowHelper.height * -1f + ) + } + } + + if (KeyToggler.isOn(Input.Keys.F10)) { + batch.color = Color.WHITE + batch.inUse { + AppLoader.fontSmallNumbers.draw(it, "Wire draw bits: ${BlocksDrawer.drawWires.toString(2)}", 2f, 2f) + } + } + if (KeyToggler.isOn(Input.Keys.F3)) { if (!debugUI.isOpened && !debugUI.isOpening) debugUI.setAsOpen() batch.inUse { debugUI.renderUI(batch, camera) } diff --git a/src/net/torvald/terrarum/modulebasegame/items/WirePieceSignalWire.kt b/src/net/torvald/terrarum/modulebasegame/items/WirePieceSignalWire.kt index eec295a1b..46285fde5 100644 --- a/src/net/torvald/terrarum/modulebasegame/items/WirePieceSignalWire.kt +++ b/src/net/torvald/terrarum/modulebasegame/items/WirePieceSignalWire.kt @@ -39,6 +39,5 @@ class WirePieceSignalWire(override val originalID: ItemID) : GameItem() { override fun effectWhenEquipped(delta: Float) { IngameRenderer.selectedWireBitToDraw = Wire.BIT_SIGNAL_RED - //println("wires!") } } \ No newline at end of file diff --git a/src/net/torvald/terrarum/worlddrawer/BlocksDrawerNew.kt b/src/net/torvald/terrarum/worlddrawer/BlocksDrawerNew.kt index 9b54b4e76..0209ee375 100644 --- a/src/net/torvald/terrarum/worlddrawer/BlocksDrawerNew.kt +++ b/src/net/torvald/terrarum/worlddrawer/BlocksDrawerNew.kt @@ -215,6 +215,9 @@ internal object BlocksDrawer { renderUsingBuffer(FLUID, projectionMatrix) } + var drawWires = 0 + private set + internal fun drawFront(projectionMatrix: Matrix4, drawWires: Int) { // blend mul Gdx.gl.glEnable(GL20.GL_TEXTURE_2D) @@ -228,8 +231,9 @@ internal object BlocksDrawer { gdxSetBlendNormal() + this.drawWires = drawWires if (drawWires != 0) { - //println("drawing wires") + //println("Wires! draw: $drawWires") // use F10 instead renderUsingBuffer(WIRE, projectionMatrix) } }