[Orxonox-commit 3351] r8039 - in code/branches/usability: data/levels src/orxonox

dafrick at orxonox.net dafrick at orxonox.net
Mon Mar 7 00:08:27 CET 2011


Author: dafrick
Date: 2011-03-07 00:08:27 +0100 (Mon, 07 Mar 2011)
New Revision: 8039

Modified:
   code/branches/usability/data/levels/presentationFS102.oxw
   code/branches/usability/data/levels/presentationFS10Ed.oxw
   code/branches/usability/src/orxonox/LevelManager.cc
Log:
Adding warning for levels with same names.


Modified: code/branches/usability/data/levels/presentationFS102.oxw
===================================================================
--- code/branches/usability/data/levels/presentationFS102.oxw	2011-03-06 22:31:09 UTC (rev 8038)
+++ code/branches/usability/data/levels/presentationFS102.oxw	2011-03-06 23:08:27 UTC (rev 8039)
@@ -1,5 +1,5 @@
 <LevelInfo
- name = "Presentation XI FPS"
+ name = "Presentation XI FPS 1st"
  description = "2nd Presentation level for Orxonox Convention XI, FPS"
  tags = "presentation"
 />

Modified: code/branches/usability/data/levels/presentationFS10Ed.oxw
===================================================================
--- code/branches/usability/data/levels/presentationFS10Ed.oxw	2011-03-06 22:31:09 UTC (rev 8038)
+++ code/branches/usability/data/levels/presentationFS10Ed.oxw	2011-03-06 23:08:27 UTC (rev 8039)
@@ -1,5 +1,5 @@
 <LevelInfo
- name = "Presentation XI FPS"
+ name = "Presentation XI FPS 2nd"
  description = "3rd Presentation level for Orxonox Convention XI, FPS"
  tags = "presentation"
 />

Modified: code/branches/usability/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/usability/src/orxonox/LevelManager.cc	2011-03-06 22:31:09 UTC (rev 8038)
+++ code/branches/usability/src/orxonox/LevelManager.cc	2011-03-06 23:08:27 UTC (rev 8039)
@@ -250,6 +250,7 @@
 
         // Iterate over all the found *.oxw files
         COUT(3) << "Loading LevelInfos..." << std::endl;
+        std::set<std::string> names;
         for (Ogre::StringVector::const_iterator it = levels->begin(); it != levels->end(); ++it)
         {
             // TODO: Replace with tag?
@@ -276,10 +277,14 @@
                     info = new LevelInfoItem(filenameWOExtension, *it);
                 }
 
+                // Warn about levels with the same name.
+                if(!names.insert(info->getName()).second)
+                    COUT(2) << "Warning: Multiple levels (" << info->getXMLFilename() << ") with name '" << info->getName() << "' found!" << std::endl;
+
                 // Warn about multiple items so that it gets fixed quickly
                 if(availableLevels_.find(info) != availableLevels_.end())
                 {
-                    COUT(2) << "Warning: Multiple levels with name '" << info->getName() << "' found!" << std::endl;
+                    COUT(2) << "Warning: Multiple levels (" << info->getXMLFilename() << ") with same name '" << info->getName() << "' and filename found! Exluding..." << std::endl;
                     // Delete LevelInfoItem to avoid a dangling pointer
                     delete info;
                 }




More information about the Orxonox-commit mailing list