From 8e19ef5460b728f8516f303e15401c2ca596ccf2 Mon Sep 17 00:00:00 2001 From: thebigMuh Date: Tue, 4 May 2021 02:34:52 +0200 Subject: [PATCH] - Fixed outline drawing for item on cursor to match rest of game - Made GetOutlineColor const - Made gold outline golden again... because the white outline made me sad --- Source/items.cpp | 4 +++- Source/items.h | 2 +- Source/scrollrt.cpp | 13 +++---------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index 5cabb252e..f6e69462e 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -338,10 +338,12 @@ bool IsItemAvailable(int i) sgOptions.Gameplay.bTestBard && (i == IDI_BARDSWORD || i == IDI_BARDDAGGER)); } -BYTE GetOutlineColor(ItemStruct &item, bool checkReq) +BYTE GetOutlineColor(const ItemStruct &item, bool checkReq) { if (checkReq && !item._iStatFlag) return ICOL_RED; + if (item._itype == ITYPE_GOLD) + return ICOL_YELLOW; if (item._iMagical == ITEM_QUALITY_MAGIC) return ICOL_BLUE; if (item._iMagical == ITEM_QUALITY_UNIQUE) diff --git a/Source/items.h b/Source/items.h index 0ab96bc2f..242d11c45 100644 --- a/Source/items.h +++ b/Source/items.h @@ -371,7 +371,7 @@ extern CornerStoneStruct CornerStone; extern bool UniqueItemFlags[128]; extern int numitems; -BYTE GetOutlineColor(ItemStruct &item, bool checkReq); +BYTE GetOutlineColor(const ItemStruct &item, bool checkReq); bool IsItemAvailable(int i); bool IsUniqueAvailable(int i); void InitItemGFX(); diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 5f2506139..34f76c4e6 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -161,7 +161,6 @@ static void scrollrt_draw_cursor_back_buffer(const CelOutputBuffer &out) static void scrollrt_draw_cursor_item(const CelOutputBuffer &out) { int mx, my; - BYTE col; assert(!sgdwCursWdt); @@ -218,15 +217,9 @@ static void scrollrt_draw_cursor_item(const CelOutputBuffer &out) const auto &sprite = GetInvItemSprite(pcurs); const int frame = GetInvItemFrame(pcurs); if (pcurs >= CURSOR_FIRSTITEM) { - col = PAL16_YELLOW + 5; - if (plr[myplr].HoldItem._iMagical != 0) { - col = PAL16_BLUE + 5; - } - if (!plr[myplr].HoldItem._iStatFlag) { - col = PAL16_RED + 5; - } - CelBlitOutlineTo(sub, col, mx, my + cursH - 1, sprite, frame, false); - if (col != PAL16_RED + 5) { + const auto &heldItem = plr[myplr].HoldItem; + CelBlitOutlineTo(sub, GetOutlineColor(heldItem, true), mx, my + cursH - 1, sprite, frame, false); + if (heldItem._iStatFlag) { CelClippedDrawSafeTo(sub, mx, my + cursH - 1, sprite, frame); } else { CelDrawLightRedSafeTo(sub, mx, my + cursH - 1, sprite, frame, 1);