- Timestamp:
- Dec 5, 2016, 6:01:02 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc
r11314 r11323 59 59 if (this->isInitialized()) 60 60 { 61 //TODO: Destroy me61 this->picks.clear(); 62 62 } 63 63 } … … 80 80 { 81 81 // orxout() << "actual pick is: " << p << endl; 82 if(i% 4==0)82 if(i%5==0) 83 83 { 84 84 offsetY+=0.04f; 85 85 i=0; 86 86 } 87 HUDPickupItem* item = new HUDPickupItem(this->getContext()); 88 // item->initializeMaterial(((Pickup*)p)->getRepresentationName(), offsetX+i*x, offsetY); 87 if(this->picks.count(p)==0) 88 { 89 HUDPickupItem* item = new HUDPickupItem(this->getContext()); 90 // item->initializeMaterial(((Pickup*)p)->getRepresentationName(), offsetX+i*x, offsetY); 89 91 if(i%2==0) 90 92 item->initializeMaterial("Shield", offsetX+i*x, offsetY); … … 93 95 item->setOverlayGroup(this->getOverlayGroup()); 94 96 this->picks[p] = item; 97 } 98 95 99 ++i; 96 100 } … … 104 108 void HUDPickupSystem::removePickup(Pickupable* pickup) 105 109 { 110 assert(pickup); 106 111 HUDPickupItem* item = this->picks.find(pickup)->second; 107 112 orxout() << "removePickup: pickup= " << pickup << " item= " << item << endl; 108 113 assert(item); 109 item->setOverlayGroup(nullptr); 110 item->hideMe(); 111 overlayElement_->_update(); 114 // item->setOverlayGroup(nullptr); 115 item->hideMe(pickup); 116 assert(overlayElement_); 117 // overlayElement_->_update(); 118 assert(this->background_); 119 // this->background_->_update(); 120 this->picks.erase(pickup); 112 121 } 113 122
Note: See TracChangeset
for help on using the changeset viewer.