Changeset 5935 for code/branches/pickup/src/modules/overlays
- Timestamp:
- Oct 13, 2009, 5:05:17 PM (15 years ago)
- Location:
- code/branches/pickup
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup
- Property svn:mergeinfo changed
-
code/branches/pickup/src/modules/overlays/FadeoutText.cc
r5781 r5935 46 46 47 47 this->bFadingOut_ = false; 48 this->fadeouttimer_.setTimer(3.0f, false, this, createExecutor(createFunctor(&FadeoutText::fadeout)));48 this->fadeouttimer_.setTimer(3.0f, false, createExecutor(createFunctor(&FadeoutText::fadeout, this))); 49 49 this->fadeouttimer_.stopTimer(); 50 50 -
code/branches/pickup/src/modules/overlays/FadeoutText.h
r5781 r5935 68 68 69 69 bool bFadingOut_; 70 Timer <FadeoutText>fadeouttimer_;70 Timer fadeouttimer_; 71 71 72 72 float initialAlpha_; -
code/branches/pickup/src/modules/overlays/OverlaysPrereqs.h
r5781 r5935 28 28 29 29 /** 30 @file 31 @brief Contains all the necessary forward declarations for all classes and structs. 30 @file 31 @brief 32 Shared library macros, enums, constants and forward declarations for the overlays module 32 33 */ 33 34 … … 36 37 37 38 #include "OrxonoxConfig.h" 39 #include "OrxonoxPrereqs.h" 38 40 39 41 //----------------------------------------------------------------------- 40 42 // Shared library settings 41 43 //----------------------------------------------------------------------- 44 42 45 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD) 43 46 # ifdef OVERLAYS_SHARED_BUILD … … 62 65 namespace orxonox 63 66 { 64 class BarColour; 67 class FadeoutText; 68 class GUIOverlay; 69 class OverlayText; 70 71 // debugging 65 72 class DebugFPSText; 66 73 class DebugRTRText; 67 class GUIOverlay; 74 75 // hud 76 class AnnounceMessage; 77 class BarColour; 78 class ChatOverlay; 79 class DeathMessage; 80 class GametypeStatus; 68 81 class HUDBar; 82 class HUDHealthBar; 69 83 class HUDNavigation; 70 84 class HUDRadar; 71 85 class HUDSpeedBar; 72 class HUDHealthBar;73 86 class HUDTimer; 74 class OrxonoxOverlay;75 class OverlayGroup;76 class OverlayText;77 class FadeoutText;78 class GametypeStatus;79 class AnnounceMessage;80 87 class KillMessage; 81 class DeathMessage; 88 class TeamBaseMatchScore; 89 class UnderAttackHealthBar; 82 90 91 // stats 83 92 class CreateLines; 84 93 class Scoreboard; -
code/branches/pickup/src/modules/overlays/hud/ChatOverlay.cc
r5781 r5935 58 58 ChatOverlay::~ChatOverlay() 59 59 { 60 for (std::set<Timer*>::iterator it = this->timers_.begin(); it != this->timers_.end(); ++it) 61 delete (*it); 60 62 } 61 63 … … 87 89 COUT(0) << "Chat: " << text << std::endl; 88 90 89 new Timer<ChatOverlay>(this->displayTime_, false, this, createExecutor(createFunctor(&ChatOverlay::dropMessage)), true); 91 Timer* timer = new Timer(); 92 this->timers_.insert(timer); // store the timer in a set to destroy it in the destructor 93 Executor* executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this)); 94 executor->setDefaultValues(timer); 95 timer->setTimer(this->displayTime_, false, executor, true); 90 96 91 97 this->updateOverlayText(); 92 98 } 93 99 94 void ChatOverlay::dropMessage( )100 void ChatOverlay::dropMessage(Timer* timer) 95 101 { 96 102 if (this->messages_.size() > 0) 97 103 this->messages_.pop_front(); 98 104 this->updateOverlayText(); 105 this->timers_.erase(timer); // the timer destroys itself, but we have to remove it from the set 99 106 } 100 107 -
code/branches/pickup/src/modules/overlays/hud/ChatOverlay.h
r5781 r5935 55 55 private: 56 56 void updateOverlayText(); 57 void dropMessage( );57 void dropMessage(Timer* timer); 58 58 59 59 float displayTime_; 60 std::set<Timer*> timers_; 60 61 }; 61 62 } -
code/branches/pickup/src/modules/overlays/hud/HUDBar.cc
r5781 r5935 96 96 { 97 97 if (this->isInitialized()) 98 { 98 99 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->bar_); 100 for (std::vector<BarColour*>::const_iterator it = this->barColours_.begin(); it != this->barColours_.end(); ) 101 (*it++)->destroy(); 102 } 99 103 } 100 104 -
code/branches/pickup/src/modules/overlays/hud/HUDHealthBar.cc
r5781 r5935 56 56 { 57 57 if (this->isInitialized()) 58 delete this->textoverlay_;58 this->textoverlay_->destroy(); 59 59 } 60 60 … … 84 84 this->setValue(this->owner_->getHealth() / this->owner_->getInitialHealth()); 85 85 this->textoverlay_->setCaption(multi_cast<std::string>(static_cast<int>(this->owner_->getHealth()))); 86 } 87 else 88 { 89 this->setValue(0); 90 this->textoverlay_->setCaption("0"); 86 91 } 87 92 -
code/branches/pickup/src/modules/overlays/hud/HUDHealthBar.h
r5781 r5935 111 111 112 112 private: 113 Pawn*owner_;113 WeakPtr<Pawn> owner_; 114 114 OverlayText* textoverlay_; 115 115 bool bUseBarColour_; -
code/branches/pickup/src/modules/overlays/hud/HUDNavigation.cc
r5781 r5935 39 39 #include "core/CoreIncludes.h" 40 40 #include "core/XMLPort.h" 41 #include "Scene.h" 41 42 #include "Radar.h" 42 43 … … 130 131 SUPER(HUDNavigation, tick, dt); 131 132 132 if (!Radar::getInstance().getFocus()) 133 // Get radar 134 Radar* radar = this->getOwner()->getScene()->getRadar(); 135 136 if (!radar->getFocus()) 133 137 { 134 138 this->overlay_->hide(); … … 150 154 */ 151 155 // transform to screen coordinates 152 Vector3 pos = /*transformationMatrix * */ Radar::getInstance().getFocus()->getRVWorldPosition();156 Vector3 pos = /*transformationMatrix * */radar->getFocus()->getRVWorldPosition(); 153 157 154 158 bool outOfView; -
code/branches/pickup/src/modules/overlays/hud/TeamBaseMatchScore.cc
r5781 r5935 118 118 119 119 if (this->getOwner() && this->getOwner()->getGametype()) 120 this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype() );120 this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype().get()); 121 121 else 122 122 this->owner_ = 0; -
code/branches/pickup/src/modules/overlays/hud/UnderAttackHealthBar.cc
r5781 r5935 52 52 this->text_->setPickPoint(Vector2(0.5, 0)); 53 53 54 this->inittimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&UnderAttackHealthBar::init)));54 this->inittimer_.setTimer(0.0f, false, createExecutor(createFunctor(&UnderAttackHealthBar::init, this))); 55 55 } 56 56 … … 58 58 { 59 59 if (this->isInitialized()) 60 delete this->text_;60 this->text_->destroy(); 61 61 } 62 62 … … 78 78 this->owner_ = player; 79 79 80 UnderAttack* ua = orxonox_cast<UnderAttack*>(player->getGametype() );80 UnderAttack* ua = orxonox_cast<UnderAttack*>(player->getGametype().get()); 81 81 if (ua) 82 82 { -
code/branches/pickup/src/modules/overlays/hud/UnderAttackHealthBar.h
r5781 r5935 62 62 PlayerInfo* owner_; 63 63 OverlayText* text_; 64 Timer <UnderAttackHealthBar>inittimer_;64 Timer inittimer_; 65 65 }; 66 66 } -
code/branches/pickup/src/modules/overlays/stats/CreateLines.cc
r5781 r5935 59 59 CreateLines::~CreateLines() 60 60 { 61 delete this->playerNameText_;62 delete this->scoreText_;63 delete this->deathsText_;64 delete this->background_;61 this->playerNameText_->destroy(); 62 this->scoreText_->destroy(); 63 this->deathsText_->destroy(); 64 this->background_->destroy(); 65 65 } 66 66 -
code/branches/pickup/src/modules/overlays/stats/Scoreboard.cc
r5781 r5935 44 44 { 45 45 RegisterObject(Scoreboard); 46 } 47 48 Scoreboard::~Scoreboard() 49 { 50 while (this->lines_.size() > 0) 51 { 52 // destroy lines 53 delete this->lines_.back(); 54 this->lines_.pop_back(); 55 } 46 56 } 47 57 -
code/branches/pickup/src/modules/overlays/stats/Scoreboard.h
r5781 r5935 42 42 public: // functions 43 43 Scoreboard(BaseObject* creator); 44 virtual ~Scoreboard() {}44 virtual ~Scoreboard(); 45 45 46 46 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
Note: See TracChangeset
for help on using the changeset viewer.