Skip to content

Commit

Permalink
Update colors
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Jan 19, 2025
1 parent 1a7d514 commit f11b7bd
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
12 changes: 6 additions & 6 deletions Source/automap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ Point Automap;

enum MapColors : uint8_t {
/** color used to draw the player's arrow */
MapColorsPlayer = (PAL8_ORANGE + 1),
MapColorsPlayer1 = (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),
MapColorsPlayer5 = (PAL16_ORANGE + 2),
MapColorsPlayer6 = (PAL16_BEIGE + 2),
MapColorsPlayer7 = (PAL16_RED + 2),
MapColorsPlayer8 = (PAL16_BLUE + 2),
/** color for bright map lines (doors, stairs etc.) */
MapColorsBright = PAL8_YELLOW,
/** color for dim map lines/dots */
Expand Down Expand Up @@ -160,7 +160,7 @@ struct AutomapTile {
}
};

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

/**
* Maps from tile_id to automap type.
Expand Down
33 changes: 29 additions & 4 deletions Source/engine/render/scrollrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@

namespace devilution {

enum OutlineColors : uint8_t {
OutlineColorsPlayer1 = (PAL16_ORANGE + 7),
OutlineColorsPlayer2 = (PAL16_YELLOW + 7),
OutlineColorsPlayer3 = (PAL16_RED + 7),
OutlineColorsPlayer4 = (PAL16_BLUE + 7),
OutlineColorsPlayer5 = (PAL16_ORANGE + 5),
OutlineColorsPlayer6 = (PAL16_BEIGE + 5),
OutlineColorsPlayer7 = (PAL16_RED + 5),
OutlineColorsPlayer8 = (PAL16_BLUE + 5),
OutlineColorsObject = (PAL16_YELLOW + 2),
OutlineColorsTowner = (PAL16_BEIGE + 6),
OutlineColorsMonster = (PAL16_RED + 9),
};

bool AutoMapShowItems;

// DevilutionX extension.
Expand Down Expand Up @@ -402,8 +416,19 @@ void DrawPlayer(const Surface &out, const Player &player, Point tilePosition, Po
const ClxSprite sprite = player.currentSprite();
Point spriteBufferPosition = targetBufferPosition + player.getRenderingOffset(sprite);

uint8_t playerColor[] = {
OutlineColorsPlayer1,
OutlineColorsPlayer2,
OutlineColorsPlayer3,
OutlineColorsPlayer4,
OutlineColorsPlayer5,
OutlineColorsPlayer6,
OutlineColorsPlayer7,
OutlineColorsPlayer8
};

if (&player == PlayerUnderCursor)
ClxDrawOutlineSkipColorZero(out, 165, spriteBufferPosition, sprite);
ClxDrawOutlineSkipColorZero(out, playerColor[player.getId()], spriteBufferPosition, sprite);

if (&player == MyPlayer && IsNoneOf(leveltype, DTYPE_NEST, DTYPE_CRYPT)) {
ClxDraw(out, spriteBufferPosition, sprite);
Expand Down Expand Up @@ -456,7 +481,7 @@ void DrawObject(const Surface &out, const Object &objectToDraw, Point tilePositi
const Point screenPosition = targetBufferPosition + objectToDraw.getRenderingOffset(sprite, tilePosition);

if (&objectToDraw == ObjectUnderCursor) {
ClxDrawOutlineSkipColorZero(out, 194, screenPosition, sprite);
ClxDrawOutlineSkipColorZero(out, OutlineColorsObject, screenPosition, sprite);
}
if (objectToDraw.applyLighting) {
ClxDrawLight(out, screenPosition, sprite, lightTableIndex);
Expand Down Expand Up @@ -659,7 +684,7 @@ void DrawMonsterHelper(const Surface &out, Point tilePosition, Point targetBuffe
const Point position = targetBufferPosition + towner.getRenderingOffset();
const ClxSprite sprite = towner.currentSprite();
if (mi == pcursmonst) {
ClxDrawOutlineSkipColorZero(out, 166, position, sprite);
ClxDrawOutlineSkipColorZero(out, OutlineColorsTowner, position, sprite);
}
ClxDraw(out, position, sprite);
return;
Expand All @@ -684,7 +709,7 @@ void DrawMonsterHelper(const Surface &out, Point tilePosition, Point targetBuffe

const Point monsterRenderPosition = targetBufferPosition + offset;
if (mi == pcursmonst) {
ClxDrawOutlineSkipColorZero(out, 233, monsterRenderPosition, sprite);
ClxDrawOutlineSkipColorZero(out, OutlineColorsMonster, monsterRenderPosition, sprite);
}
DrawMonster(out, tilePosition, monsterRenderPosition, monster, lightTableIndex);
}
Expand Down

0 comments on commit f11b7bd

Please sign in to comment.