mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
debug info for upcoming wires
This commit is contained in:
@@ -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) }
|
||||
|
||||
@@ -39,6 +39,5 @@ class WirePieceSignalWire(override val originalID: ItemID) : GameItem() {
|
||||
|
||||
override fun effectWhenEquipped(delta: Float) {
|
||||
IngameRenderer.selectedWireBitToDraw = Wire.BIT_SIGNAL_RED
|
||||
//println("wires!")
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user