Skip to content

Commit

Permalink
Update automap.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Jan 18, 2025
1 parent 74e719c commit 899a056
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Source/automap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ Point Automap;
enum MapColors : uint8_t {
/** color used to draw the player's arrow */
MapColorsPlayer = (PAL8_ORANGE + 1),
MapColorsPlayer2 = (PAL8_YELLOW + 1),
MapColorsPlayer3 = (PAL8_RED + 1),
MapColorsPlayer4 = (PAL8_BLUE + 1),
MapColorsPlayer5 = (PAL16_ORANGE + 1),
MapColorsPlayer6 = (PAL16_BEIGE + 1),
MapColorsPlayer7 = (PAL16_RED + 1),
MapColorsPlayer8 = (PAL16_BLUE + 1),
/** color for bright map lines (doors, stairs etc.) */
MapColorsBright = PAL8_YELLOW,
/** color for dim map lines/dots */
Expand Down Expand Up @@ -153,6 +160,8 @@ struct AutomapTile {
}
};

int8_t playerColors[] { MapColorsPlayer, MapColorsPlayer2, MapColorsPlayer3, MapColorsPlayer4, MapColorsPlayer5, MapColorsPlayer6, MapColorsPlayer7, MapColorsPlayer8 };

Check warning on line 163 in Source/automap.cpp

View workflow job for this annotation

GitHub Actions / build

conversion from 'devilution::`anonymous-namespace'::MapColors' to 'int8_t' requires a narrowing conversion

Check warning on line 163 in Source/automap.cpp

View workflow job for this annotation

GitHub Actions / build

conversion from 'devilution::`anonymous-namespace'::MapColors' to 'int8_t' requires a narrowing conversion

Check warning on line 163 in Source/automap.cpp

View workflow job for this annotation

GitHub Actions / build

conversion from 'devilution::`anonymous-namespace'::MapColors' to 'int8_t' requires a narrowing conversion

Check warning on line 163 in Source/automap.cpp

View workflow job for this annotation

GitHub Actions / build

conversion from 'devilution::`anonymous-namespace'::MapColors' to 'int8_t' requires a narrowing conversion

Check warning on line 163 in Source/automap.cpp

View workflow job for this annotation

GitHub Actions / build

conversion from 'devilution::`anonymous-namespace'::MapColors' to 'int8_t' requires a narrowing conversion

Check warning on line 163 in Source/automap.cpp

View workflow job for this annotation

GitHub Actions / build

conversion from 'devilution::`anonymous-namespace'::MapColors' to 'int8_t' requires a narrowing conversion

Check warning on line 163 in Source/automap.cpp

View workflow job for this annotation

GitHub Actions / build

conversion from 'devilution::`anonymous-namespace'::MapColors' to 'int8_t' requires a narrowing conversion

Check warning on line 163 in Source/automap.cpp

View workflow job for this annotation

GitHub Actions / build

conversion from 'devilution::`anonymous-namespace'::MapColors' to 'int8_t' requires a narrowing conversion

/**
* Maps from tile_id to automap type.
*/
Expand Down Expand Up @@ -1319,7 +1328,7 @@ void SearchAutomapItem(const Surface &out, const Displacement &myPlayerOffset, i
*/
void DrawAutomapPlr(const Surface &out, const Displacement &myPlayerOffset, const Player &player)
{
const uint8_t playerColor = MapColorsPlayer + (8 * player.getId()) % 128;
const uint8_t playerColor = playerColors[player.getId()];

Point tile = player.position.tile;

Expand Down

0 comments on commit 899a056

Please sign in to comment.