Skip to content

Commit 6f18583

Browse files
committed
- Path preview color now also visible on objects you can walk over.
1 parent 8e395c7 commit 6f18583

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

‎src/Battlescape/Map.cpp‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void Map::drawTerrain(Surface *surface)
218218
int dummy;
219219
BattleUnit *unit = 0;
220220
bool invalid;
221-
int tileShade, wallShade, tileColor, wallColor;
221+
int tileShade, wallShade, tileColor;
222222
NumberText *_numWaypid = 0;
223223

224224
// get corner map coordinates to give rough boundaries in which tiles to redraw are
@@ -307,16 +307,6 @@ void Map::drawTerrain(Surface *surface)
307307
}
308308

309309
tileColor = tile->getMarkerColor();
310-
wallColor = 0;
311-
312-
/*
313-
* with this we can enable FOV visibility, todo one day
314-
if (!tileColor && !tile->getVisible())
315-
{
316-
tileColor = 6;
317-
wallColor = 6;
318-
}
319-
*/
320310

321311
// Draw floor
322312
tmpSurface = tile->getSprite(MapData::O_FLOOR);
@@ -365,7 +355,7 @@ void Map::drawTerrain(Surface *surface)
365355
wallShade = 0;
366356
else
367357
wallShade = tileShade;
368-
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y - tile->getMapData(MapData::O_WESTWALL)->getYOffset(), wallShade, false, wallColor);
358+
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y - tile->getMapData(MapData::O_WESTWALL)->getYOffset(), wallShade, false);
369359
}
370360
// Draw north wall
371361
tmpSurface = tile->getSprite(MapData::O_NORTHWALL);
@@ -378,26 +368,26 @@ void Map::drawTerrain(Surface *surface)
378368
wallShade = tileShade;
379369
if (tile->getMapData(MapData::O_WESTWALL))
380370
{
381-
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y - tile->getMapData(MapData::O_NORTHWALL)->getYOffset(), wallShade, true, wallColor);
371+
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y - tile->getMapData(MapData::O_NORTHWALL)->getYOffset(), wallShade, true);
382372
}
383373
else
384374
{
385-
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y - tile->getMapData(MapData::O_NORTHWALL)->getYOffset(), wallShade, false, wallColor);
375+
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y - tile->getMapData(MapData::O_NORTHWALL)->getYOffset(), wallShade, false);
386376
}
387377
}
388378
// Draw object
389379
if (tile->getMapData(MapData::O_OBJECT))
390380
{
391381
tmpSurface = tile->getSprite(MapData::O_OBJECT);
392382
if (tmpSurface)
393-
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y - tile->getMapData(MapData::O_OBJECT)->getYOffset(), tileShade, false, wallColor);
383+
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y - tile->getMapData(MapData::O_OBJECT)->getYOffset(), tileShade, false, tileColor);
394384
}
395385
// draw an item on top of the floor (if any)
396386
int sprite = tile->getTopItemSprite();
397387
if (sprite != -1)
398388
{
399389
tmpSurface = _res->getSurfaceSet("FLOOROB.PCK")->getFrame(sprite);
400-
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y + tile->getTerrainLevel(), tileShade, false, wallColor);
390+
tmpSurface->blitNShade(surface, screenPosition.x, screenPosition.y + tile->getTerrainLevel(), tileShade, false);
401391
}
402392

403393
}

‎src/Battlescape/TileEngine.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ bool TileEngine::calculateFOV(BattleUnit *unit)
262262
|| (visibleUnit->getFaction() != FACTION_HOSTILE && unit->getFaction() == FACTION_HOSTILE))
263263
{
264264
unit->addToVisibleUnits(visibleUnit);
265+
unit->addToVisibleTiles(visibleUnit->getTile());
266+
visibleUnit->getTile()->setDiscovered(true, 2);
267+
visibleUnit->getTile()->setVisible(+1);
265268
}
266269
if (unit->getFaction() == FACTION_PLAYER)
267270
visibleUnit->setVisible(true);

0 commit comments

Comments
 (0)