diff --git a/Source/engine/render/scrollrt.cpp b/Source/engine/render/scrollrt.cpp index 9a223456d..9ed879c7c 100644 --- a/Source/engine/render/scrollrt.cpp +++ b/Source/engine/render/scrollrt.cpp @@ -654,7 +654,7 @@ void DrawItem(const Surface &out, Point tilePosition, Point targetBufferPosition } ClxDrawLight(out, position, sprite); if (item.AnimInfo.isLastFrame() || item._iCurs == ICURS_MAGIC_ROCK) - AddItemToLabelQueue(bItem - 1, px, targetBufferPosition.y); + AddItemToLabelQueue(bItem - 1, position); } /** diff --git a/Source/qol/itemlabels.cpp b/Source/qol/itemlabels.cpp index da2a803af..83f95ba63 100644 --- a/Source/qol/itemlabels.cpp +++ b/Source/qol/itemlabels.cpp @@ -88,7 +88,7 @@ bool IsHighlightingLabelsEnabled() return altPressed != *sgOptions.Gameplay.showItemLabels; } -void AddItemToLabelQueue(int id, int x, int y) +void AddItemToLabelQueue(int id, Point position) { if (!IsHighlightingLabelsEnabled()) return; @@ -109,14 +109,14 @@ void AddItemToLabelQueue(int id, int x, int y) labelCenterOffsets[index].emplace((itemBounds.first + itemBounds.second) / 2); } - x += *labelCenterOffsets[index]; - y -= TILE_HEIGHT; + position.x += *labelCenterOffsets[index]; + position.y -= TILE_HEIGHT; if (*sgOptions.Graphics.zoom) { - x *= 2; - y *= 2; + position *= 2; } - x -= nameWidth / 2; - labelQueue.push_back(ItemLabel { id, nameWidth, { x, y - Height }, textOnGround }); + position.x -= nameWidth / 2; + position.y -= Height; + labelQueue.push_back(ItemLabel { id, nameWidth, position, textOnGround }); } bool IsMouseOverGameArea() diff --git a/Source/qol/itemlabels.h b/Source/qol/itemlabels.h index b4e57cb22..cd8c7c9e8 100644 --- a/Source/qol/itemlabels.h +++ b/Source/qol/itemlabels.h @@ -13,7 +13,7 @@ void ToggleItemLabelHighlight(); void AltPressed(bool pressed); bool IsItemLabelHighlighted(); bool IsHighlightingLabelsEnabled(); -void AddItemToLabelQueue(int id, int x, int y); +void AddItemToLabelQueue(int id, Point position); void DrawItemNameLabels(const Surface &out); } // namespace devilution