• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Automap (client) [VS plugin mod]


Commit MetaInfo

Revisãoee1ef4dd4fb1496a5dc7fcc5336ec6df1d191c34 (tree)
Hora2021-05-18 07:46:19
Autormelchior <melchior@user...>
Commitermelchior

Mensagem de Log

W.I.P. correct direction diagonal

Mudança Sumário

Diff

--- a/Automap/Renderers/StandardRenderer.cs
+++ b/Automap/Renderers/StandardRenderer.cs
@@ -51,54 +51,53 @@ namespace Automap
5151 }
5252
5353 // Prefetch map chunks, in pattern
54- var corner_pos = new Vec2i(chunkPos.X - 1, chunkPos.Y - 1);
54+ var corner_pos = new Vec2i(chunkPos.X - 1, chunkPos.Y + 1);
5555 var west_pos = new Vec2i(chunkPos.X - 1, chunkPos.Y);
56- var south_pos = new Vec2i(chunkPos.X, chunkPos.Y - 1);
57-
56+ var north_pos = new Vec2i(chunkPos.X, chunkPos.Y + 1);
5857
59- ColumnMeta south, southWest, west;
58+ ColumnMeta north, northWest, west;
6059 /*
6160 "Overlap" Heightmap for Slope (height) values; covers 1 whole + 2 chunk edges, and corner block,
6261 substitute ZERO with Average Height....better than nothing even if its wrong?
6362 */
6463 var overlapHeightmap = new ushort[chunkSize + 1, chunkSize + 1];
6564
66- //Ofset copy of Heightmap...
65+ //Ofset copy of Heightmap...copied to Bottom, Rightmost
6766 for (int copyX = 0; copyX < chunkSize; copyX++)
6867 {
6968 for (int copyY = 0; copyY < chunkSize; copyY++) {
70- overlapHeightmap[copyX + 1, copyY] = targetColMeta.HeightMap[copyX, copyY];
69+ overlapHeightmap[copyX + 1, copyY + 1] = targetColMeta.HeightMap[copyX, copyY];
7170 }
7271 }
7372
7473
7574
7675 if (allCols.Contains(corner_pos) && allCols[corner_pos].HeightMap != null) {
77- southWest = allCols[corner_pos];
78- overlapHeightmap[0, 32] = southWest.HeightMap[0, chunkSize - 1];
76+ northWest = allCols[corner_pos];
77+ overlapHeightmap[0, 0] = northWest.HeightMap[chunkSize - 1, chunkSize - 1];
7978 }
8079 else {
8180 var cornerMC = ClientAPI.World.BlockAccessor.GetMapChunk(corner_pos);
8281 if (cornerMC != null && cornerMC.RainHeightMap != null)
8382 {
84- overlapHeightmap[0, 32] = cornerMC.RainHeight2DMap(0, (chunkSize - 1) );
83+ overlapHeightmap[0, 0] = cornerMC.RainHeight2DMap(chunkSize - 1, (chunkSize - 1) );
8584 }
8685 }
8786
88- if (allCols.Contains(south_pos) && allCols[south_pos].HeightMap != null) {
89- south = allCols[south_pos];
87+ if (allCols.Contains(north_pos) && allCols[north_pos].HeightMap != null) {
88+ north = allCols[north_pos];
9089
91- for (int southEdgeIndex = 0; southEdgeIndex < chunkSize; southEdgeIndex++)
90+ for (int northEdgeIndex = 0; northEdgeIndex < chunkSize; northEdgeIndex++)
9291 {
93- overlapHeightmap[32, southEdgeIndex + 1] = south.HeightMap[0, southEdgeIndex];
92+ overlapHeightmap[1, northEdgeIndex + 1 ] = north.HeightMap[ (chunkSize - 1), northEdgeIndex];
9493 }
9594 }
9695 else {
97- var southMC = ClientAPI.World.BlockAccessor.GetMapChunk(south_pos);
98- if (southMC != null && southMC.RainHeightMap != null) {
99- for (int southEdgeIndex = 0; southEdgeIndex < chunkSize; southEdgeIndex++)
96+ var northMC = ClientAPI.World.BlockAccessor.GetMapChunk(north_pos);
97+ if (northMC != null && northMC.RainHeightMap != null) {
98+ for (int northEdgeIndex = 0; northEdgeIndex < chunkSize; northEdgeIndex++)
10099 {
101- overlapHeightmap[32, southEdgeIndex] = southMC.RainHeight2DMap(0, southEdgeIndex);
100+ overlapHeightmap[1, northEdgeIndex + 1] = northMC.RainHeight2DMap((chunkSize - 1), northEdgeIndex);
102101 }
103102 }
104103 }
@@ -108,14 +107,14 @@ namespace Automap
108107
109108 for (int westEdgeIndex = 0; westEdgeIndex < chunkSize; westEdgeIndex++)
110109 {
111- overlapHeightmap[westEdgeIndex, 0] = west.HeightMap[westEdgeIndex, chunkSize - 1];
110+ overlapHeightmap[westEdgeIndex + 1, 0] = west.HeightMap[westEdgeIndex, chunkSize - 1];
112111 }
113112 }
114113 else {
115- var westMC = ClientAPI.World.BlockAccessor.GetMapChunk(south_pos);
114+ var westMC = ClientAPI.World.BlockAccessor.GetMapChunk(west_pos);
116115 if (westMC != null && westMC.RainHeightMap != null) {
117116 for (int westEdgeIndex = 0; westEdgeIndex < chunkSize; westEdgeIndex++) {
118- overlapHeightmap[westEdgeIndex, 0] = westMC.RainHeight2DMap(westEdgeIndex, chunkSize - 1);
117+ overlapHeightmap[westEdgeIndex + 1, 0] = westMC.RainHeight2DMap(westEdgeIndex, chunkSize - 1);
119118 }
120119 }
121120 }
@@ -152,17 +151,17 @@ namespace Automap
152151 float slopeBoost = 1f;
153152 int leftTop, rightTop, leftBot;
154153
155- int topX = localX;
156- int botX = localX + 1;
157- int leftZ = localZ + 1;
158- int rightZ = localZ;
159-
160- topX = GameMath.Mod(topX, chunkSize + 1);
161- leftZ = GameMath.Mod(leftZ, chunkSize + 1);
154+ int up_X = localX;
155+ int low_X = localX + 1;
156+ int left_Z = localZ;
157+ int right_Z = localZ + 1;
162158
163- leftTop = Math.Sign(localY - overlapHeightmap[topX, leftZ]);
164- rightTop = Math.Sign(localY - overlapHeightmap[topX, rightZ]);
165- leftBot = Math.Sign(localY - overlapHeightmap[botX, leftZ]);
159+ //topX = GameMath.Mod(topX, chunkSize + 1);
160+ //leftZ = GameMath.Mod(leftZ, chunkSize + 1);
161+
162+ leftTop = Math.Sign(localY - overlapHeightmap[up_X, left_Z]);
163+ rightTop = Math.Sign(localY - overlapHeightmap[up_X, right_Z]);
164+ leftBot = Math.Sign(localY - overlapHeightmap[low_X, left_Z]);
166165
167166 float slopeness = (leftTop + rightTop + leftBot);
168167