|
|
|
|
@ -1017,7 +1017,7 @@ int CreateGoldItemInInventorySlot(Player &player, int slotIndex, int value)
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
void InvDrawSlotBack(const Surface &out, Point targetPosition, Size size) |
|
|
|
|
void InvDrawSlotBack(const Surface &out, Point targetPosition, Size size, item_quality itemQuality) |
|
|
|
|
{ |
|
|
|
|
SDL_Rect srcRect = MakeSdlRect(0, 0, size.width, size.height); |
|
|
|
|
out.Clip(&srcRect, &targetPosition); |
|
|
|
|
@ -1030,11 +1030,18 @@ void InvDrawSlotBack(const Surface &out, Point targetPosition, Size size)
|
|
|
|
|
for (int hgt = size.height; hgt != 0; hgt--, dst -= dstPitch + size.width) { |
|
|
|
|
for (int wdt = size.width; wdt != 0; wdt--) { |
|
|
|
|
std::uint8_t pix = *dst; |
|
|
|
|
if (pix >= PAL16_BLUE) { |
|
|
|
|
if (pix <= PAL16_BLUE + 15) |
|
|
|
|
pix -= PAL16_BLUE - PAL16_BEIGE; |
|
|
|
|
else if (pix >= PAL16_GRAY) |
|
|
|
|
pix -= PAL16_GRAY - PAL16_BEIGE; |
|
|
|
|
if (pix >= PAL16_GRAY) { |
|
|
|
|
switch (itemQuality) { |
|
|
|
|
case ITEM_QUALITY_MAGIC: |
|
|
|
|
pix -= PAL16_GRAY - PAL16_BLUE - 1; |
|
|
|
|
break; |
|
|
|
|
case ITEM_QUALITY_UNIQUE: |
|
|
|
|
pix -= PAL16_GRAY - PAL16_YELLOW - 1; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
pix -= PAL16_GRAY - PAL16_BEIGE - 1; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
*dst++ = pix; |
|
|
|
|
} |
|
|
|
|
@ -1104,7 +1111,7 @@ void DrawInv(const Surface &out)
|
|
|
|
|
if (!myPlayer.InvBody[slot].isEmpty()) { |
|
|
|
|
int screenX = slotPos[slot].x; |
|
|
|
|
int screenY = slotPos[slot].y; |
|
|
|
|
InvDrawSlotBack(out, GetPanelPosition(UiPanels::Inventory, { screenX, screenY }), { slotSize[slot].width * InventorySlotSizeInPixels.width, slotSize[slot].height * InventorySlotSizeInPixels.height }); |
|
|
|
|
InvDrawSlotBack(out, GetPanelPosition(UiPanels::Inventory, { screenX, screenY }), { slotSize[slot].width * InventorySlotSizeInPixels.width, slotSize[slot].height * InventorySlotSizeInPixels.height }, myPlayer.InvBody[slot]._iMagical); |
|
|
|
|
|
|
|
|
|
const int cursId = myPlayer.InvBody[slot]._iCurs + CURSOR_FIRSTITEM; |
|
|
|
|
|
|
|
|
|
@ -1130,7 +1137,7 @@ void DrawInv(const Surface &out)
|
|
|
|
|
|
|
|
|
|
if (slot == INVLOC_HAND_LEFT) { |
|
|
|
|
if (myPlayer.GetItemLocation(myPlayer.InvBody[slot]) == ILOC_TWOHAND) { |
|
|
|
|
InvDrawSlotBack(out, GetPanelPosition(UiPanels::Inventory, slotPos[INVLOC_HAND_RIGHT]), { slotSize[INVLOC_HAND_RIGHT].width * InventorySlotSizeInPixels.width, slotSize[INVLOC_HAND_RIGHT].height * InventorySlotSizeInPixels.height }); |
|
|
|
|
InvDrawSlotBack(out, GetPanelPosition(UiPanels::Inventory, slotPos[INVLOC_HAND_RIGHT]), { slotSize[INVLOC_HAND_RIGHT].width * InventorySlotSizeInPixels.width, slotSize[INVLOC_HAND_RIGHT].height * InventorySlotSizeInPixels.height }, myPlayer.InvBody[slot]._iMagical); |
|
|
|
|
LightTableIndex = 0; |
|
|
|
|
cel_transparency_active = true; |
|
|
|
|
|
|
|
|
|
@ -1149,7 +1156,8 @@ void DrawInv(const Surface &out)
|
|
|
|
|
InvDrawSlotBack( |
|
|
|
|
out, |
|
|
|
|
GetPanelPosition(UiPanels::Inventory, InvRect[i + SLOTXY_INV_FIRST]) + Displacement { 0, -1 }, |
|
|
|
|
InventorySlotSizeInPixels); |
|
|
|
|
InventorySlotSizeInPixels, |
|
|
|
|
myPlayer.InvList[abs(myPlayer.InvGrid[i]) - 1]._iMagical); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -1187,7 +1195,7 @@ void DrawInvBelt(const Surface &out)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const Point position { InvRect[i + SLOTXY_BELT_FIRST].x + mainPanelPosition.x, InvRect[i + SLOTXY_BELT_FIRST].y + mainPanelPosition.y - 1 }; |
|
|
|
|
InvDrawSlotBack(out, position, InventorySlotSizeInPixels); |
|
|
|
|
InvDrawSlotBack(out, position, InventorySlotSizeInPixels, myPlayer.SpdList[i]._iMagical); |
|
|
|
|
const int cursId = myPlayer.SpdList[i]._iCurs + CURSOR_FIRSTITEM; |
|
|
|
|
|
|
|
|
|
const ClxSprite sprite = GetInvItemSprite(cursId); |
|
|
|
|
|