Changeset 1691
- Timestamp:
- Aug 31, 2008, 9:10:28 PM (16 years ago)
- Location:
- code/branches/gui/src/orxonox/gamestates
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSClient.cc
r1674 r1691 36 36 namespace orxonox 37 37 { 38 SetCommandLineArgument(ip, "127.0.0. 0").setInformation("#.#.#.#");38 SetCommandLineArgument(ip, "127.0.0.1").setInformation("#.#.#.#"); 39 39 40 40 GSClient::GSClient() -
code/branches/gui/src/orxonox/gamestates/GSRoot.cc
r1689 r1691 65 65 { 66 66 SetCommandLineArgument(dataPath, "").setInformation("PATH"); 67 SetCommandLineArgument(limitToCPU, 1).setInformation("0: off | #cpu"); 67 68 68 69 GSRoot::GSRoot() … … 130 131 // do this after ogre has initialised. Somehow Ogre changes the settings again (not through 131 132 // the timer though). 132 setThreadAffinity(); 133 int limitToCPU; 134 CommandLine::getValue("limitToCPU", &limitToCPU); 135 if (limitToCPU > 0) 136 setThreadAffinity((unsigned int)(limitToCPU - 1)); 133 137 134 138 // add console commands … … 170 174 /** 171 175 @note 172 The code of this function has been copied from OGRE, an open source graphics engine.176 The code of this function has been copied and adjusted from OGRE, an open source graphics engine. 173 177 (Object-oriented Graphics Rendering Engine) 174 178 For the latest info, see http://www.ogre3d.org/ … … 178 182 OGRE is licensed under the LGPL. For more info, see ogre license info. 179 183 */ 180 void GSRoot::setThreadAffinity( )184 void GSRoot::setThreadAffinity(unsigned int limitToCPU) 181 185 { 182 186 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 … … 195 199 procMask = 1; 196 200 197 // Find the lowest core that this process uses 201 // if the core specified with limitToCPU is not available, take the lowest one 202 if (!(procMask & (1 << limitToCPU))) 203 limitToCPU = 0; 204 205 // Find the lowest core that this process uses and limitToCPU suggests 198 206 DWORD threadMask = 1; 199 while ((threadMask & procMask) == 0 )207 while ((threadMask & procMask) == 0 || (threadMask < (1u << limitToCPU))) 200 208 threadMask <<= 1; 201 209 -
code/branches/gui/src/orxonox/gamestates/GSRoot.h
r1689 r1691 58 58 void messageLogged(const std::string& message, Ogre::LogMessageLevel lml, 59 59 bool maskDebug, const std::string& logName); 60 void setThreadAffinity( );60 void setThreadAffinity(unsigned int limitToCPU); 61 61 void setupOgre(); 62 62
Note: See TracChangeset
for help on using the changeset viewer.