Skip to content

Commit d1a14dd

Browse files
committed
fix walking and stuff.
don't ask...
1 parent 0112078 commit d1a14dd

5 files changed

Lines changed: 8 additions & 22 deletions

File tree

‎src/Battlescape/BattlescapeState.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ BattlescapeState::BattlescapeState(Game *game) : State(game), _popups(), _xBefor
9797

9898
int screenWidth = Options::baseXResolution;
9999
int screenHeight = Options::baseYResolution;
100-
int iconsWidth = 320;
100+
int iconsWidth = Map::ICON_WIDTH;
101101
int iconsHeight = Map::ICON_HEIGHT;
102102
_mouseOverIcons = false;
103103
// Create buttonbar - this should be on the centerbottom of the screen

‎src/Battlescape/Camera.cpp‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,12 @@ bool Camera::isOnScreen(const Position &mapPos) const
575575
convertMapToScreen(mapPos, &screenPos);
576576
screenPos.x += _mapOffset.x;
577577
screenPos.y += _mapOffset.y;
578-
return screenPos.x >= -40
578+
return screenPos.x >= -32
579579
&& screenPos.x <= _screenWidth + 24
580580
&& screenPos.y >= -32
581-
&& screenPos.y <= _screenHeight - 48;
581+
&& ((screenPos.y <= _screenHeight + 8 && (screenPos.x <= _screenWidth / 2 - Map::ICON_WIDTH / 2 || screenPos.x >= _screenWidth / 2 + Map::ICON_WIDTH / 2 - 32))
582+
||
583+
screenPos.y <= _screenHeight - 16);
582584
}
583585

584586
/**

‎src/Battlescape/Map.cpp‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ void Map::drawTerrain(Surface *surface)
435435
}
436436
}
437437

438-
// special handling for a moving large unit.
438+
// special handling for a moving unit.
439439
if (mapPosition.y > 0)
440440
{
441441
Tile *tileNorth = _save->getTile(mapPosition - Position(0,1,0));
@@ -454,7 +454,7 @@ void Map::drawTerrain(Surface *surface)
454454
/*
455455
* Phase I: rerender the unit to make sure they don't get drawn over any walls or under any tiles
456456
*/
457-
if (bu && bu->getVisible() && bu->getStatus() == STATUS_WALKING && bu->getArmor()->getSize() != 1 && tile->getTerrainLevel() >= tileNorth->getTerrainLevel())
457+
if (bu && bu->getVisible() && bu->getStatus() == STATUS_WALKING && tile->getTerrainLevel() >= tileNorth->getTerrainLevel())
458458
{
459459
Position tileOffset = Position(16,-8,0);
460460
// the part is 0 for small units, large units have parts 1,2 & 3 depending on the relative x/y position of this tile vs the actual unit position.
@@ -1249,15 +1249,6 @@ void Map::calculateWalkingOffset(BattleUnit *unit, Position *offset)
12491249
else
12501250
midphase = 1;
12511251
}
1252-
else if (dir == 2)
1253-
{
1254-
midphase = 1;
1255-
}
1256-
else if (dir == 6 || dir == 0)
1257-
{
1258-
midphase = endphase;
1259-
}
1260-
12611252
if (unit->getVerticalDirection())
12621253
{
12631254
midphase = 4;

‎src/Battlescape/Map.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class Map : public InteractiveSurface
7575
int getTerrainLevel(Position pos, int size);
7676
public:
7777
static const int ICON_HEIGHT = 56;
78+
static const int ICON_WIDTH = 320;
7879
/// Creates a new map at the specified position and size.
7980
Map(Game *game, int width, int height, int x, int y, int visibleMapHeight);
8081
/// Cleans up the map.

‎src/Savegame/BattleUnit.cpp‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,6 @@ void BattleUnit::keepWalking(Tile *tileBelowMe, bool cache)
470470
else
471471
middle = 1;
472472
}
473-
else if (_direction == 2)
474-
{
475-
middle = 1;
476-
}
477-
else if (_direction == 6 || _direction == 0)
478-
{
479-
middle = end;
480-
}
481473
}
482474
if (!cache)
483475
{

0 commit comments

Comments
 (0)