added inventory icon to objects

This commit is contained in:
maka70vv 2025-03-03 01:25:41 +06:00
parent 6c576510b7
commit 2e73c41519
2 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,8 @@ struct ActiveObject {
ZL::VertexDataStruct activeObjectScreenMesh;
ZL::VertexRenderStruct activeObjectScreenMeshMutable;
std::shared_ptr<ZL::Texture> inventoryItemTexturePtr;
ZL::Vector3f objectPos;
bool highlighted = false;
};

View File

@ -94,6 +94,7 @@ void GameObjectManager::initialize() {
ao1.activeObjectScreenMesh = CreateRect2D({ 0.f, 0.f }, { 64.f, 64.f }, 0.5);
ao1.activeObjectScreenMeshMutable.AssignFrom(ao1.activeObjectScreenMesh);
ao1.activeObjectScreenMeshMutable.RefreshVBO();
ao1.inventoryItemTexturePtr = std::make_shared<Texture>(CreateTextureDataFromBmp32("./textures/inventory_objects/cubic_T_icon.bmp32"));
/*
ActiveObject ao2;
@ -259,7 +260,7 @@ void GameObjectManager::handleEvent(const SDL_Event& event) {
continue;
}
AddItemToInventory(ao->name, ao->activeObjectTexturePtr, objects_in_inventory+1);
AddItemToInventory(ao->name, ao->inventoryItemTexturePtr, objects_in_inventory+1);
objects_in_inventory++;
rooms[current_room_index].removeByPtr(ao);