Browse Source

Fix automap (#6513)

pull/6531/head
Eric Robinson 3 years ago committed by GitHub
parent
commit
e3d79ae1c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 28
      Source/automap.cpp

28
Source/automap.cpp

@ -116,16 +116,28 @@ void DrawDiamond(const Surface &out, Point center, uint8_t color)
void DrawMapVerticalDoor(const Surface &out, Point center, uint8_t colorBright, uint8_t colorDim)
{
DrawMapLineNE(out, { center.x + AmLine(8), center.y - AmLine(4) }, AmLine(4), colorDim);
DrawMapLineNE(out, { center.x - AmLine(16), center.y + AmLine(8) }, AmLine(4), colorDim);
DrawDiamond(out, center, colorBright);
if (leveltype != DTYPE_CATACOMBS) {
DrawMapLineNE(out, { center.x + AmLine(8), center.y - AmLine(4) }, AmLine(4), colorDim);
DrawMapLineNE(out, { center.x - AmLine(16), center.y + AmLine(8) }, AmLine(4), colorDim);
DrawDiamond(out, center, colorBright);
} else {
DrawMapLineNE(out, { center.x - AmLine(8), center.y + AmLine(4) }, AmLine(8), colorDim);
DrawMapLineNE(out, { center.x - AmLine(16), center.y + AmLine(8) }, AmLine(4), colorDim);
DrawDiamond(out, { center.x + AmLine(16), center.y - AmLine(8) }, colorBright);
}
}
void DrawMapHorizontalDoor(const Surface &out, Point center, uint8_t colorBright, uint8_t colorDim)
{
DrawMapLineSE(out, { center.x - AmLine(16), center.y - AmLine(8) }, AmLine(4), colorDim);
DrawMapLineSE(out, { center.x + AmLine(8), center.y + AmLine(4) }, AmLine(4), colorDim);
DrawDiamond(out, center, colorBright);
if (leveltype != DTYPE_CATACOMBS) {
DrawMapLineSE(out, { center.x - AmLine(16), center.y - AmLine(8) }, AmLine(4), colorDim);
DrawMapLineSE(out, { center.x + AmLine(8), center.y + AmLine(4) }, AmLine(4), colorDim);
DrawDiamond(out, center, colorBright);
} else {
DrawMapLineSE(out, { center.x - AmLine(8), center.y - AmLine(4) }, AmLine(8), colorDim);
DrawMapLineSE(out, { center.x + AmLine(8), center.y + AmLine(4) }, AmLine(4), colorDim);
DrawDiamond(out, { center.x - AmLine(16), center.y - AmLine(8) }, colorBright);
}
}
void DrawDirt(const Surface &out, Point center, uint8_t color)
@ -897,6 +909,7 @@ void DrawAutomap(const Surface &out)
Displacement myPlayerOffset = {};
if (myPlayer.isWalking())
myPlayerOffset = GetOffsetForWalking(myPlayer.AnimInfo, myPlayer._pdir, true);
myPlayerOffset += Displacement { -1, (leveltype != DTYPE_CAVES) ? TILE_HEIGHT - 1 : -1 };
int d = (AutoMapScale * 64) / 100;
int cells = 2 * (gnScreenWidth / 2 / d) + 1;
@ -958,6 +971,8 @@ void DrawAutomap(const Surface &out)
screen.y += AmLine(32);
}
if (leveltype == DTYPE_CAVES)
myPlayerOffset.deltaY += TILE_HEIGHT;
for (size_t playerId = 0; playerId < Players.size(); playerId++) {
Player &player = Players[playerId];
if (player.isOnActiveLevel() && player.plractive && !player._pLvlChanging && (&player == MyPlayer || player.friendlyMode)) {
@ -965,6 +980,7 @@ void DrawAutomap(const Surface &out)
}
}
myPlayerOffset.deltaY -= TILE_HEIGHT / 2;
if (AutoMapShowItems)
SearchAutomapItem(out, myPlayerOffset, 8, [](Point position) { return dItem[position.x][position.y] != 0; });
#ifdef _DEBUG

Loading…
Cancel
Save