Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2007, 1:53:58 PM (18 years ago)
Author:
gfilip
Message:

hm…..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/camera/src/world_entities/blackscreen.cc

    r10238 r10254  
    5050  if( root != NULL)
    5151    this->loadParams(root);
    52   i=0.5;
    53   state=0;
     52
    5453}
    5554
     
    7271  this->material = new Material();
    7372  this->material->setIllum(3);
    74   this->material->setDiffuse(1.0,1.0,1.0);
     73  this->material->setDiffuse(0,0,0);
    7574  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;
    7780
    7881}
     
    146149void blackscreen::tick (float time)
    147150{
    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();
     153else
     154  fadeIn();*/
    152155}
    153156
     157void blackscreen::fadeIn()
     158{
     159  if (i>0)
     160    i=i-0.005*fadeSpeed;
     161}
    154162
    155 void  blackscreen::changeState (bool sta)
     163void blackscreen::fadeOut()
    156164{
    157   state=sta;
     165  if (i<=1)
     166    i=i+0.005*fadeSpeed;
    158167}
     168
     169void  blackscreen::toggleFade ()
     170{
     171  state=!state;
     172}
     173
     174void blackscreen::changeFadeSpeed(float newSpeed)
     175{
     176  fadeSpeed=newSpeed;
     177}
     178
Note: See TracChangeset for help on using the changeset viewer.