Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7221 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Mar 15, 2006, 3:10:45 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the std-branche back, it runs on windows and Linux

svn merge https://svn.orxonox.net/orxonox/branches/std . -r7202:HEAD

Location:
trunk/src/util
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/Makefile.am

    r7193 r7221  
    1515                        animation/animation_player.cc \
    1616                        \
    17                         track/pilot_node.cc \
    18                         track/track_manager.cc \
     17                        track/pilot_node.cc
     18
     19#                       track/track_manager.cc \
    1920                        track/track_node.cc
    2021
     
    3132                        animation/t_animation.h \
    3233                        \
    33                         track/pilot_node.h \
    34                         track/track_manager.h \
     34                        track/pilot_node.h
     35
     36#                       track/track_manager.h \
    3537                        track/track_node.h
  • trunk/src/util/fast_factory.cc

    r5750 r7221  
    2929 * @return a new FastFactory
    3030 */
    31 FastFactory::FastFactory (ClassID classID, const char* fastFactoryName)
     31FastFactory::FastFactory (ClassID classID, const std::string& fastFactoryName)
    3232{
    3333  this->setClassID(CL_FAST_FACTORY, "FastFactory");
     
    119119 * @returns true if found, false otherwise.
    120120 */
    121 FastFactory* FastFactory::searchFastFactory(const char* fastFactoryName)
     121FastFactory* FastFactory::searchFastFactory(const std::string& fastFactoryName)
    122122{
    123123  if (FastFactory::first == NULL)
     
    128128    while (tmpFac != NULL)
    129129    {
    130       if (strcmp(tmpFac->getName(), fastFactoryName))
     130      if (fastFactoryName == tmpFac->getName())
    131131        return tmpFac;
    132132      tmpFac = tmpFac->next;
  • trunk/src/util/fast_factory.h

    r5447 r7221  
    8080
    8181    static FastFactory* searchFastFactory(ClassID classID);
    82     static FastFactory* searchFastFactory(const char* fastFactoryName);
     82    static FastFactory* searchFastFactory(const std::string& fastFactoryName);
    8383
    8484    ClassID getStoredID() const { return this->storedClassID; };
    8585
    8686  protected:
    87     FastFactory (ClassID classID, const char* fastFactoryName = NULL);
     87    FastFactory (ClassID classID, const std::string& fastFactoryName = "");
    8888
    8989    /** sets the Next factory in the list @param nextFactory the next factory */
     
    121121  {
    122122  public:
    123     static tFastFactory<T>* getFastFactory(ClassID classID, const char* fastFactoryName = NULL);
     123    static tFastFactory<T>* getFastFactory(ClassID classID, const std::string& fastFactoryName = NULL);
    124124
    125125  private:
    126     tFastFactory(ClassID classID, const char* fastFactoryName);
     126    tFastFactory(ClassID classID, const std::string& fastFactoryName);
    127127
    128128    virtual void fabricate();
     
    136136 */
    137137template<class T>
    138 tFastFactory<T>::tFastFactory(ClassID classID, const char* fastFactoryName)
     138tFastFactory<T>::tFastFactory(ClassID classID, const std::string& fastFactoryName)
    139139    : FastFactory(classID, fastFactoryName)
    140140{}
     
    147147 */
    148148template<class T>
    149 tFastFactory<T>* tFastFactory<T>::getFastFactory(ClassID classID, const char* fastFactoryName)
     149    tFastFactory<T>* tFastFactory<T>::getFastFactory(ClassID classID, const std::string& fastFactoryName)
    150150{
    151151  tFastFactory<T>* tmpFac = NULL;
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r7193 r7221  
    9292
    9393
    94 void MultiplayerTeamDeathmatch::setDeathScreen(const char* imageName)
     94void MultiplayerTeamDeathmatch::setDeathScreen(const std::string& imageName)
    9595{
    9696  if( this->deathScreen)
  • trunk/src/util/multiplayer_team_deathmatch.h

    r7044 r7221  
    3838    inline void setDeathPenaltyTimeout(float time) { this->deathTimeout = time; }
    3939    inline void setMaxKills(int kills) { this->maxKills = kills; }
    40     void setDeathScreen(const char* imageName);
     40    void setDeathScreen(const std::string& imageName);
    4141
    4242  protected:
  • trunk/src/util/object_manager.cc

    r7198 r7221  
    9797 * this function also does a transformation from omList as char* to OM_LIST.
    9898 */
    99 void ObjectManager::toList (WorldEntity* entity, const char* omList)
     99void ObjectManager::toList (WorldEntity* entity, const std::string& omList)
    100100{
    101101  this->toList(entity, ObjectManager::StringToOMList(omList));
     
    153153 * @param level: level 0: only show list info; level 1: also show entities and their names.
    154154 */
    155 void ObjectManager::debug(const char* listName, unsigned int level)
     155void ObjectManager::debug(const std::string& listName, unsigned int level)
    156156{
    157157  PRINT(0)("=================================\n");
    158158  PRINT(0)("=ObjectManager-DEBUG=============\n");
    159159  PRINT(0)("=================================\n");
    160   if (listName == NULL || listName[0] == '\0')
     160  if (listName.empty())
    161161    for (unsigned int i = 0; i < OM_SIZE; ++i)
    162162      debug((OM_LIST) i, level);
     
    189189 * @returns the OM_LIST transformed from listName. or the default, if not found or NULL.
    190190 */
    191 OM_LIST ObjectManager::StringToOMList(const char* listName)
    192 {
    193   if (unlikely(listName == NULL)) return OM_DEFAULT_LIST;
     191OM_LIST ObjectManager::StringToOMList(const std::string& listName)
     192{
     193  if (unlikely(listName.empty())) return OM_DEFAULT_LIST;
    194194
    195195  for(unsigned int i = 0; i < OM_SIZE; ++i) {
    196     if(!strcmp(listName, ObjectManager::objectManagerListNames[i])) {
     196    if(listName == ObjectManager::objectManagerListNames[i]) {
    197197      return (OM_LIST)i;
    198198    }
  • trunk/src/util/object_manager.h

    r6142 r7221  
    7676
    7777  void toList (WorldEntity* entity, OM_LIST omList = OM_DEFAULT_LIST);
    78   void toList (WorldEntity* entity, const char* omList);
     78  void toList (WorldEntity* entity, const std::string& omList);
    7979
    8080
     
    8585
    8686  void debug(OM_LIST omList, unsigned int level = 0) const;
    87   void debug(const char* listName = NULL, unsigned int level = 0);
     87  void debug(const std::string& listName = "", unsigned int level = 0);
    8888
    89   static OM_LIST StringToOMList(const char* listName);
     89  static OM_LIST StringToOMList(const std::string& listName);
    9090  static const char* OMListToString(OM_LIST omList);
    9191
  • trunk/src/util/track/track_manager.cc

    r7193 r7221  
    123123 * @returns The TrackElement if Found, NULL otherwise.
    124124*/
    125 TrackElement* TrackElement::findByName(const char* trackName)
     125TrackElement* TrackElement::findByName(const std::string& trackName)
    126126{
    127127  // return if Found.
     
    532532 * @param trackName the Name of the Track to work on
    533533*/
    534 void TrackManager::workOnS(const char* trackName)
     534void TrackManager::workOnS(const std::string& trackName)
    535535{
    536536  TrackElement* tmpElem = this->firstTrackElem->findByName(trackName);
     
    657657   @todo this must be better
    658658*/
    659 void TrackManager::setSavePointS(const char* nextElementName)
     659void TrackManager::setSavePointS(const std::string& nextElementName)
    660660{
    661661  this->setSavePoint(NULL);
     
    725725  for(int i = 0; i < count; i++)
    726726    {
    727       this->firstTrackElem->findByID(trackIDs[i])->setName(va_arg(name, const char*));
     727      this->firstTrackElem->findByID(trackIDs[i])->setName(va_arg(name, const std::string&));
    728728    }
    729729  va_end(name);
     
    734734   \see TrackManager::fork(unsigned int count, ...)
    735735*/
    736 void TrackManager::forkS(const char* forkString)
     736void TrackManager::forkS(const std::string& forkString)
    737737{
    738738  SubString strings(forkString, ',');
     
    860860  for(int i = 0; i < count; i++)
    861861    {
    862       const char* name = va_arg (NAME, char*);
     862      const std::string& name = va_arg (NAME, char*);
    863863      TrackElement* tmpElem = this->firstTrackElem->findByName(name);
    864864      if (tmpElem)
     
    875875   \see void TrackManager::join(unsigned int count, ...)
    876876*/
    877 void TrackManager::joinS(const char* joinString)
     877void TrackManager::joinS(const std::string& joinString)
    878878{
    879879  SubString strings(joinString, ',');
     
    884884  for(unsigned int i = 0; i < strings.getCount(); i++)
    885885    {
    886       TrackElement* tmpElem = this->firstTrackElem->findByName(strings.getString(i));
     886      TrackElement* tmpElem = this->firstTrackElem->findByName(strings.getString(i).c_str());
    887887      if (tmpElem != NULL)
    888888        trackIDs[i] = tmpElem->ID;
    889889      else
    890890      {
    891         PRINTF(1)("Trying to join a Track, of which the name does not exist: %s\n", strings.getString(i));
     891        PRINTF(1)("Trying to join a Track, of which the name does not exist: %s\n", strings.getString(i).c_str());
    892892        trackIDs[i] = -1;
    893893      }
  • trunk/src/util/track/track_manager.h

    r7130 r7221  
    4646
    4747  TrackElement* findByID(unsigned int trackID);
    48   TrackElement* findByName(const char* trackName);
     48  TrackElement* findByName(const std::string& trackName);
    4949  bool backLoopCheck() const;
    5050
     
    142142  // Methods to change the Path (initialisation)
    143143  void workOn(unsigned int trackID);
    144   void workOnS(const char* trackName);
     144  void workOnS(const std::string& trackName);
    145145
    146146  /** \see setCurveType(CurveType curveType, TrackElement* trackElem); @param curveType the type of the Curve */
     
    153153  void addHotPoint(float x, float y, float z);
    154154  int addHotPointV(Vector newPoint, TrackElement* trackElem = NULL);
    155   void setSavePointS(const char* nextElementName);
     155  void setSavePointS(const std::string& nextElementName);
    156156  void setSavePoint(TrackElement* trackElem = NULL);
    157157  void fork(unsigned int count, ...);
    158158  void forkS(unsigned int count, ...);
    159   void forkS(const char* forkString);
     159  void forkS(const std::string& forkString);
    160160  void forkV(unsigned int count, int* trackIDs, char** trackNames, TrackElement* trackElem = NULL);
    161161  void condition(unsigned int trackID, CONDITION cond, void* subject);
    162162  void condition(CONDITION cond, void* subject, TrackElement* trackElem = NULL);
    163163  void join(unsigned int count, ...);
    164   void joinS(const char* joinString);
     164  void joinS(const std::string& joinString);
    165165  void joinS(unsigned int cound, ...);
    166166  void joinV(unsigned int count, int* trackIDs);
Note: See TracChangeset for help on using the changeset viewer.