Skip to content

Commit

Permalink
No LOF obstacle indicator -- cosmetic changes
Browse files Browse the repository at this point in the history
Just for easier comparison/merging with OXCE
  • Loading branch information
MeridianOXC committed Nov 3, 2018
1 parent 6ce6cce commit 0d8f592
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/Battlescape/Map.cpp
Expand Up @@ -262,10 +262,10 @@ static bool positionHaveSameXY(Position a, Position b)
* @param currTile
* @param currTileScreenPosition
* @param shade
* @param topLayer
* @param obstacleShade unitShade override for no LOF obstacle indicator
* @param topLayer
*/
void Map::drawUnit(Surface *surface, Tile *unitTile, Tile *currTile, Position currTileScreenPosition, int shade, bool topLayer, int obstacleShade)
void Map::drawUnit(Surface *surface, Tile *unitTile, Tile *currTile, Position currTileScreenPosition, int shade, int obstacleShade, bool topLayer)
{
const int tileFoorWidth = 32;
const int tileFoorHeight = 16;
Expand Down Expand Up @@ -456,7 +456,7 @@ void Map::drawUnit(Surface *surface, Tile *unitTile, Tile *currTile, Position cu
calculateWalkingOffset(bu, &offset, &shadeOffset);
int tileShade = currTile->isDiscovered(2) ? currTile->getShade() : 16;
int unitShade = (tileShade * (16 - shadeOffset) + shade * shadeOffset) / 16;
if (currTile->getObstacle(4) && !moving) //unit
if (!moving && unitTile->getObstacle(4))
{
unitShade = obstacleShade;
}
Expand Down Expand Up @@ -718,7 +718,7 @@ void Map::drawTerrain(Surface *surface)

for (int b = 0; b < backPosSize; ++b)
{
drawUnit(surface, _save->getTile(mapPosition + backPos[b]), tile, screenPosition, tileShade, topLayer, obstacleShade);
drawUnit(surface, _save->getTile(mapPosition + backPos[b]), tile, screenPosition, tileShade, obstacleShade, topLayer);
}

// Draw walls
Expand Down Expand Up @@ -863,7 +863,7 @@ void Map::drawTerrain(Surface *surface)
}
unit = tile->getUnit();
// Draw soldier from this tile or below
drawUnit(surface, tile, tile, screenPosition, tileShade, topLayer, obstacleShade);
drawUnit(surface, tile, tile, screenPosition, tileShade, obstacleShade, topLayer);

// special handling for a moving unit in forground of tile.
const int frontPosSize = 5;
Expand All @@ -878,7 +878,7 @@ void Map::drawTerrain(Surface *surface)

for (int f = 0; f < frontPosSize; ++f)
{
drawUnit(surface, _save->getTile(mapPosition + frontPos[f]), tile, screenPosition, tileShade, topLayer, obstacleShade);
drawUnit(surface, _save->getTile(mapPosition + frontPos[f]), tile, screenPosition, tileShade, obstacleShade, topLayer);
}

// Draw smoke/fire
Expand Down
2 changes: 1 addition & 1 deletion src/Battlescape/Map.h
Expand Up @@ -69,7 +69,7 @@ class Map : public InteractiveSurface
Text *_txtAccuracy;
SurfaceSet *_projectileSet;

void drawUnit(Surface *surface, Tile *unitTile, Tile *currTile, Position tileScreenPosition, int shade, bool topLayer, int obstacleShade);
void drawUnit(Surface *surface, Tile *unitTile, Tile *currTile, Position tileScreenPosition, int shade, int obstacleShade, bool topLayer);
void drawTerrain(Surface *surface);
int getTerrainLevel(const Position& pos, int size) const;
int _iconHeight, _iconWidth, _messageColor;
Expand Down

0 comments on commit 0d8f592

Please sign in to comment.