- Timestamp:
- Nov 6, 2017, 4:05:15 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc
r11510 r11540 68 68 } 69 69 70 void HUDPickupSystem::sync(std::vector<Pickupable*> p) 71 { 72 //hide all pickup symbols in HUD and delete from local map 73 74 for(const auto& sm_pair : picks) 75 { 76 sm_pair.second->hideMe(sm_pair.first, repaint); 77 picks.erase(sm_pair.first); 78 } 79 80 //add to local map and place on screen 81 int i = 0; 82 const float offsetX = 0.345f; 83 float offsetY = 0.82f; 84 const float x = 0.102f; 85 for(Pickupable* pickup:p) 86 { 87 //second row has offset 88 if(i==4) 89 { 90 i=0; 91 offsetY+=0.075f; 92 } 93 94 HUDPickupItem* item = new HUDPickupItem(this->getContext()); 95 item->initializeMaterial(this->getIcon(((Pickup*)pickup)->getRepresentationName()), offsetX+i*x, offsetY); 96 orxout() << "created new pickupHUDItem"<<endl; 97 item->setOverlayGroup(this->getOverlayGroup()); 98 picks[pickup] = item; 99 i++; 100 } 101 102 } 70 103 71 104 void HUDPickupSystem::updatePickupList(std::vector<Pickupable*> picks, std::map<Pickupable*, uint32_t> indexes_) … … 92 125 HUDPickupItem* item = new HUDPickupItem(this->getContext()); 93 126 item->initializeMaterial(this->getIcon(((Pickup*)p)->getRepresentationName()), offsetX+i*x, offsetY); 94 127 orxout() << "created new pickupHUDItem"<<endl; 95 128 item->setOverlayGroup(this->getOverlayGroup()); 96 129 this->picks[p] = item; … … 110 143 HUDPickupItem* item = this->picks.find(pickup)->second; 111 144 orxout() << "removePickup: pickup= " << pickup << " item= " << item << endl; 145 this->picks.erase(pickup); 112 146 //assert(item); 113 147 item->hideMe(pickup, repaint); … … 115 149 //assert(overlayElement_); 116 150 //assert(this->background_); 117 //this->picks.erase(pickup);118 151 orxout()<< "end removePickup method" << endl; 119 152 }
Note: See TracChangeset
for help on using the changeset viewer.