Changeset 10254 in orxonox.OLD for branches/camera/src/world_entities/blackscreen.cc
- Timestamp:
- Jan 17, 2007, 1:53:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camera/src/world_entities/blackscreen.cc
r10238 r10254 50 50 if( root != NULL) 51 51 this->loadParams(root); 52 i=0.5; 53 state=0; 52 54 53 } 55 54 … … 72 71 this->material = new Material(); 73 72 this->material->setIllum(3); 74 this->material->setDiffuse( 1.0,1.0,1.0);73 this->material->setDiffuse(0,0,0); 75 74 this->material->setSpecular(0.0,0.0,0.0); 76 this->material->setAmbient(1.0, 1.0, 1.0); 75 this->material->setAmbient(0, 0, 0); 76 77 i=0.5; 78 state=0; 79 fadeSpeed=1; 77 80 78 81 } … … 146 149 void blackscreen::tick (float time) 147 150 { 148 if (state==0 && i==1)149 i=0;150 if (state==1 && i<=1) 151 i=i+0.005;151 /*if (state == true) 152 fadeOut(); 153 else 154 fadeIn();*/ 152 155 } 153 156 157 void blackscreen::fadeIn() 158 { 159 if (i>0) 160 i=i-0.005*fadeSpeed; 161 } 154 162 155 void blackscreen::changeState (bool sta)163 void blackscreen::fadeOut() 156 164 { 157 state=sta; 165 if (i<=1) 166 i=i+0.005*fadeSpeed; 158 167 } 168 169 void blackscreen::toggleFade () 170 { 171 state=!state; 172 } 173 174 void blackscreen::changeFadeSpeed(float newSpeed) 175 { 176 fadeSpeed=newSpeed; 177 } 178
Note: See TracChangeset
for help on using the changeset viewer.