- Timestamp:
- Jan 31, 2006, 3:28:26 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 4 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); -
trunk/src/lib/graphics/graphics_engine.cc
r6815 r6884 38 38 #include "effects/graphics_effect.h" 39 39 #include "effects/fog_effect.h" 40 #include "effects/lense_flare.h" 40 41 41 42 #include "shell_command.h" … … 171 172 // fe->activate(); 172 173 // PRINTF(0)("--------------------------------------------------------------\n"); 174 175 LenseFlare* ge = new LenseFlare(); 176 this->loadGraphicsEffect(ge); 177 178 ge->addFlare("pictures/lense_flares/lens1.jpg"); 179 ge->addFlare("pictures/lense_flares/lens2.jpg"); 180 ge->addFlare("pictures/lense_flares/lens3.jpg"); 181 ge->addFlare("pictures/lense_flares/lens4.jpg"); 182 183 184 ge->activate(); 173 185 } 174 186 … … 610 622 Shader::restoreShader(); 611 623 612 //draw the graphics 624 //draw the graphics effects 613 625 list<GraphicsEffect*>::const_iterator it; 614 626 for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++) -
trunk/src/lib/graphics/light.cc
r6778 r6884 337 337 } 338 338 339 340 Light* LightManager::getLight(int lightNumber) const 341 { 342 if( lightNumber < NUMBEROFLIGHTS) 343 return this->lights[lightNumber]; 344 345 return NULL; 346 } 347 339 348 /** 340 349 * draws all the Lights in their appropriate position -
trunk/src/story_entities/simple_game_menu.cc
r6883 r6884 230 230 ie->setBindNode((const PNode*)NULL); 231 231 ie->setRelCoor2D(State::getResX() / 2.0f + 250.0f, State::getResY() / 2.0f, 0.0f); 232 ie->setSize2D(1 00.0f, 75.0f);232 ie->setSize2D(140.0f, 105.0f); 233 233 this->menuLayer[1]->screenshootList.push_back(ie); 234 234 }
Note: See TracChangeset
for help on using the changeset viewer.