Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 20, 2010, 10:23:22 AM (14 years ago)
Author:
scheusso
Message:

merging lod branch into presentation3 merger branch

Location:
code/branches/presentation3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3

  • code/branches/presentation3/src/orxonox/Level.cc

    r6746 r6926  
    4949        RegisterObject(Level);
    5050
     51       
    5152        this->registerVariables();
    5253        this->xmlfilename_ = this->getFilename();
     
    7273        XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode);
    7374        XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
    74 
     75           
     76        XMLPortObject(Level, MeshLodInformation, "lodinformation", addLodInfo, getLodInfo, xmlelement, mode);
    7577        XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
    76     }
     78}
    7779
    7880    void Level::registerVariables()
     
    125127        this->objects_.push_back(object);
    126128        object->setGametype(this->getGametype());
     129    object->setLevel(this);
    127130    }
    128131
     
    136139            ++i;
    137140        }
     141        return 0;
     142    }
     143   
     144    void Level::addLodInfo(MeshLodInformation* lodInformation)
     145    {
     146        std::string meshName = lodInformation->getMeshName();
     147        this->lodInformation_.insert(std::make_pair(meshName,lodInformation));
     148    }
     149
     150    MeshLodInformation* Level::getLodInfo(std::string meshName) const
     151    {
     152        if(this->lodInformation_.find(meshName)!=this->lodInformation_.end())
     153            return this->lodInformation_.find(meshName)->second;
     154       
    138155        return 0;
    139156    }
Note: See TracChangeset for help on using the changeset viewer.