Changeset 6884 in orxonox.OLD for trunk/src/lib/graphics/effects
- Timestamp:
- Jan 31, 2006, 3:28:26 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/effects/lense_flare.cc
r6815 r6884 29 29 30 30 #include "render2D/billboard.h" 31 32 #include "light.h" 31 33 32 34 using namespace std; … … 54 56 this->flareMatrix[10] = -0.25f; this->flareMatrix[11] = 0.25f; 55 57 this->flareMatrix[12] = 1.82f; this->flareMatrix[13] = 0.25f; 58 59 this->lightSource = (LightManager::getInstance())->getLight(0); 56 60 } 57 61 … … 127 131 void LenseFlare::addFlare(const char* textureName) 128 132 { 129 if( this->flares.size() <LF_MAX_FLARES)133 if( this->flares.size() > LF_MAX_FLARES) 130 134 { 131 135 PRINTF(2)("You tried to add more than %i lense flares, ignoring\n", LF_MAX_FLARES); … … 154 158 if( unlikely(!this->bActivated || this->flares.size() == 0)) 155 159 return; 160 161 if( unlikely( this->lightSource == NULL)) 162 this->lightSource = (LightManager::getInstance())->getLight(0); 163 else 164 this->lightSource->debug(); 165 156 166 // always update the screen center, it could be, that the window is resized 157 167 this->screenCenter = Vector(State::getResX()/2.0f, State::getResY()/2.0f, 0.0f); … … 160 170 this->distance = this->flareVector.len(); 161 171 this->flareVector.normalize(); 172 173 PRINTF(0)("Debug: screenCenter: %f, %f - flareVec: %f, %f\n", screenCenter.x, screenCenter.y, flareVector.x, flareVector.y); 162 174 163 175 // now calculate the new coordinates of the billboards … … 168 180 // set the new position 169 181 (*it)->setAbsCoor2D(this->flareVector * this->flareMatrix[i * 2]); 170 PRINTF(0)(" Drawing flare %i @ (%f, %f)\n", i, (this->flareVector * this->flareMatrix[i * 2]).x, (this->flareVector * this->flareMatrix[i * 2]).y);182 PRINTF(0)("Tick flare %i @ (%f, %f)\n", i, (*it)->getAbsCoor2D().x, (*it)->getAbsCoor2D().y); 171 183 // tick them 172 184 (*it)->tick(dt);
Note: See TracChangeset
for help on using the changeset viewer.