mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
new param 'frameDelta' on every render() function
This commit is contained in:
@@ -119,7 +119,7 @@ class WearableWorldRadarUI(val device: VM) : UICanvas() {
|
||||
device.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.end()
|
||||
|
||||
batch.color = Color.WHITE
|
||||
|
||||
@@ -50,7 +50,7 @@ internal class UIHomeComputer : UICanvas(
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(otherBatch: SpriteBatch, otherCamera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, otherBatch: SpriteBatch, otherCamera: OrthographicCamera) {
|
||||
otherBatch.end()
|
||||
|
||||
fbo.inAction(camera, batch) {
|
||||
|
||||
@@ -36,8 +36,8 @@ class BTeXDocument {
|
||||
pages.last().appendDrawCall(drawCall)
|
||||
}
|
||||
|
||||
fun render(batch: SpriteBatch, page: Int, x: Int, y: Int) {
|
||||
pages[page].render(batch, x, y)
|
||||
fun render(frameDelta: Float, batch: SpriteBatch, page: Int, x: Int, y: Int) {
|
||||
pages[page].render(frameDelta, batch, x, y)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class BTeXPage(
|
||||
drawCalls.add(drawCall)
|
||||
}
|
||||
|
||||
fun render(batch: SpriteBatch, x: Int, y: Int) {
|
||||
fun render(frameDelta: Float, batch: SpriteBatch, x: Int, y: Int) {
|
||||
batch.color = back
|
||||
Toolkit.fillArea(batch, x, y, width, height)
|
||||
drawCalls.forEach {
|
||||
|
||||
@@ -165,7 +165,7 @@ class AssembledSpriteAnimation(
|
||||
} ?: throw NullPointerException("Animation with name '$animNameRoot' is not found")
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, posX: Float, posY: Float, scale: Float) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, posX: Float, posY: Float, scale: Float) {
|
||||
if (parentActor.isVisible) {
|
||||
batch.color = colourFilter
|
||||
renderThisAnimation(batch, posX, posY, scale, "${currentAnimation}_${1+currentFrame}")
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
abstract class SpriteAnimation(@Transient val parentActor: ActorWithBody) : Disposable {
|
||||
protected abstract val currentDelay: Second
|
||||
abstract fun update(delta: Float)
|
||||
abstract fun render(batch: SpriteBatch, posX: Float, posY: Float, scale: Float = 1f)
|
||||
abstract fun render(frameDelta: Float, batch: SpriteBatch, posX: Float, posY: Float, scale: Float = 1f)
|
||||
|
||||
var flipHorizontal = false
|
||||
var flipVertical = false
|
||||
@@ -143,7 +143,7 @@ class SheetSpriteAnimation(parentActor: ActorWithBody) : SpriteAnimation(parentA
|
||||
* *
|
||||
* @param scale
|
||||
*/
|
||||
override fun render(batch: SpriteBatch, posX: Float, posY: Float, scale: Float) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, posX: Float, posY: Float, scale: Float) {
|
||||
assert(cellWidth > 0 || cellHeight > 0) {
|
||||
"Sprite width or height is set to zero! ($cellWidth, $cellHeight); master: $parentActor"
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ public class App implements ApplicationListener {
|
||||
firePostInit();
|
||||
|
||||
currentScreen.render(UPDATE_RATE);
|
||||
postProcessorOutFBO = TerrarumPostProcessor.INSTANCE.draw(camera.combined, renderFBO);
|
||||
postProcessorOutFBO = TerrarumPostProcessor.INSTANCE.draw(Gdx.graphics.getDeltaTime(), camera.combined, renderFBO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,14 +37,14 @@ object ConsistentUpdateRate : GameUpdateGovernor {
|
||||
|
||||
var i = 0L
|
||||
while (akku >= tickInterval) {
|
||||
App.measureDebugTime("Ingame.Update") { updateFunction(tickInterval) }
|
||||
App.measureDebugTime("Ingame.Update") { updateFunction(tickInterval) } // update-delta
|
||||
akku -= tickInterval
|
||||
i += 1
|
||||
}
|
||||
App.setDebugTime("Ingame.UpdateCounter", i)
|
||||
|
||||
/** RENDER CODE GOES HERE */
|
||||
App.measureDebugTime("Ingame.Render") { renderFunction(tickInterval) }
|
||||
App.measureDebugTime("Ingame.Render") { renderFunction(deltaTime) } // frame-delta, should be identical to Gdx.graphics.deltaTime
|
||||
}
|
||||
|
||||
override fun reset() {
|
||||
|
||||
@@ -92,10 +92,10 @@ class ModOptionsHost(val remoCon: UIRemoCon) : UICanvas() {
|
||||
deferred(); deferred = {}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// the actual control panel
|
||||
ControlPanelCommon.render("basegame.modcontrolpanel.$currentlySelectedModule", width, batch)
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -86,7 +86,7 @@ object TerrarumPostProcessor : Disposable {
|
||||
|
||||
private var deltatBenchStr = "ΔF: Gathering data"
|
||||
|
||||
fun draw(projMat: Matrix4, fbo: FrameBuffer): FrameBuffer {
|
||||
fun draw(frameDelta: Float, projMat: Matrix4, fbo: FrameBuffer): FrameBuffer {
|
||||
|
||||
// init
|
||||
if (!init) {
|
||||
@@ -157,7 +157,7 @@ object TerrarumPostProcessor : Disposable {
|
||||
|
||||
if (KeyToggler.isOn(Input.Keys.F3)) {
|
||||
if (!debugUI.isOpened && !debugUI.isOpening) debugUI.setAsOpen()
|
||||
batch.inUse { debugUI.renderUI(batch, camera) }
|
||||
batch.inUse { debugUI.renderUI(frameDelta, batch, camera) }
|
||||
}
|
||||
else {
|
||||
if (!debugUI.isClosed && !debugUI.isClosing) debugUI.setAsClose()
|
||||
|
||||
@@ -39,7 +39,7 @@ class UIFakeGradOverlay : UICanvas() {
|
||||
}
|
||||
|
||||
override fun updateUI(delta: Float) {}
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.end()
|
||||
val dither = App.getConfigBoolean("fx_dither")
|
||||
|
||||
@@ -91,7 +91,7 @@ class UIFakeBlurOverlay(val blurRadius: Float, val nodarken: Boolean) : UICanvas
|
||||
private val batchDrawCol = Color(-1)
|
||||
|
||||
override fun updateUI(delta: Float) {}
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batchDrawCol.a = openness
|
||||
batch.color = batchDrawCol
|
||||
if (App.getConfigBoolean("fx_backgroundblur")) {
|
||||
|
||||
@@ -275,13 +275,13 @@ class UIItemInventoryCatBar(
|
||||
}
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(batch, camera)
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(frameDelta, batch, camera)
|
||||
|
||||
// button
|
||||
// colour determined by UI items themselves
|
||||
mainButtons.forEach { it.render(batch, camera) }
|
||||
if (showSideButtons) sideButtons.forEach { it.render(batch, camera) }
|
||||
mainButtons.forEach { it.render(frameDelta, batch, camera) }
|
||||
if (showSideButtons) sideButtons.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
@@ -54,7 +54,7 @@ class UIItemInventoryElemSimple(
|
||||
private var highlightToMainCol = false
|
||||
private var highlightToSubCol = false
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
highlightToMainCol = customHighlightRuleMain?.invoke(this) ?: (equippedSlot != null && highlightEquippedItem) || forceHighlighted
|
||||
|
||||
@@ -79,7 +79,7 @@ class UIItemInventoryElemWide(
|
||||
var textHighlightMouseUpCol = Toolkit.Theme.COL_MOUSE_UP
|
||||
var textHighlightNormalCol = Color.WHITE
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
highlightToMainCol = customHighlightRuleMain?.invoke(this) ?: (equippedSlot != null && highlightEquippedItem) || forceHighlighted
|
||||
|
||||
@@ -1782,17 +1782,17 @@ open class ActorWithBody : Actor {
|
||||
)
|
||||
}
|
||||
|
||||
open fun drawGlow(batch: SpriteBatch) {
|
||||
open fun drawGlow(frameDelta: Float, batch: SpriteBatch) {
|
||||
if (isVisible && spriteGlow != null) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
drawSpriteInGoodPosition(spriteGlow!!, batch)
|
||||
drawSpriteInGoodPosition(frameDelta, spriteGlow!!, batch)
|
||||
}
|
||||
}
|
||||
|
||||
open fun drawBody(batch: SpriteBatch) {
|
||||
open fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
if (isVisible && sprite != null) {
|
||||
BlendMode.resolve(drawMode, batch)
|
||||
drawSpriteInGoodPosition(sprite!!, batch)
|
||||
drawSpriteInGoodPosition(frameDelta, sprite!!, batch)
|
||||
}
|
||||
|
||||
// debug display of hIntTilewiseHitbox
|
||||
@@ -1813,7 +1813,7 @@ open class ActorWithBody : Actor {
|
||||
}
|
||||
}
|
||||
|
||||
protected fun drawSpriteInGoodPosition(sprite: SpriteAnimation, batch: SpriteBatch) {
|
||||
protected fun drawSpriteInGoodPosition(frameDelta: Float, sprite: SpriteAnimation, batch: SpriteBatch) {
|
||||
if (world == null) return
|
||||
|
||||
val offsetX = 0f
|
||||
@@ -1823,7 +1823,7 @@ open class ActorWithBody : Actor {
|
||||
val posY = hitbox.startY.plus(PHYS_EPSILON_DIST).toFloat()
|
||||
|
||||
drawBodyInGoodPosition(posX, posY) { x, y ->
|
||||
sprite.render(batch, x + offsetX, y + offsetY, scale.toFloat())
|
||||
sprite.render(frameDelta, batch, x + offsetX, y + offsetY, scale.toFloat())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class BlockMarkerActor : ActorWithBody(Actor.RenderOrder.OVERLAY, physProp = Phy
|
||||
}
|
||||
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
if (isVisible) {
|
||||
if (markerMode == MarkerMode.FIXTURE_GHOST) {
|
||||
if (INGAME.actorNowPlaying != null) {
|
||||
@@ -60,7 +60,7 @@ class BlockMarkerActor : ActorWithBody(Actor.RenderOrder.OVERLAY, physProp = Phy
|
||||
if (ghost != null) {
|
||||
// batch.color = ghostColour
|
||||
batch.shader.setUniformf("ghostColour", ghostColour.r, ghostColour.g, ghostColour.b, ghostColour.a)
|
||||
drawSpriteInGoodPosition(ghost!!, batch)
|
||||
drawSpriteInGoodPosition(frameDelta, ghost!!, batch)
|
||||
}
|
||||
// 0L
|
||||
// }
|
||||
@@ -70,7 +70,7 @@ class BlockMarkerActor : ActorWithBody(Actor.RenderOrder.OVERLAY, physProp = Phy
|
||||
if (ghost != null) {
|
||||
// batch.color = ghostColour
|
||||
batch.shader.setUniformf("ghostColour", ghostColour.r, ghostColour.g, ghostColour.b, ghostColour.a)
|
||||
drawSpriteInGoodPosition(ghost!!, batch)
|
||||
drawSpriteInGoodPosition(frameDelta, ghost!!, batch)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class BlockMarkerActor : ActorWithBody(Actor.RenderOrder.OVERLAY, physProp = Phy
|
||||
batch.color = Color.WHITE
|
||||
}
|
||||
|
||||
override fun drawGlow(batch: SpriteBatch) {
|
||||
override fun drawGlow(frameDelta: Float, batch: SpriteBatch) {
|
||||
batch.color = Color.WHITE
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class WireActor : ActorWithBody, NoSerialise {
|
||||
override fun update(delta: Float) {
|
||||
}
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
if (isVisible && sprite != null) {
|
||||
if (WireCodex[wireID].accepts == "digital_3bits") {
|
||||
// "digital_3bits" must come right after three wires it bundles
|
||||
@@ -89,7 +89,7 @@ class WireActor : ActorWithBody, NoSerialise {
|
||||
}
|
||||
|
||||
BlendMode.resolve(drawMode, batch)
|
||||
drawSpriteInGoodPosition(sprite!!, batch)
|
||||
drawSpriteInGoodPosition(frameDelta, sprite!!, batch)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ open class ParticleBase(renderOrder: Actor.RenderOrder, var despawnUponCollision
|
||||
}
|
||||
}
|
||||
|
||||
open fun drawBody(batch: SpriteBatch) {
|
||||
open fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
if (!flagDespawn) {
|
||||
batch.color = drawColour
|
||||
drawBodyInGoodPosition(hitbox.startX.toFloat(), hitbox.startY.toFloat()) { x, y ->
|
||||
@@ -83,7 +83,7 @@ open class ParticleBase(renderOrder: Actor.RenderOrder, var despawnUponCollision
|
||||
}
|
||||
}
|
||||
|
||||
open fun drawGlow(batch: SpriteBatch) {
|
||||
open fun drawGlow(frameDelta: Float, batch: SpriteBatch) {
|
||||
if (!flagDespawn && glow != null) {
|
||||
batch.color = drawColour
|
||||
drawBodyInGoodPosition(hitbox.startX.toFloat(), hitbox.startY.toFloat()) { x, y ->
|
||||
|
||||
@@ -87,7 +87,7 @@ class ParticleVanishingText(val text: String, x: Double, y: Double, noCollision:
|
||||
drawColour.a = (lifetimeMax - lifetimeCounter) / lifetimeMax
|
||||
}
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
if (!flagDespawn) {
|
||||
val oldColour = batch.color.cpy()
|
||||
batch.color = drawColour
|
||||
@@ -135,7 +135,7 @@ open class ParticleVanishingSprite(val sprite: TextureRegionPack, val delay: Flo
|
||||
frameAdvanceCounter += delta
|
||||
}
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
if (!flagDespawn) {
|
||||
val oldColour = batch.color.cpy()
|
||||
batch.color = drawColour
|
||||
|
||||
@@ -118,12 +118,12 @@ class BuildingMaker(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
this.actorValue[AVKey.LUMG] = 1.0
|
||||
}
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
batch.color = toolCursorColour[currentPenMode]
|
||||
batch.draw(blockMarkings.get(currentPenMode, 0), hitbox.startX.toFloat(), hitbox.startY.toFloat())
|
||||
}
|
||||
|
||||
override fun drawGlow(batch: SpriteBatch) { }
|
||||
override fun drawGlow(frameDelta: Float, batch: SpriteBatch) { }
|
||||
|
||||
override fun dispose() {
|
||||
}
|
||||
@@ -152,7 +152,7 @@ class BuildingMaker(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
override var referenceID: ActorID = blockPosToRefID(x, y) // custom refID
|
||||
override val hitbox = Hitbox(x * 16.0, y * 16.0, 16.0, 16.0)
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
batch.color = blockMarkerColour
|
||||
drawSpriteInGoodPosition(blockMarkings.get(2,0), batch)
|
||||
}
|
||||
@@ -188,7 +188,7 @@ class BuildingMaker(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawGlow(batch: SpriteBatch) { }
|
||||
override fun drawGlow(frameDelta: Float, batch: SpriteBatch) { }
|
||||
|
||||
override fun update(delta: Float) { }
|
||||
|
||||
@@ -458,7 +458,7 @@ class BuildingMaker(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
private val renderGame = { delta: Float ->
|
||||
_testMarkerDrawCalls = 0L
|
||||
|
||||
IngameRenderer.invoke(false,
|
||||
IngameRenderer.invoke(delta, false,
|
||||
screenZoom,
|
||||
listOf(),
|
||||
listOf(),
|
||||
@@ -696,10 +696,10 @@ class MovableWorldCamera(val parent: BuildingMaker) : ActorHumanoid(0, physProp
|
||||
this.hitbox.hitboxStart.setCoerceIn(coerceInStart, coerceInEnd)
|
||||
}
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
}
|
||||
|
||||
override fun drawGlow(batch: SpriteBatch) {
|
||||
override fun drawGlow(frameDelta: Float, batch: SpriteBatch) {
|
||||
}
|
||||
|
||||
override fun onActorValueChange(key: String, value: Any?) {
|
||||
|
||||
@@ -202,6 +202,7 @@ object IngameRenderer : Disposable {
|
||||
private var oldCamX = 0
|
||||
|
||||
operator fun invoke(
|
||||
frameDelta: Float,
|
||||
gamePaused: Boolean,
|
||||
zoom: Float = 1f,
|
||||
actorsRenderBehind : List<ActorWithBody>,
|
||||
@@ -239,9 +240,9 @@ object IngameRenderer : Disposable {
|
||||
|
||||
prepLightmapRGBA()
|
||||
BlocksDrawer.renderData()
|
||||
drawToRGB(actorsRenderBehind, actorsRenderMiddle, actorsRenderMidTop, actorsRenderFront, actorsRenderOverlay, particlesContainer)
|
||||
drawToA(actorsRenderBehind, actorsRenderMiddle, actorsRenderMidTop, actorsRenderFront, actorsRenderOverlay, particlesContainer)
|
||||
drawOverlayActors(actorsRenderOverlay)
|
||||
drawToRGB(frameDelta, actorsRenderBehind, actorsRenderMiddle, actorsRenderMidTop, actorsRenderFront, actorsRenderOverlay, particlesContainer)
|
||||
drawToA(frameDelta, actorsRenderBehind, actorsRenderMiddle, actorsRenderMidTop, actorsRenderFront, actorsRenderOverlay, particlesContainer)
|
||||
drawOverlayActors(frameDelta, actorsRenderOverlay)
|
||||
}
|
||||
|
||||
batch.color = Color.WHITE
|
||||
@@ -263,7 +264,7 @@ object IngameRenderer : Disposable {
|
||||
|
||||
// draw sky
|
||||
measureDebugTime("WeatherMixer.render") {
|
||||
WeatherMixer.render(camera, batch, world)
|
||||
WeatherMixer.render(frameDelta, camera, batch, world)
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +404,7 @@ object IngameRenderer : Disposable {
|
||||
|
||||
if (!KeyToggler.isOn(Input.Keys.F4)) {
|
||||
uiContainer?.forEach {
|
||||
it?.render(batch, camera)
|
||||
it?.render(frameDelta, batch, camera)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -449,6 +450,7 @@ object IngameRenderer : Disposable {
|
||||
}
|
||||
|
||||
private fun drawToRGB(
|
||||
frameDelta: Float,
|
||||
actorsRenderBehind: List<ActorWithBody>?,
|
||||
actorsRenderMiddle: List<ActorWithBody>?,
|
||||
actorsRenderMidTop: List<ActorWithBody>?,
|
||||
@@ -468,8 +470,8 @@ object IngameRenderer : Disposable {
|
||||
batch.shader = shaderForActors
|
||||
batch.color = Color.WHITE
|
||||
moveCameraToWorldCoord()
|
||||
actorsRenderBehind?.forEach { it.drawBody(batch) }
|
||||
particlesContainer?.forEach { it.drawBody(batch) }
|
||||
actorsRenderBehind?.forEach { it.drawBody(frameDelta, batch) }
|
||||
particlesContainer?.forEach { it.drawBody(frameDelta, batch) }
|
||||
}
|
||||
|
||||
setCameraPosition(0f, 0f)
|
||||
@@ -483,10 +485,10 @@ object IngameRenderer : Disposable {
|
||||
// draw actors //
|
||||
/////////////////
|
||||
moveCameraToWorldCoord()
|
||||
actorsRenderMiddle?.forEach { it.drawBody(batch) }
|
||||
actorsRenderMidTop?.forEach { it.drawBody(batch) }
|
||||
player?.drawBody(batch)
|
||||
actorsRenderFront?.forEach { it.drawBody(batch) }
|
||||
actorsRenderMiddle?.forEach { it.drawBody(frameDelta, batch) }
|
||||
actorsRenderMidTop?.forEach { it.drawBody(frameDelta, batch) }
|
||||
player?.drawBody(frameDelta, batch)
|
||||
actorsRenderFront?.forEach { it.drawBody(frameDelta, batch) }
|
||||
// --> Change of blend mode <-- introduced by children of ActorWithBody //
|
||||
}
|
||||
|
||||
@@ -558,6 +560,7 @@ object IngameRenderer : Disposable {
|
||||
}
|
||||
|
||||
private fun drawToA(
|
||||
frameDelta: Float,
|
||||
actorsRenderBehind: List<ActorWithBody>?,
|
||||
actorsRenderMiddle: List<ActorWithBody>?,
|
||||
actorsRenderMidTop: List<ActorWithBody>?,
|
||||
@@ -582,8 +585,8 @@ object IngameRenderer : Disposable {
|
||||
batch.color = Color.WHITE
|
||||
|
||||
moveCameraToWorldCoord()
|
||||
actorsRenderBehind?.forEach { it.drawGlow(batch) }
|
||||
particlesContainer?.forEach { it.drawGlow(batch) }
|
||||
actorsRenderBehind?.forEach { it.drawGlow(frameDelta, batch) }
|
||||
particlesContainer?.forEach { it.drawGlow(frameDelta, batch) }
|
||||
}
|
||||
|
||||
setCameraPosition(0f, 0f)
|
||||
@@ -594,10 +597,10 @@ object IngameRenderer : Disposable {
|
||||
// draw actors //
|
||||
/////////////////
|
||||
moveCameraToWorldCoord()
|
||||
actorsRenderMiddle?.forEach { it.drawGlow(batch) }
|
||||
actorsRenderMidTop?.forEach { it.drawGlow(batch) }
|
||||
player?.drawGlow(batch)
|
||||
actorsRenderFront?.forEach { it.drawGlow(batch) }
|
||||
actorsRenderMiddle?.forEach { it.drawGlow(frameDelta, batch) }
|
||||
actorsRenderMidTop?.forEach { it.drawGlow(frameDelta, batch) }
|
||||
player?.drawGlow(frameDelta, batch)
|
||||
actorsRenderFront?.forEach { it.drawGlow(frameDelta, batch) }
|
||||
// --> Change of blend mode <-- introduced by children of ActorWithBody //
|
||||
}
|
||||
}
|
||||
@@ -647,7 +650,7 @@ object IngameRenderer : Disposable {
|
||||
blendNormalStraightAlpha(batch)
|
||||
}
|
||||
|
||||
private fun drawOverlayActors(actors: List<ActorWithBody>?) {
|
||||
private fun drawOverlayActors(frameDelta: Float, actors: List<ActorWithBody>?) {
|
||||
fboRGB_lightMixed.inActionF(camera, batch) {
|
||||
|
||||
setCameraPosition(0f, 0f)
|
||||
@@ -659,7 +662,7 @@ object IngameRenderer : Disposable {
|
||||
|
||||
moveCameraToWorldCoord()
|
||||
actors?.forEach {
|
||||
it.drawBody(batch)
|
||||
it.drawBody(frameDelta, batch)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ import net.torvald.terrarum.realestate.LandUtil
|
||||
import net.torvald.terrarum.savegame.VDUtil
|
||||
import net.torvald.terrarum.savegame.VirtualDisk
|
||||
import net.torvald.terrarum.serialise.Common
|
||||
import net.torvald.terrarum.ui.BasicDebugInfoWindow.Companion.toIntAndFrac
|
||||
import net.torvald.terrarum.ui.Toolkit
|
||||
import net.torvald.terrarum.ui.Toolkit.hdrawWidth
|
||||
import net.torvald.terrarum.ui.UIAutosaveNotifier
|
||||
@@ -971,10 +972,20 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
paused = true
|
||||
}
|
||||
|
||||
|
||||
if (KeyToggler.isOn(Input.Keys.F10)) {
|
||||
batch.inUse {
|
||||
batch.color = Color.WHITE
|
||||
App.fontSmallNumbers.draw(batch, "$ccY\u00DCupd $ccG${delta.toIntAndFrac(1)}", 2f, App.scr.height - 16f)
|
||||
_dbgDeltaUpd = delta
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var _dbgDeltaUpd = 0f
|
||||
|
||||
private val renderGame = { delta: Float ->
|
||||
|
||||
private val renderGame = { frameDelta: Float ->
|
||||
Gdx.graphics.setTitle(getCanonicalTitle())
|
||||
|
||||
WorldCamera.update(world, actorNowPlaying)
|
||||
@@ -994,6 +1005,7 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
if (uiFixture?.isClosed == true) { uiFixture = null }
|
||||
|
||||
IngameRenderer.invoke(
|
||||
frameDelta,
|
||||
paused,
|
||||
screenZoom,
|
||||
visibleActorsRenderBehind,
|
||||
@@ -1035,6 +1047,16 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (KeyToggler.isOn(Input.Keys.F10)) {
|
||||
batch.inUse {
|
||||
batch.color = Color.WHITE
|
||||
App.fontSmallNumbers.draw(batch, "$ccY\u00DCupd $ccG${_dbgDeltaUpd.toIntAndFrac(1)}", 2f, App.scr.height - 16f)
|
||||
App.fontSmallNumbers.draw(batch, "$ccY\u00DCren $ccG${frameDelta.toIntAndFrac(1)}", 2f + 7*12, App.scr.height - 16f)
|
||||
App.fontSmallNumbers.draw(batch, "$ccY\u00DCgdx $ccG${Gdx.graphics.deltaTime.toIntAndFrac(1)}", 2f + 7*24, App.scr.height - 16f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var worldTransitionOngoing = false
|
||||
|
||||
@@ -358,6 +358,7 @@ class TitleScreen(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
if (!demoWorld.layerTerrain.ptr.destroyed) { // FIXME q&d hack to circumvent the dangling pointer issue #26
|
||||
IngameRenderer.invoke(
|
||||
delta,
|
||||
false,
|
||||
1f,
|
||||
listOf(),
|
||||
@@ -598,8 +599,8 @@ class TitleScreen(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
)
|
||||
}
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) { }
|
||||
override fun drawGlow(batch: SpriteBatch) { }
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) { }
|
||||
override fun drawGlow(frameDelta: Float, batch: SpriteBatch) { }
|
||||
|
||||
override fun update(delta: Float) {
|
||||
ai.update(this, delta)
|
||||
|
||||
@@ -84,7 +84,7 @@ class UIBuildingMakerGetFilename : UICanvas() {
|
||||
}
|
||||
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
// draw border
|
||||
@@ -111,7 +111,7 @@ class UIBuildingMakerGetFilename : UICanvas() {
|
||||
App.fontGame.draw(batch, str, 0 + LINE_HEIGHT / 2, 0 + LINE_HEIGHT / 2 + LINE_HEIGHT * index)
|
||||
}
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
private var dragOriginX = 0 // relative mousepos
|
||||
|
||||
@@ -96,7 +96,7 @@ open class DroppedItem : ActorWithBody {
|
||||
}
|
||||
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
// deserialiser won't call setter of the fields
|
||||
if (visualItemID == "") {
|
||||
visualItemID = BlockCodex.getOrNull(itemID)?.world ?: itemID
|
||||
|
||||
@@ -72,8 +72,8 @@ internal class FixtureTikiTorch : FixtureBase {
|
||||
spawnTimer += delta
|
||||
}
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
super.drawBody(batch)
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
super.drawBody(frameDelta, batch)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -53,9 +53,9 @@ class FixtureWorldPortal : Electric {
|
||||
|
||||
@Transient internal var teleportRequest: TeleportRequest? = null
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
(sprite as SheetSpriteAnimation).currentFrame = (Math.random() * 3).toInt()
|
||||
super.drawBody(batch)
|
||||
super.drawBody(frameDelta, batch)
|
||||
}
|
||||
|
||||
override fun onRisingEdge(readFrom: BlockBoxIndex) {
|
||||
|
||||
@@ -24,7 +24,7 @@ class PhysTestBall : ActorWithBody(RenderOrder.MIDDLE, PhysProperties.PHYSICS_OB
|
||||
color = RoguelikeRandomiser.composeColourFrom(RoguelikeRandomiser.POTION_PRIMARY_COLSET)
|
||||
}
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
/*Terrarum.inShapeRenderer {
|
||||
it.color = color
|
||||
it.circle(
|
||||
|
||||
@@ -41,10 +41,10 @@ class PhysTestLuarLander : ActorWithBody(RenderOrder.MIDTOP, PhysProperties.PHYS
|
||||
return true
|
||||
}
|
||||
|
||||
override fun drawGlow(batch: SpriteBatch) {
|
||||
override fun drawGlow(frameDelta: Float, batch: SpriteBatch) {
|
||||
}
|
||||
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
batch.color = Color.WHITE
|
||||
batch.draw(texture, hitbox.startX.toFloat(), hitbox.endY.toFloat(), hitbox.width.toFloat(), -hitbox.height.toFloat())
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ open class ProjectileSimple : ActorWithBody, Projectile {
|
||||
/**
|
||||
* WARNING! ends and begins Batch
|
||||
*/
|
||||
override fun drawBody(batch: SpriteBatch) {
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
val colourTail = displayColour.cpy() // clone a colour
|
||||
colourTail.a = 0.16f
|
||||
|
||||
@@ -113,7 +113,7 @@ open class ProjectileSimple : ActorWithBody, Projectile {
|
||||
batch.begin()*/
|
||||
}
|
||||
|
||||
override fun drawGlow(batch: SpriteBatch) = drawBody(batch)
|
||||
override fun drawGlow(frameDelta: Float, batch: SpriteBatch) = drawBody(frameDelta, batch)
|
||||
|
||||
companion object {
|
||||
val OFFSET_DAMAGE = 0
|
||||
|
||||
@@ -26,7 +26,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormal(batch)
|
||||
|
||||
val textWidth = messagesList.map { AppLoader.fontGame.getWidth(it) }.sorted()[1]
|
||||
|
||||
@@ -66,7 +66,7 @@ class Notification : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
fontCol.a = handler.opacity * OPACITY
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ object NullUI : UICanvas() {
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
|
||||
@@ -87,7 +87,7 @@ class UIBasicInfo() : UICanvas() {
|
||||
|
||||
private val lcdLitCol: Color = lcdLitColELoff
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = drawCol
|
||||
batch.draw(atlas.get(0, 0), 0f, 0f)
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ class UIBuildingMakerBlockChooser(val parent: BuildingMaker): UICanvas() {
|
||||
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
// border
|
||||
@@ -182,14 +182,14 @@ class UIBuildingMakerBlockChooser(val parent: BuildingMaker): UICanvas() {
|
||||
Toolkit.fillArea(batch, 0, 0, MENUBAR_SIZE, height)
|
||||
|
||||
// the actual buttons
|
||||
tabs.render(batch, camera)
|
||||
closeButton.render(batch, camera)
|
||||
tabs.render(frameDelta, batch, camera)
|
||||
closeButton.render(frameDelta, batch, camera)
|
||||
|
||||
currentPalette.visible.forEach {
|
||||
it.render(batch, camera)
|
||||
it.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
private var dragOriginX = 0 // relative mousepos
|
||||
|
||||
@@ -150,7 +150,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
||||
parent.tappedOnUI = true
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw back
|
||||
batch.color = backCol
|
||||
Toolkit.fillCircle(batch,0, 0, SIZE, SIZE)
|
||||
@@ -194,7 +194,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
||||
|
||||
// draw icons
|
||||
toolButtons.forEach {
|
||||
it.render(batch, camera)
|
||||
it.render(frameDelta, batch, camera)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ class UIBuildingMakerToolbox : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
tools.forEach { it.render(batch, camera) }
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
tools.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) { }
|
||||
|
||||
@@ -32,7 +32,7 @@ class UICheatDetected : UICanvas() {
|
||||
|
||||
private val backgroundCol = Color(0x00000080)
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
Terrarum.ingame?.consoleHandler?.setAsClose()
|
||||
Terrarum.ingame?.consoleHandler?.isVisible = false
|
||||
|
||||
|
||||
@@ -443,9 +443,9 @@ class UICrafting(val full: UIInventoryFull) : UICanvas(), HasInventory {
|
||||
if (openingClickLatched && !Terrarum.mouseDown) openingClickLatched = false
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// NO super.render due to an infinite recursion
|
||||
this.uiItems.forEach { it.render(batch, camera) }
|
||||
this.uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
batch.color = Color.WHITE
|
||||
|
||||
|
||||
@@ -49,9 +49,9 @@ class UIGraphicsControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
ControlPanelCommon.render("basegame.graphicscontrolpanel", width, batch)
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
if (App.getConfigBoolean("fx_streamerslayout")) {
|
||||
val xstart = App.scr.width - App.scr.chatWidth
|
||||
|
||||
@@ -173,7 +173,7 @@ class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
|
||||
val txt1 = Lang["MENU_LABEL_KEYBOARD_LAYOUT"]; val tw1 = App.fontGame.getWidth(txt1)
|
||||
@@ -198,7 +198,7 @@ class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() {
|
||||
|
||||
|
||||
batch.color = Color.WHITE
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
shiftin = Gdx.input.isKeyPressed(Input.Keys.SHIFT_LEFT) || Gdx.input.isKeyPressed(Input.Keys.SHIFT_RIGHT)
|
||||
altgrin = Gdx.input.isKeyPressed(Input.Keys.ALT_RIGHT) || (Gdx.input.isKeyPressed(Input.Keys.ALT_LEFT) && Gdx.input.isKeyPressed(Input.Keys.CONTROL_LEFT))
|
||||
@@ -271,8 +271,8 @@ private class UIItemInputKeycap(
|
||||
c in 0x1DC0..0x1DFF || c in 0x20D0..0x20FF || c in 0xFE20..0xFE2F ||
|
||||
c == 0xE31 || c in 0xE33..0xE3A || c in 0xE47..0xE4E
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(batch, camera)
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(frameDelta, batch, camera)
|
||||
|
||||
// key background
|
||||
batch.color = keycapFill
|
||||
|
||||
@@ -113,7 +113,7 @@ class UIImportAvatar(val remoCon: UIRemoCon) : Advanceable() {
|
||||
}
|
||||
private lateinit var wotKeys: List<String>
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
val textboxWidth = wotKeys.maxOf { App.fontGame.getWidth(it) }
|
||||
val textX = (Toolkit.drawWidth - textboxWidth) / 2
|
||||
@@ -126,7 +126,7 @@ class UIImportAvatar(val remoCon: UIRemoCon) : Advanceable() {
|
||||
App.fontGame.draw(batch, App.importDir, (Toolkit.drawWidth - pathW) / 2, textY)
|
||||
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
|
||||
if (importReturnCode != 0) {
|
||||
@@ -262,7 +262,7 @@ class UIItemCodeBox(parent: UIImportAvatar, initialX: Int, initialY: Int, val co
|
||||
}
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw box backgrounds
|
||||
batch.color = UIInventoryFull.CELL_COL
|
||||
Toolkit.fillArea(batch, posX, posY, width, height)
|
||||
|
||||
@@ -213,7 +213,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
private val weightBarWidth = 60f
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// background
|
||||
blendNormal()
|
||||
batch.color = backgroundColour
|
||||
@@ -225,14 +225,14 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
batch.color = Color(0xcccccc_ff.toInt())
|
||||
Toolkit.fillArea(batch, 0f, 0f, catButtons.width.toFloat(), height.toFloat())
|
||||
|
||||
catButtons.render(batch, camera)
|
||||
catButtons.render(frameDelta, batch, camera)
|
||||
|
||||
// left/right page mover
|
||||
scrollLeftButton.render(batch, camera)
|
||||
scrollRightButton.render(batch, camera)
|
||||
scrollLeftButton.render(frameDelta, batch, camera)
|
||||
scrollRightButton.render(frameDelta, batch, camera)
|
||||
|
||||
items.forEach {
|
||||
it.render(batch, camera)
|
||||
it.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
// texts
|
||||
|
||||
@@ -110,11 +110,11 @@ internal class UIInventoryCells(
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
//itemList.posX = itemList.initialX + inventoryScrOffX.roundToInt()
|
||||
itemList.render(batch, camera)
|
||||
itemList.render(frameDelta, batch, camera)
|
||||
//equipped.posX = equipped.initialX + inventoryScrOffX.roundToInt()
|
||||
equipped.render(batch, camera)
|
||||
equipped.render(frameDelta, batch, camera)
|
||||
|
||||
|
||||
// control hints
|
||||
|
||||
@@ -188,39 +188,39 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
|
||||
// `screens` order
|
||||
private val screenRenders = arrayOf(
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
{ frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, controlHintX, full.yEnd - 20)
|
||||
// text buttons
|
||||
gameMenuButtons.render(batch, camera)
|
||||
gameMenuButtons.render(frameDelta, batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
{ frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, controlHintX, full.yEnd - 20)
|
||||
keyboardSetupUI.render(batch, camera)
|
||||
keyboardSetupUI.render(frameDelta, batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
{ frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, controlHintX, full.yEnd - 20)
|
||||
areYouSureMainMenuButtons.render(batch, camera)
|
||||
areYouSureMainMenuButtons.render(frameDelta, batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
savingUI.render(batch, camera)
|
||||
{ frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
savingUI.render(frameDelta, batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
{ frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, controlHintX, full.yEnd - 20)
|
||||
keyConfigUI.render(batch, camera)
|
||||
keyConfigUI.render(frameDelta, batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
{ frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, controlHintX, full.yEnd - 20)
|
||||
languageUI.render(batch, camera)
|
||||
languageUI.render(frameDelta, batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
{ frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, controlHintX, full.yEnd - 20)
|
||||
shareUI.render(batch, camera)
|
||||
shareUI.render(frameDelta, batch, camera)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -300,10 +300,10 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
yeet.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
batch.color = Color.WHITE
|
||||
screenRenders[screen](batch, camera)
|
||||
screenRenders[screen](frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
|
||||
|
||||
@@ -320,13 +320,13 @@ class UIInventoryFull(
|
||||
internal var yEnd = -YPOS_CORRECTION + (App.scr.height + internalHeight).div(2).toFloat()
|
||||
private set
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
|
||||
drawBackground(batch, 1f)
|
||||
|
||||
// UI items
|
||||
catBar.render(batch, camera)
|
||||
transitionPanel.render(batch, camera)
|
||||
catBar.render(frameDelta, batch, camera)
|
||||
transitionPanel.render(frameDelta, batch, camera)
|
||||
|
||||
// if (transitionPanel.currentPosition != 1f) INGAME.setTooltipMessage(null)
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class UIInventoryMinimap(val full: UIInventoryFull) : UICanvas() {
|
||||
minimapRerenderTimer += Gdx.graphics.deltaTime
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
val cellOffY = INVENTORY_CELLS_OFFSET_Y()
|
||||
val worldWidth = INGAME.world.width
|
||||
|
||||
@@ -35,7 +35,7 @@ abstract class UIItemInventoryCellBase(
|
||||
var colourTheme: InventoryCellColourTheme = UIItemInventoryCellCommonRes.defaultInventoryCellTheme
|
||||
) : UIItem(parentUI, initialX, initialY) {
|
||||
abstract override fun update(delta: Float)
|
||||
abstract override fun render(batch: SpriteBatch, camera: OrthographicCamera)
|
||||
abstract override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera)
|
||||
|
||||
/** Custom highlight rule to highlight tihs button to primary accent colour (blue by default).
|
||||
* Set to `null` to use default rule:
|
||||
|
||||
@@ -68,7 +68,7 @@ class UIItemInventoryEquippedView(
|
||||
itemGrid.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
val posXDelta = posX - oldPosX
|
||||
@@ -109,7 +109,7 @@ class UIItemInventoryEquippedView(
|
||||
|
||||
// slot image on each cells
|
||||
itemGrid.forEachIndexed { index, cell ->
|
||||
cell.render(batch, camera)
|
||||
cell.render(frameDelta, batch, camera)
|
||||
if (cell.item == null) {
|
||||
batch.color = equipPosIconCol
|
||||
batch.draw(equipPosIcon.get(cellToIcon[index], 1), 15f + cell.posX, 15f + cell.posY)
|
||||
|
||||
@@ -306,21 +306,21 @@ open class UIItemInventoryItemGrid(
|
||||
// private fun getIconPosY(index: Int) =
|
||||
// posY + 8 + 26 * index
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val posXDelta = posX - oldPosX
|
||||
itemGrid.forEach { it.posX += posXDelta }
|
||||
itemList.forEach { it.posX += posXDelta }
|
||||
// define each button's highlighted status from the list of forceHighlighted, then render the button
|
||||
items.forEach {
|
||||
if (useHighlightingManager) it.forceHighlighted = forceHighlightList.contains(it.item?.dynamicID)
|
||||
it.render(batch, camera)
|
||||
it.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
if (!hideSidebar) {
|
||||
navRemoCon.render(batch, camera)
|
||||
navRemoCon.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
super.render(batch, camera)
|
||||
super.render(frameDelta, batch, camera)
|
||||
|
||||
oldPosX = posX
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class UIItemListNavBarVertical(
|
||||
var itemPage = 0
|
||||
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val posXDelta = posX - oldPosX
|
||||
|
||||
gridModeButtons.forEach { it.posX += posXDelta }
|
||||
@@ -131,9 +131,9 @@ class UIItemListNavBarVertical(
|
||||
batch.color = colourTheme.cellHighlightNormalCol
|
||||
Toolkit.drawBoxBorder(batch, iconPosX - 4, getIconPosY(0) - 8, width, height)
|
||||
|
||||
if (hasGridModeButtons) gridModeButtons.forEach { it.render(batch, camera) }
|
||||
scrollUpButton.render(batch, camera)
|
||||
scrollDownButton.render(batch, camera)
|
||||
if (hasGridModeButtons) gridModeButtons.forEach { it.render(frameDelta, batch, camera) }
|
||||
scrollUpButton.render(frameDelta, batch, camera)
|
||||
scrollDownButton.render(frameDelta, batch, camera)
|
||||
|
||||
// draw scroll dots
|
||||
for (i in 0 until itemPageCount) {
|
||||
@@ -151,7 +151,7 @@ class UIItemListNavBarVertical(
|
||||
|
||||
extraDrawOpOnBottom(this, batch)
|
||||
|
||||
super.render(batch, camera)
|
||||
super.render(frameDelta, batch, camera)
|
||||
|
||||
oldPosX = posX
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class UIItemSaving(parentUI: UICanvas, initialX: Int, initialY: Int) : UIItem(pa
|
||||
init {
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// these things will not scroll along with the parent GUI!
|
||||
val t = if ((INGAME as TerrarumIngame).uiAutosaveNotifier.isVisible) Lang["MENU_IO_WAITING_AUTOSAVE_TO_FINISH"] else Lang["MENU_IO_SAVING"]
|
||||
val tlen = App.fontGame.getWidth(t)
|
||||
|
||||
@@ -206,13 +206,13 @@ class UIKeyboardControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
controlPalette.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// batch.color = borderNormal
|
||||
// Toolkit.drawBoxBorder(batch, drawX, drawY, width, height)
|
||||
// batch.color = fillCol
|
||||
// Toolkit.fillArea(batch, drawX, drawY, width, height)
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
presetSelector.render(batch, camera)
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
presetSelector.render(frameDelta, batch, camera)
|
||||
|
||||
// title
|
||||
// todo show "Keyboard"/"Gamepad" accordingly
|
||||
@@ -228,7 +228,7 @@ class UIKeyboardControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
// action palette
|
||||
batch.color = Color.WHITE
|
||||
if (keycapClicked >= 0 && controlSelected < 0) {
|
||||
controlPalette.render(batch, camera)
|
||||
controlPalette.render(frameDelta, batch, camera)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,8 +342,8 @@ private class UIItemKeycap(
|
||||
super.update(delta)
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(batch, camera)
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(frameDelta, batch, camera)
|
||||
|
||||
batch.color = if (key == null)
|
||||
borderKeyForbidden
|
||||
@@ -455,21 +455,21 @@ class UIItemControlPaletteBaloon(val parent: UIKeyboardControlPanel, initialX: I
|
||||
)
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(batch, camera)
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(frameDelta, batch, camera)
|
||||
|
||||
Toolkit.drawBaloon(batch, posX.toFloat(), posY.toFloat(), width.toFloat(), height.toFloat())
|
||||
|
||||
iconButtons.forEach {
|
||||
batch.color = buttonBackground
|
||||
Toolkit.fillArea(batch, it.posX-4, it.posY-4, 28, 28)
|
||||
it.render(batch, camera)
|
||||
it.render(frameDelta, batch, camera)
|
||||
batch.color = Color(batch.color.r, batch.color.g, batch.color.b, batch.color.a * (if (it.mouseUp) 0.9f else 0.6f))
|
||||
Toolkit.drawBoxBorder(batch, it.posX-4, it.posY-4, 28, 28)
|
||||
}
|
||||
|
||||
closeButton1.render(batch, camera)
|
||||
closeButton2.render(batch, camera)
|
||||
closeButton1.render(frameDelta, batch, camera)
|
||||
closeButton2.render(frameDelta, batch, camera)
|
||||
|
||||
// texts. Sorted in the same way as UIItemControlPaletteBaloon.iconButtons
|
||||
batch.color = Color.WHITE
|
||||
|
||||
@@ -122,7 +122,7 @@ import java.util.zip.GZIPInputStream
|
||||
|
||||
private var loadFiredFrameCounter = 0
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
if (mode == MODE_INIT) {
|
||||
// "The Autosave is more recent than the manual save"
|
||||
Toolkit.drawTextCentered(batch, App.fontGame, Lang["GAME_MORE_RECENT_AUTOSAVE1"], Toolkit.drawWidth, 0, altSelDrawY)
|
||||
@@ -131,10 +131,10 @@ import java.util.zip.GZIPInputStream
|
||||
Toolkit.drawTextCentered(batch, App.fontGame, Lang["MENU_IO_MANUAL_SAVE"], altSelHdrawW, (Toolkit.drawWidth - altSelDrawW)/2, altSelDrawY + 80)
|
||||
Toolkit.drawTextCentered(batch, App.fontGame, Lang["MENU_IO_AUTOSAVE"], altSelHdrawW, Toolkit.drawWidth/2, altSelDrawY + 80)
|
||||
|
||||
if (::loadAutoThumbButton.isInitialized) loadAutoThumbButton.render(batch, camera)
|
||||
if (::loadManualThumbButton.isInitialized) loadManualThumbButton.render(batch, camera)
|
||||
if (::loadAutoThumbButton.isInitialized) loadAutoThumbButton.render(frameDelta, batch, camera)
|
||||
if (::loadManualThumbButton.isInitialized) loadManualThumbButton.render(frameDelta, batch, camera)
|
||||
|
||||
mainBackButton.render(batch, camera)
|
||||
mainBackButton.render(frameDelta, batch, camera)
|
||||
}
|
||||
else if (mode == MODE_LOAD) {
|
||||
loadFiredFrameCounter += 1
|
||||
|
||||
@@ -307,7 +307,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : Advanceable() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
|
||||
if (mode == 2) {
|
||||
loadFired += 1
|
||||
@@ -348,7 +348,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : Advanceable() {
|
||||
it.posX += uiXdiffChatOverlay
|
||||
|
||||
if (index in listScroll - 2 until listScroll + savesVisible + 2)
|
||||
it.render(batch, camera)
|
||||
it.render(frameDelta, batch, camera)
|
||||
|
||||
if (App.getConfigBoolean("fx_streamerslayout"))
|
||||
it.posX -= uiXdiffChatOverlay
|
||||
@@ -607,7 +607,7 @@ class UIItemPlayerCells(
|
||||
|
||||
private val avatarViewWidth = 120
|
||||
|
||||
fun render(batch: SpriteBatch, camera: OrthographicCamera, offX: Int, offY: Int) {
|
||||
fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera, offX: Int, offY: Int) {
|
||||
// try to generate a texture
|
||||
if (!hasTexture) { acquirePlayerAvatar(); hasTexture = true }
|
||||
|
||||
@@ -677,8 +677,8 @@ class UIItemPlayerCells(
|
||||
}
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
render(batch, camera, 0, 0)
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
render(frameDelta, batch, camera, 0, 0)
|
||||
}
|
||||
|
||||
private fun acquirePlayerAvatar() {
|
||||
@@ -846,7 +846,7 @@ class UIItemWorldCells(
|
||||
highlightCol = if (mouseUp) Toolkit.Theme.COL_MOUSE_UP else Toolkit.Theme.COL_LIST_DEFAULT
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// try to generate a texture
|
||||
if (skimmer.initialised && !hasTexture) {
|
||||
// load thumbnail or use stock if the file is not there
|
||||
@@ -904,7 +904,7 @@ class UIItemWorldCells(
|
||||
if (saveDamaged) batch.color = colourBad
|
||||
App.fontGame.draw(batch, saveName, x + 3f, y + -1f)
|
||||
|
||||
super.render(batch, camera)
|
||||
super.render(frameDelta, batch, camera)
|
||||
batch.color = Color.WHITE
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ class UILoadList(val full: UILoadSavegame) : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.end()
|
||||
|
||||
val cells = playerCells
|
||||
@@ -190,7 +190,7 @@ class UILoadList(val full: UILoadSavegame) : UICanvas() {
|
||||
it.posX += uiXdiffChatOverlay
|
||||
|
||||
if (index in listScroll - 2 until listScroll + savesVisible + 2)
|
||||
it.render(batch, camera)
|
||||
it.render(frameDelta, batch, camera)
|
||||
|
||||
if (App.getConfigBoolean("fx_streamerslayout"))
|
||||
it.posX -= uiXdiffChatOverlay
|
||||
|
||||
@@ -344,15 +344,15 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
|
||||
private val icons = CommonResourcePool.getAsTextureRegionPack("inventory_category")
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
if (mode != MODE_SHOW_LOAD_ORDER) {
|
||||
val buttonYdelta = (full.titleTopGradEnd) - full.playerButtonSelected!!.posY
|
||||
full.playerButtonSelected!!.render(batch, camera, 0, buttonYdelta)
|
||||
full.playerButtonSelected!!.render(frameDelta, batch, camera, 0, buttonYdelta)
|
||||
}
|
||||
|
||||
when (mode) {
|
||||
MODE_INIT -> {
|
||||
mainButtons.forEach { it.render(batch, camera) }
|
||||
mainButtons.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
// draw thumbnails of the most recent game
|
||||
// val tex = screencap ?: CommonResourcePool.getAsTextureRegion("terrarum-defaultsavegamethumb")
|
||||
@@ -378,11 +378,11 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
Toolkit.drawTextCentered(batch, App.fontGame, Lang["MENU_LABEL_SAVE_WILL_BE_DELETED"], Toolkit.drawWidth, 0, full.titleTopGradEnd + full.cellInterval + SAVE_CELL_HEIGHT + 36)
|
||||
Toolkit.drawTextCentered(batch, App.fontGame, Lang["MENU_LABEL_ARE_YOU_SURE"], Toolkit.drawWidth, 0, full.titleTopGradEnd + full.cellInterval + SAVE_CELL_HEIGHT + 36 + 24)
|
||||
|
||||
delButtons.forEach { it.render(batch, camera) }
|
||||
delButtons.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
MODE_RENAME -> {
|
||||
renameInput.render(batch, camera)
|
||||
renameButtons.forEach { it.render(batch, camera) }
|
||||
renameInput.render(frameDelta, batch, camera)
|
||||
renameButtons.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
MODE_LOAD -> {
|
||||
loadFiredFrameCounter += 1
|
||||
@@ -417,7 +417,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
App.fontGame.draw(batch, s, wx64, modulesBoxBaseY + 32 + App.fontGame.lineHeight.toInt() * index)
|
||||
}
|
||||
|
||||
modulesBackButton.render(batch, camera)
|
||||
modulesBackButton.render(frameDelta, batch, camera)
|
||||
}
|
||||
MODE_PREV_SAVES -> {
|
||||
val modulesBoxBaseY2 = full.titleTopGradEnd + SAVE_CELL_HEIGHT + listGap + 4
|
||||
@@ -449,7 +449,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
modulesBackButton.render(batch, camera)
|
||||
modulesBackButton.render(frameDelta, batch, camera)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class UILoadNewCharacter(val full: UILoadSavegame) : UICanvas() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
|
||||
@@ -147,8 +147,8 @@ class UILoadSavegame(val remoCon: UIRemoCon) : Advanceable() {
|
||||
transitionPanel.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
transitionPanel.render(batch, camera)
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
transitionPanel.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
override fun inputStrobed(e: TerrarumKeyboardEvent) {
|
||||
|
||||
@@ -126,7 +126,7 @@ class UINewCharacter(val remoCon: UIRemoCon) : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
// ui title
|
||||
// val titlestr = Lang["CONTEXT_WORLD_NEW"]
|
||||
@@ -136,7 +136,7 @@ class UINewCharacter(val remoCon: UIRemoCon) : UICanvas() {
|
||||
// name/seed input labels
|
||||
App.fontGame.draw(batch, Lang["MENU_NAME"], drawX, drawY + row1)
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -272,7 +272,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
// ui title
|
||||
// val titlestr = Lang["CONTEXT_WORLD_NEW"]
|
||||
@@ -322,7 +322,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -69,7 +69,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
||||
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw title bar
|
||||
batch.color = UINSMenu.DEFAULT_TITLEBACKCOL
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
@@ -41,9 +41,9 @@ class UIPerformanceControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
ControlPanelCommon.render("basegame.performancecontrolpanel", width, batch)
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -18,7 +18,7 @@ class UIProxyLoadLatestSave(val remoCon: UIRemoCon) : UICanvas() {
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
|
||||
@@ -22,7 +22,7 @@ class UIProxyNewBuildingMaker(val remoCon: UIRemoCon) : UICanvas() {
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
|
||||
@@ -25,7 +25,7 @@ class UIProxyNewRandomGame(val remoCon: UIRemoCon) : UICanvas() {
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
|
||||
@@ -87,7 +87,7 @@ class UIQuickslotBar : UICanvas() {
|
||||
|
||||
private val itemCntTextCol = Color(0x404040ff)
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.let { actor ->
|
||||
for (i in 0 until SLOT_COUNT) {
|
||||
|
||||
@@ -69,7 +69,7 @@ class UIQuickslotPie : UICanvas() {
|
||||
|
||||
private val drawColor = Color(1f, 1f, 1f, 1f)
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw radial thingies
|
||||
for (i in 0 until slotCount) {
|
||||
val qs = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.inventory?.getQuickslotItem(i)
|
||||
|
||||
@@ -220,9 +220,9 @@ open class UIRemoCon(val parent: TitleScreen, val treeRoot: QNDTreeNode<String>)
|
||||
openUI = external
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
remoConTray.render(batch, camera)
|
||||
openUI?.render(batch, camera)
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
remoConTray.render(frameDelta, batch, camera)
|
||||
openUI?.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
@@ -314,8 +314,8 @@ open class UIRemoCon(val parent: TitleScreen, val treeRoot: QNDTreeNode<String>)
|
||||
menubar.update(delta)
|
||||
}
|
||||
|
||||
fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
menubar.render(batch, camera)
|
||||
fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
menubar.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
// nullifies currently selected item
|
||||
|
||||
@@ -45,7 +45,7 @@ class UIScreenZoom : UICanvas(
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
|
||||
val offX = (App.scr.tvSafeGraphicsWidth * 1.25f).roundToInt().toFloat()
|
||||
|
||||
@@ -42,7 +42,7 @@ class UIShare : UICanvas() {
|
||||
|
||||
private lateinit var wotKeys: List<String>
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
|
||||
val textY = drawY + (height/2) - App.fontGame.lineHeight.toInt() * 4 - 2
|
||||
@@ -68,7 +68,7 @@ class UIShare : UICanvas() {
|
||||
}
|
||||
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ class UISoundControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
ControlPanelCommon.render("basegame.soundcontrolpanel", width, batch)
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -180,16 +180,16 @@ internal class UIStorageChest : UICanvas(
|
||||
else
|
||||
"${App.gamepadLabelStart} ${Lang["GAME_ACTION_CLOSE"]} "
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// background fill
|
||||
UIInventoryFull.drawBackground(batch, 1f)
|
||||
|
||||
// UI items
|
||||
batch.color = Color.WHITE
|
||||
|
||||
catBar.render(batch, camera)
|
||||
itemListChest.render(batch, camera)
|
||||
itemListPlayer.render(batch, camera)
|
||||
catBar.render(frameDelta, batch, camera)
|
||||
itemListChest.render(frameDelta, batch, camera)
|
||||
itemListPlayer.render(frameDelta, batch, camera)
|
||||
|
||||
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
@@ -110,11 +110,11 @@ class UITitleLanguage(remoCon: UIRemoCon?) : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
|
||||
batch.color = Color.WHITE
|
||||
textArea1.render(batch, camera)
|
||||
textArea2.render(batch, camera)
|
||||
textArea1.render(frameDelta, batch, camera)
|
||||
textArea2.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
override fun show() {
|
||||
|
||||
@@ -138,7 +138,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
|
||||
moduleCells.clear()
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.end()
|
||||
|
||||
lateinit var savePixmap: Pixmap
|
||||
@@ -151,7 +151,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
|
||||
for (index in 0 until moduleCells.size) {
|
||||
val it = moduleCells[index]
|
||||
if (index in listScroll - 2 until listScroll + savesVisible + 2) {
|
||||
it.render(batch, camera)
|
||||
it.render(frameDelta, batch, camera)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,8 +124,8 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
//println("UITitleRemoConRoot bro u even updatez")
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
menubar.render(batch, camera)
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
menubar.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
|
||||
@@ -49,10 +49,10 @@ open class UITitleWallOfText(private val text: List<String>) : UICanvas() {
|
||||
scrollbar?.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
textArea.render(batch, camera)
|
||||
scrollbar?.render(batch, camera)
|
||||
textArea.render(frameDelta, batch, camera)
|
||||
scrollbar?.render(frameDelta, batch, camera)
|
||||
|
||||
//AppLoader.printdbg(this, "Rendering texts of length ${text.size}")
|
||||
}
|
||||
@@ -120,7 +120,7 @@ class UISystemInfo(val remoCon: UIRemoCon) : UICanvas() {
|
||||
uptime = App.getTIME_T() - App.startupTime
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
var i = 0
|
||||
|
||||
v.forEach { (k, v0) ->
|
||||
|
||||
@@ -48,7 +48,7 @@ class UITooltip : UICanvas() {
|
||||
get() = 36 * 2 + font.lineHeight.toInt()
|
||||
set(value) { throw Error("You are not supposed to set the height of the tooltip manually.") }
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val mouseXoff = 28f
|
||||
val mouseYoff = 0f
|
||||
val txtW = msgWidth + 2f * textMarginX
|
||||
|
||||
@@ -63,7 +63,7 @@ class UIVitalMetre(
|
||||
/**
|
||||
* g must be same as World Graphics!
|
||||
*/
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// TODO now that we just can't draw arcs, we need to re-think about this
|
||||
|
||||
/*if (vitalGetterVal() != null && vitalGetterMax() != null && player != null) {
|
||||
|
||||
@@ -79,7 +79,7 @@ class UIWallCalendar : UICanvas(
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
UIInventoryFull.drawBackground(batch, 1f)
|
||||
|
||||
val thisYear = INGAME.world.worldTime.years
|
||||
|
||||
@@ -49,7 +49,7 @@ class UIWatchLargeAnalogue() : UICanvas() {
|
||||
|
||||
private val TWO_PI = 2.0 * Math.PI
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
TerrarumIngame.setCameraPosition(batch, App.shapeRender, camera, posX.toFloat(), posY.toFloat())
|
||||
|
||||
val day = INGAME.world.worldTime.calendarDay - 1
|
||||
|
||||
@@ -69,7 +69,7 @@ class UIWatchLargeDigital() : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// disabling light button
|
||||
batch.color = Color.WHITE
|
||||
batch.draw(watchface, -1f, -1f)
|
||||
|
||||
@@ -119,11 +119,11 @@ class UIWorldPortal : UICanvas(
|
||||
transitionPanel.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
drawBackground(batch, 1f)
|
||||
|
||||
// UI items
|
||||
transitionPanel.render(batch, camera)
|
||||
transitionPanel.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
internal fun addWorldToPlayersDict(uuid: UUID) {
|
||||
@@ -280,11 +280,11 @@ class UIItemWorldPortalTopBar(
|
||||
}
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(batch, camera)
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(frameDelta, batch, camera)
|
||||
|
||||
// button
|
||||
/*buttons.forEach { it.render(batch, camera) }
|
||||
/*buttons.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
// label
|
||||
batch.color = Color.WHITE
|
||||
|
||||
@@ -172,16 +172,16 @@ class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas(), HasInventory {
|
||||
else
|
||||
"${App.gamepadLabelStart} ${Lang["GAME_ACTION_CLOSE"]} "
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// background fill
|
||||
UIInventoryFull.drawBackground(batch, 1f)
|
||||
|
||||
// UI items
|
||||
batch.color = Color.WHITE
|
||||
|
||||
catBar.render(batch, camera)
|
||||
itemListChest.render(batch, camera)
|
||||
itemListPlayer.render(batch, camera)
|
||||
catBar.render(frameDelta, batch, camera)
|
||||
itemListChest.render(frameDelta, batch, camera)
|
||||
itemListPlayer.render(frameDelta, batch, camera)
|
||||
|
||||
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
@@ -45,14 +45,14 @@ class UIWorldPortalDelete(private val full: UIWorldPortal) : UICanvas() {
|
||||
}
|
||||
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
full.selectedButton?.let {
|
||||
val buttonYdelta = (App.scr.tvSafeGraphicsHeight + 172 + 36) - it.posY
|
||||
val buttonXdelta = (Toolkit.drawWidth - it.width) / 2 - it.posX
|
||||
it.render(batch, camera, buttonXdelta, buttonYdelta)
|
||||
it.render(frameDelta, batch, camera, buttonXdelta, buttonYdelta)
|
||||
}
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
batch.color = Color.WHITE
|
||||
// ui title
|
||||
|
||||
@@ -389,7 +389,7 @@ class UIWorldPortalListing(val full: UIWorldPortal) : UICanvas() {
|
||||
private var selectedWorldThumb: TextureRegion? = null
|
||||
|
||||
val icons = CommonResourcePool.getAsTextureRegionPack("terrarum-basegame-worldportalicons")
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val memoryGaugeXpos = hx - memoryGaugeWidth - gridGap/2
|
||||
val memoryGaugeYpos = y + listHeight - buttonHeight
|
||||
val textXpos = memoryGaugeXpos + 3
|
||||
@@ -454,8 +454,8 @@ class UIWorldPortalListing(val full: UIWorldPortal) : UICanvas() {
|
||||
}
|
||||
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
if (::worldCells.isInitialized) worldCells.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
if (::worldCells.isInitialized) worldCells.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
// control hints
|
||||
batch.color = Color.WHITE
|
||||
@@ -565,8 +565,8 @@ class UIItemWorldCellsSimple(
|
||||
super.update(delta)
|
||||
}
|
||||
|
||||
fun render(batch: SpriteBatch, camera: OrthographicCamera, offX: Int, offY: Int) {
|
||||
super.render(batch, camera)
|
||||
fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera, offX: Int, offY: Int) {
|
||||
super.render(frameDelta, batch, camera)
|
||||
|
||||
val posX = posX + offX
|
||||
val posY = posY + offY
|
||||
@@ -597,8 +597,8 @@ class UIItemWorldCellsSimple(
|
||||
}
|
||||
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
render(batch, camera, 0, 0)
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
render(frameDelta, batch, camera, 0, 0)
|
||||
}
|
||||
|
||||
override fun scrolled(amountX: Float, amountY: Float): Boolean {
|
||||
|
||||
@@ -64,7 +64,7 @@ class UIWorldPortalRename(private val full: UIWorldPortal) : UICanvas() {
|
||||
|
||||
private var oldPosX = full.posX
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val posXDelta = posX - oldPosX
|
||||
|
||||
// ugh why won't you just scroll along??
|
||||
@@ -78,14 +78,14 @@ class UIWorldPortalRename(private val full: UIWorldPortal) : UICanvas() {
|
||||
full.selectedButton?.let {
|
||||
val buttonYdelta = (App.scr.tvSafeGraphicsHeight + 172 + 36) - it.posY
|
||||
val buttonXdelta = (Toolkit.drawWidth - it.width) / 2 - it.posX
|
||||
it.render(batch, camera, buttonXdelta, buttonYdelta)
|
||||
it.render(frameDelta, batch, camera, buttonXdelta, buttonYdelta)
|
||||
}
|
||||
|
||||
// control hints
|
||||
batch.color = Color.WHITE
|
||||
App.fontGame.draw(batch, full.portalListingControlHelp, (Toolkit.drawWidth - width)/2 + 2, (full.yEnd - 20).toInt())
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
oldPosX = posX
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() {
|
||||
val icons = CommonResourcePool.getAsTextureRegionPack("terrarum-basegame-worldportalicons")
|
||||
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val memoryGaugeXpos = hx - memoryGaugeWidth/2
|
||||
val memoryGaugeYpos = drawY + sizeSelY + buttonHeight + 10
|
||||
val textXpos = memoryGaugeXpos + 3
|
||||
@@ -233,7 +233,7 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() {
|
||||
batch.color = Color.WHITE
|
||||
App.fontGame.draw(batch, full.portalListingControlHelp, 2 + (Toolkit.drawWidth - 560)/2 + 2, (full.yEnd - 20).toInt())
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
oldPosX = posX
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class UIWorldPortalShare(private val full: UIWorldPortal) : UICanvas() {
|
||||
|
||||
private lateinit var wotKeys: List<String>
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
|
||||
val textY = drawY + (height/2) - App.fontGame.lineHeight.toInt() * 4 - 2
|
||||
@@ -93,7 +93,7 @@ class UIWorldPortalShare(private val full: UIWorldPortal) : UICanvas() {
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.portalListingControlHelp, (Toolkit.drawWidth - width)/2 + 2, (full.yEnd - 20).toInt())
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ class UIWorldPortalUseInvitation(val full: UIWorldPortal) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// error messages
|
||||
if (importReturnCode != 0) {
|
||||
batch.color = Toolkit.Theme.COL_RED
|
||||
@@ -128,7 +128,7 @@ class UIWorldPortalUseInvitation(val full: UIWorldPortal) : UICanvas() {
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.portalListingControlHelp, 2 + (Toolkit.drawWidth - 560)/2 + 2, (full.yEnd - 20).toInt())
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -87,7 +87,7 @@ class UIElemTest : ApplicationAdapter() {
|
||||
gdxClearAndEnableBlend(0.1f, 0.1f, 0.1f, 1f)
|
||||
|
||||
ui.update(Gdx.graphics.deltaTime)
|
||||
ui.render(batch, camera)
|
||||
ui.render(Gdx.graphics.deltaTime, batch, camera)
|
||||
|
||||
Gdx.graphics.setTitle("Terrarum UIElemTest $EMDASH F: ${Gdx.graphics.framesPerSecond}")
|
||||
}
|
||||
@@ -122,13 +122,13 @@ class DummyTogglePane : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.inUse {
|
||||
batch.color = Color.CORAL
|
||||
Toolkit.fillArea(batch, 0f, 0f, 800f, 600f)
|
||||
|
||||
batch.color = Color.WHITE
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ class BasicDebugInfoWindow : UICanvas() {
|
||||
|
||||
private val tileCursX = 0; private val tileCursY = 4
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
TerrarumIngame.setCameraPosition(batch, App.shapeRender, camera, 0f, 0f)
|
||||
|
||||
// toggle show-something
|
||||
|
||||
@@ -104,7 +104,7 @@ class ConsoleWindow : UICanvas() {
|
||||
textinput.isEnabled = (isOpened && !isClosing)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// background
|
||||
batch.color = UIColour
|
||||
Toolkit.fillArea(batch, drawOffX, drawOffY, width.toFloat(), height.toFloat())
|
||||
@@ -132,7 +132,7 @@ class ConsoleWindow : UICanvas() {
|
||||
App.fontGame.draw(batch, message, 1f + drawOffX, (LINE_HEIGHT * (MESSAGES_DISPLAY_COUNT - i)).toFloat() + drawOffY + inputToMsgboxGap)
|
||||
}
|
||||
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
uiItems.forEach { it.render(frameDelta, batch, camera) }
|
||||
}
|
||||
|
||||
override fun inputStrobed(e: TerrarumKeyboardEvent) {
|
||||
|
||||
@@ -56,7 +56,7 @@ class UIAutosaveNotifier : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val spin = spinner.get(spinnerFrame % 8, spinnerFrame / 8)
|
||||
val offX = App.scr.width - WIDTH - (App.scr.tvSafeGraphicsWidth * 1.25f).roundToInt().toFloat()
|
||||
val offY = App.scr.height - HEIGHT - App.scr.tvSafeGraphicsHeight - 9f // +9 to align to quickslot and watch UI
|
||||
|
||||
@@ -120,8 +120,8 @@ abstract class UICanvas(
|
||||
handler.update(this, delta)
|
||||
}
|
||||
/** Called by the screen */
|
||||
fun render(batch: SpriteBatch, camera: OrthographicCamera, parentOpacity: Float = 1f) {
|
||||
handler.render(this, batch, camera, parentOpacity)
|
||||
fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera, parentOpacity: Float = 1f) {
|
||||
handler.render(this, frameDelta, batch, camera, parentOpacity)
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ abstract class UICanvas(
|
||||
* The transparency of the handler is independent of the draw, you must set the drawing color yourself
|
||||
* (use handler.opacity or handler.opacityColour)
|
||||
*/
|
||||
abstract fun renderUI(batch: SpriteBatch, camera: OrthographicCamera)
|
||||
abstract fun renderUI(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera)
|
||||
|
||||
/**
|
||||
* Do not modify ui.handler.openCloseCounter here.
|
||||
|
||||
@@ -281,7 +281,7 @@ void main() {
|
||||
subUIs.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
fun render(ui: UICanvas, batch: SpriteBatch, camera: OrthographicCamera, parentOpacity: Float) {
|
||||
fun render(ui: UICanvas, frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera, parentOpacity: Float) {
|
||||
|
||||
if (isVisible) {
|
||||
// camera SHOULD BE CENTERED to HALFX and HALFY (see StateInGame) //
|
||||
@@ -301,7 +301,7 @@ void main() {
|
||||
|
||||
batch.shader = shader
|
||||
shader.setUniformf("opacity", opacity * parentOpacity)
|
||||
ui.renderUI(batch, camera)
|
||||
ui.renderUI(frameDelta, batch, camera)
|
||||
//ingameGraphics.flush()
|
||||
|
||||
batch.shader = null
|
||||
@@ -313,7 +313,7 @@ void main() {
|
||||
|
||||
|
||||
subUIs.forEach {
|
||||
it.render(batch, camera)
|
||||
it.render(frameDelta, batch, camera)
|
||||
batch.color = Color.WHITE
|
||||
}
|
||||
|
||||
|
||||
@@ -177,13 +177,13 @@ abstract class UIItem(var parentUI: UICanvas, val initialX: Int, val initialY: I
|
||||
/**
|
||||
* In this time, you do write like: ```draw(posX + 4, posY + 32)```, unlike UICanvas, because posX/posY comes from the parent UI.
|
||||
*/
|
||||
open fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
open fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
if (parentUI.isVisible) {
|
||||
// if (isActive) {
|
||||
mouseOverCall?.render(batch, camera)
|
||||
mouseOverCall?.render(frameDelta, batch, camera)
|
||||
|
||||
if (mouseUp) {
|
||||
mouseOverCall?.renderUI(batch, camera)
|
||||
mouseOverCall?.renderUI(frameDelta, batch, camera)
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class UIItemConfigKeycap(
|
||||
super.update(delta)
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw keycap
|
||||
batch.draw(capTex.get(0, 0), posX.toFloat(), posY.toFloat())
|
||||
batch.draw(capTex.get(1, 0), (posX + capTex.tileW).toFloat(), posY.toFloat(),
|
||||
@@ -54,7 +54,7 @@ class UIItemConfigKeycap(
|
||||
// draw icon
|
||||
|
||||
|
||||
super.render(batch, camera)
|
||||
super.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -95,11 +95,11 @@ class UIItemHorzSlider(
|
||||
|
||||
private val renderOrderMouseUp = arrayOf(0,2,3,1).map { renderJobs[it] }
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
renderOrderMouseUp.forEach { it(batch) }
|
||||
|
||||
super.render(batch, camera)
|
||||
super.render(frameDelta, batch, camera)
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -54,7 +54,7 @@ open class UIItemImageButton(
|
||||
var highlighted = false
|
||||
var extraDrawOp: (UIItem, SpriteBatch) -> Unit = { _,_ -> }
|
||||
|
||||
fun render(batch: SpriteBatch, camera: OrthographicCamera, offX: Int, offY: Int) {
|
||||
fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera, offX: Int, offY: Int) {
|
||||
val posX = this.posX + offX
|
||||
val posY = this.posY + offY
|
||||
|
||||
@@ -93,8 +93,8 @@ open class UIItemImageButton(
|
||||
extraDrawOp(this, batch)
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
render(batch, camera, 0, 0)
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
render(frameDelta, batch, camera, 0, 0)
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -24,7 +24,7 @@ class UIItemImageGallery(
|
||||
override fun update(delta: Float) {
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
override fun render(frameDelta: Float, batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
fun column(i: Int) = i % column
|
||||
fun row(i: Int) = i / column
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user