Changeset 6417 for code/trunk/src/libraries/tools
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/tools/BillboardSet.cc
r5781 r6417 38 38 #include "util/Convert.h" 39 39 #include "util/Math.h" 40 #include "util/StringUtils.h"41 40 #include "core/GameMode.h" 42 41 … … 81 80 catch (...) 82 81 { 83 COUT(1) << "Error: Couln't load billboard \"" << file << "\""<< std::endl;82 COUT(1) << "Error: Couln't load billboard \"" << file << '"' << std::endl; 84 83 this->billboardSet_ = 0; 85 84 } … … 104 103 catch (...) 105 104 { 106 COUT(1) << "Error: Couln't load billboard \"" << file << "\""<< std::endl;105 COUT(1) << "Error: Couln't load billboard \"" << file << '"' << std::endl; 107 106 this->billboardSet_ = 0; 108 107 } -
code/trunk/src/libraries/tools/CMakeLists.txt
r5929 r6417 23 23 LINK_LIBRARIES 24 24 core 25 network 25 26 SOURCE_FILES ${TOOLS_SRC_FILES} 26 27 ) -
code/trunk/src/libraries/tools/Mesh.cc
r5781 r6417 36 36 37 37 #include "util/Convert.h" 38 #include "util/StringUtils.h"39 38 #include "core/GameMode.h" 40 39 … … 84 83 catch (...) 85 84 { 86 COUT(1) << "Error: Couln't load mesh \"" << meshsource << "\""<< std::endl;85 COUT(1) << "Error: Couln't load mesh \"" << meshsource << '"' << std::endl; 87 86 this->entity_ = 0; 88 87 } -
code/trunk/src/libraries/tools/ParticleInterface.cc
r5781 r6417 64 64 this->bAllowedByLOD_ = true; 65 65 this->speedFactor_ = 1.0f; 66 67 this->setDetailLevel(static_cast<unsigned int>(detaillevel)); 68 69 this->setConfigValues(); 66 70 67 71 if (GameMode::showsGraphics()) … … 74 78 catch (...) 75 79 { 76 COUT(1) << "Error: Couln't load particle system \"" << templateName << "\""<< std::endl;80 COUT(1) << "Error: Couln't load particle system \"" << templateName << '"' << std::endl; 77 81 this->particleSystem_ = 0; 78 82 } 79 83 } 80 81 this->setDetailLevel(static_cast<unsigned int>(detaillevel));82 84 } 83 85 -
code/trunk/src/libraries/tools/ResourceLocation.cc
r5929 r6417 92 92 { 93 93 // Remove from Ogre paths 94 resourceGroup_. erase();94 resourceGroup_.clear(); 95 95 try 96 96 { -
code/trunk/src/libraries/tools/Shader.cc
r5781 r6417 57 57 this->bLoadCompositor_ = GameMode::showsGraphics(); 58 58 this->bViewportInitialized_ = false; 59 this->compositor_ = "";60 this->oldcompositor_ = "";61 59 62 60 if (this->bLoadCompositor_ && Ogre::Root::getSingletonPtr()) … … 79 77 Shader::~Shader() 80 78 { 81 82 if (this->bLoadCompositor_ && this->compositorInstance_) 79 if (this->compositorInstance_ && this->bLoadCompositor_) 83 80 { 84 81 Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport(); … … 112 109 Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport(); 113 110 assert(viewport); 114 if ( this->oldcompositor_ != "")111 if (!this->oldcompositor_.empty()) 115 112 { 116 113 Ogre::CompositorManager::getSingleton().removeCompositor(viewport, this->oldcompositor_); 117 114 this->compositorInstance_ = 0; 118 115 } 119 if ( this->compositor_ != "")116 if (!this->compositor_.empty()) 120 117 { 121 118 this->compositorInstance_ = Ogre::CompositorManager::getSingleton().addCompositor(viewport, this->compositor_); … … 299 296 continue; 300 297 301 if ( pass_pointer->getFragmentProgramName() != "")298 if (!pass_pointer->getFragmentProgramName().empty()) 302 299 { 303 300 Ogre::GpuProgramParameters* parameter_pointer = pass_pointer->getFragmentProgramParameters().get(); -
code/trunk/src/libraries/tools/TextureGenerator.cc
r5781 r6417 72 72 if (it == colourMap.end()) 73 73 { 74 std::stringmaterialName = textureName + "_Material_" + multi_cast<std::string>(materialCount_s++);74 const std::string& materialName = textureName + "_Material_" + multi_cast<std::string>(materialCount_s++); 75 75 Ogre::MaterialPtr material = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().create(materialName, "General")); 76 76 material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA); … … 82 82 else 83 83 { 84 return (*it).second;84 return it->second; 85 85 } 86 86 } -
code/trunk/src/libraries/tools/Timer.cc
r5929 r6417 112 112 this->deleteExecutor(); 113 113 } 114 114 115 115 /** 116 116 @brief Initializes the Timer -
code/trunk/src/libraries/tools/Timer.h
r5929 r6417 140 140 private: 141 141 void init(); 142 142 143 143 Executor* executor_; //!< The executor of the function that should be called when the time expires 144 144 -
code/trunk/src/libraries/tools/interfaces/TimeFactorListener.h
r5781 r6417 37 37 class _ToolsExport TimeFactorListener : virtual public OrxonoxClass 38 38 { 39 friend class GSRoot;40 41 39 public: 42 40 TimeFactorListener(); 43 41 virtual ~TimeFactorListener() {} 44 42 43 static void setTimeFactor( float factor ); 44 static void setTimeFactorInternal( float factor ); 45 static inline float getTimeFactor(){ return TimeFactorListener::timefactor_s; } 46 45 47 protected: 46 48 virtual void changedTimeFactor(float factor_new, float factor_old) {} 47 inline float getTimeFactor() const48 { return TimeFactorListener::timefactor_s; }49 49 50 50 private: -
code/trunk/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc
r5781 r6417 37 37 38 38 #include "core/CoreIncludes.h" 39 #include "core/GameMode.h" 40 #include "network/NetworkFunction.h" 39 41 40 42 namespace orxonox … … 43 45 // TimeFactorListener 44 46 //---------------------------- 47 registerStaticNetworkFunction( &TimeFactorListener::setTimeFactorInternal ); 48 45 49 float TimeFactorListener::timefactor_s = 1.0f; 46 50 … … 48 52 { 49 53 RegisterRootObject(TimeFactorListener); 54 } 55 56 /*static*/ void TimeFactorListener::setTimeFactor( float factor ) 57 { 58 if ( !GameMode::isStandalone() ) 59 callStaticNetworkFunction( &TimeFactorListener::setTimeFactorInternal, CLIENTID_UNKNOWN, factor ); 60 TimeFactorListener::setTimeFactorInternal(factor); 61 } 62 63 /*static*/ void TimeFactorListener::setTimeFactorInternal( float factor ) 64 { 65 float oldFactor = TimeFactorListener::timefactor_s; 66 TimeFactorListener::timefactor_s = factor; 67 for (ObjectList<TimeFactorListener>::iterator it = ObjectList<TimeFactorListener>::begin(); it != ObjectList<TimeFactorListener>::end(); ++it) 68 it->changedTimeFactor(factor, oldFactor); 50 69 } 51 70
Note: See TracChangeset
for help on using the changeset viewer.