- Timestamp:
- May 18, 2006, 3:15:46 PM (19 years ago)
- Location:
- branches/water/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/water/src/story_entities/game_world.cc
r7460 r7686 33 33 #include "terrain.h" 34 34 #include "playable.h" 35 #include "mapped_water.h" 35 36 36 37 #include "light.h" … … 445 446 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 446 447 // draw world 447 this->draw(); 448 // this->draw(); 449 450 // render the reflection texture 451 this->renderPassReflection(); 452 // redner the refraction texture 453 this->renderPassRefraction(); 454 // render all 455 this->renderPassAll(); 456 448 457 // flip buffers 449 458 GraphicsEngine::swapBuffers(); … … 463 472 } 464 473 465 /** 466 * @brief runs through all entities calling their draw() methods 467 */ 468 void GameWorld::draw () 474 475 void GameWorld::renderPassReflection() 476 { 477 478 const std::list<BaseObject*>* reflectedWaters; 479 MappedWater* mw; 480 481 if( reflectedWaters = ClassList::getList(CL_MAPPED_WATER) != NULL) 482 { 483 std::list<BaseObject*>::const_iterator it; 484 for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++) 485 { 486 mw = dynamic_cast<MappedWater*>(*it); 487 488 // prepare for reflection rendering 489 mw->activateReflection(); 490 491 // draw everything to be included in the reflection 492 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 493 this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i])); 494 495 // clean up from reflection rendering 496 mw->deactivateReflection(); 497 } 498 } 499 500 } 501 502 void GameWorld::renderPassRefraction() 503 {} 504 505 void GameWorld::renderPassAll() 469 506 { 470 507 GraphicsEngine* engine = GraphicsEngine::getInstance(); … … 477 514 /* draw all WorldEntiy groups */ 478 515 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 479 this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));516 this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i])); 480 517 481 518 … … 495 532 if( likely(this->dataTank->gameRule != NULL)) 496 533 this->dataTank->gameRule->draw(); 534 } 535 536 537 /** 538 * @brief runs through all entities calling their draw() methods 539 */ 540 void GameWorld::draw () 541 { 542 497 543 } 498 544 -
branches/water/src/story_entities/game_world.h
r7391 r7686 71 71 72 72 void drawEntityList(const ObjectManager::EntityList& drawList ) const; 73 virtual void renderPassReflection(); 74 virtual void renderPassRefraction(); 75 virtual void renderPassAll(); 73 76 virtual void draw(); 77 74 78 virtual void display(); 75 79 -
branches/water/src/util/object_manager.h
r7368 r7686 19 19 OM_ENVIRON, 20 20 OM_COMMON, 21 22 OM_REFLECTION, //!< list of all object that need to be drawn in the reflection image 21 23 22 24 OM_GROUP_00,
Note: See TracChangeset
for help on using the changeset viewer.