buildingmaker working terrain/wall palette

This commit is contained in:
minjaesong
2023-10-21 20:03:03 +09:00
parent e88b595320
commit 6e90d3521b
5 changed files with 66 additions and 24 deletions

View File

@@ -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)
}
}