Browse Source

- 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
pull/1860/head
thebigMuh 5 years ago committed by Anders Jenbo
parent
commit
8e19ef5460
  1. 4
      Source/items.cpp
  2. 2
      Source/items.h
  3. 13
      Source/scrollrt.cpp

4
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)

2
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();

13
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);

Loading…
Cancel
Save