Changeset 9709 in orxonox.OLD for branches/new_class_id/src/story_entities/game_world.cc
- Timestamp:
- Aug 31, 2006, 10:51:08 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/story_entities/game_world.cc
r9494 r9709 22 22 #include "util/loading/resource_manager.h" 23 23 #include "state.h" 24 #include "class_list.h"25 24 26 25 #include "util/loading/game_loader.h" … … 40 39 #include "util/loading/factory.h" 41 40 #include "util/loading/load_param.h" 42 #include " fast_factory.h"41 #include "loading/fast_factory.h" 43 42 #include "shell_command.h" 44 43 … … 63 62 64 63 #include "script_class.h" 65 CREATE_SCRIPTABLE_CLASS(GameWorld, CL_GAME_WORLD, 64 NewObjectListDefinition(GameWorld); 65 CREATE_SCRIPTABLE_CLASS(GameWorld, GameWorld::classID(), 66 66 addMethod("setPlaymode", ExecutorLua1<GameWorld,const std::string&>(&GameWorld::setPlaymode)) 67 67 ->addMethod("setSoundtrack", ExecutorLua1<GameWorld, const std::string&>(&GameWorld::setSoundtrack)) … … 77 77 78 78 79 80 79 GameWorld::GameWorld() 81 80 : StoryEntity() 82 81 { 83 this-> setClassID(CL_GAME_WORLD, "GameWorld");82 this->registerObject(this, GameWorld::_objectList); 84 83 this->setName("Preloaded World - no name yet"); 85 84 … … 432 431 // TICK everything 433 432 for (i = 0; i < this->dataTank->tickLists.size(); ++i) 434 this->tick(this->dataTank->objectManager->get ObjectList(this->dataTank->tickLists[i]), this->dtS);433 this->tick(this->dataTank->objectManager->getEntityList(this->dataTank->tickLists[i]), this->dtS); 435 434 436 435 /* update tick the rest */ … … 471 470 { 472 471 // object-object collision detection 473 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_00),474 this->dataTank->objectManager->get ObjectList(OM_GROUP_01_PROJ));475 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),476 this->dataTank->objectManager->get ObjectList(OM_GROUP_00_PROJ));477 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),478 this->dataTank->objectManager->get ObjectList(OM_GROUP_00));479 480 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),481 this->dataTank->objectManager->get ObjectList(OM_GROUP_02));482 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_02),483 this->dataTank->objectManager->get ObjectList(OM_GROUP_01_PROJ));484 485 486 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_00),487 this->dataTank->objectManager->get ObjectList(OM_COMMON));488 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),489 this->dataTank->objectManager->get ObjectList(OM_COMMON));472 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00), 473 this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ)); 474 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01), 475 this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ)); 476 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01), 477 this->dataTank->objectManager->getEntityList(OM_GROUP_00)); 478 479 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01), 480 this->dataTank->objectManager->getEntityList(OM_GROUP_02)); 481 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_02), 482 this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ)); 483 484 485 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00), 486 this->dataTank->objectManager->getEntityList(OM_COMMON)); 487 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01), 488 this->dataTank->objectManager->getEntityList(OM_COMMON)); 490 489 491 490 // ground collision detection: BSP Model 492 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->get ObjectList(OM_GROUP_00));493 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->get ObjectList(OM_GROUP_01));491 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00)); 492 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01)); 494 493 } 495 494 … … 567 566 // glLoadIdentity(); 568 567 569 const std::list<BaseObject*>* reflectedWaters;570 568 MappedWater* mw; 571 569 572 if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL) 573 { 574 std::list<BaseObject*>::const_iterator it; 575 for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++) 576 { 577 mw = dynamic_cast<MappedWater*>(*it); 578 579 //camera and light 580 //this->dataTank->localCamera->apply (); 581 //this->dataTank->localCamera->project (); 582 583 LightManager::getInstance()->draw(); 584 585 586 // prepare for reflection rendering 587 mw->activateReflection(); 588 589 // draw everything to be included in the reflection 590 this->drawEntityList(State::getObjectManager()->getReflectionList()); 591 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 592 // this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i])); 593 594 // clean up from reflection rendering 595 mw->deactivateReflection(); 596 } 570 for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin(); 571 it != MappedWater::objectList().end(); 572 ++it) 573 { 574 mw = (*it); 575 576 //camera and light 577 //this->dataTank->localCamera->apply (); 578 //this->dataTank->localCamera->project (); 579 580 LightManager::getInstance()->draw(); 581 582 583 // prepare for reflection rendering 584 mw->activateReflection(); 585 586 // draw everything to be included in the reflection 587 this->drawEntityList(State::getObjectManager()->getReflectionList()); 588 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 589 // this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i])); 590 591 // clean up from reflection rendering 592 mw->deactivateReflection(); 597 593 } 598 594 … … 609 605 //glLoadIdentity(); 610 606 611 const std::list<BaseObject*>* reflectedWaters;612 607 MappedWater* mw; 613 608 614 if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL) 615 { 616 std::list<BaseObject*>::const_iterator it; 617 for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++) 618 { 619 mw = dynamic_cast<MappedWater*>(*it); 620 621 //camera and light 622 //this->dataTank->localCamera->apply (); 623 //this->dataTank->localCamera->project (); 624 // prepare for reflection rendering 625 mw->activateRefraction(); 626 627 628 LightManager::getInstance()->draw(); 629 // draw everything to be included in the reflection 630 this->drawEntityList(State::getObjectManager()->getReflectionList()); 631 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 632 // this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i])); 633 634 // clean up from reflection rendering 635 mw->deactivateRefraction(); 636 } 609 for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin(); 610 it != MappedWater::objectList().end(); 611 ++it) 612 { 613 mw = dynamic_cast<MappedWater*>(*it); 614 615 //camera and light 616 //this->dataTank->localCamera->apply (); 617 //this->dataTank->localCamera->project (); 618 // prepare for reflection rendering 619 mw->activateRefraction(); 620 621 622 LightManager::getInstance()->draw(); 623 // draw everything to be included in the reflection 624 this->drawEntityList(State::getObjectManager()->getReflectionList()); 625 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 626 // this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i])); 627 628 // clean up from reflection rendering 629 mw->deactivateRefraction(); 637 630 } 638 631 } … … 659 652 { 660 653 /* Draw the BackGround */ 661 this->drawEntityList(State::getObjectManager()->get ObjectList(OM_BACKGROUND));654 this->drawEntityList(State::getObjectManager()->getEntityList(OM_BACKGROUND)); 662 655 engine->drawBackgroundElements(); 663 656 664 657 /* draw all WorldEntiy groups */ 665 658 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 666 this->drawEntityList(State::getObjectManager()->get ObjectList(this->dataTank->drawLists[i]));659 this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i])); 667 660 668 661 AtmosphericEngine::getInstance()->draw(); … … 672 665 CDEngine* engine = CDEngine::getInstance(); 673 666 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 674 engine->drawBV(State::getObjectManager()->get ObjectList(this->dataTank->drawLists[i]), this->showBVLevel);667 engine->drawBV(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]), this->showBVLevel); 675 668 } 676 669
Note: See TracChangeset
for help on using the changeset viewer.