[Orxonox-commit 621] r3153 - in branches/pch/src: . orxonox/gui orxonox/tools util

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Jun 13 16:12:45 CEST 2009


Author: rgrieder
Date: 2009-06-13 16:12:45 +0200 (Sat, 13 Jun 2009)
New Revision: 3153

Modified:
   branches/pch/src/OrxonoxConfig.h.in
   branches/pch/src/orxonox/gui/GUIManager.cc
   branches/pch/src/orxonox/gui/GUIManager.h
   branches/pch/src/orxonox/tools/TextureGenerator.cc
   branches/pch/src/orxonox/tools/TextureGenerator.h
   branches/pch/src/util/ExprParser.h
   branches/pch/src/util/OrxAssert.h
   branches/pch/src/util/OutputHandler.h
Log:
Small fixes.

Modified: branches/pch/src/OrxonoxConfig.h.in
===================================================================
--- branches/pch/src/OrxonoxConfig.h.in	2009-06-12 16:47:14 UTC (rev 3152)
+++ branches/pch/src/OrxonoxConfig.h.in	2009-06-13 14:12:45 UTC (rev 3153)
@@ -189,6 +189,11 @@
     typedef basic_string<char, char_traits<char>, allocator<char> > string;
 }
 
+/* Just in case you don't include a standard header */
+#ifndef NULL
+  #define NULL 0
+#endif
+
 /* Visual Leak Detector looks for memory leaks */
 #cmakedefine VISUAL_LEAK_DETECTOR_ENABLE
 #ifdef VISUAL_LEAK_DETECTOR_ENABLE

Modified: branches/pch/src/orxonox/gui/GUIManager.cc
===================================================================
--- branches/pch/src/orxonox/gui/GUIManager.cc	2009-06-12 16:47:14 UTC (rev 3152)
+++ branches/pch/src/orxonox/gui/GUIManager.cc	2009-06-13 14:12:45 UTC (rev 3153)
@@ -270,7 +270,7 @@
     @return
         Returns false if the Overlay was already present.
     */
-    bool GUIManager::registerOverlay(std::string name, GUIOverlay* overlay)
+    bool GUIManager::registerOverlay(const std::string& name, GUIOverlay* overlay)
     {
         return (this->guiOverlays_.insert(std::pair<std::string, GUIOverlay*>(name, overlay))).second;
     }
@@ -283,7 +283,7 @@
     @return
         Returns a pointer to the GUIOverlay.
     */
-    GUIOverlay* GUIManager::getOverlay(std::string name)
+    GUIOverlay* GUIManager::getOverlay(const std::string& name)
     {
         return (this->guiOverlays_.find(name))->second;
     }

Modified: branches/pch/src/orxonox/gui/GUIManager.h
===================================================================
--- branches/pch/src/orxonox/gui/GUIManager.h	2009-06-12 16:47:14 UTC (rev 3152)
+++ branches/pch/src/orxonox/gui/GUIManager.h	2009-06-13 14:12:45 UTC (rev 3153)
@@ -90,8 +90,8 @@
         void showGUI(const std::string& name);
         void executeCode(const std::string& str);
 
-        bool registerOverlay(std::string name, GUIOverlay* overlay); //!< Register a GUIOverlay with the GUIManager.
-        GUIOverlay* getOverlay(std::string name); // Get the GUIOverlay of the GUI with the given name.
+        bool registerOverlay(const std::string& name, GUIOverlay* overlay); //!< Register a GUIOverlay with the GUIManager.
+        GUIOverlay* getOverlay(const std::string& name); // Get the GUIOverlay of the GUI with the given name.
 
         void setCamera(Ogre::Camera* camera);
 

Modified: branches/pch/src/orxonox/tools/TextureGenerator.cc
===================================================================
--- branches/pch/src/orxonox/tools/TextureGenerator.cc	2009-06-12 16:47:14 UTC (rev 3152)
+++ branches/pch/src/orxonox/tools/TextureGenerator.cc	2009-06-13 14:12:45 UTC (rev 3153)
@@ -64,7 +64,7 @@
     std::map<std::string, std::map<ColourValue, std::string> > TextureGenerator::materials_s;
     unsigned int TextureGenerator::materialCount_s = 0;
 
