one diag done, one more to go

This commit is contained in:
minjaesong
2020-11-09 23:13:20 +09:00
parent fdee65ad0d
commit 65f536db3c
2 changed files with 35 additions and 30 deletions

View File

@@ -34,10 +34,10 @@ import com.badlogic.gdx.utils.NumberUtils
class Cvec { class Cvec {
/** the red, green, blue and alpha components */ /** the red, green, blue and alpha components */
var r: Float = 0.toFloat() var r: Float = 0f
var g: Float = 0.toFloat() var g: Float = 0f
var b: Float = 0.toFloat() var b: Float = 0f
var a: Float = 0.toFloat() var a: Float = 0f
/** Constructs a new Cvec with all components set to 0. */ /** Constructs a new Cvec with all components set to 0. */
constructor() {} constructor() {}

View File

@@ -286,7 +286,6 @@ object LightmapRenderer {
fun r3() { fun r3() {
// TODO test non-parallel // TODO test non-parallel
swipeDiag = true swipeDiag = true
for (linx in -LIGHTMAP_HEIGHT + 1 until LIGHTMAP_WIDTH - 1) {
/* construct indices such that: /* construct indices such that:
56789ABC 56789ABC
4 1 w-2 4 1 w-2
@@ -301,10 +300,12 @@ object LightmapRenderer {
2 (1, h-2-2) -> (3, h-2) 2 (1, h-2-2) -> (3, h-2)
3 (1, h-2-3) -> (4, h-2) 3 (1, h-2-3) -> (4, h-2)
4 (1, 1) -> (5, h-2) 4 (1, 1) -> (5, h-2)
5 (2, 1) -> (6, h-2) 5 (2, 1) -> (6, h-2)
6 (3, 1) -> (7, h-2) 6 (3, 1) -> (7, h-2)
7 (4, 1) -> (8, h-2) 7 (4, 1) -> (8, h-2)
8 (5, 1) -> (w-2, h-2) 8 (5, 1) -> (w-2, h-2)
9 (6, 1) -> (w-2, h-2-1) 9 (6, 1) -> (w-2, h-2-1)
10 (7, 1) -> (w-2, h-2-2) 10 (7, 1) -> (w-2, h-2-2)
11 (8, 1) -> (w-2, h-2-3) 11 (8, 1) -> (w-2, h-2-3)
@@ -312,8 +313,12 @@ object LightmapRenderer {
number of indices: internal_width + internal_height - 1 number of indices: internal_width + internal_height - 1
*/ */
for (i in 0 until LIGHTMAP_WIDTH + LIGHTMAP_HEIGHT - 5) {
TODO() swipeLight(
maxOf(1, i - LIGHTMAP_HEIGHT - 2 + 2), maxOf(1, LIGHTMAP_HEIGHT - 2 - i),
minOf(LIGHTMAP_WIDTH - 2, i + 1), minOf(LIGHTMAP_HEIGHT - 2, (LIGHTMAP_WIDTH + LIGHTMAP_HEIGHT - 5) - i),
1, 1
)
} }
} }
@@ -333,7 +338,7 @@ object LightmapRenderer {
//r3();r4();r1();r2();r3(); //r3();r4();r1();r2();r3();
r1();r2();//r3() r1();r2();r3()
} }
} }
else if (world.worldIndex != -1) { // to avoid updating on the null world else if (world.worldIndex != -1) { // to avoid updating on the null world