mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
buildingmaker working terrain/wall palette
This commit is contained in:
@@ -15,6 +15,7 @@ import net.torvald.terrarum.gamecontroller.KeyToggler
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.gameworld.fmod
|
||||
import net.torvald.terrarum.worlddrawer.CreateTileAtlas.Companion.WALL_OVERLAY_COLOUR
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@@ -669,7 +670,7 @@ internal object BlocksDrawer {
|
||||
}
|
||||
val vertexColour = when (mode) {
|
||||
TERRAIN, /*WIRE,*/ ORES, FLUID, OCCLUSION -> Color.WHITE
|
||||
WALL -> App.tileMaker.wallOverlayColour
|
||||
WALL -> WALL_OVERLAY_COLOUR
|
||||
else -> throw IllegalArgumentException()
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,10 @@ import kotlin.math.sqrt
|
||||
*/
|
||||
class CreateTileAtlas {
|
||||
|
||||
companion object {
|
||||
val WALL_OVERLAY_COLOUR = Color(.65f, .65f, .65f, 1f)
|
||||
}
|
||||
|
||||
var MAX_TEX_SIZE = App.getConfigInt("atlastexsize").coerceIn(1024, App.glInfo.GL_MAX_TEXTURE_SIZE); private set
|
||||
var TILES_IN_X = MAX_TEX_SIZE / TILE_SIZE; private set
|
||||
|
||||
@@ -38,8 +42,6 @@ class CreateTileAtlas {
|
||||
|
||||
private var TOTAL_TILES = TILES_IN_X * TILES_IN_X
|
||||
|
||||
val wallOverlayColour = Color(.65f, .65f, .65f, 1f)
|
||||
|
||||
lateinit var atlasPrevernal: Pixmap
|
||||
lateinit var atlasVernal: Pixmap
|
||||
lateinit var atlasAestival: Pixmap
|
||||
@@ -250,9 +252,9 @@ class CreateTileAtlas {
|
||||
// darken things for the wall
|
||||
for (y in 0 until itemWallPixmap.height) {
|
||||
for (x in 0 until itemWallPixmap.width) {
|
||||
val c1 = Color(itemWallPixmap.getPixel(x, y)).mulAndAssign(wallOverlayColour).toRGBA()
|
||||
val c1 = Color(itemWallPixmap.getPixel(x, y)).mulAndAssign(WALL_OVERLAY_COLOUR).toRGBA()
|
||||
itemWallPixmap.drawPixel(x, y, c1)
|
||||
val c2 = Color(itemWallPixmapGlow.getPixel(x, y)).mulAndAssign(wallOverlayColour).toRGBA()
|
||||
val c2 = Color(itemWallPixmapGlow.getPixel(x, y)).mulAndAssign(WALL_OVERLAY_COLOUR).toRGBA()
|
||||
itemWallPixmapGlow.drawPixel(x, y, c2)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user