Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2010, 3:48:24 PM (15 years ago)
Author:
kolibri7
Message:

implementing the XMLPort function for LoD; getting some erreors from gcc…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/lod/src/orxonox/Level.cc

    r6417 r6691  
    3232#include "core/CoreIncludes.h"
    3333#include "core/Loader.h"
    34 #include "core/Template.h"
     34#include "core/template.h"
    3535#include "core/XMLFile.h"
    3636#include "core/XMLPort.h"
     
    7373        XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
    7474
    75         XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
    76     }
     75        XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);           
     76        XMLPortObject(Level, MeshLodInformation, "lodinformation", addLodInfo, getLodInfo, xmlelement, mode);
     77}
    7778
    7879    void Level::registerVariables()
     
    138139        return 0;
    139140    }
     141   
     142    //LoD
     143    void Level::addLodInfo(const MeshLodInformation* lodInformation)
     144    {
     145//              std::pair<std::map<std::string,MeshLodInformation*>::iterator,bool> it
     146//                  = new std::pair<lodInformation->getMeshName(),lodInformation>;
     147        this->lodInformation_.insert(std::pair<lodInformation->getMeshName(),lodInformation>);
     148    }
     149
     150    MeshLodInformation* Level::getLodInfo(string meshName) const
     151    {
     152        if(this->lodInformation_.find(meshName)!=std::map::end)
     153            return this->lodInformation_.find(meshName);
     154       
     155        return 0;
     156       
     157       
     158        /*
     159        unsigned int i = 0;
     160        for (std::map<MeshLodInformation*>::const_iterator it = this->lodInformation_.begin(); it != this->lodInformation_.end(); ++it)
     161        {
     162            if (i == index)
     163                return (*it);
     164            ++i;
     165        }
     166        return 0;*/
     167    }
    140168
    141169    void Level::playerEntered(PlayerInfo* player)
Note: See TracChangeset for help on using the changeset viewer.