Changeset 3196 for code/trunk/src/orxonox/overlays
- Timestamp:
- Jun 20, 2009, 9:20:47 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 deleted
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/pch (added) merged: 3114-3118,3124-3125,3127-3131,3133,3138-3194
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/overlays/FadeoutText.cc
r3110 r3196 30 30 31 31 #include <OgreTextAreaOverlayElement.h> 32 32 #include "util/Math.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/XMLPort.h" -
code/trunk/src/orxonox/overlays/FadeoutText.h
r3099 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "tools/Timer.h" 35 #include "interfaces/Tickable.h" 34 36 #include "overlays/OverlayText.h" 35 #include "objects/Tickable.h"36 #include "tools/Timer.h"37 37 38 38 namespace orxonox -
code/trunk/src/orxonox/overlays/GUIOverlay.cc
r3110 r3196 28 28 29 29 #include "GUIOverlay.h" 30 30 31 #include <string> 31 32 #include <sstream> 33 32 34 #include "core/input/InputManager.h" 33 34 #include "../gui/GUIManager.h" 35 #include "core/CoreIncludes.h" 36 #include "core/XMLPort.h" 37 #include "gui/GUIManager.h" 35 38 36 39 namespace orxonox … … 53 56 XMLPortParam(GUIOverlay, "guiname", setGUIName, getGUIName, xmlElement, mode); 54 57 55 GUIManager::getInstance Ptr()->registerOverlay(this->guiName_, this);58 GUIManager::getInstance().registerOverlay(this->guiName_, this); 56 59 } 57 60 … … 66 69 out << (long)this; 67 70 str = out.str(); 68 GUIManager::getInstance Ptr()->executeCode("showCursor()");71 GUIManager::getInstance().executeCode("showCursor()"); 69 72 InputManager::getInstance().requestEnterState("guiMouseOnly"); 70 GUIManager::getInstance Ptr()->executeCode("showGUI(\"" + this->guiName_ + "\", " + str + ")");73 GUIManager::getInstance().executeCode("showGUI(\"" + this->guiName_ + "\", " + str + ")"); 71 74 } 72 75 else 73 76 { 74 GUIManager::getInstance Ptr()->executeCode("hideGUI(\"" + this->guiName_ + "\")");75 GUIManager::getInstance Ptr()->executeCode("hideCursor()");77 GUIManager::getInstance().executeCode("hideGUI(\"" + this->guiName_ + "\")"); 78 GUIManager::getInstance().executeCode("hideCursor()"); 76 79 InputManager::getInstance().requestLeaveState("guiMouseOnly"); 77 80 } -
code/trunk/src/orxonox/overlays/GUIOverlay.h
r3078 r3196 30 30 #define _GUIOverlay_H__ 31 31 32 33 #include "OrxonoxOverlay.h"34 32 #include "OrxonoxPrereqs.h" 35 33 36 #include <OgrePrerequisites.h> 37 38 #include "core/XMLPort.h" 34 #include <string> 35 #include "OrxonoxOverlay.h" 39 36 40 37 namespace orxonox -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r3110 r3196 215 215 if (angle < 0.0) 216 216 angle = -angle; 217 angle -= 180.0 * (int)(angle / 180.0);217 angle -= 180.0f * (int)(angle / 180.0); 218 218 219 219 // take the reverse if angle is about 90 degrees 220 220 float tempAspect; 221 if (angle > 89.0 && angle < 91.0)221 if (angle > 89.0f && angle < 91.0f) 222 222 { 223 223 tempAspect = 1.0 / this->windowAspectRatio_; … … 231 231 else 232 232 { 233 tempAspect = 1.0 ;233 tempAspect = 1.0f; 234 234 rotState_ = Inbetween; 235 235 } … … 238 238 // magnitude of the width is about the magnitude of the height. 239 239 // Correctly we would have to take the square root of width*height 240 this->sizeCorrection_.x = 2.0 / (tempAspect + 1.0);240 this->sizeCorrection_.x = 2.0f / (tempAspect + 1.0f); 241 241 this->sizeCorrection_.y = tempAspect * this->sizeCorrection_.x; 242 242 } -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r2993 r3196 37 37 #include "OrxonoxPrereqs.h" 38 38 39 #include < OgrePrerequisites.h>40 #include "tools/WindowEventListener.h" 39 #include <string> 40 41 41 #include "util/Math.h" 42 #include "util/OgreForwardRefs.h" 42 43 #include "core/BaseObject.h" 44 #include "interfaces/WindowEventListener.h" 43 45 44 46 namespace orxonox … … 134 136 135 137 //! Gets the current size that was set (uncorrected) 136 const Vector2& getSize() const 138 const Vector2& getSize() const { return this->size_; } 137 139 138 140 //! Gets the actual size of the overlay on the screen (corrected) 139 Vector2 getActualSize() const { return this->size_ * this->sizeCorrection_; }141 Vector2 getActualSize() const { return this->size_ * this->sizeCorrection_; } 140 142 141 143 //! Gets the current size correction (default: 1.0, 1.0) … … 198 200 Vector2 pickPoint_; //!< Point on the overlay to pick when translating 199 201 Degree angle_; //!< Rotation angle of the overlay 200 RotationState rotState_; //!< horizontal, vertical or inbetween202 RotationState rotState_; //!< horizontal, vertical or inbetween 201 203 202 204 private: -
code/trunk/src/orxonox/overlays/OverlayGroup.cc
r3110 r3196 34 34 #include "OverlayGroup.h" 35 35 36 #include "util/Debug.h"37 36 #include "core/ConsoleCommand.h" 38 37 #include "core/CoreIncludes.h" 39 #include "core/Iterator.h"40 38 #include "core/XMLPort.h" 41 39 #include "OrxonoxOverlay.h" -
code/trunk/src/orxonox/overlays/OverlayGroup.h
r2911 r3196 38 38 39 39 #include <set> 40 #include <OgrePrerequisites.h> 40 #include "util/Math.h" 41 #include "util/OgreForwardRefs.h" 41 42 #include "core/BaseObject.h" 42 #include "util/Math.h"43 43 44 44 namespace orxonox -
code/trunk/src/orxonox/overlays/OverlayText.cc
r3110 r3196 31 31 #include <OgreOverlayManager.h> 32 32 #include <OgrePanelOverlayElement.h> 33 #include <OgreTextAreaOverlayElement.h> 34 #include <boost/static_assert.hpp> 33 35 34 36 #include "util/String.h" … … 36 38 #include "core/XMLPort.h" 37 39 40 38 41 namespace orxonox 39 42 { 40 43 CreateFactory(OverlayText); 44 45 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Left == (int)OverlayText::Left); 46 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Center); 47 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Right == (int)OverlayText::Right); 41 48 42 49 OverlayText::OverlayText(BaseObject* creator) … … 76 83 } 77 84 78 void OverlayText::setFont(const std::string& font)79 {80 if (font != "")81 this->text_->setFontName(font);82 }83 84 85 void OverlayText::setAlignmentString(const std::string& alignment) 85 86 { 86 87 if (alignment == "right") 87 this->setAlignment(O gre::TextAreaOverlayElement::Right);88 this->setAlignment(OverlayText::Right); 88 89 else if (alignment == "center") 89 this->setAlignment(O gre::TextAreaOverlayElement::Center);90 this->setAlignment(OverlayText::Center); 90 91 else // "left" and default 91 this->setAlignment(O gre::TextAreaOverlayElement::Left);92 this->setAlignment(OverlayText::Left); 92 93 } 93 94 … … 120 121 positionChanged(); 121 122 } 123 124 void OverlayText::setCaption(const std::string& caption) 125 { 126 this->text_->setCaption(caption); 127 this->changedCaption(); 128 } 129 std::string OverlayText::getCaption() const 130 { 131 return this->text_->getCaption(); 132 } 133 134 void OverlayText::setFont(const std::string& font) 135 { 136 if (font != "") 137 this->text_->setFontName(font); 138 } 139 const std::string& OverlayText::getFont() const 140 { 141 return this->text_->getFontName(); 142 } 143 144 void OverlayText::setSpaceWidth(float width) 145 { 146 this->text_->setSpaceWidth(width); 147 } 148 float OverlayText::getSpaceWidth() const 149 { 150 return this->text_->getSpaceWidth(); 151 } 152 153 void OverlayText::setColour(const ColourValue& colour) 154 { 155 this->text_->setColour(colour); this->changedColour(); 156 } 157 const ColourValue& OverlayText::getColour() const 158 { 159 return this->text_->getColour(); 160 } 161 162 void OverlayText::setAlignment(OverlayText::Alignment alignment) 163 { 164 this->text_->setAlignment(static_cast<Ogre::TextAreaOverlayElement::Alignment>(alignment)); 165 } 166 OverlayText::Alignment OverlayText::getAlignment() const 167 { 168 return static_cast<OverlayText::Alignment>(this->text_->getAlignment()); 169 } 122 170 } -
code/trunk/src/orxonox/overlays/OverlayText.h
r3099 r3196 33 33 34 34 #include <string> 35 #include <OgrePrerequisites.h>36 #include <OgreTextAreaOverlayElement.h>35 #include "util/Math.h" 36 #include "util/OgreForwardRefs.h" 37 37 #include "OrxonoxOverlay.h" 38 38 … … 42 42 { 43 43 public: 44 enum Alignment 45 { 46 Left, 47 Right, 48 Center 49 }; 50 44 51 OverlayText(BaseObject* creator); 45 52 virtual ~OverlayText(); … … 47 54 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); 48 55 49 inline void setCaption(const std::string& caption) { this->text_->setCaption(caption); this->changedCaption(); }50 inline std::string getCaption() const { return this->text_->getCaption(); }56 void setCaption(const std::string& caption); 57 std::string getCaption() const; 51 58 52 59 void setFont(const std::string& font); 53 inline const std::string& getFont() const { return this->text_->getFontName(); }60 const std::string& getFont() const; 54 61 55 inline void setSpaceWidth(float width) { this->text_->setSpaceWidth(width); }56 inline float getSpaceWidth() const { return this->text_->getSpaceWidth(); }62 void setSpaceWidth(float width); 63 float getSpaceWidth() const; 57 64 58 inline void setColour(const ColourValue& colour) { this->text_->setColour(colour); this->changedColour(); }59 inline const ColourValue& getColour() const { return this->text_->getColour(); }65 void setColour(const ColourValue& colour); 66 const ColourValue& getColour() const; 60 67 61 inline void setAlignment(Ogre::TextAreaOverlayElement::Alignment alignment) { this->text_->setAlignment(alignment); }62 inline Ogre::TextAreaOverlayElement::Alignment getAlignment() const { return this->text_->getAlignment(); }68 void setAlignment(OverlayText::Alignment alignment); 69 OverlayText::Alignment getAlignment() const; 63 70 64 71 void setAlignmentString(const std::string& alignment); -
code/trunk/src/orxonox/overlays/console/InGameConsole.cc
r3110 r3196 35 35 #include <OgreOverlayManager.h> 36 36 #include <OgreOverlayContainer.h> 37 #include <OgreBorderPanelOverlayElement.h> 38 #include <OgreTextAreaOverlayElement.h> 37 39 #include <OgreFontManager.h> 38 40 #include <OgreFont.h> … … 40 42 #include "util/Math.h" 41 43 #include "util/Convert.h" 42 #include "util/ Debug.h"44 #include "util/UTFStringConversions.h" 43 45 #include "core/Clock.h" 44 46 #include "core/CoreIncludes.h" … … 466 468 { 467 469 ++linesUsed; 468 this->consoleOverlayTextAreas_[index]->setCaption( convert2UTF(output.substr(0, this->maxCharsPerLine_)));470 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output.substr(0, this->maxCharsPerLine_))); 469 471 output.erase(0, this->maxCharsPerLine_); 470 472 output.insert(0, 1, ' '); … … 473 475 this->colourLine(level, index); 474 476 } 475 this->consoleOverlayTextAreas_[index]->setCaption( convert2UTF(output));477 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output)); 476 478 this->displayedText_ = output; 477 479 this->numLinesShifted_ = linesUsed; … … 491 493 this->inputWindowStart_ = 0; 492 494 this->displayedText_ = output; 493 this->consoleOverlayTextAreas_[index]->setCaption( convert2UTF(output));495 this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output)); 494 496 } 495 497 } … … 606 608 InGameConsole::getInstance().deactivate(); 607 609 } 608 609 /**610 @brief Converts a string into an Ogre::UTFString.611 @param s The string to convert612 @return The converted string613 */614 /*static*/ Ogre::UTFString InGameConsole::convert2UTF(const std::string& text)615 {616 Ogre::UTFString utf;617 Ogre::UTFString::code_point cp;618 for (unsigned int i = 0; i < text.size(); ++i)619 {620 cp = text[i];621 cp &= 0xFF;622 utf.append(1, cp);623 }624 return utf;625 }626 610 } -
code/trunk/src/orxonox/overlays/console/InGameConsole.h
r2896 r3196 32 32 33 33 #include "OrxonoxPrereqs.h" 34 #include <OgrePrerequisites.h>35 #include <OgreBorderPanelOverlayElement.h>36 #include <OgreTextAreaOverlayElement.h>37 34 35 #include <string> 36 #include "util/OgreForwardRefs.h" 38 37 #include "core/Shell.h" 39 #include "core/OrxonoxClass.h" 40 #include "tools/WindowEventListener.h" 41 38 #include "interfaces/WindowEventListener.h" 42 39 43 40 namespace orxonox 44 41 { 45 class _OrxonoxExport InGameConsole : virtual public OrxonoxClass,public ShellListener, public WindowEventListener42 class _OrxonoxExport InGameConsole : public ShellListener, public WindowEventListener 46 43 { 47 44 public: // functions … … 60 57 static void openConsole(); 61 58 static void closeConsole(); 62 63 static Ogre::UTFString convert2UTF(const std::string& text);64 59 65 60 private: // functions -
code/trunk/src/orxonox/overlays/debug/DebugFPSText.cc
r3110 r3196 28 28 29 29 #include "DebugFPSText.h" 30 #include <OgreTextAreaOverlayElement.h> 30 31 31 #include "util/Convert.h" 32 32 #include "core/CoreIncludes.h" … … 51 51 52 52 float fps = Game::getInstance().getAvgFPS(); 53 this->setCaption( convertToString(fps));53 this->setCaption(multi_cast<std::string>(fps)); 54 54 } 55 55 } -
code/trunk/src/orxonox/overlays/debug/DebugFPSText.h
r2087 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/Tickable.h" 34 35 #include "overlays/OverlayText.h" 35 #include "objects/Tickable.h"36 36 37 37 namespace orxonox … … 41 41 public: 42 42 DebugFPSText(BaseObject* creator); 43 ~DebugFPSText();43 virtual ~DebugFPSText(); 44 44 45 45 virtual void tick(float dt); -
code/trunk/src/orxonox/overlays/debug/DebugRTRText.cc
r3110 r3196 28 28 29 29 #include "DebugRTRText.h" 30 #include <OgreTextAreaOverlayElement.h> 30 31 #include "util/Convert.h" 31 32 #include "core/CoreIncludes.h" 32 #include "util/Convert.h"33 33 #include "core/Game.h" 34 34 … … 51 51 52 52 float rtr = Game::getInstance().getAvgTickTime(); 53 this->setCaption( convertToString(rtr));53 this->setCaption(multi_cast<std::string>(rtr)); 54 54 } 55 55 } -
code/trunk/src/orxonox/overlays/debug/DebugRTRText.h
r2087 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/Tickable.h" 34 35 #include "overlays/OverlayText.h" 35 #include "objects/Tickable.h"36 36 37 37 namespace orxonox … … 41 41 public: 42 42 DebugRTRText(BaseObject* creator); 43 ~DebugRTRText();43 virtual ~DebugRTRText(); 44 44 45 45 virtual void tick(float dt); -
code/trunk/src/orxonox/overlays/hud/AnnounceMessage.h
r3099 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/GametypeMessageListener.h" 34 35 #include "overlays/FadeoutText.h" 35 #include "objects/GametypeMessageListener.h"36 36 37 37 namespace orxonox -
code/trunk/src/orxonox/overlays/hud/ChatOverlay.cc
r3110 r3196 29 29 #include "ChatOverlay.h" 30 30 31 #include <string> 31 32 #include <OgreTextAreaOverlayElement.h> 32 33 34 #include "util/Convert.h" 35 #include "util/UTFStringConversions.h" 33 36 #include "core/CoreIncludes.h" 34 37 #include "core/ConfigValueIncludes.h" 35 38 #include "core/Executor.h" 36 39 37 #include " network/ClientInformation.h"38 40 #include "tools/Timer.h" 41 #include "objects/infos/PlayerInfo.h" 39 42 #include "PlayerManager.h" 40 #include "objects/infos/PlayerInfo.h"41 #include "overlays/console/InGameConsole.h"42 #include "tools/Timer.h"43 44 #include "util/Convert.h"45 43 46 44 namespace orxonox … … 86 84 } 87 85 88 this->messages_.push_back( InGameConsole::convert2UTF(text));86 this->messages_.push_back(multi_cast<Ogre::UTFString>(text)); 89 87 COUT(0) << "Chat: " << text << std::endl; 90 88 -
code/trunk/src/orxonox/overlays/hud/ChatOverlay.h
r2171 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include <OgreTextAreaOverlayElement.h> 34 #include <list> 35 #include <OgreUTFString.h> 35 36 36 37 #include "network/ChatListener.h" … … 43 44 public: 44 45 ChatOverlay(BaseObject* creator); 45 ~ChatOverlay();46 virtual ~ChatOverlay(); 46 47 47 48 void setConfigValues(); -
code/trunk/src/orxonox/overlays/hud/DeathMessage.h
r3099 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/GametypeMessageListener.h" 34 35 #include "overlays/FadeoutText.h" 35 #include "objects/GametypeMessageListener.h"36 36 37 37 namespace orxonox -
code/trunk/src/orxonox/overlays/hud/GametypeStatus.cc
r3110 r3196 29 29 #include "GametypeStatus.h" 30 30 31 #include <OgreTextAreaOverlayElement.h> 32 31 #include "util/Convert.h" 33 32 #include "core/CoreIncludes.h" 34 #include "util/Convert.h"35 33 #include "objects/infos/GametypeInfo.h" 36 34 #include "objects/infos/PlayerInfo.h" -
code/trunk/src/orxonox/overlays/hud/GametypeStatus.h
r2973 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/Tickable.h" 34 35 #include "overlays/OverlayText.h" 35 #include "objects/Tickable.h"36 36 37 37 namespace orxonox … … 41 41 public: 42 42 GametypeStatus(BaseObject* creator); 43 ~GametypeStatus();43 virtual ~GametypeStatus(); 44 44 45 45 virtual void tick(float dt); -
code/trunk/src/orxonox/overlays/hud/HUDBar.cc
r3110 r3196 34 34 #include <OgreMaterialManager.h> 35 35 #include <OgreTechnique.h> 36 #include <OgrePass.h> 36 37 #include <OgrePanelOverlayElement.h> 37 38 … … 77 78 this->textureUnitState_->setTextureName("bar2.tga"); 78 79 // use the default colour 79 this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, ColourValue(0.2 , 0.7, 0.2));80 this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, ColourValue(0.2f, 0.7f, 0.2f)); 80 81 81 82 this->bar_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() -
code/trunk/src/orxonox/overlays/hud/HUDBar.h
r2662 r3196 35 35 36 36 #include <map> 37 #include <OgrePrerequisites.h> 37 #include <vector> 38 38 39 #include "util/Math.h" 40 #include "util/OgreForwardRefs.h" 41 #include "core/BaseObject.h" 39 42 #include "overlays/OrxonoxOverlay.h" 40 43 … … 45 48 public: 46 49 BarColour(BaseObject* creator); 47 ~BarColour() { }50 virtual ~BarColour() { } 48 51 49 52 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); -
code/trunk/src/orxonox/overlays/hud/HUDHealthBar.cc
r3110 r3196 29 29 #include "HUDHealthBar.h" 30 30 31 #include <OgreOverlayManager.h> 32 #include <OgrePanelOverlayElement.h> 33 31 #include "util/Convert.h" 34 32 #include "core/CoreIncludes.h" 35 33 #include "core/XMLPort.h" 36 34 #include "objects/worldentities/pawns/Pawn.h" 37 #include "objects/items/Engine.h"38 35 #include "overlays/OverlayGroup.h" 39 #include "util/Convert.h"40 36 41 37 namespace orxonox -
code/trunk/src/orxonox/overlays/hud/HUDHealthBar.h
r2662 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "util/Math.h" 35 #include "interfaces/Tickable.h" 36 #include "overlays/OverlayText.h" 34 37 #include "HUDBar.h" 35 #include "objects/Tickable.h"36 #include "overlays/OverlayText.h"37 38 38 39 namespace orxonox … … 42 43 public: 43 44 HUDHealthBar(BaseObject* creator); 44 ~HUDHealthBar();45 virtual ~HUDHealthBar(); 45 46 46 47 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); … … 64 65 { return this->bUseBarColour_; } 65 66 66 inline void setTextAlignment(O gre::TextAreaOverlayElement::Alignment alignment)67 inline void setTextAlignment(OverlayText::Alignment alignment) 67 68 { this->textoverlay_->setAlignment(alignment); } 68 inline O gre::TextAreaOverlayElement::Alignment getTextAlignment() const69 inline OverlayText::Alignment getTextAlignment() const 69 70 { return this->textoverlay_->getAlignment(); } 70 71 -
code/trunk/src/orxonox/overlays/hud/HUDNavigation.cc
r3110 r3196 29 29 #include "HUDNavigation.h" 30 30 31 #include <string> 31 32 #include <OgreOverlayManager.h> 32 33 #include <OgreTextAreaOverlayElement.h> … … 36 37 #include "util/String.h" 37 38 #include "util/Convert.h" 38 #include "core/ConsoleCommand.h"39 39 #include "core/CoreIncludes.h" 40 40 #include "core/XMLPort.h" -
code/trunk/src/orxonox/overlays/hud/HUDNavigation.h
r2087 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include <OgrePrerequisites.h> 34 #include "util/OgreForwardRefs.h" 35 #include "interfaces/Tickable.h" 35 36 #include "overlays/OrxonoxOverlay.h" 36 #include "objects/Tickable.h"37 37 38 38 namespace orxonox … … 42 42 public: 43 43 HUDNavigation(BaseObject* creator); 44 ~HUDNavigation();44 virtual ~HUDNavigation(); 45 45 46 46 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); -
code/trunk/src/orxonox/overlays/hud/HUDRadar.cc
r3110 r3196 35 35 #include "util/Math.h" 36 36 #include "util/String.h" 37 #include "core/ConsoleCommand.h"38 37 #include "core/CoreIncludes.h" 39 38 #include "core/XMLPort.h" 40 #include " objects/Radar.h"39 #include "tools/TextureGenerator.h" 41 40 #include "objects/worldentities/WorldEntity.h" 42 41 #include "objects/worldentities/pawns/Pawn.h" 43 #include "tools/TextureGenerator.h"44 42 45 43 namespace orxonox -
code/trunk/src/orxonox/overlays/hud/HUDRadar.h
r2662 r3196 33 33 #include "OrxonoxPrereqs.h" 34 34 35 #include <map> 35 36 #include <vector> 36 #include <map> 37 #include <OgrePrerequisites.h> 37 38 #include "util/OgreForwardRefs.h" 39 #include "interfaces/RadarListener.h" 40 #include "interfaces/RadarViewable.h" 38 41 #include "overlays/OrxonoxOverlay.h" 39 #include "objects/RadarListener.h"40 #include "objects/RadarViewable.h"41 42 42 43 namespace orxonox … … 46 47 public: 47 48 HUDRadar(BaseObject* creator); 48 ~HUDRadar();49 virtual ~HUDRadar(); 49 50 50 51 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); -
code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.cc
r3110 r3196 29 29 30 30 #include "HUDSpeedBar.h" 31 31 32 #include "core/CoreIncludes.h" 32 33 #include "objects/worldentities/pawns/SpaceShip.h" -
code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.h
r2662 r3196 33 33 #include "OrxonoxPrereqs.h" 34 34 35 #include "interfaces/Tickable.h" 35 36 #include "HUDBar.h" 36 #include "objects/Tickable.h"37 37 38 38 namespace orxonox … … 42 42 public: 43 43 HUDSpeedBar(BaseObject* creator); 44 ~HUDSpeedBar();44 virtual ~HUDSpeedBar(); 45 45 46 46 virtual void tick(float dt); -
code/trunk/src/orxonox/overlays/hud/HUDTimer.cc
r3110 r3196 29 29 #include "HUDTimer.h" 30 30 31 #include "util/Convert.h" 31 32 #include "core/CoreIncludes.h" 32 #include "util/Convert.h"33 33 #include "objects/worldentities/ControllableEntity.h" 34 34 #include "objects/gametypes/Gametype.h" … … 36 36 namespace orxonox 37 37 { 38 CreateFactory(HUDTimer);38 CreateFactory(HUDTimer); 39 39 40 HUDTimer::HUDTimer(BaseObject* creator) : OverlayText(creator)41 {42 RegisterObject(HUDTimer);40 HUDTimer::HUDTimer(BaseObject* creator) : OverlayText(creator) 41 { 42 RegisterObject(HUDTimer); 43 43 44 this->owner_ = 0;45 }44 this->owner_ = 0; 45 } 46 46 47 HUDTimer::~HUDTimer()48 {49 }47 HUDTimer::~HUDTimer() 48 { 49 } 50 50 51 void HUDTimer::tick(float dt)52 {53 SUPER(HUDTimer, tick, dt);51 void HUDTimer::tick(float dt) 52 { 53 SUPER(HUDTimer, tick, dt); 54 54 55 Gametype* gametype = this->getGametype(); 56 57 if(gametype) 55 Gametype* gametype = this->getGametype(); 56 57 if (gametype) 58 { 59 if (gametype->getTimerIsActive()) 60 { 61 this->setCaption(convertToString((int)gametype->getTime() + 1)); 62 } 63 } 64 } 65 66 void HUDTimer::changedOwner() 58 67 { 59 if (gametype->getTimerIsActive()) 60 { 61 this->setCaption(convertToString((int)gametype->getTime() + 1)); 62 } 68 SUPER(HUDTimer, changedOwner); 69 70 this->owner_ = dynamic_cast<ControllableEntity*>(this->getOwner()); 63 71 } 64 }65 66 void HUDTimer::changedOwner()67 {68 SUPER(HUDTimer, changedOwner);69 70 this->owner_ = dynamic_cast<ControllableEntity*>(this->getOwner());71 }72 72 } -
code/trunk/src/orxonox/overlays/hud/HUDTimer.h
r3033 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/Tickable.h" 34 35 #include "overlays/OverlayText.h" 35 #include "objects/Tickable.h"36 36 37 37 namespace orxonox 38 38 { 39 class _OrxonoxExport HUDTimer : public OverlayText, public Tickable40 {39 class _OrxonoxExport HUDTimer : public OverlayText, public Tickable 40 { 41 41 public: 42 HUDTimer(BaseObject* creator);43 ~HUDTimer();42 HUDTimer(BaseObject* creator); 43 virtual ~HUDTimer(); 44 44 45 virtual void tick(float dt);45 virtual void tick(float dt); 46 46 47 virtual void changedOwner();47 virtual void changedOwner(); 48 48 49 49 private: 50 50 ControllableEntity* owner_; 51 };51 }; 52 52 } 53 53 #endif /* _HUDTimer_H__ */ -
code/trunk/src/orxonox/overlays/hud/KillMessage.h
r3099 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/GametypeMessageListener.h" 34 35 #include "overlays/FadeoutText.h" 35 #include "objects/GametypeMessageListener.h"36 36 37 37 namespace orxonox -
code/trunk/src/orxonox/overlays/hud/PongScore.cc
r3110 r3196 29 29 #include "PongScore.h" 30 30 31 #include <OgreTextAreaOverlayElement.h> 32 31 #include "util/Convert.h" 33 32 #include "core/CoreIncludes.h" 34 33 #include "core/XMLPort.h" 35 #include "util/Convert.h"36 34 #include "objects/gametypes/Pong.h" 37 35 #include "objects/infos/PlayerInfo.h" -
code/trunk/src/orxonox/overlays/hud/PongScore.h
r3078 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/Tickable.h" 34 35 #include "overlays/OverlayText.h" 35 #include "objects/Tickable.h"36 36 37 37 namespace orxonox … … 41 41 public: 42 42 PongScore(BaseObject* creator); 43 ~PongScore();43 virtual ~PongScore(); 44 44 45 45 virtual void tick(float dt); -
code/trunk/src/orxonox/overlays/hud/TeamBaseMatchScore.cc
r3110 r3196 28 28 29 29 #include "TeamBaseMatchScore.h" 30 31 #include <OgreTextAreaOverlayElement.h>32 30 33 31 #include "core/CoreIncludes.h" -
code/trunk/src/orxonox/overlays/hud/TeamBaseMatchScore.h
r3104 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/Tickable.h" 34 35 #include "overlays/OverlayText.h" 35 #include "objects/Tickable.h"36 36 37 37 namespace orxonox … … 41 41 public: 42 42 TeamBaseMatchScore(BaseObject* creator); 43 ~TeamBaseMatchScore();43 virtual ~TeamBaseMatchScore(); 44 44 45 45 virtual void tick(float dt); -
code/trunk/src/orxonox/overlays/hud/UnderAttackHealthBar.cc
r3110 r3196 47 47 this->text_ = new OverlayText(this); 48 48 this->text_->setFont("Monofur"); 49 this->text_->setTextSize(0.04 );49 this->text_->setTextSize(0.04f); 50 50 this->text_->setAlignmentString("center"); 51 51 this->text_->setColour(ColourValue::White); -
code/trunk/src/orxonox/overlays/hud/UnderAttackHealthBar.h
r3104 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "util/Math.h" 35 #include "tools/Timer.h" 34 36 #include "HUDHealthBar.h" 35 #include "tools/Timer.h"36 37 37 38 namespace orxonox -
code/trunk/src/orxonox/overlays/map/Map.cc
r3110 r3196 24 24 * 25 25 */ 26 26 27 #include "Map.h" 27 28 28 29 #include <string> 29 #include "util/String.h" 30 31 #include <OgreBorderPanelOverlayElement.h> 32 #include <OgreCamera.h> 33 #include <OgreEntity.h> 34 #include <OgreHardwarePixelBuffer.h> 35 #include <OgreMaterialManager.h> 36 #include <OgreMovablePlane.h> 37 #include <OgreOverlay.h> 38 #include <OgreOverlayContainer.h> 39 #include <OgreOverlayManager.h> 40 #include <OgrePass.h> 41 #include <OgreRenderTexture.h> 42 #include <OgreResourceGroupManager.h> 43 #include <OgreRoot.h> 30 44 #include <OgreSceneManager.h> 31 45 #include <OgreSceneNode.h> 32 #include <OgreEntity.h> 33 #include <OgreNode.h> 34 35 36 #include <OgreRenderWindow.h> 37 #include <OgreRenderTexture.h> 46 #include <OgreTechnique.h> 38 47 #include <OgreTexture.h> 48 #include <OgreTextureManager.h> 39 49 #include <OgreViewport.h> 40 50 41 #include <OgreMaterialManager.h> 42 #include <OgreRoot.h> 43 #include <OgreHardwarePixelBuffer.h> 51 #include "core/ConsoleCommand.h" 52 #include "core/CoreIncludes.h" 53 #include "core/XMLPort.h" 54 #include "interfaces/RadarViewable.h" 55 #include "objects/Scene.h" 56 #include "objects/controllers/HumanController.h" 57 #include "objects/worldentities/CameraPosition.h" 44 58 #include "objects/worldentities/ControllableEntity.h" 45 #include "objects/worldentities/CameraPosition.h"46 47 #include <OgreOverlay.h>48 #include <OgreMovablePlane.h>49 #include <OgreOverlayElement.h>50 #include <OgreOverlayManager.h>51 #include <OgreOverlayContainer.h>52 #include "core/CoreIncludes.h"53 #include "core/ConfigValueIncludes.h"54 #include "core/ConsoleCommand.h"55 #include "objects/Scene.h"56 #include "objects/RadarViewable.h"57 #include "objects/controllers/HumanController.h"58 59 59 60 namespace orxonox … … 264 265 } 265 266 266 Ogre::MaterialPtr Map::createRenderCamera(Ogre::Camera * cam, std::stringmatName)267 Ogre::MaterialPtr Map::createRenderCamera(Ogre::Camera * cam, const std::string& matName) 267 268 { 268 269 Ogre::TexturePtr rttTex = Ogre::TextureManager::getSingleton().createManual(matName+"_tex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET); … … 400 401 } 401 402 403 // HACK! 404 void Map::hackDestroyMap() 405 { 406 Map::OverlayMaterial_.setNull(); 407 } 408 402 409 void Map::tick(float dt) 403 410 { -
code/trunk/src/orxonox/overlays/map/Map.h
r3101 r3196 25 25 */ 26 26 27 #ifndef _M AP_H__28 #define _M AP_H__27 #ifndef _Map_H__ 28 #define _Map_H__ 29 29 30 #include <string>31 30 #include "OrxonoxPrereqs.h" 32 #include <OgrePrerequisites.h>33 #include <OgreSceneManager.h>34 #include <OgreSceneNode.h>35 #include <OgreEntity.h>36 #include <OgreOverlay.h>37 #include <OgreOverlayElement.h>38 #include <OgreOverlayManager.h>39 #include <OgreOverlayContainer.h>40 #include <OgreMovablePlane.h>41 31 42 #include <OgreBorderPanelOverlayElement.h> 43 #include <OgreTextAreaOverlayElement.h> 32 #include <OgreMaterial.h> 44 33 34 #include "util/UtilPrereqs.h" 35 #include "interfaces/Tickable.h" 45 36 #include "overlays/OrxonoxOverlay.h" 46 #include "objects/Tickable.h"47 48 49 37 50 38 namespace orxonox … … 55 43 public: // functions 56 44 Map(BaseObject* creator); 57 ~Map();45 virtual ~Map(); 58 46 59 47 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); … … 61 49 virtual void changedOwner(); 62 50 63 static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, std::stringmatName);51 static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, const std::string& matName); 64 52 65 53 static void openMap(); 54 // HACK! 55 static void hackDestroyMap(); 66 56 67 57 //Not yet implemented … … 126 116 } 127 117 128 #endif /* _M AP_H__ */118 #endif /* _Map_H__ */ -
code/trunk/src/orxonox/overlays/notifications/Notification.cc
r3110 r3196 28 28 29 29 /** 30 @file Notification.cc30 @file 31 31 @brief Implementation of the Notification class. 32 32 */ … … 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "util/Exception.h"38 39 37 #include "NotificationManager.h" 40 38 … … 48 46 Notification::Notification(BaseObject* creator) : BaseObject(creator) 49 47 { 48 RegisterObject(Notification); 50 49 this->initialize(); 51 50 } … … 76 75 void Notification::initialize(void) 77 76 { 78 RegisterObject(Notification);79 80 77 this->message_ = ""; 81 78 this->sender_ = NotificationManager::NONE; -
code/trunk/src/orxonox/overlays/notifications/Notification.h
r3034 r3196 28 28 29 29 /** 30 @file Notification.h30 @file 31 31 @brief Definition of the Notification class. 32 32 */ … … 38 38 39 39 #include <string> 40 41 40 #include "core/BaseObject.h" 42 41 -
code/trunk/src/orxonox/overlays/notifications/NotificationManager.cc
r3110 r3196 28 28 29 29 /** 30 @file NotificationManager.cc30 @file 31 31 @brief Implementation of the NotificationManager class. 32 32 */ … … 34 34 #include "NotificationManager.h" 35 35 36 #include <set> 37 36 38 #include "core/CoreIncludes.h" 37 38 #include <set>39 40 39 #include "Notification.h" 41 40 #include "NotificationQueue.h" -
code/trunk/src/orxonox/overlays/notifications/NotificationManager.h
r3034 r3196 28 28 29 29 /** 30 @file NotificationManager.h30 @file 31 31 @brief Definition of the NotificationManager class. 32 32 */ … … 37 37 #include "OrxonoxPrereqs.h" 38 38 39 #include "core/OrxonoxClass.h" 40 39 #include <ctime> 41 40 #include <map> 42 41 #include <string> 43 #include <ctime> 44 45 #include "NotificationOverlay.h" 42 #include "core/OrxonoxClass.h" 46 43 47 44 namespace orxonox -
code/trunk/src/orxonox/overlays/notifications/NotificationOverlay.cc
r3110 r3196 28 28 29 29 /** 30 @file NotificationOverlay.cc30 @file 31 31 @brief Implementation of the NotificationOverlay class. 32 32 */ … … 34 34 #include "NotificationOverlay.h" 35 35 36 #include <OgreOverlayManager.h> 37 #include <OgreTextAreaOverlayElement.h> 38 #include <OgrePanelOverlayElement.h> 39 36 #include "util/Exception.h" 40 37 #include "core/CoreIncludes.h" 41 #include "util/Exception.h"42 43 38 #include "Notification.h" 44 39 #include "NotificationQueue.h" … … 53 48 NotificationOverlay::NotificationOverlay(BaseObject* creator) : OverlayText(creator) 54 49 { 50 RegisterObject(NotificationOverlay); 55 51 this->initialize(); 56 52 } … … 87 83 void NotificationOverlay::initialize(void) 88 84 { 89 RegisterObject(NotificationOverlay);90 91 85 this->queue_ = NULL; 92 86 } … … 133 127 Clips the input message so that it meets the requirements for the maximal length of Notifications given by the NotificationQueue. 134 128 */ 135 conststd::string NotificationOverlay::clipMessage(const std::string & message)129 std::string NotificationOverlay::clipMessage(const std::string & message) 136 130 { 137 131 if(message.length() <= (unsigned int)this->queue_->getNotificationLength()) //!< If the message is not too long. -
code/trunk/src/orxonox/overlays/notifications/NotificationOverlay.h
r3078 r3196 28 28 29 29 /** 30 @file NotificationOverlay.h30 @file 31 31 @brief Definition of the NotificationOverlay class. 32 32 */ … … 38 38 #include "OrxonoxPrereqs.h" 39 39 40 #include <string> 40 41 #include "orxonox/overlays/OverlayText.h" 41 42 #include <string>43 #include <set>44 #include <OgrePrerequisites.h>45 #include <OgreTextAreaOverlayElement.h>46 42 47 43 namespace orxonox … … 72 68 73 69 protected: 74 conststd::string clipMessage(const std::string & message); //!< Clips the input message if too long.70 std::string clipMessage(const std::string & message); //!< Clips the input message if too long. 75 71 76 72 private: -
code/trunk/src/orxonox/overlays/notifications/NotificationQueue.cc
r3110 r3196 28 28 29 29 /** 30 @file NotificationQueue.cc30 @file 31 31 @brief Implementation of the NotificationQueue class. 32 32 */ … … 34 34 #include "NotificationQueue.h" 35 35 36 #include <OgreOverlayManager.h>37 #include <OgreTextAreaOverlayElement.h>38 #include <list>39 #include <iostream>40 36 #include <sstream> 41 37 42 38 #include "core/CoreIncludes.h" 43 39 #include "core/XMLPort.h" 44 45 #include "Notification.h"46 40 #include "NotificationOverlay.h" 41 #include "NotificationManager.h" 47 42 48 43 namespace orxonox … … 53 48 const std::string NotificationQueue::DEFAULT_FONT = "VeraMono"; 54 49 const Vector2 NotificationQueue::DEFAULT_POSITION = Vector2(0.0,0.0); 55 const float NotificationQueue::DEFAULT_FONT_SIZE = 0.025 ;50 const float NotificationQueue::DEFAULT_FONT_SIZE = 0.025f; 56 51 57 52 /** … … 61 56 NotificationQueue::NotificationQueue(BaseObject* creator) : OverlayGroup(creator) 62 57 { 58 RegisterObject(NotificationQueue); 63 59 this->initialize(); 64 60 } … … 81 77 void NotificationQueue::initialize(void) 82 78 { 83 RegisterObject(NotificationQueue);84 85 79 this->size_ = 0; 86 80 this->tickTime_ = 0.0; -
code/trunk/src/orxonox/overlays/notifications/NotificationQueue.h
r2926 r3196 28 28 29 29 /** 30 @file NotificationQueue.h30 @file 31 31 @brief Definition of the NotificationQueue class. 32 32 */ … … 37 37 #include "OrxonoxPrereqs.h" 38 38 39 #include <ctime> 40 #include <map> 41 #include <set> 39 42 #include <string> 40 #include <set> 41 #include <OgreOverlayManager.h> 42 #include <OgreTextAreaOverlayElement.h> 43 #include <OgrePanelOverlayElement.h> 44 #include <map> 45 #include <ctime> 46 47 #include "orxonox/overlays/OverlayGroup.h" 48 #include "orxonox/objects/Tickable.h" 49 50 #include "NotificationManager.h" 43 44 #include "util/Math.h" 45 #include "interfaces/Tickable.h" 46 #include "overlays/OverlayGroup.h" 51 47 52 48 namespace orxonox -
code/trunk/src/orxonox/overlays/stats/CMakeLists.txt
r2710 r3196 3 3 Scoreboard.cc 4 4 Stats.cc 5 StatsTest.cc6 5 ) -
code/trunk/src/orxonox/overlays/stats/CreateLines.cc
r3110 r3196 26 26 27 27 #include "CreateLines.h" 28 29 #include <string>30 #include <OgreOverlay.h>31 #include <OgreOverlayElement.h>32 #include <OgreOverlayManager.h>33 #include <OgreOverlayContainer.h>34 35 #include "util/Convert.h"36 #include "util/Debug.h"37 #include "core/CoreIncludes.h"38 #include "core/ConfigValueIncludes.h"39 28 40 29 #include "overlays/OverlayText.h" -
code/trunk/src/orxonox/overlays/stats/CreateLines.h
r2662 r3196 28 28 #define _CreateLines_H__ 29 29 30 31 30 #include "OrxonoxPrereqs.h" 32 #include <OgrePrerequisites.h>33 #include <OgreBorderPanelOverlayElement.h>34 #include <OgreTextAreaOverlayElement.h>35 36 #include "overlays/OrxonoxOverlay.h"37 #include "objects/Tickable.h"38 39 31 40 32 namespace orxonox -
code/trunk/src/orxonox/overlays/stats/Scoreboard.cc
r3110 r3196 27 27 #include "Scoreboard.h" 28 28 29 #include <string>30 #include <OgreOverlay.h>31 #include <OgreOverlayElement.h>32 #include <OgreOverlayManager.h>33 #include <OgreOverlayContainer.h>34 35 29 #include "util/Convert.h" 36 #include "util/Debug.h"37 30 #include "core/CoreIncludes.h" 38 #include "core/ConfigValueIncludes.h"39 31 #include "objects/gametypes/Gametype.h" 40 32 #include "objects/infos/PlayerInfo.h" … … 101 93 for (std::map<PlayerInfo*, Player>::const_iterator it = playerList.begin(); it != playerList.end(); ++it) 102 94 { 103 this->lines_[index]->setPlayerName( omni_cast<std::string>(it->first->getName()));104 this->lines_[index]->setScore( omni_cast<std::string>(it->second.frags_));105 this->lines_[index]->setDeaths( omni_cast<std::string>(it->second.killed_));95 this->lines_[index]->setPlayerName(multi_cast<std::string>(it->first->getName())); 96 this->lines_[index]->setScore(multi_cast<std::string>(it->second.frags_)); 97 this->lines_[index]->setDeaths(multi_cast<std::string>(it->second.killed_)); 106 98 index++; 107 99 } -
code/trunk/src/orxonox/overlays/stats/Scoreboard.h
r2662 r3196 30 30 31 31 #include "OrxonoxPrereqs.h" 32 #include <OgrePrerequisites.h>33 #include <OgreBorderPanelOverlayElement.h>34 #include <OgreTextAreaOverlayElement.h>35 32 33 #include <string> 34 #include <vector> 35 #include "interfaces/Tickable.h" 36 36 #include "overlays/OrxonoxOverlay.h" 37 #include "objects/Tickable.h"38 39 37 40 38 namespace orxonox … … 42 40 class _OrxonoxExport Scoreboard : public OrxonoxOverlay, public Tickable 43 41 { 44 45 42 public: // functions 46 43 Scoreboard(BaseObject* creator); -
code/trunk/src/orxonox/overlays/stats/Stats.cc
r3110 r3196 30 30 31 31 #include <string> 32 #include <OgreOverlay.h>33 #include <OgreOverlayElement.h>34 32 #include <OgreOverlayManager.h> 35 #include <Ogre OverlayContainer.h>33 #include <OgreBorderPanelOverlayElement.h> 36 34 37 #include "util/Convert.h" 38 #include "util/Debug.h" 35 #include "util/String.h" 39 36 #include "core/CoreIncludes.h" 40 37 #include "core/ConfigValueIncludes.h" -
code/trunk/src/orxonox/overlays/stats/Stats.h
r2662 r3196 30 30 #define _Stats_H__ 31 31 32 #include "OrxonoxPrereqs.h" 32 33 33 #include "OrxonoxPrereqs.h" 34 #include <OgrePrerequisites.h> 35 #include <OgreBorderPanelOverlayElement.h> 36 #include <OgreTextAreaOverlayElement.h> 37 34 #include "util/OgreForwardRefs.h" 35 #include "interfaces/Tickable.h" 38 36 #include "overlays/OrxonoxOverlay.h" 39 #include "objects/Tickable.h"40 41 37 42 38 namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.