-    /*static*/ const std::string& TextureGenerator::getMaterialName(std::string textureName, const ColourValue& colour)
+    /*static*/ const std::string& TextureGenerator::getMaterialName(const std::string& textureName, const ColourValue& colour)
     {
         std::map<ColourValue, std::string>& colourMap = materials_s[textureName];
         std::map<ColourValue, std::string>::const_iterator it = colourMap.find(colour);

Modified: branches/pch/src/orxonox/tools/TextureGenerator.h
===================================================================
--- branches/pch/src/orxonox/tools/TextureGenerator.h	2009-06-12 16:47:14 UTC (rev 3152)
+++ branches/pch/src/orxonox/tools/TextureGenerator.h	2009-06-13 14:12:45 UTC (rev 3153)
@@ -45,7 +45,7 @@
     class _OrxonoxExport TextureGenerator
     {
     public:
-        static const std::string& getMaterialName(std::string textureName, const ColourValue& colour);
+        static const std::string& getMaterialName(const std::string& textureName, const ColourValue& colour);
 
     private:
         TextureGenerator();

Modified: branches/pch/src/util/ExprParser.h
===================================================================
--- branches/pch/src/util/ExprParser.h	2009-06-12 16:47:14 UTC (rev 3152)
+++ branches/pch/src/util/ExprParser.h	2009-06-13 14:12:45 UTC (rev 3153)
@@ -71,9 +71,9 @@
 
 
         ExprParser(const std::string& str);
-        std::string& getRemains() { return  this->remains_; }
-        double       getResult()  { return  this->result_; }
-        bool         getSuccess() { return !this->failed_; }
+        const std::string& getRemains() { return  this->remains_; }
+        double             getResult()  { return  this->result_; }
+        bool               getSuccess() { return !this->failed_; }
 
     private:
         double parse_expr_1();

Modified: branches/pch/src/util/OrxAssert.h
===================================================================
--- branches/pch/src/util/OrxAssert.h	2009-06-12 16:47:14 UTC (rev 3152)
+++ branches/pch/src/util/OrxAssert.h	2009-06-13 14:12:45 UTC (rev 3153)
@@ -43,7 +43,7 @@
 // define an assert macro that can display a message
 #ifndef NDEBUG
 #define OrxAssert(Assertion, ErrorMessage) \
-    Assertion ? ((void)0) : (void)(orxonox::OutputHandler::getOutStream().setOutputLevel(ORX_ERROR) << ErrorMessage << std::endl); \
+    Assertion ? ((void)0) : (void)(orxonox::OutputHandler::getOutStream().setOutputLevel(1) << ErrorMessage << std::endl); \
     assert(Assertion)
 #else
 #define OrxAssert(condition, errorMessage)  ((void)0)

Modified: branches/pch/src/util/OutputHandler.h
===================================================================
--- branches/pch/src/util/OutputHandler.h	2009-06-12 16:47:14 UTC (rev 3152)
+++ branches/pch/src/util/OutputHandler.h	2009-06-13 14:12:45 UTC (rev 3153)
@@ -62,23 +62,23 @@
             static OutputHandler& getOutStream();
 
             /** @brief Puts some text on the outstream. @param text The text */
-            static inline std::string log(const std::string& text)
+            static inline const std::string& log(const std::string& text)
                 { OutputHandler::getOutStream().setOutputLevel(0); OutputHandler::getOutStream().output(text + "\n"); return text; }
 
             /** @brief Puts an error on the outstream. @param text The text */
-            static inline std::string error(const std::string& text)
+            static inline const std::string& error(const std::string& text)
                 { OutputHandler::getOutStream().setOutputLevel(1); OutputHandler::getOutStream().output(text + "\n"); return text; }
 
             /** @brief Puts a warning on the outstream. @param text The text */
-            static inline std::string warning(const std::string& text)
+            static inline const std::string& warning(const std::string& text)
                 { OutputHandler::getOutStream().setOutputLevel(2); OutputHandler::getOutStream().output(text + "\n"); return text; }
 
             /** @brief Puts an info on the outstream. @param text The text */
-            static inline std::string info(const std::string& text)
+            static inline const std::string& info(const std::string& text)
                 { OutputHandler::getOutStream().setOutputLevel(3); OutputHandler::getOutStream().output(text + "\n"); return text; }
 
             /** @brief Puts some debug output on the outstream. @param text The text */
-            static inline std::string debug(const std::string& text)
+            static inline const std::string& debug(const std::string& text)
                 { OutputHandler::getOutStream().setOutputLevel(4); OutputHandler::getOutStream().output(text + "\n"); return text; }
 
             /** @brief Returns a reference to the logfile. @return The logfile */




More information about the Orxonox-commit mailing list