Changeset 2495 for code/branches/presentation/src
- Timestamp:
- Dec 17, 2008, 4:05:25 AM (16 years ago)
- Location:
- code/branches/presentation/src/orxonox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/OrxonoxPrereqs.h
r2493 r2495 194 194 195 195 class Scores; 196 class CreateLines; 197 class Scoreboard; 198 class Stats; 196 199 197 200 // collision -
code/branches/presentation/src/orxonox/objects/gametypes/Gametype.cc
r2494 r2495 35 35 #include "core/CoreIncludes.h" 36 36 #include "core/ConfigValueIncludes.h" 37 #include "core/Loader.h" 38 #include "core/XMLFile.h" 37 #include "core/Template.h" 38 #include "core/Core.h" 39 #include "overlays/OverlayGroup.h" 39 40 #include "objects/infos/PlayerInfo.h" 40 41 #include "objects/infos/Bot.h" … … 68 69 this->addBots(this->numberOfBots_); 69 70 70 this->statsOverlay_ = 0;71 72 71 setConfigValues(); 73 72 74 73 // load the corresponding score board 75 //this->statsOverlay_ = new XMLFile(Settings::getDataPath() + "overlay/" + this->statsOverlayName_); 76 //Loader::open(statsOverlay_); 77 //this->setGametype(this); 74 if (Core::showsGraphics() && this->scoreboardTemplate_ != "") 75 { 76 this->scoreboard_ = new OverlayGroup(this); 77 this->scoreboard_->addTemplate(this->scoreboardTemplate_); 78 this->scoreboard_->setGametype(this); 79 } 80 else 81 this->scoreboard_ = 0; 78 82 } 79 83 … … 84 88 SetConfigValue(bForceSpawn_, false); 85 89 SetConfigValue(numberOfBots_, 0); 86 SetConfigValue(s tatsOverlayName_, "stats.oxo");90 SetConfigValue(scoreboardTemplate_, "defaultScoreboard"); 87 91 } 88 92 … … 118 122 void Gametype::playerEntered(PlayerInfo* player) 119 123 { 120 this->players_[player] = PlayerState::Joined;124 this->players_[player].state_ = PlayerState::Joined; 121 125 122 126 std::string message = player->getName() + " entered the game"; … … 127 131 void Gametype::playerLeft(PlayerInfo* player) 128 132 { 129 std::map<PlayerInfo*, Player State::Enum>::iterator it = this->players_.find(player);133 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player); 130 134 if (it != this->players_.end()) 131 135 { … … 188 192 if (victim && victim->getPlayer()) 189 193 { 190 std::map<PlayerInfo*, Player State::Enum>::iterator it = this->players_.find(victim->getPlayer());194 std::map<PlayerInfo*, Player>::iterator it = this->players_.find(victim->getPlayer()); 191 195 if (it != this->players_.end()) 192 196 { 193 it->second = PlayerState::Dead; 197 it->second.state_ = PlayerState::Dead; 198 it->second.killed_++; 199 200 // Reward killer 201 if (killer) 202 { 203 std::map<PlayerInfo*, Player>::iterator itKiller = this->players_.find(killer->getPlayer()); 204 if (itKiller != this->players_.end()) 205 { 206 this->playerScored(itKiller->second); 207 } 208 else 209 COUT(2) << "Warning: Killing Pawn was not in the playerlist" << std::endl; 210 } 194 211 195 212 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator()); … … 211 228 } 212 229 213 void Gametype::playerScored(PlayerInfo* player) 214 { 230 void Gametype::playerScored(Player& player) 231 { 232 player.frags_++; 215 233 } 216 234 … … 234 252 void Gametype::assignDefaultPawnsIfNeeded() 235 253 { 236 for (std::map<PlayerInfo*, Player State::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)254 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 237 255 { 238 256 if (!it->first->getControllableEntity()) 239 257 { 240 it->second = PlayerState::Dead;258 it->second.state_ = PlayerState::Dead; 241 259 242 260 if (!it->first->isReadyToSpawn() || !this->gtinfo_.bStarted_) … … 249 267 spawn->spawn(entity); 250 268 it->first->startControl(entity); 251 it->second = PlayerState::Dead;269 it->second.state_ = PlayerState::Dead; 252 270 } 253 271 else … … 284 302 bool allplayersready = true; 285 303 bool hashumanplayers = false; 286 for (std::map<PlayerInfo*, Player State::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)304 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 287 305 { 288 306 if (!it->first->isReadyToSpawn()) … … 303 321 void Gametype::spawnPlayersIfRequested() 304 322 { 305 for (std::map<PlayerInfo*, Player State::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)323 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 306 324 if (it->first->isReadyToSpawn() || this->bForceSpawn_) 307 325 this->spawnPlayer(it->first); … … 310 328 void Gametype::spawnDeadPlayersIfRequested() 311 329 { 312 for (std::map<PlayerInfo*, Player State::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)313 if (it->second == PlayerState::Dead)330 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 331 if (it->second.state_ == PlayerState::Dead) 314 332 if (it->first->isReadyToSpawn() || this->bForceSpawn_) 315 333 this->spawnPlayer(it->first); … … 322 340 { 323 341 player->startControl(spawnpoint->spawn()); 324 this->players_[player] = PlayerState::Alive;342 this->players_[player].state_ = PlayerState::Alive; 325 343 } 326 344 else -
code/branches/presentation/src/orxonox/objects/gametypes/Gametype.h
r2492 r2495 53 53 } 54 54 55 struct Player 56 { 57 PlayerInfo* info_; 58 PlayerState::Enum state_; 59 int frags_; 60 int killed_; 61 }; 62 55 63 class _OrxonoxExport Gametype : public BaseObject, public Tickable 56 64 { 57 65 friend class PlayerInfo; 58 friend class ClassIdentifier<Gametype>;59 66 60 67 public: … … 82 89 virtual void playerChangedName(PlayerInfo* player); 83 90 84 virtual void playerScored(Player Info*player);91 virtual void playerScored(Player& player); 85 92 86 93 virtual void pawnKilled(Pawn* victim, Pawn* killer = 0); … … 88 95 virtual void pawnPostSpawn(Pawn* pawn); 89 96 90 inline const std::map<PlayerInfo*, Player State::Enum>& getPlayers() const97 inline const std::map<PlayerInfo*, Player>& getPlayers() const 91 98 { return this->players_; } 92 99 … … 104 111 inline unsigned int getNumberOfPlayers() const 105 112 { return this->players_.size(); } 106 107 inline std::string getPlayersName() const108 { return "StatsBot77"; }109 110 inline unsigned int getPlayersFrags() const111 { return 123; }112 113 113 114 private: … … 131 132 unsigned int numberOfBots_; 132 133 133 std::map<PlayerInfo*, Player State::Enum> players_;134 std::map<PlayerInfo*, Player> players_; 134 135 std::set<SpawnPoint*> spawnpoints_; 135 136 SubclassIdentifier<ControllableEntity> defaultControllableEntity_; 136 137 137 XMLFile* statsOverlay_;138 OverlayGroup* scoreboard_; 138 139 139 140 // Config Values 140 std::string s tatsOverlayName_;141 std::string scoreboardTemplate_; 141 142 }; 142 143 } -
code/branches/presentation/src/orxonox/overlays/stats/CreateLines.cc
- Property svn:eol-style set to native
r2492 r2495 39 39 #include "core/ConfigValueIncludes.h" 40 40 41 #include "overlays/OverlayText.h" 42 #include "overlays/stats/Stats.h" 43 41 44 namespace orxonox 42 45 { 43 CreateFactory(CreateLines);44 45 46 /** 46 47 @brief Constructor: Creates a line. 47 48 */ 48 CreateLines::CreateLines(BaseObject* creator) 49 : OrxonoxOverlay(creator) 49 CreateLines::CreateLines(float leftOffset, float topOffset, float width, float height) 50 50 { 51 RegisterObject(CreateLines); 51 playerNameText_ = new OverlayText(0); 52 playerNameText_->setTextSize(0.04); 53 playerNameText_->setColour(ColourValue(0, 0.75, 0.2, 1)); 54 playerNameText_->setPosition(Vector2(0.1, topOffset + 0.01)); 55 56 scoreText_ = new OverlayText(0); 57 scoreText_->setTextSize(0.04); 58 scoreText_->setColour(ColourValue(0, 0.75, 0.2, 1)); 59 scoreText_->setPosition(Vector2(0.6, topOffset + 0.01)); 60 61 deathsText_ = new OverlayText(0); 62 deathsText_->setTextSize(0.04); 63 deathsText_->setColour(ColourValue(0, 0.75, 0.2, 1)); 64 deathsText_->setPosition(Vector2(0.8, topOffset + 0.01)); 65 66 background_ = new Stats(0); 67 background_->setPosition(Vector2(leftOffset, topOffset)); 68 background_->setSize(Vector2(width, height)); 52 69 } 53 70 54 /** 55 @brief Initializes the lines. 56 */ 57 void CreateLines::XMLPort(Element& xmlElement, XMLPort::Mode mode) 71 CreateLines::~CreateLines() 58 72 { 59 SUPER(CreateLines, XMLPort, xmlElement, mode); 73 delete this->playerNameText_; 74 delete this->scoreText_; 75 delete this->deathsText_; 76 delete this->background_; 77 } 78 79 void CreateLines::setPlayerName(const std::string& str) 80 { 81 this->playerNameText_->setCaption(str); 82 } 83 84 void CreateLines::setScore(const std::string& str) 85 { 86 this->scoreText_->setCaption(str); 87 } 88 89 void CreateLines::setDeaths(const std::string& str) 90 { 91 this->deathsText_->setCaption(str); 92 } 93 94 void CreateLines::setVisibility(bool visible) 95 { 96 this->scoreText_->setVisible(visible); 97 this->deathsText_->setVisible(visible); 98 this->playerNameText_->setVisible(visible); 99 this->background_->setVisible(visible); 60 100 } 61 101 … … 63 103 @brief Ensures that the number of OverlayElements is equal to numberOfColumns. 64 104 */ 65 void CreateLines::setNumberOfColumns(unsigned int numberOfColumns, unsigned int lineIndex) {105 //void CreateLines::setNumberOfColumns(unsigned int numberOfColumns, unsigned int lineIndex) { 66 106 67 Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();107 // Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr(); 68 108 69 unsigned int colIndex = 0;109 // unsigned int colIndex = 0; 70 110 71 while (textColumns_.size() < numberOfColumns) { 111 // while (textColumns_.size() < numberOfColumns) 112 // { 113 // Ogre::TextAreaOverlayElement* tempTextArea = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + convertToString(lineIndex) + convertToString(colIndex))); 114 // textColumns_.push_back(tempTextArea); 115 // this->background_->addChild(tempTextArea); 72 116 73 Ogre::TextAreaOverlayElement* tempTextArea = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + convertToString(lineIndex) + convertToString(colIndex))); 74 textColumns_.push_back(tempTextArea); 75 this->background_->addChild(tempTextArea); 117 // colIndex++; 118 // } 76 119 77 colIndex++; 120 // while (textColumns_.size() > numberOfColumns) 121 // { 122 // this->background_->_removeChild(textColumns_.back()); 123 // ovMan->destroyOverlayElement(textColumns_.back()); 124 // textColumns_.pop_back(); 125 // } 126 //} 78 127 79 } 128 //void CreateLines::alignColumn(int columnIndex, float leftOffset, float topOffset) 129 //{ 130 // this->textColumns_[columnIndex]->setPosition(leftOffset, topOffset); 131 //} 80 132 81 while (textColumns_.size() > numberOfColumns) { 82 83 this->background_->_removeChild(textColumns_.back()); 84 ovMan->destroyOverlayElement(textColumns_.back()); 85 textColumns_.pop_back(); 86 87 } 88 89 } 90 91 void CreateLines::alignColumn(int columnIndex, float leftOffset, float topOffset) { 92 93 this->textColumns_[columnIndex]->setPosition(leftOffset, topOffset); 94 95 } 96 97 void CreateLines::setColumnText(int columnIndex, std::string columnText) { 98 99 this->textColumns_[columnIndex]->setCaption(columnText); 100 101 } 102 133 //void CreateLines::setColumnText(int columnIndex, std::string columnText) 134 //{ 135 // this->textColumns_[columnIndex]->setCaption(columnText); 136 //} 103 137 } -
code/branches/presentation/src/orxonox/overlays/stats/CreateLines.h
- Property svn:eol-style set to native
r2492 r2495 40 40 namespace orxonox 41 41 { 42 class _OrxonoxExport CreateLines : public OrxonoxOverlay42 class _OrxonoxExport CreateLines 43 43 { 44 44 45 45 public: // functions 46 CreateLines( BaseObject* creator);47 virtual ~CreateLines() {}46 CreateLines(float, float, float, float); 47 virtual ~CreateLines(); 48 48 49 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); 49 void setPlayerName(const std::string&); 50 void setScore(const std::string&); 51 void setDeaths(const std::string&); 50 52 51 void setNumberOfColumns(unsigned int numberOfColumns, unsigned int lineIndex); 52 void alignColumn(int columnIndex, float leftOffset, float topOffset); 53 void setColumnText(int columnIndex, std::string columnText); 53 void setVisibility(bool); 54 55 //void setNumberOfColumns(unsigned int numberOfColumns, unsigned int lineIndex); 56 //void alignColumn(int columnIndex, float leftOffset, float topOffset); 57 //void setColumnText(int columnIndex, std::string columnText); 54 58 55 59 private: // functions 56 60 57 61 private: // variables 58 std::vector<Ogre::TextAreaOverlayElement*> textColumns_; 62 //std::vector<OverlayText*> textColumns_; 63 OverlayText* playerNameText_; 64 OverlayText* scoreText_; 65 OverlayText* deathsText_; 66 67 Stats* background_; 59 68 60 69 }; -
code/branches/presentation/src/orxonox/overlays/stats/Scoreboard.cc
- Property svn:eol-style set to native
r2492 r2495 39 39 #include "core/ConfigValueIncludes.h" 40 40 #include "objects/gametypes/Gametype.h" 41 #include "objects/infos/PlayerInfo.h" 41 42 #include "CreateLines.h" 42 43 … … 52 53 { 53 54 RegisterObject(Scoreboard); 54 55 createlines_ = new CreateLines(this); 56 // this->gametype_ = new Gametype(this); 55 this->setGametype(creator->getGametype()); 57 56 } 58 57 … … 64 63 SUPER(Scoreboard, XMLPort, xmlElement, mode); 65 64 66 printLines(); 65 COUT(0) << "XMLPort executed." << std::endl; 66 } 67 67 68 COUT(0) << "XMLPort executed." << std::endl; 68 void Scoreboard::changedVisibility() 69 { 70 SUPER(Scoreboard, changedVisibility); 69 71 72 for (unsigned int i = 0; i < this->lines_.size(); ++i) 73 this->lines_[i]->setVisibility(this->isVisible()); 70 74 } 71 75 … … 73 77 @brief Prints the scoreboard on the screen. 74 78 */ 75 void Scoreboard::printLines() { 79 void Scoreboard::tick(float dt) 80 { 81 const std::map<PlayerInfo*, Player>& playerList = this->getGametype()->getPlayers(); 76 82 77 numberOfColumns = 2; 78 // numberOfLines = this->gametype_->getNumberOfPlayers(); 79 numberOfLines = 3; 80 topOffset = 0.1; 81 lineSpacing = 0.1; 82 83 for (unsigned int i = 0; i < numberOfLines; i++) { 84 85 columnIndex = 0; 86 leftOffset = 0.1; 87 88 this->createlines_->setNumberOfColumns(numberOfColumns, i); 89 90 // columnText = this->gametype_->getPlayersName(); 91 columnText = "PlayerName"; 92 this->createlines_->alignColumn(columnIndex, topOffset, leftOffset); 93 this->createlines_->setColumnText(columnIndex, columnText); 94 95 columnIndex++; 96 leftOffset = leftOffset + 0.3; 97 98 // columnText = this->gametype_->getPlayersFrags(); 99 columnText = "PlayerFrags"; 100 this->createlines_->alignColumn(columnIndex, topOffset, leftOffset); 101 this->createlines_->setColumnText(columnIndex, columnText); 102 103 topOffset = topOffset + lineSpacing; 104 83 const float topOffset = 0.2; 84 const float leftOffset = 0.075; 85 const float distance = 0.01; 86 const float width = 0.85; 87 const float height = 0.05; 88 while (playerList.size() > this->lines_.size()) 89 { 90 // create new lines 91 this->lines_.push_back(new CreateLines(leftOffset, topOffset + (distance + height) * lines_.size(), width, height)); 92 } 93 while (playerList.size() < this->lines_.size()) 94 { 95 // destroy lines 96 delete this->lines_.back(); 97 this->lines_.pop_back(); 105 98 } 106 99 100 // update board 101 102 unsigned int index = 0; 103 for (std::map<PlayerInfo*, Player>::const_iterator it = playerList.begin(); it != playerList.end(); ++it) 104 { 105 this->lines_[index]->setPlayerName(omni_cast<std::string>(it->first->getName())); 106 this->lines_[index]->setScore(omni_cast<std::string>(it->second.frags_)); 107 this->lines_[index]->setDeaths(omni_cast<std::string>(it->second.killed_)); 108 index++; 109 } 110 111 //numberOfColumns = 2; 112 //numberOfLines = 3; 113 //topOffset = 0.1; 114 //lineSpacing = 0.1; 115 116 //for (unsigned int i = 0; i < this->lines_.size(); ++i) 117 //{ 118 // columnIndex = 0; 119 // leftOffset = 0.1; 120 121 // this->createlines_->setNumberOfColumns(numberOfColumns, i); 122 123 // // columnText = this->gametype_->getPlayersName(); 124 // columnText = "PlayerName"; 125 // this->createlines_->alignColumn(columnIndex, topOffset, leftOffset); 126 // this->createlines_->setColumnText(columnIndex, columnText); 127 128 // columnIndex++; 129 // leftOffset = leftOffset + 0.3; 130 131 // // columnText = this->gametype_->getPlayersFrags(); 132 // columnText = "PlayerFrags"; 133 // this->createlines_->alignColumn(columnIndex, topOffset, leftOffset); 134 // this->createlines_->setColumnText(columnIndex, columnText); 135 136 // topOffset = topOffset + lineSpacing; 137 //} 107 138 } 108 109 139 } -
code/branches/presentation/src/orxonox/overlays/stats/Scoreboard.h
- Property svn:eol-style set to native
r2492 r2495 40 40 namespace orxonox 41 41 { 42 class _OrxonoxExport Scoreboard : public OrxonoxOverlay 42 class _OrxonoxExport Scoreboard : public OrxonoxOverlay, public Tickable 43 43 { 44 44 45 45 public: // functions 46 46 Scoreboard(BaseObject* creator); 47 ~Scoreboard() {}47 virtual ~Scoreboard() {} 48 48 49 49 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); 50 virtual void tick(float dt); 50 51 51 52 inline void setGametype(Gametype* gt) … … 59 60 { return this->createlines_; } 60 61 62 virtual void changedVisibility(); 63 61 64 private: // functions 62 65 void printLines(); 63 66 64 67 private: // variables 68 std::vector<CreateLines*> lines_; 69 65 70 unsigned int numberOfColumns; 66 71 unsigned int numberOfLines; -
code/branches/presentation/src/orxonox/overlays/stats/Stats.cc
r2492 r2495 56 56 57 57 this->setConfigValues(); 58 59 // create overlay and elements 60 Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr(); 61 62 // create BorderPanel 63 this->statsOverlayBorder_ = static_cast<Ogre::BorderPanelOverlayElement*>(ovMan->createOverlayElement("BorderPanel", "StatsBorderPanel" + getUniqueNumberString())); 64 //this->statsOverlayBorder_->setMaterialName("StatsCenter"); 65 this->statsOverlayBorder_->setBorderSize(0.003, 16 * 0.003); 66 this->statsOverlayBorder_->setBorderMaterialName("StatsBorder"); 67 this->statsOverlayBorder_->setTopBorderUV(0.49, 0.0, 0.51, 0.5); 68 this->statsOverlayBorder_->setTopLeftBorderUV(0.0, 0.0, 0.5, 0.5); 69 this->statsOverlayBorder_->setTopRightBorderUV(0.5, 0.0, 1.0, 0.5); 70 this->statsOverlayBorder_->setLeftBorderUV(0.0, 0.49, 0.5, 0.51); 71 this->statsOverlayBorder_->setRightBorderUV(0.5, 0.49, 1.0, 0.5); 72 this->statsOverlayBorder_->setBottomBorderUV(0.49, 0.5, 0.51, 1.0); 73 this->statsOverlayBorder_->setBottomLeftBorderUV(0.0, 0.5, 0.5, 1.0); 74 this->statsOverlayBorder_->setBottomRightBorderUV(0.5, 0.5, 1.0, 1.0); 75 76 background_->addChild(statsOverlayBorder_); 77 78 // create noise 79 //this->statsOverlayNoise_ = static_cast<Ogre::PanelOverlayElement*>(ovMan->createOverlayElement("Panel", "StatsNoise" + getUniqueNumberString())); 80 //this->statsOverlayNoise_->setPosition(0,0); 81 //this->statsOverlayNoise_->setMaterialName("StatsNoiseSmall"); 82 // comment following line to disable noise 83 //background_->addChild(this->statsOverlayNoise_); 84 } 85 86 Stats::~Stats() 87 { 88 if (this->isInitialized()) 89 { 90 Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr(); 91 ovMan->destroyOverlayElement(this->statsOverlayBorder_); 92 //ovMan->destroyOverlayElement(this->statsOverlayNoise_); 93 } 58 94 } 59 95 … … 72 108 { 73 109 OrxonoxOverlay::XMLPort(xmlElement, mode); 74 75 // create overlay and elements76 Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();77 78 // create BorderPanel79 this->statsOverlayBorder_ = static_cast<Ogre::BorderPanelOverlayElement*>(ovMan->createOverlayElement("BorderPanel", "StatsBorderPanel"));80 this->statsOverlayBorder_->setMaterialName("StatsCenter");81 this->statsOverlayBorder_->setBorderSize(0.02, 0.02, 0.02, 0.02);82 this->statsOverlayBorder_->setBorderMaterialName("StatsBorder");83 this->statsOverlayBorder_->setTopBorderUV(0.49, 0.0, 0.51, 0.5);84 this->statsOverlayBorder_->setTopLeftBorderUV(0.0, 0.0, 0.5, 0.5);85 this->statsOverlayBorder_->setTopRightBorderUV(0.5, 0.0, 1.0, 0.5);86 this->statsOverlayBorder_->setLeftBorderUV(0.0, 0.49, 0.5, 0.51);87 this->statsOverlayBorder_->setRightBorderUV(0.5, 0.49, 1.0, 0.5);88 this->statsOverlayBorder_->setBottomBorderUV(0.49, 0.5, 0.51, 1.0);89 this->statsOverlayBorder_->setBottomLeftBorderUV(0.0, 0.5, 0.5, 1.0);90 this->statsOverlayBorder_->setBottomRightBorderUV(0.5, 0.5, 1.0, 1.0);91 92 background_->addChild(statsOverlayBorder_);93 94 // create noise95 this->statsOverlayNoise_ = static_cast<Ogre::PanelOverlayElement*>(ovMan->createOverlayElement("Panel", "StatsNoise"));96 this->statsOverlayNoise_->setPosition(0,0);97 this->statsOverlayNoise_->setMaterialName("StatsNoiseSmall");98 // comment following line to disable noise99 background_->addChild(this->statsOverlayNoise_);100 101 110 } 102 111 … … 106 115 107 116 // this creates a flickering effect (extracts exactly 80% of the texture at a random location) 108 float uRand = (rand() & 1023) / 1023.0f * 0.2f;109 float vRand = (rand() & 1023) / 1023.0f * 0.2f;110 this->statsOverlayNoise_->setUV(uRand, vRand, 7.5f + uRand, 7.5f + vRand);117 //float uRand = (rand() & 1023) / 1023.0f * 0.2f; 118 //float vRand = (rand() & 1023) / 1023.0f * 0.2f; 119 //this->statsOverlayNoise_->setUV(uRand, vRand, 7.5f + uRand, 7.5f + vRand); 111 120 } 112 121 -
code/branches/presentation/src/orxonox/overlays/stats/Stats.h
r2492 r2495 46 46 public: // functions 47 47 Stats(BaseObject* creator); 48 virtual ~Stats() {}48 virtual ~Stats(); 49 49 50 50 void setConfigValues();
Note: See TracChangeset
for help on using the changeset viewer.