mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
new small number font, fix on histogram drawing and torch drawing (now less likely to stick on wall)
Former-commit-id: 04d20ca0bf3c48152234073eb6875512450b942f Former-commit-id: bde21ffce1581885cc449143c2f72932837f3c57
This commit is contained in:
@@ -619,8 +619,7 @@ object LightmapRenderer {
|
||||
val GREEN = 1
|
||||
val BLUE = 2
|
||||
|
||||
val screen_tiles: Int
|
||||
get() = (for_x_end - for_x_start + 2) * (for_y_end - for_y_start + 2)
|
||||
val screen_tiles: Int = (for_x_end - for_x_start + 2) * (for_y_end - for_y_start + 2)
|
||||
|
||||
val brightest: Int
|
||||
get() {
|
||||
@@ -645,20 +644,7 @@ object LightmapRenderer {
|
||||
return CHANNEL_MAX
|
||||
}
|
||||
|
||||
val histogramMax: Int
|
||||
get() {
|
||||
var max = 0
|
||||
for (c in 0..2) {
|
||||
for (i in 0..CHANNEL_MAX) {
|
||||
val value = get(c)[i]
|
||||
if (value > max) max = value
|
||||
}
|
||||
}
|
||||
return max
|
||||
}
|
||||
|
||||
val range: Int
|
||||
get() = reds.size
|
||||
val range: Int = CHANNEL_MAX
|
||||
|
||||
fun get(index: Int): IntArray {
|
||||
return when (index) {
|
||||
|
||||
@@ -392,25 +392,28 @@ object MapCamera {
|
||||
nearbyTiles[NEARBY_TILE_KEY_BACK] = map.getTileFrom(WALL, x, y) ?: 4096
|
||||
|
||||
try {
|
||||
if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_RIGHT]).isSolid
|
||||
&& TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_LEFT]).isSolid) {
|
||||
if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_BACK]).isSolid)
|
||||
return 0
|
||||
else
|
||||
return 3
|
||||
} else if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_RIGHT]).isSolid) {
|
||||
return 2
|
||||
} else if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_LEFT]).isSolid) {
|
||||
return 1
|
||||
} else if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_BACK]).isSolid) {
|
||||
if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_DOWN]).isSolid)
|
||||
// has tile on the bottom
|
||||
return 3
|
||||
else if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_RIGHT]).isSolid
|
||||
&& TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_LEFT]).isSolid)
|
||||
// has tile on both sides
|
||||
return 0
|
||||
} else
|
||||
else if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_RIGHT]).isSolid)
|
||||
// has tile on the right
|
||||
return 2
|
||||
else if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_LEFT]).isSolid)
|
||||
// has tile on the left
|
||||
return 1
|
||||
else if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_BACK]).isSolid)
|
||||
// has tile on the back
|
||||
return 0
|
||||
else
|
||||
return 3
|
||||
} catch (e: ArrayIndexOutOfBoundsException) {
|
||||
return if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_BACK]).isSolid)
|
||||
0
|
||||
else
|
||||
3
|
||||
return if (TilePropCodex.getProp(nearbyTiles[NEARBY_TILE_KEY_DOWN]).isSolid)
|
||||
// has tile on the bottom
|
||||
3 else 0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user