Changeset 2495
- Timestamp:
- Dec 17, 2008, 4:05:25 AM (16 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 10 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(); -
code/branches/presentation/visual_studio/vc8/orxonox.vcproj
r2492 r2495 429 429 </File> 430 430 <File 431 RelativePath="..\..\src\orxonox\objects\weaponSystem\WeaponPack.cc" 432 > 433 </File> 434 <File 431 435 RelativePath="..\..\src\orxonox\objects\weaponSystem\WeaponSet.cc" 432 436 > … … 445 449 <File 446 450 RelativePath="..\..\src\orxonox\objects\weaponSystem\munitions\LaserGunMunition.cc" 451 > 452 <FileConfiguration 453 Name="Debug|Win32" 454 > 455 <Tool 456 Name="VCCLCompilerTool" 457 /> 458 </FileConfiguration> 459 <FileConfiguration 460 Name="Release|Win32" 461 > 462 <Tool 463 Name="VCCLCompilerTool" 464 /> 465 </FileConfiguration> 466 </File> 467 </Filter> 468 <Filter 469 Name="weapons" 470 > 471 <File 472 RelativePath="..\..\src\orxonox\objects\weaponSystem\weapons\LaserGun.cc" 473 > 474 <FileConfiguration 475 Name="Debug|Win32" 476 > 477 <Tool 478 Name="VCCLCompilerTool" 479 /> 480 </FileConfiguration> 481 <FileConfiguration 482 Name="Release|Win32" 483 > 484 <Tool 485 Name="VCCLCompilerTool" 486 /> 487 </FileConfiguration> 488 </File> 489 <File 490 RelativePath="..\..\src\orxonox\objects\weaponSystem\weapons\Missile.cc" 447 491 > 448 492 <FileConfiguration … … 465 509 </Filter> 466 510 <Filter 467 Name=" weapons"468 > 469 <File 470 RelativePath="..\..\src\orxonox\objects\weaponSystem\ weapons\LaserGun.cc"511 Name="projectiles" 512 > 513 <File 514 RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\BillboardProjectile.cc" 471 515 > 472 516 <FileConfiguration 473 517 Name="Debug|Win32" 474 ExcludedFromBuild="true"475 518 > 476 519 <Tool … … 480 523 <FileConfiguration 481 524 Name="Release|Win32" 482 ExcludedFromBuild="true"483 525 > 484 526 <Tool … … 488 530 </File> 489 531 <File 490 RelativePath="..\..\src\orxonox\objects\weaponSystem\ weapons\Missile.cc"532 RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\ParticleProjectile.cc" 491 533 > 492 534 <FileConfiguration 493 535 Name="Debug|Win32" 494 ExcludedFromBuild="true"495 536 > 496 537 <Tool … … 500 541 <FileConfiguration 501 542 Name="Release|Win32" 502 ExcludedFromBuild="true"503 543 > 504 544 <Tool … … 507 547 </FileConfiguration> 508 548 </File> 509 </Filter> 510 <Filter 511 Name="projectiles" 512 > 513 <File 514 RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\BillboardProjectile.cc" 549 <File 550 RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\Projectile.cc" 515 551 > 516 552 <FileConfiguration 517 553 Name="Debug|Win32" 518 ExcludedFromBuild="true"519 554 > 520 555 <Tool … … 524 559 <FileConfiguration 525 560 Name="Release|Win32" 526 ExcludedFromBuild="true"527 561 > 528 562 <Tool … … 531 565 </FileConfiguration> 532 566 </File> 533 <File534 RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\ParticleProjectile.cc"535 >536 <FileConfiguration537 Name="Debug|Win32"538 ExcludedFromBuild="true"539 >540 <Tool541 Name="VCCLCompilerTool"542 />543 </FileConfiguration>544 <FileConfiguration545 Name="Release|Win32"546 ExcludedFromBuild="true"547 >548 <Tool549 Name="VCCLCompilerTool"550 />551 </FileConfiguration>552 </File>553 <File554 RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\Projectile.cc"555 >556 <FileConfiguration557 Name="Debug|Win32"558 ExcludedFromBuild="true"559 >560 <Tool561 Name="VCCLCompilerTool"562 />563 </FileConfiguration>564 <FileConfiguration565 Name="Release|Win32"566 ExcludedFromBuild="true"567 >568 <Tool569 Name="VCCLCompilerTool"570 />571 </FileConfiguration>572 </File>573 567 </Filter> 574 568 </Filter> 575 569 <Filter 570 Name="collisionShapes" 571 > 572 <File 573 RelativePath="..\..\src\orxonox\objects\collisionshapes\BoxCollisionShape.cc" 574 > 575 </File> 576 <File 577 RelativePath="..\..\src\orxonox\objects\collisionshapes\CollisionShape.cc" 578 > 579 </File> 580 <File 581 RelativePath="..\..\src\orxonox\objects\collisionshapes\CompoundCollisionShape.cc" 582 > 583 </File> 584 <File 585 RelativePath="..\..\src\orxonox\objects\collisionshapes\ConeCollisionShape.cc" 586 > 587 </File> 588 <File 589 RelativePath="..\..\src\orxonox\objects\collisionshapes\PlaneCollisionShape.cc" 590 > 591 </File> 592 <File 593 RelativePath="..\..\src\orxonox\objects\collisionshapes\SphereCollisionShape.cc" 594 > 595 </File> 596 </Filter> 597 <Filter 598 Name="items" 599 > 600 <File 601 RelativePath="..\..\src\orxonox\objects\items\Engine.cc" 602 > 603 </File> 604 <File 605 RelativePath="..\..\src\orxonox\objects\items\Item.cc" 606 > 607 </File> 608 <File 609 RelativePath="..\..\src\orxonox\objects\items\MultiStateEngine.cc" 610 > 611 </File> 612 </Filter> 613 <Filter 576 614 Name="quest" 577 615 > … … 642 680 <File 643 681 RelativePath="..\..\src\orxonox\objects\quest\Rewardable.cc" 644 >645 </File>646 </Filter>647 <Filter648 Name="collisionShapes"649 >650 <File651 RelativePath="..\..\src\orxonox\objects\collisionshapes\BoxCollisionShape.cc"652 >653 </File>654 <File655 RelativePath="..\..\src\orxonox\objects\collisionshapes\CollisionShape.cc"656 >657 </File>658 <File659 RelativePath="..\..\src\orxonox\objects\collisionshapes\CompoundCollisionShape.cc"660 >661 </File>662 <File663 RelativePath="..\..\src\orxonox\objects\collisionshapes\ConeCollisionShape.cc"664 >665 </File>666 <File667 RelativePath="..\..\src\orxonox\objects\collisionshapes\PlaneCollisionShape.cc"668 >669 </File>670 <File671 RelativePath="..\..\src\orxonox\objects\collisionshapes\SphereCollisionShape.cc"672 >673 </File>674 </Filter>675 <Filter676 Name="items"677 >678 <File679 RelativePath="..\..\src\orxonox\objects\items\Engine.cc"680 >681 </File>682 <File683 RelativePath="..\..\src\orxonox\objects\items\Item.cc"684 >685 </File>686 <File687 RelativePath="..\..\src\orxonox\objects\items\MultiStateEngine.cc"688 682 > 689 683 </File> … … 843 837 > 844 838 <File 839 RelativePath="..\..\src\orxonox\overlays\stats\CreateLines.cc" 840 > 841 </File> 842 <File 843 RelativePath="..\..\src\orxonox\overlays\stats\Scoreboard.cc" 844 > 845 </File> 846 <File 845 847 RelativePath="..\..\src\orxonox\overlays\stats\Stats.cc" 846 848 > … … 1476 1478 Name="stats" 1477 1479 > 1480 <File 1481 RelativePath="..\..\src\orxonox\overlays\stats\CreateLines.h" 1482 > 1483 </File> 1484 <File 1485 RelativePath="..\..\src\orxonox\overlays\stats\Scoreboard.h" 1486 > 1487 </File> 1478 1488 <File 1479 1489 RelativePath="..\..\src\orxonox\overlays\stats\Stats.h"
Note: See TracChangeset
for help on using the changeset viewer.