mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-17 01:21:49 +01:00
Added Buildings
Fixed rendering bugs with edges
This commit is contained in:
@@ -104,6 +104,14 @@ void WorldTile::DrawSide(const TileDirection& direction) {
|
||||
const WorldTile* tile = m_SurroundingTiles.GetTile(direction);
|
||||
if(tile != nullptr) {
|
||||
const GroundTileTypes type = tile->GetTileType()->getType();
|
||||
if(direction == TileDirection::BottomMiddle || direction == TileDirection::BottomLeft || direction == TileDirection::BottomRight) {
|
||||
if(type == Tiles::Special::GRASS->getType() || type == Tiles::Special::HARD_LEFT->getType() || type == Tiles::Special::HARD_MIDDLE->getType() || type == Tiles::Special::HARD_RIGHT->getType()) {
|
||||
//Fix for edges being renderd on grass / hard tiles
|
||||
//TODO: Possible fix if i have time
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(type != Tiles::AIR->getType()) {
|
||||
m_SideTextures[direction]->Draw(m_Position);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ enum class GroundTileTypes
|
||||
{
|
||||
Air,
|
||||
Dirt,
|
||||
Grass,
|
||||
Hard,
|
||||
Stone,
|
||||
Iron
|
||||
@@ -97,7 +98,7 @@ namespace Tiles
|
||||
static GroundTileType* HARD_RIGHT = new GroundTileType("tiles/dirt/special/hardRight.png", GroundTileTypes::Hard);
|
||||
static GroundTileType* HARD_MIDDLE = new GroundTileType("tiles/dirt/special/hardMiddle.png", GroundTileTypes::Hard);
|
||||
|
||||
static GroundTileType* GRASS = new RandomGroundTile("tiles/dirt/special/grass[0].png", GroundTileTypes::Dirt, 2);
|
||||
static GroundTileType* GRASS = new RandomGroundTile("tiles/dirt/special/grass[0].png", GroundTileTypes::Grass, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user