Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 27, 2006, 10:15:46 AM (18 years ago)
Author:
patrick
Message:

network: lense flare work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/graphics/effects/lense_flare.cc

    r6783 r6785  
    4141  if (root != NULL)
    4242    this->loadParams(root);
     43
     44  this->flareVector = new Vector();
     45  this->screenCenter = new Vector();
    4346}
    4447
     
    5255  for( it = flares.begin(); it != flares.end(); it++)
    5356    delete (*it);
     57
     58  delete this-flareVector;
     59  delete this->screenCenter;
    5460}
    5561
     
    104110 * @param textureName the name of the flare texture
    105111 *
    106  *  1st Flare: Texture of the Sun/Light source itself
    107  *  2nd Flare: Texture of the
     112 *  1st: Texture of the Sun/Light source itself
     113 *  2nd: Texture of the fist halo
     114 *  3rd: Texture of small burst
     115 *  4th: Texture of the second halo
     116 *  5th: Texutre of the second burst
     117 *  6th: Texture of the third halo
     118 *  7th: Texture of the third burst
    108119 */
    109120void LenseFlare::addFlare(const char* textureName)
     
    112123  bb->setTexture(textureName);
    113124  this->flares.push_back(bb);
     125
     126  // the first flare belongs to the light source
     127  if( this->flares.size() == 1 && this->lightSource != NULL)
     128  {
     129    bb->setBindNode(this->lightSource);
     130  }
     131}
     132
     133
     134
     135/**
     136 * tick the effect
     137 */
     138void LenseFlare::tick(float dt)
     139{
     140
    114141}
    115142
     
    123150    return;
    124151
    125 
     152  for( it = flares.begin(); it != flares.end(); it++)
     153    (*it)->draw();
    126154}
Note: See TracChangeset for help on using the changeset viewer.