mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
when it's not dev build, title bar shows less info
they take some processing time
This commit is contained in:
@@ -100,6 +100,7 @@ object Terrarum : Screen {
|
||||
|
||||
private val javaHeapCircularArray = CircularArray<Int>(128)
|
||||
private val nativeHeapCircularArray = CircularArray<Int>(128)
|
||||
private val updateRateCircularArray = CircularArray<Double>(128)
|
||||
|
||||
val memJavaHeap: Int
|
||||
get() {
|
||||
@@ -119,6 +120,14 @@ object Terrarum : Screen {
|
||||
}
|
||||
val memXmx: Int
|
||||
get() = (Runtime.getRuntime().maxMemory() shr 20).toInt()
|
||||
val updateRateStr: String
|
||||
get() {
|
||||
updateRateCircularArray.add(updateRate)
|
||||
|
||||
var acc = 0.0
|
||||
updateRateCircularArray.forEach { acc = maxOf(acc, it) }
|
||||
return String.format("%.2f", acc)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -482,8 +491,6 @@ object Terrarum : Screen {
|
||||
/** Bigger than 1.0 */
|
||||
inline val updateRate: Double
|
||||
get() = 1.0 / Gdx.graphics.deltaTime
|
||||
val updateRateStr: String
|
||||
get() = String.format("%.2f", updateRate)
|
||||
/** Smaller than 1.0 */
|
||||
val renderRate = 1.0 / TARGET_INTERNAL_FPS
|
||||
val renderRateStr = TARGET_INTERNAL_FPS.toString()
|
||||
@@ -559,7 +566,7 @@ fun Float.round(): Float {
|
||||
fun SpriteBatch.fillRect(x: Float, y: Float, w: Float, h: Float) {
|
||||
this.draw(AppLoader.textureWhiteSquare, x, y, w, h)
|
||||
}
|
||||
inline fun SpriteBatch.drawStraightLine(x: Float, y: Float, otherEnd: Float, thickness: Float, isVertical: Boolean) {
|
||||
fun SpriteBatch.drawStraightLine(x: Float, y: Float, otherEnd: Float, thickness: Float, isVertical: Boolean) {
|
||||
if (!isVertical)
|
||||
this.fillRect(x, y, otherEnd - x, thickness)
|
||||
else
|
||||
@@ -667,23 +674,23 @@ val ccK = GameFontBase.toColorCode(0x888F)
|
||||
|
||||
typealias Second = Float
|
||||
|
||||
inline fun Int.sqr(): Int = this * this
|
||||
inline fun Double.floorInt() = Math.floor(this).toInt()
|
||||
inline fun Float.floorInt() = FastMath.floor(this)
|
||||
inline fun Float.floor() = FastMath.floor(this).toFloat()
|
||||
inline fun Double.ceilInt() = Math.ceil(this).toInt()
|
||||
inline fun Float.ceil(): Float = FastMath.ceil(this).toFloat()
|
||||
inline fun Float.ceilInt() = FastMath.ceil(this)
|
||||
inline fun Double.round() = Math.round(this).toDouble()
|
||||
inline fun Double.floor() = Math.floor(this)
|
||||
inline fun Double.ceil() = this.floor() + 1.0
|
||||
inline fun Double.roundInt(): Int = Math.round(this).toInt()
|
||||
inline fun Float.roundInt(): Int = Math.round(this)
|
||||
inline fun Double.abs() = Math.abs(this)
|
||||
inline fun Double.sqr() = this * this
|
||||
inline fun Double.sqrt() = Math.sqrt(this)
|
||||
inline fun Float.sqrt() = FastMath.sqrt(this)
|
||||
inline fun Int.abs() = this.absoluteValue
|
||||
fun Int.sqr(): Int = this * this
|
||||
fun Double.floorInt() = Math.floor(this).toInt()
|
||||
fun Float.floorInt() = FastMath.floor(this)
|
||||
fun Float.floor() = FastMath.floor(this).toFloat()
|
||||
fun Double.ceilInt() = Math.ceil(this).toInt()
|
||||
fun Float.ceil(): Float = FastMath.ceil(this).toFloat()
|
||||
fun Float.ceilInt() = FastMath.ceil(this)
|
||||
fun Double.round() = Math.round(this).toDouble()
|
||||
fun Double.floor() = Math.floor(this)
|
||||
fun Double.ceil() = this.floor() + 1.0
|
||||
fun Double.roundInt(): Int = Math.round(this).toInt()
|
||||
fun Float.roundInt(): Int = Math.round(this)
|
||||
fun Double.abs() = Math.abs(this)
|
||||
fun Double.sqr() = this * this
|
||||
fun Double.sqrt() = Math.sqrt(this)
|
||||
fun Float.sqrt() = FastMath.sqrt(this)
|
||||
fun Int.abs() = this.absoluteValue
|
||||
fun Double.bipolarClamp(limit: Double) =
|
||||
this.coerceIn(-limit, limit)
|
||||
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
package net.torvald.terrarum.modulebasegame
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.*
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
|
||||
import net.torvald.dataclass.CircularArray
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.AppLoader.printdbg
|
||||
import net.torvald.terrarum.blockproperties.BlockPropUtil
|
||||
import net.torvald.terrarum.blockstats.BlockStats
|
||||
import net.torvald.terrarum.concurrent.ThreadParallel
|
||||
import net.torvald.terrarum.gameactors.*
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.physicssolver.CollisionSolver
|
||||
import net.torvald.terrarum.console.Authenticator
|
||||
import net.torvald.terrarum.gameactors.Actor
|
||||
import net.torvald.terrarum.gameactors.ActorWithBody
|
||||
import net.torvald.terrarum.gamecontroller.IngameController
|
||||
import net.torvald.terrarum.gamecontroller.KeyToggler
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.WorldSimulator
|
||||
import net.torvald.terrarum.modulebasegame.weather.WeatherMixer
|
||||
import net.torvald.terrarum.worlddrawer.FeaturesDrawer
|
||||
import net.torvald.terrarum.worlddrawer.LightmapRenderer
|
||||
import net.torvald.terrarum.worlddrawer.WorldCamera
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.concurrent.locks.ReentrantLock
|
||||
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.AppLoader.printdbg
|
||||
import net.torvald.terrarum.itemproperties.GameItem
|
||||
import net.torvald.terrarum.modulebasegame.console.AVTracker
|
||||
import net.torvald.terrarum.modulebasegame.console.ActorsList
|
||||
import net.torvald.terrarum.console.Authenticator
|
||||
import net.torvald.terrarum.itemproperties.GameItem
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.*
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.physicssolver.CollisionSolver
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.WorldSimulator
|
||||
import net.torvald.terrarum.modulebasegame.imagefont.Watch7SegMain
|
||||
import net.torvald.terrarum.modulebasegame.imagefont.WatchDotAlph
|
||||
import net.torvald.terrarum.modulebasegame.ui.*
|
||||
import net.torvald.terrarum.ui.*
|
||||
import net.torvald.terrarum.modulebasegame.weather.WeatherMixer
|
||||
import net.torvald.terrarum.modulebasegame.worldgenerator.RoguelikeRandomiser
|
||||
import net.torvald.terrarum.modulebasegame.worldgenerator.WorldGenerator
|
||||
import net.torvald.terrarum.ui.BasicDebugInfoWindow
|
||||
import net.torvald.terrarum.ui.ConsoleWindow
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.worlddrawer.FeaturesDrawer
|
||||
import net.torvald.terrarum.worlddrawer.LightmapRenderer
|
||||
import net.torvald.terrarum.worlddrawer.WorldCamera
|
||||
import java.util.*
|
||||
import java.util.concurrent.locks.ReentrantLock
|
||||
import kotlin.system.measureNanoTime
|
||||
|
||||
|
||||
@@ -80,8 +80,12 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
}
|
||||
|
||||
fun getCanonicalTitle() = AppLoader.GAME_NAME +
|
||||
" — F: ${Gdx.graphics.framesPerSecond} (Δt${Terrarum.updateRateStr} / RT${Terrarum.renderRateStr})" +
|
||||
" — M: J${Terrarum.memJavaHeap}M / N${Terrarum.memNativeHeap}M / X${Terrarum.memXmx}M"
|
||||
" — F: ${Gdx.graphics.framesPerSecond}" +
|
||||
if (AppLoader.IS_DEVELOPMENT_BUILD)
|
||||
" (Δt${Terrarum.updateRateStr} / RT${Terrarum.renderRateStr})" +
|
||||
" — M: J${Terrarum.memJavaHeap}M / N${Terrarum.memNativeHeap}M / X${Terrarum.memXmx}M"
|
||||
else
|
||||
""
|
||||
}
|
||||
|
||||
|
||||
@@ -784,6 +788,10 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
val i = actorsRenderFront.binarySearch(actor.referenceID!!)
|
||||
actorsRenderFront.removeAt(i)
|
||||
}
|
||||
Actor.RenderOrder.OVERLAY-> {
|
||||
val i = actorsRenderOverlay.binarySearch(actor.referenceID!!)
|
||||
actorsRenderFront.removeAt(i)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -819,6 +827,9 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
Actor.RenderOrder.FRONT -> {
|
||||
actorsRenderFront.add(actor); insertionSortLastElemAV(actorsRenderFront)
|
||||
}
|
||||
Actor.RenderOrder.OVERLAY-> {
|
||||
actorsRenderOverlay.add(actor); insertionSortLastElemAV(actorsRenderOverlay)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -850,6 +861,9 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
Actor.RenderOrder.FRONT -> {
|
||||
actorsRenderFront.add(actor); insertionSortLastElemAV(actorsRenderFront)
|
||||
}
|
||||
Actor.RenderOrder.OVERLAY-> {
|
||||
actorsRenderOverlay.add(actor); insertionSortLastElemAV(actorsRenderOverlay)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ open class UIRemoCon(treeRepresentation: QNDTreeNode<String>) : UICanvas() {
|
||||
val newCurrentRemoConContents = currentRemoConContents.children[selectedIndex!!]
|
||||
|
||||
// only go deeper if that node has child to navigate
|
||||
if (currentRemoConContents.children[selectedIndex!!].children.size != 0) {
|
||||
if (currentRemoConContents.children[selectedIndex].children.size != 0) {
|
||||
remoConTray.consume()
|
||||
remoConTray = generateNewRemoCon(newCurrentRemoConContents)
|
||||
currentRemoConContents = newCurrentRemoConContents
|
||||
|
||||
@@ -6,13 +6,12 @@ import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.worlddrawer.LightmapRenderer
|
||||
import net.torvald.terrarum.worlddrawer.FeaturesDrawer
|
||||
import net.torvald.terrarum.Terrarum.mouseTileX
|
||||
import net.torvald.terrarum.Terrarum.mouseTileY
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension
|
||||
import net.torvald.terrarum.worlddrawer.FeaturesDrawer
|
||||
import net.torvald.terrarum.worlddrawer.LightmapRenderer
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-03-14.
|
||||
@@ -91,8 +90,8 @@ class BasicDebugInfoWindow : UICanvas() {
|
||||
+ "${(hitbox?.endY?.div(FeaturesDrawer.TILE_SIZE))?.toInt()}"
|
||||
+ ")")
|
||||
|
||||
printLine(batch, 3, "veloX reported $ccG${player.externalForce?.x}")
|
||||
printLine(batch, 4, "veloY reported $ccG${player.externalForce?.y}")
|
||||
printLine(batch, 3, "veloX reported $ccG${player.externalForce.x}")
|
||||
printLine(batch, 4, "veloY reported $ccG${player.externalForce.y}")
|
||||
|
||||
printLine(batch, 5, "p_WalkX $ccG${player.controllerMoveDelta?.x}")
|
||||
printLine(batch, 6, "p_WalkY $ccG${player.controllerMoveDelta?.y}")
|
||||
|
||||
@@ -4,8 +4,8 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.roundInt
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ abstract class UICanvas(
|
||||
}
|
||||
|
||||
|
||||
inline fun addSubUI(ui: UICanvas) {
|
||||
fun addSubUI(ui: UICanvas) {
|
||||
handler.addSubUI(ui)
|
||||
}
|
||||
|
||||
@@ -200,23 +200,23 @@ abstract class UICanvas(
|
||||
|
||||
// handler func aliases //
|
||||
|
||||
inline fun setPosition(x: Int, y: Int) {
|
||||
fun setPosition(x: Int, y: Int) {
|
||||
handler.setPosition(x, y)
|
||||
}
|
||||
|
||||
inline fun setAsAlwaysVisible() {
|
||||
fun setAsAlwaysVisible() {
|
||||
handler.setAsAlwaysVisible()
|
||||
}
|
||||
|
||||
inline fun setAsOpen() {
|
||||
fun setAsOpen() {
|
||||
handler.setAsOpen()
|
||||
}
|
||||
|
||||
inline fun setAsClose() {
|
||||
fun setAsClose() {
|
||||
handler.setAsClose()
|
||||
}
|
||||
|
||||
inline fun toggleOpening() {
|
||||
fun toggleOpening() {
|
||||
handler.toggleOpening()
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ abstract class UIItem(var parentUI: UICanvas) { // do not replace parentUI to UI
|
||||
get() = relativeMouseX in 0..width - 1 && relativeMouseY in 0..height - 1
|
||||
/** If mouse is hovering over it and mouse is down */
|
||||
open val mousePushed: Boolean
|
||||
get() = mouseUp && Gdx.input.isButtonPressed(AppLoader.getConfigInt("mouseprimary")!!)
|
||||
get() = mouseUp && Gdx.input.isButtonPressed(AppLoader.getConfigInt("mouseprimary"))
|
||||
|
||||
|
||||
/** UI to call (show up) while mouse is up */
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import java.lang.Error
|
||||
|
||||
/**
|
||||
* Nextstep-themed menu bar with mandatory title line
|
||||
@@ -43,8 +42,8 @@ class UINSMenu(
|
||||
private data class MenuPack(val title: String, val ui: UIItemTextButtonList)
|
||||
|
||||
private fun ArrayList<MenuPack>.push(item: MenuPack) { this.add(item) }
|
||||
private fun ArrayList<MenuPack>.pop() = this.removeAt(this.lastIndex)!!
|
||||
private fun ArrayList<MenuPack>.peek() = this.last()!!
|
||||
private fun ArrayList<MenuPack>.pop() = this.removeAt(this.lastIndex)
|
||||
private fun ArrayList<MenuPack>.peek() = this.last()
|
||||
|
||||
|
||||
val selectedIndex: Int?
|
||||
|
||||
@@ -2,15 +2,15 @@ package net.torvald.terrarum.worlddrawer
|
||||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.blockproperties.BlockCodex
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.blockproperties.Block
|
||||
import net.torvald.terrarum.blockproperties.BlockCodex
|
||||
import net.torvald.terrarum.fillRect
|
||||
import net.torvald.terrarum.gameactors.*
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
import net.torvald.terrarum.floorInt
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
import net.torvald.terrarum.gameactors.Luminous
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.modulebasegame.IngameRenderer
|
||||
import java.util.*
|
||||
|
||||
@@ -580,17 +580,17 @@ object LightmapRendererOld {
|
||||
}
|
||||
}
|
||||
|
||||
inline infix fun Float.powerOf(f: Float) = FastMath.pow(this, f)
|
||||
private inline fun Float.sqr() = this * this
|
||||
private inline fun Float.sqrt() = FastMath.sqrt(this)
|
||||
private inline fun Float.inv() = 1f / this
|
||||
inline fun Float.floor() = FastMath.floor(this)
|
||||
inline fun Double.floorInt() = Math.floor(this).toInt()
|
||||
inline fun Float.round(): Int = Math.round(this)
|
||||
inline fun Double.round(): Int = Math.round(this).toInt()
|
||||
inline fun Float.ceil() = FastMath.ceil(this)
|
||||
inline fun Int.even(): Boolean = this and 1 == 0
|
||||
inline fun Int.odd(): Boolean = this and 1 == 1
|
||||
infix fun Float.powerOf(f: Float) = FastMath.pow(this, f)
|
||||
private fun Float.sqr() = this * this
|
||||
private fun Float.sqrt() = FastMath.sqrt(this)
|
||||
private fun Float.inv() = 1f / this
|
||||
fun Float.floor() = FastMath.floor(this)
|
||||
fun Double.floorInt() = Math.floor(this).toInt()
|
||||
fun Float.round(): Int = Math.round(this)
|
||||
fun Double.round(): Int = Math.round(this).toInt()
|
||||
fun Float.ceil() = FastMath.ceil(this)
|
||||
fun Int.even(): Boolean = this and 1 == 0
|
||||
fun Int.odd(): Boolean = this and 1 == 1
|
||||
|
||||
// TODO: float LUT lookup using linear interpolation
|
||||
|
||||
@@ -677,14 +677,14 @@ object LightmapRendererOld {
|
||||
1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f // isn't it beautiful?
|
||||
)
|
||||
/** To eliminated visible edge on the gradient when 255/1023 is exceeded */
|
||||
inline fun Color.normaliseToColourHDR() = Color(
|
||||
fun Color.normaliseToColourHDR() = Color(
|
||||
hdr(this.r),
|
||||
hdr(this.g),
|
||||
hdr(this.b),
|
||||
1f
|
||||
)
|
||||
|
||||
inline fun Color.normaliseToAlphaHDR() = Color(
|
||||
fun Color.normaliseToAlphaHDR() = Color(
|
||||
hdr(this.a),
|
||||
hdr(this.a),
|
||||
hdr(this.a),
|
||||
|
||||
@@ -6,21 +6,20 @@ import com.badlogic.gdx.graphics.GL20
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.blockproperties.BlockCodex
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.AppLoader.printdbg
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.blockproperties.Block
|
||||
import net.torvald.terrarum.gameactors.*
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
import net.torvald.terrarum.blockproperties.BlockCodex
|
||||
import net.torvald.terrarum.ceilInt
|
||||
import net.torvald.terrarum.concurrent.ParallelUtils.sliceEvenly
|
||||
import net.torvald.terrarum.concurrent.ThreadParallel
|
||||
import net.torvald.terrarum.floorInt
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
import net.torvald.terrarum.gameactors.Luminous
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.modulebasegame.IngameRenderer
|
||||
import net.torvald.terrarum.concurrent.ParallelUtils.sliceEvenly
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.system.measureNanoTime
|
||||
|
||||
/**
|
||||
@@ -708,17 +707,17 @@ object LightmapRenderer {
|
||||
}
|
||||
*/
|
||||
|
||||
inline infix fun Float.powerOf(f: Float) = FastMath.pow(this, f)
|
||||
private inline fun Float.sqr() = this * this
|
||||
private inline fun Float.sqrt() = FastMath.sqrt(this)
|
||||
private inline fun Float.inv() = 1f / this
|
||||
inline fun Float.floor() = FastMath.floor(this)
|
||||
inline fun Double.floorInt() = Math.floor(this).toInt()
|
||||
inline fun Float.round(): Int = Math.round(this)
|
||||
inline fun Double.round(): Int = Math.round(this).toInt()
|
||||
inline fun Float.ceil() = FastMath.ceil(this)
|
||||
inline fun Int.even(): Boolean = this and 1 == 0
|
||||
inline fun Int.odd(): Boolean = this and 1 == 1
|
||||
infix fun Float.powerOf(f: Float) = FastMath.pow(this, f)
|
||||
private fun Float.sqr() = this * this
|
||||
private fun Float.sqrt() = FastMath.sqrt(this)
|
||||
private fun Float.inv() = 1f / this
|
||||
fun Float.floor() = FastMath.floor(this)
|
||||
fun Double.floorInt() = Math.floor(this).toInt()
|
||||
fun Float.round(): Int = Math.round(this)
|
||||
fun Double.round(): Int = Math.round(this).toInt()
|
||||
fun Float.ceil() = FastMath.ceil(this)
|
||||
fun Int.even(): Boolean = this and 1 == 0
|
||||
fun Int.odd(): Boolean = this and 1 == 1
|
||||
|
||||
// TODO: float LUT lookup using linear interpolation
|
||||
|
||||
@@ -830,7 +829,7 @@ object LightmapRenderer {
|
||||
1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f // isn't it beautiful?
|
||||
)
|
||||
/** To eliminated visible edge on the gradient when 255/1023 is exceeded */
|
||||
internal inline fun Color.normaliseToHDR() = Color(
|
||||
internal fun Color.normaliseToHDR() = Color(
|
||||
hdr(this.r),
|
||||
hdr(this.g),
|
||||
hdr(this.b),
|
||||
|
||||
Reference in New Issue
Block a user