From dc788aa51587f1d6a9db039600df4e793c112acf Mon Sep 17 00:00:00 2001 From: Song Minjae Date: Thu, 3 Mar 2016 16:57:43 +0900 Subject: [PATCH] fix: "sunlight leakage" when GlobalLightLevel was changed, premature lightmap rendering on leftmost side of screen where no pre-calculated light value was given Former-commit-id: bf628e9bde44858f641998e65bf5fef847060791 Former-commit-id: b32fec30a112a7b5868e51ba1394454d5740c5d9 --- .../Terrarum/MapDrawer/LightmapLantern.class | Bin 709 -> 709 bytes .../Terrarum/MapDrawer/LightmapRenderer.class | Bin 13059 -> 13131 bytes .../Terrarum/TileProperties/propdata.csv | 83 +++---- .../Terrarum/MapDrawer/LightmapRenderer.java | 216 +++++++++--------- 4 files changed, 157 insertions(+), 142 deletions(-) diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapLantern.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapLantern.class index 98d6c49fe170b4731ff145d40d7914a3f67a4802..cb42f86c92b1b226409d29bdd1a70d9dfdd5691d 100644 GIT binary patch delta 55 zcmX@gdX#m;VMf7n1{S6Y22Q3*20o@L24SY^$yXSo80#kMGubdU0ZGxxjZEr{ZD7_u GCUyXnvJOE2 delta 55 zcmX@gdX#m;VMf7h1{S6q22Q4220o@d24SZB$yXSo7>g$BGubef0ZGxxjZEr{RbbXW GCUyXc5)I)1 diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.class index eaeb09cef1282f4393d2e8e6f0d082a7d09c2137..b53845f7b160025bfff8cf32d5b72bc9339dbda2 100644 GIT binary patch delta 4810 zcmb7Id0>>)wf~*_&CECR@deo?WZy%EY!i|YAS{v)K_H@lpb}I91PF$NB??;YV9i5Z z+G1}l7B|EqE+{*sR&ifZt5&78*7aHXZ1p`Av_(kzyI(?@=i`sp33KM$d(S=h?Dt%* zTXbkq?B$L}4+1Ec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1UnnKXwYbc1=vmijj~3 z9iCWF(>iLY`v_Lk+LcLLBuu;;nOFG~a>4;;@XeT8Lr>*GftxS$au8 zdP^VaD}$t;j1J0$GL22zOu0mE_x0nBuu$bZQ69?De zCGB`7xN2>4Jtt}+g<5woz1_4sv8^x_i=u#=b%#~2>FIBMf}p2FS4!f4rt@P=BJk|J-a-6?*P zU4S~CGO=_b+Q=j%O9gVI5ZzX$niQzwS_>jIJy;;&6z5aO>* z-CX|tA^Rk$g0z06OSs3Aw9!+v(NfxIS+hNw+vtP;(?)FK)ca}I1=rF>&mmvdVW?~f z@t)3p1}t|68tp#{2SdEw7>)~|v$NT#yJ_?o zzEmqRF6#a+6YV}a_B|xX`=Oc9R0V7x8+OsyS2U7@!om&H_IW89TU?diF(c+cGv>ZV z+t|A8RTUgPeBM#^!)g^rkDPau*A(?t$4iEM#`wm}W2F}KkJ z;k2jryg`3PhrDbuuD$q_G#Aap4qM%kS=IkI)%=>=zG3Ws8{+7vufSe+FK6m!AkUgs zRby*H9Q9f7!ejgNL%rF?tHP|?gK~nw`Xf5YNn9X5VW9ks;qnW{vIgtKQ9?HZ<)K4N zgqThensIq3Nf_K9jxDAR+~H`2pNP5Gt@>E}b>KE`>-fU>$8CAV;c7PCxSK27P+dBe z3}p#&P96cSH0=HRf$Cp$XO=on23>YqIm)5uDmWt$x9u=7zZ|W;lZf>FEsY$uX z{PDwXv}An9A57I75wV^!N$6hT(Nv?5bt{aw*!j5~QoDtuYd96&b5)DBYp7bbzVfOM zaxaT1hR-NLE29_UjowHn-pMFNzR^$h%1cg)pr!Rwz*5~1Vg=GN4H^f-7!TVh zLrcD+jfo+db$Gkbip_xbJm7D%t-(SO9g;$Ok-r`N&MODokw|tdZIx5d)oMq&Au;~~ DQ*qBF diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/TileProperties/propdata.csv b/out/production/Terrarum_renewed/com/Torvald/Terrarum/TileProperties/propdata.csv index ca21bdb5e..246027201 100644 --- a/out/production/Terrarum_renewed/com/Torvald/Terrarum/TileProperties/propdata.csv +++ b/out/production/Terrarum_renewed/com/Torvald/Terrarum/TileProperties/propdata.csv @@ -1,46 +1,49 @@ "id";"name" ;"opacity";"strength";"fluid";"viscosity";"solid";"wall";"lumcolor";"opaque";"drop";"fall";"friction" -# Friction: 0: frictionless, <16: slippery, 16: regular, >16: sticky | Opacity/Lumcolor: 40-step RGB | Opaque: whether the tile completely hides wall behind - "0";"TILE_AIR" ; "1641"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "0"; "0";"16" - "1";"TILE_STONE" ; "8205"; "25"; "0"; "N/A"; "1"; "1"; "0"; "1"; "1"; "0";"16" - "2";"TILE_DIRT" ; "8205"; "6"; "0"; "N/A"; "1"; "1"; "0"; "1"; "2"; "0";"16" - "3";"TILE_GRASS" ; "8205"; "6"; "0"; "N/A"; "1"; "1"; "0"; "1"; "2"; "0";"16" - "4";"TILE_PLANK_NORMAL" ; "8205"; "12"; "0"; "N/A"; "1"; "1"; "0"; "1"; "4"; "0";"16" - "5";"TILE_PLANK_EBONY" ; "8205"; "12"; "0"; "N/A"; "1"; "1"; "0"; "1"; "5"; "0";"16" - "6";"TILE_PLANK_BIRCH" ; "8205"; "12"; "0"; "N/A"; "1"; "1"; "0"; "1"; "6"; "0";"16" - "7";"TILE_PLANK_BLOODROSE" ; "8205"; "12"; "0"; "N/A"; "1"; "1"; "0"; "1"; "7"; "0";"16" - "8";"TILE_TRUNK_NORMAL" ; "8205"; "12"; "0"; "N/A"; "1"; "0"; "0"; "1"; "8"; "0";"16" - "9";"TILE_TRUNK_EBONY" ; "8205"; "12"; "0"; "N/A"; "1"; "0"; "0"; "1"; "9"; "0";"16" - "10";"TILE_TRUNK_BIRCH" ; "8205"; "12"; "0"; "N/A"; "1"; "0"; "0"; "1"; "10"; "0";"16" - "11";"TILE_TRUNK_BLOODROSE" ; "8205"; "12"; "0"; "N/A"; "1"; "0"; "0"; "1"; "11"; "0";"16" - "12";"TILE_STONE_QUARRIED" ; "8205"; "25"; "0"; "N/A"; "1"; "1"; "0"; "1"; "12"; "0";"16" - "13";"TILE_SAND" ; "8205"; "6"; "0"; "N/A"; "1"; "1"; "0"; "1"; "13"; "1";"16" - "14";"TILE_GRAVEL" ; "8205"; "6"; "0"; "N/A"; "1"; "0"; "0"; "1"; "14"; "1";"16" + "0";"TILE_AIR" ; "1641"; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "0";"16" + "1";"TILE_STONE" ; "8205"; "25"; "0"; "0"; "1"; "1"; "0"; "1"; "1"; "0";"16" + "2";"TILE_DIRT" ; "8205"; "6"; "0"; "0"; "1"; "1"; "0"; "1"; "2"; "0";"16" + "3";"TILE_GRASS" ; "8205"; "6"; "0"; "0"; "1"; "1"; "0"; "1"; "2"; "0";"16" + "4";"TILE_PLANK_NORMAL" ; "8205"; "12"; "0"; "0"; "1"; "1"; "0"; "1"; "4"; "0";"16" + "5";"TILE_PLANK_EBONY" ; "8205"; "12"; "0"; "0"; "1"; "1"; "0"; "1"; "5"; "0";"16" + "6";"TILE_PLANK_BIRCH" ; "8205"; "12"; "0"; "0"; "1"; "1"; "0"; "1"; "6"; "0";"16" + "7";"TILE_PLANK_BLOODROSE" ; "8205"; "12"; "0"; "0"; "1"; "1"; "0"; "1"; "7"; "0";"16" + "8";"TILE_TRUNK_NORMAL" ; "8205"; "12"; "0"; "0"; "1"; "0"; "0"; "1"; "8"; "0";"16" + "9";"TILE_TRUNK_EBONY" ; "8205"; "12"; "0"; "0"; "1"; "0"; "0"; "1"; "9"; "0";"16" + "10";"TILE_TRUNK_BIRCH" ; "8205"; "12"; "0"; "0"; "1"; "0"; "0"; "1"; "10"; "0";"16" + "11";"TILE_TRUNK_BLOODROSE" ; "8205"; "12"; "0"; "0"; "1"; "0"; "0"; "1"; "11"; "0";"16" + "12";"TILE_STONE_QUARRIED" ; "8205"; "25"; "0"; "0"; "1"; "1"; "0"; "1"; "12"; "0";"16" + "13";"TILE_SAND" ; "8205"; "6"; "0"; "0"; "1"; "1"; "0"; "1"; "13"; "1";"16" + "14";"TILE_GRAVEL" ; "8205"; "6"; "0"; "0"; "1"; "0"; "0"; "1"; "14"; "1";"16" - "15";"TILE_ORE_MALACHITE" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "15"; "0";"16" - "16";"TILE_ORE_HEMATITE" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "16"; "0";"16" - "17";"TILE_ORE_NATURAL_GOLD" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "17"; "0";"16" - "18";"TILE_ORE_NATURAL_SILVER" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "18"; "0";"16" - "19";"TILE_ORE_RUTILE" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "19"; "0";"16" - "20";"TILE_ORE_AURICHALCUMITE" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "20"; "0";"16" - "21";"TILE_GEM_RUBY" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "21"; "0";"16" - "22";"TILE_GEM_EMERALD" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "22"; "0";"16" - "23";"TILE_GEM_SAPPHIRE" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "23"; "0";"16" - "24";"TILE_GEM_TOPAZ" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "24"; "0";"16" - "25";"TILE_GEM_DIAMOND" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "25"; "0";"16" - "26";"TILE_GEM_AMETHYST" ; "8205"; "25"; "0"; "N/A"; "1"; "0"; "0"; "1"; "26"; "0";"16" + "15";"TILE_ORE_MALACHITE" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "15"; "0";"16" + "16";"TILE_ORE_HEMATITE" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "16"; "0";"16" + "17";"TILE_ORE_NATURAL_GOLD" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "17"; "0";"16" + "18";"TILE_ORE_NATURAL_SILVER" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "18"; "0";"16" + "19";"TILE_ORE_RUTILE" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "19"; "0";"16" + "20";"TILE_ORE_AURICHALCUMITE" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "20"; "0";"16" + "21";"TILE_GEM_RUBY" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "21"; "0";"16" + "22";"TILE_GEM_EMERALD" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "22"; "0";"16" + "23";"TILE_GEM_SAPPHIRE" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "23"; "0";"16" + "24";"TILE_GEM_TOPAZ" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "24"; "0";"16" + "25";"TILE_GEM_DIAMOND" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "25"; "0";"16" + "26";"TILE_GEM_AMETHYST" ; "8205"; "25"; "0"; "0"; "1"; "0"; "0"; "1"; "26"; "0";"16" - "27";"TILE_SNOW" ; "8205"; "6"; "0"; "N/A"; "1"; "1"; "0"; "1"; "27"; "0";"16" - "28";"TILE_ICE_FRAGILE" ; "3282"; "1"; "0"; "N/A"; "1"; "0"; "0"; "0"; "28"; "0";"16" - "29";"TILE_ICE_NATURAL" ; "6564"; "25"; "0"; "N/A"; "1"; "1"; "0"; "1"; "29"; "0"; "8" - "30";"TILE_ICE_CLEAR_MAGICAL" ; "8205"; "25"; "0"; "N/A"; "1"; "1"; "5009"; "0"; "30"; "0"; "8" + "27";"TILE_SNOW" ; "8205"; "6"; "0"; "0"; "1"; "1"; "0"; "1"; "27"; "0";"16" + "28";"TILE_ICE_FRAGILE" ; "3282"; "1"; "0"; "0"; "1"; "0"; "0"; "0"; "28"; "0";"16" + "29";"TILE_ICE_NATURAL" ; "6564"; "25"; "0"; "0"; "1"; "1"; "0"; "1"; "29"; "0"; "8" + "30";"TILE_ICE_CLEAR_MAGICAL" ; "8205"; "25"; "0"; "0"; "1"; "1"; "5009"; "0"; "30"; "0"; "8" # see scandinavian name set female of this tile id! - "31";"TILE_PLATFORM_STONE" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "31"; "0";"16" - "32";"TILE_PLATFORM_WOODEN" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "32"; "0";"16" - "33";"TILE_PLATFORM_EBONY" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "33"; "0";"16" - "34";"TILE_PLATFORM_BIRCH" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "34"; "0";"16" - "35";"TILE_PLATFORM_BLOODROSE" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "0"; "35"; "0";"16" + "31";"TILE_PLATFORM_STONE" ; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "31"; "0";"16" + "32";"TILE_PLATFORM_WOODEN" ; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "32"; "0";"16" + "33";"TILE_PLATFORM_EBONY" ; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "33"; "0";"16" + "34";"TILE_PLATFORM_BIRCH" ; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "34"; "0";"16" + "35";"TILE_PLATFORM_BLOODROSE" ; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "0"; "35"; "0";"16" - "36";"TILE_TORCH" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "63412"; "0"; "36"; "0";"16" + "36";"TILE_TORCH" ; "0"; "0"; "0"; "0"; "0"; "0"; "63412"; "0"; "36"; "0";"16" # 63412 (ffa44e) : real candlelight colour taken from properly configured camera. -"239";"TILE_WATER" ; "6522"; "100"; "1"; "2"; "0"; "0"; "0"; "0"; "239"; "0";"16" -"255";"TILE_LAVA" ; "62358"; "100"; "1"; "2"; "0"; "0"; "48320"; "0"; "239"; "0";"16" +"239";"TILE_WATER" ; "6522"; "100"; "1"; "16"; "0"; "0"; "0"; "0"; "239"; "0";"16" +"255";"TILE_LAVA" ; "62358"; "100"; "1"; "16"; "0"; "0"; "48320"; "0"; "239"; "0";"16" +# Friction: 0: frictionless, <16: slippery, 16: regular, >16: sticky +# Opacity/Lumcolor: 40-step RGB +# Opaque: whether the tile completely hides wall behind +# Viscosity: (walkspeedmax) * (1 + (n/16)) \ No newline at end of file diff --git a/src/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.java b/src/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.java index b2dae6e75..cd7a1f859 100644 --- a/src/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.java +++ b/src/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.java @@ -47,6 +47,7 @@ public class LightmapRenderer { } + @Deprecated public static void addLantern(int x, int y, char intensity) { LightmapLantern thisLantern = new LightmapLantern(x, y, intensity); @@ -64,6 +65,7 @@ public class LightmapRenderer { lanterns.add(thisLantern); } + @Deprecated public static void removeLantern(int x, int y) { for (int i = lanterns.size() - 1; i >= 0; i--) { LightmapLantern lantern = lanterns.get(i); @@ -85,11 +87,11 @@ public class LightmapRenderer { } - int for_y_start = div16(MapCamera.getCameraY()) - MUL; - int for_x_start = div16(MapCamera.getCameraX()) - MUL; + int for_y_start = div16(MapCamera.getCameraY()) - 1; + int for_x_start = div16(MapCamera.getCameraX()) - 1; - int for_y_end = clampHTile(for_y_start + div16(MapCamera.getRenderHeight()) + 2) + MUL; - int for_x_end = clampWTile(for_x_start + div16(MapCamera.getRenderWidth()) + 2) + MUL; + int for_y_end = clampHTile(for_y_start + div16(MapCamera.getRenderHeight()) + 2) + 1; + int for_x_end = clampWTile(for_x_start + div16(MapCamera.getRenderWidth()) + 2) + 1; /** * Updating order: @@ -102,13 +104,12 @@ public class LightmapRenderer { * for all staticLightMap[y][x] */ - // Round 1 - purgePartOfLightmap(for_x_start, for_y_start, for_x_end, for_y_end); - - //System.out.println(for_x_start); - //System.out.println(for_x_end); + purgePartOfLightmap(for_x_start - 1, for_y_start - 1, for_x_end + 1, for_y_end + 1); + // if wider purge were not applied, GL changing (sunset, sunrise) will behave incorrectly + // ("leakage" of non-updated sunlight) try { + // Round 1 for (int y = for_y_start; y < for_y_end; y++) { for (int x = for_x_start; x < for_x_end; x++) { staticLightMap[y][x] = calculate(x, y); @@ -140,117 +141,132 @@ public class LightmapRenderer { } public static void draw(Graphics g) { - int for_x_start = MapCamera.getRenderStartX(); - int for_y_start = MapCamera.getRenderStartY(); + int for_x_start = MapCamera.getRenderStartX() - 1; + int for_y_start = MapCamera.getRenderStartY() - 1; int for_x_end = MapCamera.getRenderEndX(); int for_y_end = MapCamera.getRenderEndY(); // draw - for (int y = for_y_start; y < for_y_end; y++) { - for (int x = for_x_start; x < for_x_end; x++) { - // smooth - if (Terrarum.game.screenZoom >= 1 && ((boolean) Terrarum.game.gameConfig.get("smoothlighting"))) { - char thisLightLevel = staticLightMap[y][x]; - if (y > 0 && x < for_x_end && thisLightLevel == 0 && staticLightMap[y - 1][x] == 0) { - try { - // coalesce zero intensity blocks to one - int zeroLevelCounter = 1; - while (staticLightMap[y][x + zeroLevelCounter] == 0 - && staticLightMap[y - 1][x + zeroLevelCounter] == 0) { - zeroLevelCounter += 1; + try { + for (int y = for_y_start; y < for_y_end; y++) { + for (int x = for_x_start; x < for_x_end; x++) { + // smooth + if (Terrarum.game.screenZoom >= 1 && ((boolean) Terrarum.game.gameConfig.get( + "smoothlighting"))) { + char thisLightLevel = staticLightMap[y][x]; + if (y > 0 && x < for_x_end && thisLightLevel == 0 && staticLightMap[y - 1][x] == 0) { + try { + // coalesce zero intensity blocks to one + int zeroLevelCounter = 1; + while (staticLightMap[y][x + zeroLevelCounter] == 0 + && staticLightMap[y - 1][x + zeroLevelCounter] == 0) { + zeroLevelCounter += 1; - if (x + zeroLevelCounter >= for_x_end) break; + if (x + zeroLevelCounter >= for_x_end) break; + } + + g.setColor(new Color(0)); + g.fillRect( + Math.round(x * TSIZE * Terrarum.game.screenZoom) + , Math.round(y * TSIZE * Terrarum.game.screenZoom) + , FastMath.ceil( + TSIZE * Terrarum.game.screenZoom) * zeroLevelCounter + , FastMath.ceil(TSIZE * Terrarum.game.screenZoom) + ); + + x += (zeroLevelCounter - 1); + } + catch (ArrayIndexOutOfBoundsException e) { + // do nothing + } + } + else { + /** a + * +-+-+ + * |i|j| + * b +-+-+ c + * |k|l| + * +-+-+ + * d + */ + char a = (y == 0) ? thisLightLevel + : (y == Terrarum.game.map.height - 1) ? thisLightLevel + : maximiseRGB( + staticLightMap[y][x] + , + staticLightMap[y - 1][x]); + char d = (y == 0) ? thisLightLevel + : (y == Terrarum.game.map.height - 1) ? thisLightLevel + : maximiseRGB( + staticLightMap[y][x] + , + staticLightMap[y + 1][x]); + char b = (x == 0) ? thisLightLevel + : (x == Terrarum.game.map.width - 1) ? thisLightLevel + : maximiseRGB( + staticLightMap[y][x] + , + staticLightMap[y][x - 1]); + char c = (x == 0) ? thisLightLevel + : (x == Terrarum.game.map.width - 1) ? thisLightLevel + : maximiseRGB( + staticLightMap[y][x] + , + staticLightMap[y][x + 1]); + char[] colourMapItoL = new char[4]; + colourMapItoL[0] = colourLinearMix(a, b); + colourMapItoL[1] = colourLinearMix(a, c); + colourMapItoL[2] = colourLinearMix(b, d); + colourMapItoL[3] = colourLinearMix(c, d); + + for (int iy = 0; iy < 2; iy++) { + for (int ix = 0; ix < 2; ix++) { + g.setColor(toTargetColour(colourMapItoL[iy * 2 + ix])); + + g.fillRect( + Math.round( + x * TSIZE * Terrarum.game.screenZoom) + (ix * TSIZE / 2 * Terrarum.game.screenZoom) + , Math.round( + y * TSIZE * Terrarum.game.screenZoom) + (iy * TSIZE / 2 * Terrarum.game.screenZoom) + , FastMath.ceil(TSIZE * Terrarum.game.screenZoom / 2) + , FastMath.ceil(TSIZE * Terrarum.game.screenZoom / 2) + ); + } + } + } + } + // Retro + else { + try { + int thisLightLevel = staticLightMap[y][x]; + + // coalesce identical intensity blocks to one + int sameLevelCounter = 1; + while (staticLightMap[y][x + sameLevelCounter] == thisLightLevel) { + sameLevelCounter += 1; + + if (x + sameLevelCounter >= for_x_end) break; } - g.setColor(new Color(0)); + g.setColor(toTargetColour(staticLightMap[y][x])); g.fillRect( Math.round(x * TSIZE * Terrarum.game.screenZoom) , Math.round(y * TSIZE * Terrarum.game.screenZoom) , FastMath.ceil( - TSIZE * Terrarum.game.screenZoom) * zeroLevelCounter + TSIZE * Terrarum.game.screenZoom) * sameLevelCounter , FastMath.ceil(TSIZE * Terrarum.game.screenZoom) ); - x += (zeroLevelCounter - 1); + x += (sameLevelCounter - 1); } catch (ArrayIndexOutOfBoundsException e) { // do nothing } } - else { - /** a - * +-+-+ - * |i|j| - * b +-+-+ c - * |k|l| - * +-+-+ - * d - */ - char a = (y == 0) ? thisLightLevel - : (y == Terrarum.game.map.height - 1) ? thisLightLevel - : maximiseRGB(staticLightMap[y][x] - , staticLightMap[y - 1][x]); - char d = (y == 0) ? thisLightLevel - : (y == Terrarum.game.map.height - 1) ? thisLightLevel - : maximiseRGB(staticLightMap[y][x] - , staticLightMap[y + 1][x]); - char b = (x == 0) ? thisLightLevel - : (x == Terrarum.game.map.width - 1) ? thisLightLevel - : maximiseRGB(staticLightMap[y][x] - , staticLightMap[y][x - 1]); - char c = (x == 0) ? thisLightLevel - : (x == Terrarum.game.map.width - 1) ? thisLightLevel - : maximiseRGB(staticLightMap[y][x] - , staticLightMap[y][x + 1]); - char[] colourMapItoL = new char[4]; - colourMapItoL[0] = colourLinearMix(a, b); - colourMapItoL[1] = colourLinearMix(a, c); - colourMapItoL[2] = colourLinearMix(b, d); - colourMapItoL[3] = colourLinearMix(c, d); - - for (int iy = 0; iy < 2; iy++) { - for (int ix = 0; ix < 2; ix++) { - g.setColor(toTargetColour(colourMapItoL[iy * 2 + ix])); - - g.fillRect( - Math.round(x * TSIZE * Terrarum.game.screenZoom) + (ix * TSIZE / 2 * Terrarum.game.screenZoom) - , Math.round(y * TSIZE * Terrarum.game.screenZoom) + (iy * TSIZE / 2 * Terrarum.game.screenZoom) - , FastMath.ceil(TSIZE * Terrarum.game.screenZoom / 2) - , FastMath.ceil(TSIZE * Terrarum.game.screenZoom / 2) - ); - } - } - } - } - // Retro - else { - try { - int thisLightLevel = staticLightMap[y][x]; - - // coalesce identical intensity blocks to one - int sameLevelCounter = 1; - while (staticLightMap[y][x + sameLevelCounter] == thisLightLevel) { - sameLevelCounter += 1; - - if (x + sameLevelCounter >= for_x_end) break; - } - - g.setColor(toTargetColour(staticLightMap[y][x])); - g.fillRect( - Math.round(x * TSIZE * Terrarum.game.screenZoom) - , Math.round(y * TSIZE * Terrarum.game.screenZoom) - , FastMath.ceil(TSIZE * Terrarum.game.screenZoom) * sameLevelCounter - , FastMath.ceil(TSIZE * Terrarum.game.screenZoom) - ); - - x += (sameLevelCounter - 1); - } - catch (ArrayIndexOutOfBoundsException e) { - // do nothing - } } } } + catch (ArrayIndexOutOfBoundsException e) {} } private static Color toTargetColour(char raw) { @@ -561,10 +577,6 @@ public class LightmapRenderer { return (i < 0) ? 0 : (i > 1) ? 1 : i; } - public static char[][] getStaticLightMap() { - return staticLightMap; - } - public static char getValueFromMap(int x, int y) { return staticLightMap[y][x]; }