added inventory icon to objects

This commit is contained in:
maka70vv 2025-03-03 01:27:09 +06:00
parent 2e73c41519
commit 24eecbec3b
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -94,7 +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"));
ao1.inventoryIconTexturePtr = std::make_shared<Texture>(CreateTextureDataFromBmp32("./textures/inventory_objects/cubic_T_icon.bmp32"));
/*
ActiveObject ao2;
@ -260,7 +260,7 @@ void GameObjectManager::handleEvent(const SDL_Event& event) {
continue;
}
AddItemToInventory(ao->name, ao->inventoryItemTexturePtr, objects_in_inventory+1);
AddItemToInventory(ao->name, ao->inventoryIconTexturePtr, objects_in_inventory+1);
objects_in_inventory++;
rooms[current_room_index].removeByPtr(ao);