Seeen werden jetzt mit runden ecken gerendert

This commit is contained in:
2014-05-14 16:56:59 +02:00
parent 55b439f743
commit 79bfe10dd5
2 changed files with 34 additions and 0 deletions

View File

@@ -50,6 +50,10 @@ namespace WorldOfPeacecraft
private Image BeachTopRight;
private Image BeachBottomLeft;
private Image BeachBottomRight;
private Image BeachInnerTopLeft;
private Image BeachInnerTopRight;
private Image BeachInnerBotLeft;
private Image BeachInnerBotRight;
private int FlowerCounter;
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));
} else if (tile.IsWater ()) {
PaintImage(g, x, y, Water);
PaintBeachInnerEdge(g, locx, locy, x, y, map);
PaintWallInnerEdge(g, locx, locy, x, y, map);
}
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)
{
bool topWall = NullsafeIsWall (locx, locy - 1, map);
@@ -388,6 +417,10 @@ namespace WorldOfPeacecraft
BeachBottomLeft = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate90FlipNone);
BeachTopLeft = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate180FlipNone);
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");
WallEdgeBotLeft = Image.FromFile (ImagesFolder + "wall_edge_botleft.png");
WallEdgeBotRight = Image.FromFile (ImagesFolder + "wall_edge_botright.png");
@@ -406,6 +439,7 @@ namespace WorldOfPeacecraft
WaterInnerTopRight = Image.FromFile (ImagesFolder + "water_topright.png");
WaterInnerBotLeft = Image.FromFile (ImagesFolder + "water_botleft.png");
WaterInnerBotRight = Image.FromFile (ImagesFolder + "water_botright.png");
}
public void InitializeComponents(){

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB