@@ -216,7 +216,7 @@ void DrawMapVerticalDoor(const Surface &out, Point center, AutomapTile neTile, u
216216 default :
217217 app_fatal (" Invalid leveltype" );
218218 }
219- if (!( neTile.hasFlag (AutomapTile::Flags::VerticalPassage) && leveltype == DTYPE_CATHEDRAL) )
219+ if (!neTile.hasFlag (AutomapTile::Flags::VerticalPassage) || leveltype != DTYPE_CATHEDRAL)
220220 DrawMapLineNE (out, center + AmOffset (lWidthOffset, lHeightOffset), AmLine (length), colorDim);
221221 DrawDiamond (out, center + AmOffset (dWidthOffset, dHeightOffset), colorBright);
222222}
@@ -265,7 +265,7 @@ void DrawMapHorizontalDoor(const Surface &out, Point center, AutomapTile nwTile,
265265 default :
266266 app_fatal (" Invalid leveltype" );
267267 }
268- if (!( nwTile.hasFlag (AutomapTile::Flags::HorizontalPassage) && leveltype == DTYPE_CATHEDRAL) )
268+ if (!nwTile.hasFlag (AutomapTile::Flags::HorizontalPassage) || leveltype != DTYPE_CATHEDRAL)
269269 DrawMapLineSE (out, center + AmOffset (lWidthOffset, lHeightOffset), AmLine (length), colorDim);
270270 DrawDiamond (out, center + AmOffset (dWidthOffset, dHeightOffset), colorBright);
271271}
@@ -747,7 +747,7 @@ void DrawVertical(const Surface &out, Point center, AutomapTile tile, AutomapTil
747747 * @brief Draw half-tile length lines to connect walls to any walls to the south-west and/or south-east
748748 * (For caves the horizontal/vertical flags are swapped)
749749 */
750- void DrawCaveWallConnections (const Surface &out, Point center, AutomapTile sTile , AutomapTile swTile, AutomapTile seTile, uint8_t colorDim)
750+ void DrawCaveWallConnections (const Surface &out, Point center, AutomapTile swTile, AutomapTile seTile, uint8_t colorDim)
751751{
752752 if (IsAnyOf (swTile.type , AutomapTile::Types::CaveVerticalWallLava, AutomapTile::Types::CaveVertical, AutomapTile::Types::CaveVerticalWood, AutomapTile::Types::CaveCross, AutomapTile::Types::CaveWoodCross, AutomapTile::Types::CaveRightWoodCross, AutomapTile::Types::CaveLeftWoodCross, AutomapTile::Types::CaveRightCorner)) {
753753 DrawMapLineNE (out, center + AmOffset (AmWidthOffset::QuarterTileLeft, AmHeightOffset::ThreeQuartersTileDown), AmLine (AmLineLength::HalfTile), colorDim);
@@ -850,7 +850,7 @@ void DrawMapEllipse(const Surface &out, Point from, int radius, uint8_t colorInd
850850 SetMapPixel (out, { from.x , from.y - b }, colorIndex);
851851
852852 // Initialize the parameters
853- int p1 = (b * b) - (a * a * b) + (a * a) / 4 ;
853+ int p1 = (b * b) - (a * a * b) + (( a * a) / 4 ) ;
854854
855855 // Region 1
856856 while ((b * b * x) < (a * a * y)) {
@@ -1056,7 +1056,7 @@ void DrawAutomapTile(const Surface &out, Point center, Point map)
10561056
10571057 if (!noConnect) {
10581058 if (IsAnyOf (leveltype, DTYPE_TOWN, DTYPE_CAVES, DTYPE_NEST)) {
1059- DrawCaveWallConnections (out, center, sTile , swTile, seTile, colorDim);
1059+ DrawCaveWallConnections (out, center, swTile, seTile, colorDim);
10601060 }
10611061 DrawWallConnections (out, center, tile, nwTile, neTile, colorBright, colorDim);
10621062 }
@@ -1259,8 +1259,8 @@ Displacement GetAutomapScreen()
12591259
12601260 if (GetAutomapType () == AutomapType::Minimap) {
12611261 screen = {
1262- MinimapRect.position .x + MinimapRect.size .width / 2 ,
1263- MinimapRect.position .y + MinimapRect.size .height / 2
1262+ MinimapRect.position .x + ( MinimapRect.size .width / 2 ) ,
1263+ MinimapRect.position .y + ( MinimapRect.size .height / 2 )
12641264 };
12651265 } else {
12661266 screen = {
@@ -1298,12 +1298,12 @@ void SearchAutomapItem(const Surface &out, const Displacement &myPlayerOffset, i
12981298 if (!highlightTile ({ i, j }))
12991299 continue ;
13001300
1301- const int px = i - 2 * AutomapOffset.deltaX - ViewPosition.x ;
1302- const int py = j - 2 * AutomapOffset.deltaY - ViewPosition.y ;
1301+ const int px = i - ( 2 * AutomapOffset.deltaX ) - ViewPosition.x ;
1302+ const int py = j - ( 2 * AutomapOffset.deltaY ) - ViewPosition.y ;
13031303
13041304 Point screen = {
1305- (myPlayerOffset.deltaX * scale / 100 / 2 ) + (px - py) * AmLine (AmLineLength::DoubleTile),
1306- (myPlayerOffset.deltaY * scale / 100 / 2 ) + (px + py) * AmLine (AmLineLength::FullTile),
1305+ (myPlayerOffset.deltaX * scale / 100 / 2 ) + (( px - py) * AmLine (AmLineLength::DoubleTile) ),
1306+ (myPlayerOffset.deltaY * scale / 100 / 2 ) + (( px + py) * AmLine (AmLineLength::FullTile) ),
13071307 };
13081308
13091309 screen += GetAutomapScreen ();
@@ -1345,8 +1345,8 @@ void DrawAutomapPlr(const Surface &out, const Displacement &myPlayerOffset, cons
13451345
13461346 const Point tile = player.position .tile ;
13471347
1348- const int px = tile.x - 2 * AutomapOffset.deltaX - ViewPosition.x ;
1349- const int py = tile.y - 2 * AutomapOffset.deltaY - ViewPosition.y ;
1348+ const int px = tile.x - ( 2 * AutomapOffset.deltaX ) - ViewPosition.x ;
1349+ const int py = tile.y - ( 2 * AutomapOffset.deltaY ) - ViewPosition.y ;
13501350
13511351 Displacement playerOffset = {};
13521352 if (player.isWalking ())
@@ -1355,8 +1355,8 @@ void DrawAutomapPlr(const Surface &out, const Displacement &myPlayerOffset, cons
13551355 const int scale = (GetAutomapType () == AutomapType::Minimap) ? MinimapScale : AutoMapScale;
13561356
13571357 Point base = {
1358- ((playerOffset.deltaX + myPlayerOffset.deltaX ) * scale / 100 / 2 ) + (px - py) * AmLine (AmLineLength::DoubleTile),
1359- ((playerOffset.deltaY + myPlayerOffset.deltaY ) * scale / 100 / 2 ) + (px + py) * AmLine (AmLineLength::FullTile) + AmOffset (AmWidthOffset::None, AmHeightOffset::HalfTileUp).deltaY
1358+ ((playerOffset.deltaX + myPlayerOffset.deltaX ) * scale / 100 / 2 ) + (( px - py) * AmLine (AmLineLength::DoubleTile) ),
1359+ ((playerOffset.deltaY + myPlayerOffset.deltaY ) * scale / 100 / 2 ) + (( px + py) * AmLine (AmLineLength::FullTile) ) + AmOffset (AmWidthOffset::None, AmHeightOffset::HalfTileUp).deltaY
13601360 };
13611361
13621362 base += GetAutomapScreen ();
@@ -1775,7 +1775,7 @@ void DrawAutomap(const Surface &out)
17751775
17761776 const int scale = (GetAutomapType () == AutomapType::Minimap) ? MinimapScale : AutoMapScale;
17771777 const int d = (scale * 64 ) / 100 ;
1778- int cells = 2 * (gnScreenWidth / 2 / d) + 1 ;
1778+ int cells = ( 2 * (gnScreenWidth / 2 / d) ) + 1 ;
17791779 if (((gnScreenWidth / 2 ) % d) != 0 )
17801780 cells++;
17811781 if (((gnScreenWidth / 2 ) % d) >= (scale * 32 ) / 100 )
0 commit comments