- Timestamp:
- Jun 22, 2008, 11:47:09 PM (16 years ago)
- Location:
- code/branches/hud
- Files:
-
- 1 added
- 8 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/bin/levels/sample.oxw
r1557 r1618 9 9 </audio--> 10 10 11 <Ambient colourvalue=" 0.1, 0.1, 0.1" />11 <Ambient colourvalue="1.0, 1.0, 1.0" /> 12 12 <Skybox src="Orxonox/Starbox" /> 13 13 <SpaceShip camera="true" position="0,0,0" scale="10" yawpitchroll="0,0,0" mesh="assff.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" /> -
code/branches/hud/src/orxonox/GraphicsEngine.h
r1590 r1618 77 77 void setAverageRTR(float rtr) { this->renderTimeRatio_ = rtr; } 78 78 79 void setWindowActivity(bool activity) 80 { if (this->renderWindow_) this->renderWindow_->setActive(activity); } 81 79 82 void windowMoved (Ogre::RenderWindow* rw); 80 83 void windowResized (Ogre::RenderWindow* rw); -
code/branches/hud/src/orxonox/Orxonox.cc
r1613 r1618 501 501 // This calls the WindowEventListener objects. 502 502 Ogre::WindowEventUtilities::messagePump(); 503 GraphicsEngine::getSingleton().setWindowActivity(true); 503 504 504 505 // render -
code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc
r1617 r1618 111 111 this->overlay_->hide(); 112 112 113 this->sizeCorrectionChanged(); 113 114 this->sizeChanged(); 114 115 this->positionChanged(); … … 160 161 { 161 162 float angle = this->angle_.valueDegrees(); 163 if (angle < 0.0) 164 angle = -angle; 165 angle -= 180.0 * (int)(angle / 180.0); 166 162 167 float tempAspect; 163 if (angle > 89.0 && angle < 91.0 || angle > 269 && angle < 271)168 if (angle > 89.0 && angle < 91.0) 164 169 tempAspect = 1.0 / this->windowAspectRatio_; 165 else if (angle > 359 && angle < 1 || angle > 179 && angle < 181)170 else if (angle > 179 || angle < 1) 166 171 tempAspect = this->windowAspectRatio_; 167 172 else -
code/branches/hud/src/orxonox/overlays/hud/HUDBar.cc
r1616 r1618 43 43 namespace orxonox 44 44 { 45 CreateFactory(BarColour); 46 47 BarColour::BarColour() 48 : position_(0.0) 49 { 50 RegisterObject(BarColour); 51 } 52 53 void BarColour::XMLPort(Element& xmlElement, XMLPort::Mode mode) 54 { 55 BaseObject::XMLPort(xmlElement, mode); 56 57 XMLPortParam(BarColour, "colour", setColour, getColour, xmlElement, mode); 58 XMLPortParam(BarColour, "position", setPosition, getPosition, xmlElement, mode); 59 } 60 61 45 62 unsigned int HUDBar::materialcount_s = 0; 46 63 … … 87 104 this->autoColour_ = true; 88 105 this->right2Left_ = false; // default is left to right progress 89 90 this->addColour(0.7, ColourValue(0.2, 0.7, 0.2));91 this->addColour(0.4, ColourValue(0.7, 0.5, 0.2));92 this->addColour(0.1, ColourValue(0.7, 0.2, 0.2));93 106 } 94 107 95 108 XMLPortParamLoadOnly(HUDBar, "value", setValue, xmlElement, mode); 109 XMLPortParam(HUDBar, "right2left", setRightToLeft, getRightToLeft, xmlElement, mode); 110 XMLPortObject(HUDBar, BarColour, "", addColour, getColour, xmlElement, mode, false, true); 96 111 } 97 112 … … 154 169 } 155 170 156 void HUDBar::addColour( float value, const ColourValue&colour)171 void HUDBar::addColour(BarColour* colour) 157 172 { 158 value = clamp<float>(value, 0, 1); 159 this->colours_[value] = colour; 173 float value = clamp<float>(colour->getPosition(), 0.0, 1.0); 174 this->colours_[value] = colour->getColour(); 175 176 this->barColours_.push_back(colour); 177 } 178 179 BarColour* HUDBar::getColour(unsigned int index) 180 { 181 if (index < this->barColours_.size()) 182 return barColours_[index]; 183 else 184 return 0; 160 185 } 161 186 -
code/branches/hud/src/orxonox/overlays/hud/HUDBar.h
r1615 r1618 41 41 namespace orxonox 42 42 { 43 class _OrxonoxExport BarColour : public BaseObject 44 { 45 public: 46 BarColour(); 47 ~BarColour() { } 48 49 void XMLPort(Element& xmlElement, XMLPort::Mode mode); 50 51 void setColour(const ColourValue& colour) { this->colour_ = colour; } 52 const ColourValue& getColour() const { return this->colour_; } 53 54 void setPosition(float pos) { this->position_ = pos; } 55 float getPosition() const { return this->position_; } 56 57 private: 58 ColourValue colour_; 59 float position_; 60 }; 61 43 62 class _OrxonoxExport HUDBar : public OrxonoxOverlay 44 63 { … … 50 69 51 70 virtual void setValue(float value); 52 void addColour(float value, const ColourValue& colour);53 71 void clearColours(); 54 72 … … 61 79 62 80 private: 81 void addColour(BarColour* colour); 82 BarColour* getColour(unsigned int index); 83 63 84 bool right2Left_; 64 85 bool autoColour_; //!< whether bar changes colour automatically … … 68 89 Ogre::TextureUnitState* textureUnitState_; 69 90 std::map<float, ColourValue> colours_; 91 std::vector<BarColour*> barColours_; 70 92 71 93 float barWidth_s; -
code/branches/hud/src/tinyxml/ticpp.cc
r1505 r1618 23 23 */ 24 24 25 /* 26 Modifications by the orxonox team: 27 In function: void Document::Parse( const std::string& xml, bool throwIfParseError, TiXmlEncoding encoding ) 28 change: Added row and column number to the error description. 29 author: Reto Grieder 30 */ 31 25 32 #ifdef TIXML_USE_TICPP 26 33 … … 853 860 if( throwIfParseError && m_tiXmlPointer->Error() ) 854 861 { 855 TICPPTHROW( "Error parsing xml: " << m_tiXmlPointer->ErrorDesc() ); 862 TICPPTHROW( "Error parsing xml: " << m_tiXmlPointer->ErrorDesc() 863 << " In row " << m_tiXmlPointer->ErrorRow() << ", column " << m_tiXmlPointer->ErrorCol() << "."); 856 864 } 857 865 } -
code/branches/hud/src/util/Convert.h
r1595 r1618 668 668 669 669 SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0'); 670 if (tokens.size() >= 4)670 if (tokens.size() >= 3) 671 671 { 672 672 if (!ConvertValue(&(output->r), tokens[0])) … … 676 676 if (!ConvertValue(&(output->b), tokens[2])) 677 677 return false; 678 if (!ConvertValue(&(output->a), tokens[3])) 679 return false; 678 if (tokens.size() >= 4) 679 { 680 if (!ConvertValue(&(output->a), tokens[3])) 681 return false; 682 } 683 else 684 output->a = 1.0; 680 685 681 686 return true;
Note: See TracChangeset
for help on using the changeset viewer.