Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6785 in orxonox.OLD for branches/network/src/lib


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

network: lense flare work

Location:
branches/network/src/lib/graphics
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/graphics/Makefile.am

    r6782 r6785  
    1616                           effects/fog_effect.cc \
    1717                           effects/lense_flare.cc
     18
    1819
    1920noinst_HEADERS = graphics_engine.h \
  • branches/network/src/lib/graphics/effects/graphics_effect.cc

    r6776 r6785  
    8080void GraphicsEffect::draw() const
    8181{}
     82
     83
     84
     85/**
     86 * ticks the effect if there is any time dependancy
     87 */
     88void GraphicsEffect::tick(float dt)
     89{}
  • branches/network/src/lib/graphics/effects/graphics_effect.h

    r6777 r6785  
    2626
    2727    virtual void draw() const;
     28    virtual void tick(float dt);
    2829
    2930    inline bool isActivated() const { return this->bActivated; }
  • 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}
  • branches/network/src/lib/graphics/effects/lense_flare.h

    r6783 r6785  
    3131
    3232    virtual void draw() const;
     33    virtual void tick(float dt);
    3334
    3435    void addFlare(const char* textureName);
     
    4445
    4546    Vector*                  flareVector;        //!< the axis to draw the flares on
     47    Vector*                  screenCenter;       //!< the vector marking the center of the screen
    4648};
    4749
  • branches/network/src/lib/graphics/graphics_engine.cc

    r6777 r6785  
    594594#endif /* NO_TEXT */
    595595
    596 
    597   }
     596  }
     597
    598598  Render2D::getInstance()->tick(dt);
     599
     600  // tick the graphics effects
     601  list<GraphicsEffect*>::iterator it;
     602  for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++)
     603    (*it)->tick(dt);
    599604}
    600605
     
    608613  Render2D::getInstance()->draw(E2D_LAYER_ALL);
    609614  Shader::restoreShader();
     615
     616  //draw the graphics
     617  for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++)
     618    (*it)->draw();
    610619}
    611620
Note: See TracChangeset for help on using the changeset viewer.