Seeen werden jetzt mit runden ecken gerendert
This commit is contained in:
@@ -50,6 +50,10 @@ namespace WorldOfPeacecraft
|
|||||||
private Image BeachTopRight;
|
private Image BeachTopRight;
|
||||||
private Image BeachBottomLeft;
|
private Image BeachBottomLeft;
|
||||||
private Image BeachBottomRight;
|
private Image BeachBottomRight;
|
||||||
|
private Image BeachInnerTopLeft;
|
||||||
|
private Image BeachInnerTopRight;
|
||||||
|
private Image BeachInnerBotLeft;
|
||||||
|
private Image BeachInnerBotRight;
|
||||||
private int FlowerCounter;
|
private int FlowerCounter;
|
||||||
|
|
||||||
public MapPanel (IBackend backend)
|
public MapPanel (IBackend backend)
|
||||||
@@ -149,6 +153,7 @@ namespace WorldOfPeacecraft
|
|||||||
DrawWallEdge(g, CountWater (bot, botleft, left), x, y, 0, offset, WallEdgeBotLeft, WallCornerBotLeft, (bot.IsWater () ? BeachBottom : BeachLeft));
|
DrawWallEdge(g, CountWater (bot, botleft, left), x, y, 0, offset, WallEdgeBotLeft, WallCornerBotLeft, (bot.IsWater () ? BeachBottom : BeachLeft));
|
||||||
} else if (tile.IsWater ()) {
|
} else if (tile.IsWater ()) {
|
||||||
PaintImage(g, x, y, Water);
|
PaintImage(g, x, y, Water);
|
||||||
|
PaintBeachInnerEdge(g, locx, locy, x, y, map);
|
||||||
PaintWallInnerEdge(g, locx, locy, x, y, map);
|
PaintWallInnerEdge(g, locx, locy, x, y, map);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -228,6 +233,30 @@ namespace WorldOfPeacecraft
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PaintBeachInnerEdge (Graphics g, int locx, int locy, int x, int y, ITile[,] map)
|
||||||
|
{
|
||||||
|
bool topDry = GetTile (locx, locy - 1, map).IsWalkable() || GetTile (locx, locy - 1, map).IsWall();
|
||||||
|
bool rightDry = GetTile (locx + 1, locy, map).IsWalkable() || GetTile (locx + 1, locy, map).IsWall();
|
||||||
|
bool botDry = GetTile (locx, locy + 1, map).IsWalkable() || GetTile (locx, locy + 1, map).IsWall();
|
||||||
|
bool leftDry = GetTile (locx - 1, locy, map).IsWalkable() || GetTile (locx - 1, locy, map).IsWall();
|
||||||
|
if (leftDry) {
|
||||||
|
if (topDry)
|
||||||
|
if (GetTile (locx - 1, locy - 1, map).IsWalkable() || GetTile (locx - 1, locy - 1, map).IsWall())
|
||||||
|
PaintImage (g, x, y, BeachInnerTopLeft);
|
||||||
|
if (botDry)
|
||||||
|
if (GetTile (locx - 1, locy + 1, map).IsWalkable()|| GetTile (locx - 1, locy + 1, map).IsWall())
|
||||||
|
PaintImage (g, x, y, BeachInnerBotLeft);
|
||||||
|
}
|
||||||
|
if (rightDry) {
|
||||||
|
if (topDry)
|
||||||
|
if (GetTile (locx + 1, locy - 1, map).IsWalkable()|| GetTile (locx + 1, locy - 1, map).IsWall())
|
||||||
|
PaintImage (g, x, y, BeachInnerTopRight);
|
||||||
|
if (botDry)
|
||||||
|
if (GetTile (locx + 1, locy + 1, map).IsWalkable()|| GetTile (locx + 1, locy + 1, map).IsWall())
|
||||||
|
PaintImage (g, x, y, BeachInnerBotRight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void PaintWallInnerEdge (Graphics g, int locx, int locy, int x, int y, ITile[,] map)
|
private void PaintWallInnerEdge (Graphics g, int locx, int locy, int x, int y, ITile[,] map)
|
||||||
{
|
{
|
||||||
bool topWall = NullsafeIsWall (locx, locy - 1, map);
|
bool topWall = NullsafeIsWall (locx, locy - 1, map);
|
||||||
@@ -388,6 +417,10 @@ namespace WorldOfPeacecraft
|
|||||||
BeachBottomLeft = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate90FlipNone);
|
BeachBottomLeft = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate90FlipNone);
|
||||||
BeachTopLeft = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate180FlipNone);
|
BeachTopLeft = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate180FlipNone);
|
||||||
BeachTopRight = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate270FlipNone);
|
BeachTopRight = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate270FlipNone);
|
||||||
|
BeachInnerBotRight = Image.FromFile (ImagesFolder + "beachcorner_inner.png");
|
||||||
|
BeachInnerBotLeft = RotateFlipImage (BeachInnerBotRight, RotateFlipType.Rotate90FlipNone);
|
||||||
|
BeachInnerTopLeft = RotateFlipImage (BeachInnerBotRight, RotateFlipType.Rotate180FlipNone);
|
||||||
|
BeachInnerTopRight = RotateFlipImage (BeachInnerBotRight, RotateFlipType.Rotate270FlipNone);
|
||||||
WallBase = Image.FromFile(ImagesFolder + "wall_base.png");
|
WallBase = Image.FromFile(ImagesFolder + "wall_base.png");
|
||||||
WallEdgeBotLeft = Image.FromFile (ImagesFolder + "wall_edge_botleft.png");
|
WallEdgeBotLeft = Image.FromFile (ImagesFolder + "wall_edge_botleft.png");
|
||||||
WallEdgeBotRight = Image.FromFile (ImagesFolder + "wall_edge_botright.png");
|
WallEdgeBotRight = Image.FromFile (ImagesFolder + "wall_edge_botright.png");
|
||||||
@@ -406,6 +439,7 @@ namespace WorldOfPeacecraft
|
|||||||
WaterInnerTopRight = Image.FromFile (ImagesFolder + "water_topright.png");
|
WaterInnerTopRight = Image.FromFile (ImagesFolder + "water_topright.png");
|
||||||
WaterInnerBotLeft = Image.FromFile (ImagesFolder + "water_botleft.png");
|
WaterInnerBotLeft = Image.FromFile (ImagesFolder + "water_botleft.png");
|
||||||
WaterInnerBotRight = Image.FromFile (ImagesFolder + "water_botright.png");
|
WaterInnerBotRight = Image.FromFile (ImagesFolder + "water_botright.png");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitializeComponents(){
|
public void InitializeComponents(){
|
||||||
|
|||||||
BIN
textures/beachcorner_inner.png
Normal file
BIN
textures/beachcorner_inner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
Reference in New Issue
Block a user