Changeset 8435 in orxonox.OLD for branches/gui/src/lib/gui/gl/glgui_widget.cc
- Timestamp:
- Jun 15, 2006, 1:16:13 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl/glgui_widget.cc
r8425 r8435 45 45 if (this == GLGuiWidget::_focused) 46 46 GLGuiWidget::_focused = NULL; 47 48 if (this->_toFrontColor) 49 delete this->_toFrontColor; 47 50 } 48 51 … … 69 72 this->_backMat.setDiffuseMap("gui_element_background.png"); 70 73 this->_frontColor.setColor(1.0, 0.0, 0.0); 74 _toFrontColor = NULL; 75 71 76 72 77 this->_borderLeft = 15.0; … … 116 121 } 117 122 123 void GLGuiWidget::setFrontColor(const Color& frontColor) 124 { 125 if (!this->_toFrontColor) 126 this->_toFrontColor = new Color(frontColor); 127 else 128 *this->_toFrontColor = frontColor; 129 //this->_frontColor = frontColor; 130 //this->updateFrontColor(); 131 }; 132 118 133 119 134 void GLGuiWidget::setBorderSize(float borderSize) … … 243 258 } 244 259 260 void GLGuiWidget::tick(float dt) 261 { 262 if (this->_toFrontColor) 263 { 264 this->_frontColor.slerp(*_toFrontColor, dt*3.0); 265 this->updateFrontColor(); 266 if (this->_frontColor.dist(*_toFrontColor) < .1) 267 { 268 delete _toFrontColor; 269 _toFrontColor = NULL; 270 } 271 } 272 } 273 245 274 246 275 /**
Note: See TracChangeset
for help on using the changeset viewer.