- Timestamp:
- Jul 2, 2006, 6:25:54 AM (18 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/hud.cc
r8995 r8996 27 27 #include "specials/glgui_notifier.h" 28 28 #include "elements/glgui_radar.h" 29 30 31 32 /// HACK 33 #include "player.h" 34 #include "playable.h" 29 35 30 36 /** … … 128 134 129 135 this->updateWeaponManager(); 130 // this->updateResolution();136 // this->updateResolution(); 131 137 } 132 138 … … 174 180 this->notifier->setWidgetSize(0.25 * this->resX, 0.6 * this->resY); 175 181 176 this->_radar->setAbsCoor2D(0.8 * this->resX, 0.1 * this->resY); 177 this->_radar->setWidgetSize(0.2 * this->resX, 0.2 * this->resY); 178 this->_radar->show(); 182 183 if (State::getPlayer() && State::getPlayer()->getPlayable() && State::getObjectManager()) 184 { 185 printf("UPDATING RADAR\n"); 186 this->_radar->setCenterNode(State::getPlayer()->getPlayable()); 187 this->_radar->addEntityList(&State::getObjectManager()->getObjectList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color::red); 188 this->_radar->setAbsCoor2D(0.8 * this->resX, 0.1 * this->resY); 189 this->_radar->setWidgetSize(0.2 * this->resX, 0.2 * this->resY); 190 this->_radar->show(); 191 } 192 179 193 180 194 if (this->energyWidget != NULL) -
trunk/src/world_entities/elements/glgui_radar.cc
r8994 r8996 19 19 #include "world_entity.h" 20 20 21 #include "debug.h" 22 21 23 namespace OrxGui 22 24 { … … 25 27 */ 26 28 GLGuiRadar::GLGuiRadar () 27 {} 29 { 30 this->init(); 31 } 28 32 29 33 … … 78 82 _timePassed+=dt; 79 83 80 if (_timePassed > _updateInterval)84 //if (_timePassed > _updateInterval) 81 85 { 82 _timePassed -=_updateInterval;86 _timePassed = 0 ; //-=_updateInterval; 83 87 this->updateRadar(); 84 88 } … … 104 108 if (_centerNode->distance(*it) < this->_range) 105 109 { 106 this->_dotLists[i].positions.push_back(Vector2D(50, 50) + Vector2D(_centerNode->getAbsCoor().x - (*it)->getAbsCoor().x, _centerNode->getAbsCoor().y - (*it)->getAbsCoor().y) /_range * 50);110 this->_dotLists[i].positions.push_back(Vector2D(50, 50) + Vector2D(_centerNode->getAbsCoor().x - (*it)->getAbsCoor().x, _centerNode->getAbsCoor().y - (*it)->getAbsCoor().y)* (50.0 /_range)); 107 111 } 108 112 … … 118 122 GLGuiWidget::draw(); 119 123 124 glPointSize(2.0f); 120 125 for (unsigned int i = 0; i < this->_dotLists.size(); ++i) 121 126 { … … 124 129 { 125 130 glBegin(GL_POINTS); 126 127 glVertex2f(this->_dotLists[i].positions[i].x, this->_dotLists[i].positions[i].y); 128 131 glVertex2f(this->_dotLists[i].positions[j].x, this->_dotLists[i].positions[j].y); 129 132 glEnd(); 130 133 } -
trunk/src/world_entities/elements/glgui_radar.h
r8993 r8996 42 42 void updateRadar(); 43 43 44 v oid tick(float dt);44 virtual void tick(float dt); 45 45 void draw() const; 46 46
Note: See TracChangeset
for help on using the changeset viewer.