mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
NANCY: Fix items and inventory box in The Vampire Diaries
Items now show up in TVD's inventory box, and displaying their cursor in the viewport no longer crashes the game.
This commit is contained in:
parent
954954a85a
commit
2a8512925a
@ -83,17 +83,19 @@ void CursorManager::setCursor(CursorType type, int16 itemID) {
|
||||
case kHotspotArrow:
|
||||
_curCursorID = 6;
|
||||
break;
|
||||
default:
|
||||
default: {
|
||||
uint itemsOffset = 0;
|
||||
if (itemID == -1) {
|
||||
// No item held, set to eyeglass
|
||||
itemID = 0;
|
||||
} else {
|
||||
// Item held
|
||||
itemID += 3;
|
||||
itemsOffset = g_nancy->getConstants().numNonItemCursors;
|
||||
hasItem = true;
|
||||
}
|
||||
|
||||
_curCursorID = itemID * 4 + type;
|
||||
_curCursorID = itemID * 4 + itemsOffset + type;
|
||||
}
|
||||
}
|
||||
|
||||
Graphics::ManagedSurface *surf;
|
||||
|
@ -65,7 +65,6 @@ private:
|
||||
Common::Point _primaryVideoInitialPos;
|
||||
|
||||
Graphics::ManagedSurface _invCursorsSurface;
|
||||
Graphics::ManagedSurface _object0Copy;
|
||||
|
||||
CursorType _curCursorType;
|
||||
int16 _curItemID;
|
||||
|
@ -81,12 +81,13 @@ void InventoryBox::init() {
|
||||
stream.skip(8);
|
||||
readRect(stream, _emptySpace);
|
||||
|
||||
char itemName[0x14];
|
||||
char itemName[20];
|
||||
uint itemNameLength = g_nancy->getGameType() == kGameTypeVampire ? 15 : 20;
|
||||
|
||||
_itemDescriptions.reserve(g_nancy->getConstants().numItems);
|
||||
for (uint i = 0; i < g_nancy->getConstants().numItems; ++i) {
|
||||
stream.read(itemName, 0x14);
|
||||
itemName[0x13] = '\0';
|
||||
stream.read(itemName, itemNameLength);
|
||||
itemName[itemNameLength - 1] = '\0';
|
||||
_itemDescriptions.push_back(ItemDescription());
|
||||
ItemDescription &desc = _itemDescriptions.back();
|
||||
desc.name = Common::String(itemName);
|
||||
|
@ -102,7 +102,7 @@ private:
|
||||
Common::Rect hotspot; // in screen coordinates
|
||||
};
|
||||
|
||||
Graphics::Surface _iconsSurface;
|
||||
Graphics::ManagedSurface _iconsSurface;
|
||||
Graphics::ManagedSurface _fullInventorySurface;
|
||||
|
||||
Scrollbar *_scrollbar;
|
||||
|
Loading…
Reference in New Issue
Block a user