From cd2043b04469726cf6632d6b6384655e46968173 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Tue, 3 Oct 2023 02:47:10 +0900 Subject: [PATCH] fix: getGradientCloud not sampling correct coord --- .../gameitems/ItemHomeComputer.kt | 4 +- assets/clut/skyboxavr.png | 4 +- assets/mods/basegame/crafting/blocks.json | 10 ++-- assets/mods/basegame/crafting/items.json | 14 ++--- .../clut/GenerateSkyboxTextureAtlas.kt | 19 ++++--- .../torvald/terrarum/gameitems/GameItem.kt | 22 +++++--- .../terrarum/modulebasegame/EntryPoint.kt | 12 ++-- .../gameactors/ActorHumanoid.kt | 8 ++- .../modulebasegame/gameactors/HumanoidNPC.kt | 9 ++- .../gameitems/FixtureItemBase.kt | 3 - .../gameitems/ItemLogicSignalEmitter.kt | 4 +- .../gameitems/ItemStorageChest.kt | 4 +- .../gameitems/ItemSwingingDoorOak.kt | 16 ++---- .../modulebasegame/gameitems/ItemTapestry.kt | 4 +- .../modulebasegame/gameitems/ItemTikiTorch.kt | 4 +- .../gameitems/ItemTypewriter.kt | 4 +- .../gameitems/ItemWallCalendar.kt | 4 +- .../modulebasegame/gameitems/ItemWorkbench.kt | 4 +- .../gameitems/ItemWorldPortal.kt | 4 +- .../gameitems/PickaxeGeneric.kt | 36 +++++------- .../gameitems/SledgehammerCore.kt | 36 +++++------- .../modulebasegame/gameitems/WireCutterAll.kt | 8 +-- .../gameitems/WireGraphDebugger.kt | 10 ++-- .../gameitems/WirePieceSignalWire.kt | 6 +- .../torvald/terrarum/weather/WeatherMixer.kt | 55 ++++++++++--------- 25 files changed, 140 insertions(+), 164 deletions(-) diff --git a/ModuleComputers/src/net/torvald/terrarum/modulecomputers/gameitems/ItemHomeComputer.kt b/ModuleComputers/src/net/torvald/terrarum/modulecomputers/gameitems/ItemHomeComputer.kt index 30e04f2eb..4ad955280 100644 --- a/ModuleComputers/src/net/torvald/terrarum/modulecomputers/gameitems/ItemHomeComputer.kt +++ b/ModuleComputers/src/net/torvald/terrarum/modulecomputers/gameitems/ItemHomeComputer.kt @@ -18,11 +18,8 @@ import net.torvald.terrarum.modulecomputers.gameactors.FixtureHomeComputer class ItemHomeComputer(originalID: ItemID) : GameItem(originalID) { override var dynamicID: ItemID = originalID - override val originalName = "Computer" override var baseMass = 20.0 - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -32,6 +29,7 @@ class ItemHomeComputer(originalID: ItemID) : GameItem(originalID) { init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_DESKTOP_COMPUTER" } override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = mouseInInteractableRange(actor) { _, _, mtx, mty -> diff --git a/assets/clut/skyboxavr.png b/assets/clut/skyboxavr.png index 1ecb6f785..1303c966f 100644 --- a/assets/clut/skyboxavr.png +++ b/assets/clut/skyboxavr.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4201e1a48b9d4435adbcc5d9ae8e77e7c4c0ed19c182e754bd5a29a1da53581a -size 50461 +oid sha256:c8d1ced0fd995eb36a4a5c6143fde0abff37a7f73bffb24b257b72372442909a +size 41287 diff --git a/assets/mods/basegame/crafting/blocks.json b/assets/mods/basegame/crafting/blocks.json index 5480a0db0..5e5afee13 100644 --- a/assets/mods/basegame/crafting/blocks.json +++ b/assets/mods/basegame/crafting/blocks.json @@ -1,29 +1,29 @@ { - "basegame:160": { + "basegame:160": { /* stone platform */ "workbench": "", "ingredients": [ [2, 1, "$ROCK"] ] }, - "basegame:161": { + "basegame:161": { /* wooden platform */ "workbench": "", "ingredients": [ [2, 1, "basegame:48"] ] }, - "basegame:162": { + "basegame:162": { /* ebony platform */ "workbench": "", "ingredients": [ [2, 1, "basegame:49"] ] }, - "basegame:163": { + "basegame:163": { /* birch platform */ "workbench": "", "ingredients": [ [2, 1, "basegame:50"] ] }, - "basegame:164": { + "basegame:164": { /* rosewood platform */ "workbench": "", "ingredients": [ [2, 1, "basegame:51"] diff --git a/assets/mods/basegame/crafting/items.json b/assets/mods/basegame/crafting/items.json index 55e7910b3..b163e039d 100644 --- a/assets/mods/basegame/crafting/items.json +++ b/assets/mods/basegame/crafting/items.json @@ -1,5 +1,5 @@ { - "item@basegame:5": { + "item@basegame:5": { /* tiki torch */ "workbench": "", "ingredients": [ [1, 3, "$WOOD", 1, "basegame:176"], @@ -7,32 +7,32 @@ ] }, - "item@basegame:16": { + "item@basegame:16": { /* workbench */ "workbench": "", "ingredients": [ - [1, 6, "$WOOD"] + [1, 8, "$WOOD"] ] }, - "item@basegame:256": { + "item@basegame:256": { /* oak door */ "workbench": "basiccrafting", "ingredients": [ [1, 4, "basegame:48"] ] }, - "item@basegame:257": { + "item@basegame:257": { /* ebony door */ "workbench": "basiccrafting", "ingredients": [ [1, 4, "basegame:49"] ] }, - "item@basegame:258": { + "item@basegame:258": { /* birch door */ "workbench": "basiccrafting", "ingredients": [ [1, 4, "basegame:50"] ] }, - "item@basegame:259": { + "item@basegame:259": { /* rosewood door */ "workbench": "basiccrafting", "ingredients": [ [1, 4, "basegame:51"] diff --git a/src/net/torvald/terrarum/clut/GenerateSkyboxTextureAtlas.kt b/src/net/torvald/terrarum/clut/GenerateSkyboxTextureAtlas.kt index 5a33725d5..df7e72294 100644 --- a/src/net/torvald/terrarum/clut/GenerateSkyboxTextureAtlas.kt +++ b/src/net/torvald/terrarum/clut/GenerateSkyboxTextureAtlas.kt @@ -137,7 +137,7 @@ class GenerateSkyboxTextureAtlas { File("./assets/clut/skybox.tga").writeBytes(bytes) } - private val gradSizes = (0 until Skybox.gradSize) + private val gradSizes = listOf(50) private fun getByte(gammaPair: Int, albedo0: Int, turb0: Int, elev0: Int, yp: Int, channel: Int): Byte { val imgOffX = albedo0 * Skybox.elevCnt + elev0 + Skybox.elevCnt * Skybox.albedoCnt * gammaPair @@ -179,12 +179,12 @@ class GenerateSkyboxTextureAtlas { println("....... Turbidity=$turbidity") for (elev0 in 0 until Skybox.elevCnt) { - val avrB = (gradSizes.sumOf { getByte(gammaPair, albedo0, turb0, elev0, it, 0).toUint() }.toDouble() / Skybox.gradSize).div(255.0).srgbLinearise().toFloat() - val avrG = (gradSizes.sumOf { getByte(gammaPair, albedo0, turb0, elev0, it, 1).toUint() }.toDouble() / Skybox.gradSize).div(255.0).srgbLinearise().toFloat() - val avrR = (gradSizes.sumOf { getByte(gammaPair, albedo0, turb0, elev0, it, 2).toUint() }.toDouble() / Skybox.gradSize).div(255.0).srgbLinearise().toFloat() - val avrA = (gradSizes.sumOf { getByte(gammaPair, albedo0, turb0, elev0, it, 3).toUint() }.toDouble() / Skybox.gradSize).div(255.0).srgbLinearise().toFloat() + val avrB = (gradSizes.sumOf { getByte(gammaPair, albedo0, turb0, elev0, it, 0).toUint() }.toDouble() / gradSizes.size).div(255.0).toFloat() + val avrG = (gradSizes.sumOf { getByte(gammaPair, albedo0, turb0, elev0, it, 1).toUint() }.toDouble() / gradSizes.size).div(255.0).toFloat() + val avrR = (gradSizes.sumOf { getByte(gammaPair, albedo0, turb0, elev0, it, 2).toUint() }.toDouble() / gradSizes.size).div(255.0).toFloat() + val avrA = (gradSizes.sumOf { getByte(gammaPair, albedo0, turb0, elev0, it, 3).toUint() }.toDouble() / gradSizes.size).div(255.0).toFloat() - val colour = Cvec(avrR, avrG, avrB, avrA).saturate(1.6666667f) + val colour = Cvec(avrR, avrG, avrB, avrA).mul(1.02f).vibrancy(1.1f) val colourBytes = arrayOf( colour.b.times(255f).roundToInt().coerceIn(0..255).toByte(), @@ -223,9 +223,12 @@ class GenerateSkyboxTextureAtlas { this * 12.92 } - private fun Cvec.saturate(intensity: Float): Cvec { + private fun Cvec.vibrancy(intensity: Float): Cvec { val luv = HUSLColorConverter.rgbToHsluv(floatArrayOf(this.r, this.g, this.b)) - luv[1] *= intensity + + val sat = luv[1] // 0..100 + luv[1] = (sat / 100f).pow(1f / intensity) * 100f + val rgb = HUSLColorConverter.hsluvToRgb(luv) this.r = rgb[0] this.g = rgb[1] diff --git a/src/net/torvald/terrarum/gameitems/GameItem.kt b/src/net/torvald/terrarum/gameitems/GameItem.kt index 387c73dd0..d25ae821e 100644 --- a/src/net/torvald/terrarum/gameitems/GameItem.kt +++ b/src/net/torvald/terrarum/gameitems/GameItem.kt @@ -42,7 +42,7 @@ abstract class GameItem(val originalID: ItemID) : Comparable, Cloneabl * * e.g. Key Items (in a Pokémon sense); only the single instance of the item can exist in the pocket */ - abstract val isUnique: Boolean + @Transient var isUnique: Boolean = false /** * OriginalName is always read from Language files. @@ -52,10 +52,10 @@ abstract class GameItem(val originalID: ItemID) : Comparable, Cloneabl * - `BLOCK_AIR` – Prints out `Lang.get("BLOCK_AIR")` * - `BLOCK_AIR>>=BLOCK_WALL_NAME_TEMPLATE` – Prints out `Formatter().format(Lang.get("BLOCK_WALL_NAME_TEMPLATE"), Lang.get("BLOCK_AIR")).toString()` */ - abstract val originalName: String + @Transient var originalName: String = "" - var newName: String = "I AM VITUN PLACEHOLDER" + var newName: String = "" private set /** @@ -84,7 +84,7 @@ abstract class GameItem(val originalID: ItemID) : Comparable, Cloneabl var itemProperties = ItemValue() /** Single-use then destroyed (e.g. Tiles), same as "consumable" */ - abstract var stackable: Boolean + @Transient var stackable: Boolean = true /** @@ -110,7 +110,7 @@ abstract class GameItem(val originalID: ItemID) : Comparable, Cloneabl * } * ``` */ - var equipPosition: Int = EquipPosition.NULL + @Transient var equipPosition: Int = EquipPosition.NULL internal val material: Material get() = MaterialCodex.getOrDefault(materialId) @@ -180,7 +180,7 @@ abstract class GameItem(val originalID: ItemID) : Comparable, Cloneabl /** * Set to zero (GameItem.DURABILITY_NA) if durability not applicable */ - open var maxDurability: Int = 0 + @Transient open var maxDurability: Int = 0 /** * Float. NOT A MISTAKE @@ -189,7 +189,15 @@ abstract class GameItem(val originalID: ItemID) : Comparable, Cloneabl @Transient var using = false // Always false when loaded from savegame - var tags = HashSet() + /** + * Tags defined by the basegame + */ + @Transient var tags = HashSet() + + /** + * Tags added/removed by dynamic items + */ + var modifiers = HashSet() /** * Mainly intended to be used by third-party modules diff --git a/src/net/torvald/terrarum/modulebasegame/EntryPoint.kt b/src/net/torvald/terrarum/modulebasegame/EntryPoint.kt index b64f4778a..b1a0a63ba 100644 --- a/src/net/torvald/terrarum/modulebasegame/EntryPoint.kt +++ b/src/net/torvald/terrarum/modulebasegame/EntryPoint.kt @@ -91,10 +91,8 @@ class EntryPoint : ModuleEntryPoint() { private fun makeNewItemObj(tile: BlockProp, isWall: Boolean) = object : GameItem( if (isWall) "wall@"+tile.id else tile.id ) { - override val isUnique: Boolean = false override var baseMass: Double = tile.density / 1000.0 override var baseToolSize: Double? = null - override var stackable = true override var inventoryCategory = if (isWall) Category.WALL else Category.BLOCK override var isDynamic = false override val materialId = tile.material @@ -111,13 +109,13 @@ class EntryPoint : ModuleEntryPoint() { init { equipPosition = EquipPosition.HAND_GRIP tags.addAll(tile.tags) + originalName = + if (isWall && tags.contains("UNLIT")) "${tile.nameKey}>>=BLOCK_UNLIT_TEMPLATE>>=BLOCK_WALL_NAME_TEMPLATE" + else if (isWall) "${tile.nameKey}>>=BLOCK_WALL_NAME_TEMPLATE" + else if (tags.contains("UNLIT")) "${tile.nameKey}>>=BLOCK_UNLIT_TEMPLATE" + else tile.nameKey } - override val originalName: String = - if (isWall && tags.contains("UNLIT")) "${tile.nameKey}>>=BLOCK_UNLIT_TEMPLATE>>=BLOCK_WALL_NAME_TEMPLATE" - else if (isWall) "${tile.nameKey}>>=BLOCK_WALL_NAME_TEMPLATE" - else if (tags.contains("UNLIT")) "${tile.nameKey}>>=BLOCK_UNLIT_TEMPLATE" - else tile.nameKey override fun startPrimaryUse(actor: ActorWithBody, delta: Float): Long { return BlockBase.blockStartPrimaryUse(actor, this, dynamicID, delta) diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/ActorHumanoid.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/ActorHumanoid.kt index 8e9589bec..1ec75e9ad 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/ActorHumanoid.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/ActorHumanoid.kt @@ -186,14 +186,16 @@ open class ActorHumanoid : ActorWithBody, Controllable, Pocketed, Factionable, L private var jumpJustPressedLatched = false @Transient private val nullItem = object : GameItem("item@basegame:0") { - override val isUnique: Boolean = false override var baseMass: Double = 0.0 override var baseToolSize: Double? = null override var inventoryCategory = "should_not_be_seen" - override val originalName: String = actorValue.getAsString(AVKey.NAME) ?: "(no name)" - override var stackable = false override val isDynamic = false override val materialId = "" + + init { + stackable = false + originalName = actorValue.getAsString(AVKey.NAME) ?: "(no name)" + } } override fun update(delta: Float) { diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/HumanoidNPC.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/HumanoidNPC.kt index 88e85bb34..215baea6b 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/HumanoidNPC.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/HumanoidNPC.kt @@ -36,7 +36,6 @@ open class HumanoidNPC : ActorHumanoid, AIControlled, CanBeAnItem { // we're having GameItem data so that this class could be somewhat universal override var itemData: GameItem = object : GameItem("actor:"+referenceID) {//GameItem(referenceID ?: forceAssignRefID!!) { - override val isUnique = true override var baseMass: Double get() = actorValue.getAsDouble(AVKey.BASEMASS)!! set(value) { actorValue[AVKey.BASEMASS] = value } @@ -47,8 +46,6 @@ open class HumanoidNPC : ActorHumanoid, AIControlled, CanBeAnItem { actorValue[AVKey.SCALE] = value } override var inventoryCategory = "npc" - override val originalName: String = actorValue.getAsString(AVKey.NAME) ?: "NPC" - override var stackable = true override val isDynamic = false override val materialId = "" @@ -65,6 +62,12 @@ open class HumanoidNPC : ActorHumanoid, AIControlled, CanBeAnItem { return -1 } } + + init { + isUnique = true + stackable = false + originalName = actorValue.getAsString(AVKey.NAME) ?: "NPC" + } } override fun getItemWeight(): Double { diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/FixtureItemBase.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/FixtureItemBase.kt index 8c6e1ab9a..f40b5c35d 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/FixtureItemBase.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/FixtureItemBase.kt @@ -39,11 +39,8 @@ open class FixtureItemBase(originalID: ItemID, val fixtureClassName: String) : G @Transient private var ghostInit = AtomicBoolean(false) override var dynamicID: ItemID = originalID - override val originalName = "FIXTUREBASE" override var baseMass = 1.0 - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemLogicSignalEmitter.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemLogicSignalEmitter.kt index c9161e33a..f49130704 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemLogicSignalEmitter.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemLogicSignalEmitter.kt @@ -11,11 +11,8 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureLogicSignalEmitter class ItemLogicSignalEmitter(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureLogicSignalEmitter") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_LOGIC_SIGNAL_EMITTER" override var baseMass = FixtureLogicSignalEmitter.MASS - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -25,6 +22,7 @@ class ItemLogicSignalEmitter(originalID: ItemID) : FixtureItemBase(originalID, " init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_LOGIC_SIGNAL_EMITTER" } override fun effectWhileEquipped(actor: ActorWithBody, delta: Float) { diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemStorageChest.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemStorageChest.kt index 6391b100f..2518b096e 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemStorageChest.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemStorageChest.kt @@ -13,11 +13,8 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch class ItemStorageChest(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureStorageChest") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_STORAGE_CHEST" override var baseMass = FixtureTikiTorch.MASS - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -26,6 +23,7 @@ class ItemStorageChest(originalID: ItemID) : FixtureItemBase(originalID, "net.to init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_STORAGE_CHEST" } } \ No newline at end of file diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemSwingingDoorOak.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemSwingingDoorOak.kt index 07c7324a0..b6d1bf164 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemSwingingDoorOak.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemSwingingDoorOak.kt @@ -13,11 +13,8 @@ class ItemSwingingDoorOak(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureSwingingDoorOak") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_DOOR_OAK" override var baseMass = 20.0 // 360[L] * 0.1 * 0.56[SpecificGravity], rounded to the nearest integer - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -26,6 +23,7 @@ class ItemSwingingDoorOak(originalID: ItemID) : init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_DOOR_OAK" } @Transient override val makeFixture: () -> FixtureBase = { @@ -38,11 +36,8 @@ class ItemSwingingDoorEbony(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureSwingingDoorEbony") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_DOOR_EBONY" override var baseMass = 30.0 // 360[L] * 0.1 * 0.82[SpecificGravity], rounded to the nearest integer - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -51,6 +46,7 @@ class ItemSwingingDoorEbony(originalID: ItemID) : init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_DOOR_EBONY" } @Transient override val makeFixture: () -> FixtureBase = { @@ -63,11 +59,8 @@ class ItemSwingingDoorBirch(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureSwingingDoorBirch") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_DOOR_BIRCH" override var baseMass = 17.0 // 360[L] * 0.1 * 0.48[SpecificGravity], rounded to the nearest integer - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -76,6 +69,7 @@ class ItemSwingingDoorBirch(originalID: ItemID) : init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_DOOR_BIRCH" } @Transient override val makeFixture: () -> FixtureBase = { @@ -88,11 +82,8 @@ class ItemSwingingDoorRosewood(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureSwingingDoorRosewood") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_DOOR_ROSEWOOD" override var baseMass = 24.0 // 360[L] * 0.1 * 0.68[SpecificGravity], rounded to the nearest integer - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -101,6 +92,7 @@ class ItemSwingingDoorRosewood(originalID: ItemID) : init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_DOOR_ROSEWOOD" } @Transient override val makeFixture: () -> FixtureBase = { diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTapestry.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTapestry.kt index b7110804e..e9b1d5e8e 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTapestry.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTapestry.kt @@ -15,11 +15,8 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureTapestry class ItemTapestry(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureTapestry") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_TAPESTRY" override var baseMass = 6.0 - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -28,6 +25,7 @@ class ItemTapestry(originalID: ItemID) : FixtureItemBase(originalID, "net.torval init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_TAPESTRY" } @Transient override val makeFixture: () -> FixtureBase = { diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTikiTorch.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTikiTorch.kt index adc6e2459..bffc7b068 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTikiTorch.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTikiTorch.kt @@ -11,11 +11,8 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch class ItemTikiTorch(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_TIKI_TORCH" override var baseMass = FixtureTikiTorch.MASS - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -25,6 +22,7 @@ class ItemTikiTorch(originalID: ItemID) : FixtureItemBase(originalID, "net.torva init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_TIKI_TORCH" } } \ No newline at end of file diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTypewriter.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTypewriter.kt index 1a0bc2b1d..fcc941851 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTypewriter.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemTypewriter.kt @@ -11,11 +11,8 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch class ItemTypewriter(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureTypewriter") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_TYPEWRITER" override var baseMass = FixtureTikiTorch.MASS - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -25,6 +22,7 @@ class ItemTypewriter(originalID: ItemID) : FixtureItemBase(originalID, "net.torv init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_TYPEWRITER" } } \ No newline at end of file diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWallCalendar.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWallCalendar.kt index 362648f1c..cb67dace7 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWallCalendar.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWallCalendar.kt @@ -10,11 +10,8 @@ import net.torvald.terrarum.gameitems.ItemID class ItemWallCalendar(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureWallCalendar") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_CALENDAR" override var baseMass = 1.0 - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -24,6 +21,7 @@ class ItemWallCalendar(originalID: ItemID) : FixtureItemBase(originalID, "net.to init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_CALENDAR" } } \ No newline at end of file diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWorkbench.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWorkbench.kt index 261128c67..b5872a22b 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWorkbench.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWorkbench.kt @@ -9,11 +9,8 @@ import net.torvald.terrarum.gameitems.ItemID class ItemWorkbench(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureWorkbench") { - override val originalName = "ITEM_WORKBENCH" override var baseMass = 20.0 - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -23,6 +20,7 @@ class ItemWorkbench(originalID: ItemID) : FixtureItemBase(originalID, "net.torva init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_WORKBENCH" } diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWorldPortal.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWorldPortal.kt index 748df6219..12b00305c 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWorldPortal.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemWorldPortal.kt @@ -11,11 +11,8 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch class ItemWorldPortal(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureWorldPortal") { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_WORLD_PORTAL" override var baseMass = 6000.0 - override var stackable = true override var inventoryCategory = Category.MISC - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion @@ -25,6 +22,7 @@ class ItemWorldPortal(originalID: ItemID) : FixtureItemBase(originalID, "net.tor init { equipPosition = EquipPosition.HAND_GRIP + originalName = "ITEM_WORLD_PORTAL" } } \ No newline at end of file diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/PickaxeGeneric.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/PickaxeGeneric.kt index 362d8f01d..16bd6e06d 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/PickaxeGeneric.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/PickaxeGeneric.kt @@ -112,11 +112,8 @@ object PickaxeCore { class PickaxeCopper(originalID: ItemID) : GameItem(originalID) { internal constructor() : this("-uninitialised-") - override val originalName = "ITEM_PICK_COPPER" override var baseToolSize: Double? = BASE_MASS_AND_SIZE - override var stackable = true override var inventoryCategory = Category.TOOL - override val isUnique = false override val isDynamic = true override val materialId = "CUPR" override var baseMass = material.density.toDouble() / MaterialCodex["IRON"].density * BASE_MASS_AND_SIZE @@ -124,10 +121,11 @@ class PickaxeCopper(originalID: ItemID) : GameItem(originalID) { get() = CommonResourcePool.getAsItemSheet("basegame.items").get(0,0) init { - super.equipPosition = GameItem.EquipPosition.HAND_GRIP - super.maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() - super.durability = maxDurability.toFloat() - super.tags.add("PICK") + equipPosition = GameItem.EquipPosition.HAND_GRIP + maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() + durability = maxDurability.toFloat() + tags.add("PICK") + originalName = "ITEM_PICK_COPPER" } override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = @@ -141,11 +139,8 @@ class PickaxeCopper(originalID: ItemID) : GameItem(originalID) { class PickaxeIron(originalID: ItemID) : GameItem(originalID) { internal constructor() : this("-uninitialised-") - override val originalName = "ITEM_PICK_IRON" override var baseToolSize: Double? = BASE_MASS_AND_SIZE - override var stackable = true override var inventoryCategory = Category.TOOL - override val isUnique = false override val isDynamic = true override val materialId = "IRON" override var baseMass = material.density.toDouble() / MaterialCodex["IRON"].density * BASE_MASS_AND_SIZE @@ -153,10 +148,11 @@ class PickaxeIron(originalID: ItemID) : GameItem(originalID) { get() = CommonResourcePool.getAsItemSheet("basegame.items").get(1,0) init { - super.equipPosition = GameItem.EquipPosition.HAND_GRIP - super.maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() - super.durability = maxDurability.toFloat() - super.tags.add("PICK") + equipPosition = GameItem.EquipPosition.HAND_GRIP + maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() + durability = maxDurability.toFloat() + tags.add("PICK") + originalName = "ITEM_PICK_IRON" } override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = @@ -170,11 +166,8 @@ class PickaxeIron(originalID: ItemID) : GameItem(originalID) { class PickaxeSteel(originalID: ItemID) : GameItem(originalID) { internal constructor() : this("-uninitialised-") - override val originalName = "ITEM_PICK_STEEL" override var baseToolSize: Double? = BASE_MASS_AND_SIZE - override var stackable = true override var inventoryCategory = Category.TOOL - override val isUnique = false override val isDynamic = true override val materialId = "STAL" override var baseMass = material.density.toDouble() / MaterialCodex["IRON"].density * BASE_MASS_AND_SIZE @@ -182,10 +175,11 @@ class PickaxeSteel(originalID: ItemID) : GameItem(originalID) { get() = CommonResourcePool.getAsItemSheet("basegame.items").get(2,0) init { - super.equipPosition = GameItem.EquipPosition.HAND_GRIP - super.maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() - super.durability = maxDurability.toFloat() - super.tags.add("PICK") + equipPosition = GameItem.EquipPosition.HAND_GRIP + maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() + durability = maxDurability.toFloat() + tags.add("PICK") + originalName = "ITEM_PICK_STEEL" } override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/SledgehammerCore.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/SledgehammerCore.kt index 0d4b9f8ea..710573c6e 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/SledgehammerCore.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/SledgehammerCore.kt @@ -118,11 +118,8 @@ object SledgehammerCore { class SledgehammerCopper(originalID: ItemID) : GameItem(originalID) { internal constructor() : this("-uninitialised-") - override val originalName = "ITEM_SLEDGEHAMMER_COPPER" override var baseToolSize: Double? = BASE_MASS_AND_SIZE - override var stackable = true override var inventoryCategory = Category.TOOL - override val isUnique = false override val isDynamic = true override val materialId = "CUPR" override var baseMass = material.density.toDouble() / MaterialCodex["IRON"].density * BASE_MASS_AND_SIZE @@ -130,10 +127,11 @@ class SledgehammerCopper(originalID: ItemID) : GameItem(originalID) { get() = CommonResourcePool.getAsItemSheet("basegame.items").get(6,0) init { - super.equipPosition = GameItem.EquipPosition.HAND_GRIP - super.maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() - super.durability = maxDurability.toFloat() - super.tags.add("HAMR") + equipPosition = GameItem.EquipPosition.HAND_GRIP + maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() + durability = maxDurability.toFloat() + tags.add("SLEDGEHAMMER") + originalName = "ITEM_SLEDGEHAMMER_COPPER" } override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = @@ -144,11 +142,8 @@ class SledgehammerCopper(originalID: ItemID) : GameItem(originalID) { class SledgehammerIron(originalID: ItemID) : GameItem(originalID) { internal constructor() : this("-uninitialised-") - override val originalName = "ITEM_SLEDGEHAMMER_IRON" override var baseToolSize: Double? = BASE_MASS_AND_SIZE - override var stackable = true override var inventoryCategory = Category.TOOL - override val isUnique = false override val isDynamic = true override val materialId = "IRON" override var baseMass = material.density.toDouble() / MaterialCodex["IRON"].density * BASE_MASS_AND_SIZE @@ -156,10 +151,11 @@ class SledgehammerIron(originalID: ItemID) : GameItem(originalID) { get() = CommonResourcePool.getAsItemSheet("basegame.items").get(7,0) init { - super.equipPosition = GameItem.EquipPosition.HAND_GRIP - super.maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() - super.durability = maxDurability.toFloat() - super.tags.add("HAMR") + equipPosition = GameItem.EquipPosition.HAND_GRIP + maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() + durability = maxDurability.toFloat() + tags.add("SLEDGEHAMMER") + originalName = "ITEM_SLEDGEHAMMER_IRON" } override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = @@ -170,11 +166,8 @@ class SledgehammerIron(originalID: ItemID) : GameItem(originalID) { class SledgehammerSteel(originalID: ItemID) : GameItem(originalID) { internal constructor() : this("-uninitialised-") - override val originalName = "ITEM_SLEDGEHAMMER_STEEL" override var baseToolSize: Double? = BASE_MASS_AND_SIZE - override var stackable = true override var inventoryCategory = Category.TOOL - override val isUnique = false override val isDynamic = true override val materialId = "STAL" override var baseMass = material.density.toDouble() / MaterialCodex["IRON"].density * BASE_MASS_AND_SIZE @@ -182,10 +175,11 @@ class SledgehammerSteel(originalID: ItemID) : GameItem(originalID) { get() = CommonResourcePool.getAsItemSheet("basegame.items").get(8,0) init { - super.equipPosition = GameItem.EquipPosition.HAND_GRIP - super.maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() - super.durability = maxDurability.toFloat() - super.tags.add("HAMR") + equipPosition = GameItem.EquipPosition.HAND_GRIP + maxDurability = (TOOL_DURABILITY_BASE * material.enduranceMod).roundToInt() + durability = maxDurability.toFloat() + tags.add("SLEDGEHAMMER") + originalName = "ITEM_SLEDGEHAMMER_STEEL" } override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/WireCutterAll.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/WireCutterAll.kt index 015652938..5a302b4df 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/WireCutterAll.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/WireCutterAll.kt @@ -85,19 +85,19 @@ object WireCutterBase { class WireCutterAll(originalID: ItemID) : GameItem(originalID) { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_WIRE_CUTTER" override var baseMass = 0.1 override var baseToolSize: Double? = baseMass - override var stackable = false override var inventoryCategory = Category.TOOL - override val isUnique = true override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion get() = CommonResourcePool.getAsItemSheet("basegame.items").get(1, 3) init { - super.equipPosition = GameItem.EquipPosition.HAND_GRIP + stackable = false + isUnique = true + equipPosition = GameItem.EquipPosition.HAND_GRIP + originalName = "ITEM_WIRE_CUTTER" } override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/WireGraphDebugger.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/WireGraphDebugger.kt index 1d041dc0a..8c3e984b8 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/WireGraphDebugger.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/WireGraphDebugger.kt @@ -12,11 +12,8 @@ import net.torvald.terrarum.modulebasegame.TerrarumIngame class WireGraphDebugger(originalID: ItemID) : GameItem(originalID) { - override val originalName = "WIRE_DEBUGGER" override var baseToolSize: Double? = PickaxeCore.BASE_MASS_AND_SIZE - override var stackable = false override var inventoryCategory = Category.TOOL - override val isUnique = true override val isDynamic = false override val materialId = "CUPR" override var baseMass = 2.0 @@ -24,8 +21,11 @@ class WireGraphDebugger(originalID: ItemID) : GameItem(originalID) { get() = CommonResourcePool.getAsItemSheet("basegame.items").get(2,3) init { - super.equipPosition = GameItem.EquipPosition.HAND_GRIP - super.name = "Wire Debugger" + equipPosition = GameItem.EquipPosition.HAND_GRIP + name = "Wire Debugger" + stackable = false + isUnique = true + originalName = "WIRE_DEBUGGER" } private val sb = StringBuilder() diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/WirePieceSignalWire.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/WirePieceSignalWire.kt index 547273cc5..61753edbd 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/WirePieceSignalWire.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/WirePieceSignalWire.kt @@ -15,19 +15,17 @@ import net.torvald.terrarum.itemproperties.Material class WirePieceSignalWire(originalID: ItemID, private val atlasID: String, private val sheetX: Int, private val sheetY: Int) : GameItem(originalID) { override var dynamicID: ItemID = originalID - override val originalName = "ITEM_WIRE" override var baseMass = 0.001 override var baseToolSize: Double? = null - override var stackable = true override var inventoryCategory = Category.WIRE - override val isUnique = false override val isDynamic = false override val materialId = "" override val itemImage: TextureRegion get() = CommonResourcePool.getAsItemSheet(atlasID).get(sheetX, sheetY) init { - super.equipPosition = GameItem.EquipPosition.HAND_GRIP + equipPosition = GameItem.EquipPosition.HAND_GRIP + originalName = "ITEM_WIRE" } override fun startPrimaryUse(actor: ActorWithBody, delta: Float): Long { diff --git a/src/net/torvald/terrarum/weather/WeatherMixer.kt b/src/net/torvald/terrarum/weather/WeatherMixer.kt index 87857aa00..497a06d14 100644 --- a/src/net/torvald/terrarum/weather/WeatherMixer.kt +++ b/src/net/torvald/terrarum/weather/WeatherMixer.kt @@ -592,9 +592,9 @@ internal object WeatherMixer : RNGConsumer { clouds.forEach { val altOfSolarRay = cloudYtoSolarAlt(it.posY*-1.0, solarElev) - val cloudCol1 = getGradientCloud(skyboxavr, solarElev, mornNoonBlend.toDouble(), turbidity, albedo) + val cloudCol1 = getGradientCloud(skyboxavr, solarElev, 1.0, turbidity, albedo) val cloudCol2 = getGradientColour2(currentWeather.daylightClut, altOfSolarRay, timeNow, 4) - val cloudDrawColour = lerp(0.75, cloudCol1, cloudCol2) // no srgblerp for performance + val cloudDrawColour = lerp(0.7, cloudCol1, cloudCol2) // no srgblerp for performance val shadiness = (1.0 / cosh(altOfSolarRay * 0.5)).toFloat().coerceAtLeast(if (altOfSolarRay < 0) 0.6666f else 0f) @@ -653,7 +653,7 @@ internal object WeatherMixer : RNGConsumer { turbidity0 = (world.weatherbox.oldWeather.json.getDouble("atmoTurbidity") + turbidityCoeff * 2.5).coerceIn(1.0, 10.0) turbidity1 = (currentWeather.json.getDouble("atmoTurbidity") + turbidityCoeff * 2.5).coerceIn(1.0, 10.0) - turbidity = FastMath.interpolateLinear(oldNewBlend.toDouble(), turbidity0, turbidity1) + turbidity = forceTurbidity ?: FastMath.interpolateLinear(oldNewBlend.toDouble(), turbidity0, turbidity1) val oldTurbidity = forceTurbidity ?: turbidity0 val thisTurbidity = forceTurbidity ?: turbidity1 @@ -839,31 +839,36 @@ internal object WeatherMixer : RNGConsumer { val turbY = turbidity.coerceIn(Skybox.turbiditiesD.first(), Skybox.turbiditiesD.last()).minus(1.0) .times(Skybox.turbDivisor) val turbY1 = turbY.floorToInt() - val turbY2 = (turbY1).coerceAtMost(Skybox.turbCnt - 1) + val turbY2 = (turbY1 + 1).coerceAtMost(Skybox.turbCnt - 1) val tx = turbY - turbY1 // coarse-grained val albX = - albedo.coerceIn(Skybox.albedos.first(), Skybox.albedos.last()).times(5.0) * Skybox.elevCnt // 0*151..5*151 - val albX1 = albX.floorToInt() - val albX2 = (albX1 + 1).coerceAtMost(5 * Skybox.elevCnt) - val bx = albX - albX1 + albedo.coerceIn(Skybox.albedos.first(), Skybox.albedos.last()).times(5.0) // 0..5 + val albX1 = albX.floorToInt() * elevCnt + val albX2 = (albX + 1).floorToInt().coerceAtMost(5) * elevCnt + val bx = ((albX * elevCnt) - albX1) / elevCnt - val a1t1b1A = colorMap.getCvec(albX1 * elevCnt + angleX1, turbY1) - val a2t1b1A = colorMap.getCvec(albX1 * elevCnt + angleX2, turbY1) - val a1t2b1A = colorMap.getCvec(albX1 * elevCnt + angleX1, turbY2) - val a2t2b1A = colorMap.getCvec(albX1 * elevCnt + angleX2, turbY2) - val a1t1b2A = colorMap.getCvec(albX2 * elevCnt + angleX1, turbY1) - val a2t1b2A = colorMap.getCvec(albX2 * elevCnt + angleX2, turbY1) - val a1t2b2A = colorMap.getCvec(albX2 * elevCnt + angleX1, turbY2) - val a2t2b2A = colorMap.getCvec(albX2 * elevCnt + angleX2, turbY2) - val a1t1b1B = colorMap.getCvec(albX1 * elevCnt + angleX1 + Skybox.albedoCnt * elevCnt, turbY1) - val a2t1b1B = colorMap.getCvec(albX1 * elevCnt + angleX2 + Skybox.albedoCnt * elevCnt, turbY1) - val a1t2b1B = colorMap.getCvec(albX1 * elevCnt + angleX1 + Skybox.albedoCnt * elevCnt, turbY2) - val a2t2b1B = colorMap.getCvec(albX1 * elevCnt + angleX2 + Skybox.albedoCnt * elevCnt, turbY2) - val a1t1b2B = colorMap.getCvec(albX2 * elevCnt + angleX1 + Skybox.albedoCnt * elevCnt, turbY1) - val a2t1b2B = colorMap.getCvec(albX2 * elevCnt + angleX2 + Skybox.albedoCnt * elevCnt, turbY1) - val a1t2b2B = colorMap.getCvec(albX2 * elevCnt + angleX1 + Skybox.albedoCnt * elevCnt, turbY2) - val a2t2b2B = colorMap.getCvec(albX2 * elevCnt + angleX2 + Skybox.albedoCnt * elevCnt, turbY2) + +// println("AngleX: ($angleX1,$angleX2); TurbY: ($turbY1,$turbY2); AlbX: ($albX1,$albX2); MornNoon=(0,${Skybox.albedoCnt * elevCnt}); Albedo: $albedo") +// println("ax=$ax; tx=$tx; bx=$bx") +// println("XY: ${albX1 + angleX1 + Skybox.albedoCnt * elevCnt}, $turbY1") + + val a1t1b1A = colorMap.getCvec(albX1 + angleX1, turbY1) + val a2t1b1A = colorMap.getCvec(albX1 + angleX2, turbY1) + val a1t2b1A = colorMap.getCvec(albX1 + angleX1, turbY2) + val a2t2b1A = colorMap.getCvec(albX1 + angleX2, turbY2) + val a1t1b2A = colorMap.getCvec(albX2 + angleX1, turbY1) + val a2t1b2A = colorMap.getCvec(albX2 + angleX2, turbY1) + val a1t2b2A = colorMap.getCvec(albX2 + angleX1, turbY2) + val a2t2b2A = colorMap.getCvec(albX2 + angleX2, turbY2) + val a1t1b1B = colorMap.getCvec(albX1 + angleX1 + Skybox.albedoCnt * elevCnt, turbY1) + val a2t1b1B = colorMap.getCvec(albX1 + angleX2 + Skybox.albedoCnt * elevCnt, turbY1) + val a1t2b1B = colorMap.getCvec(albX1 + angleX1 + Skybox.albedoCnt * elevCnt, turbY2) + val a2t2b1B = colorMap.getCvec(albX1 + angleX2 + Skybox.albedoCnt * elevCnt, turbY2) + val a1t1b2B = colorMap.getCvec(albX2 + angleX1 + Skybox.albedoCnt * elevCnt, turbY1) + val a2t1b2B = colorMap.getCvec(albX2 + angleX2 + Skybox.albedoCnt * elevCnt, turbY1) + val a1t2b2B = colorMap.getCvec(albX2 + angleX1 + Skybox.albedoCnt * elevCnt, turbY2) + val a2t2b2B = colorMap.getCvec(albX2 + angleX2 + Skybox.albedoCnt * elevCnt, turbY2) // no srgblerp here to match the skybox shader's behaviour @@ -884,7 +889,7 @@ internal object WeatherMixer : RNGConsumer { val A = lerp(bx, b1A, b2A) val B = lerp(bx, b1B, b2B) - return lerp(mornNoonBlend, A, B) + return B//lerp(mornNoonBlend, A, B) } private fun lerp(x: Double, c1: Cvec, c2: Cvec): Cvec {