- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2
- Files:
-
- 238 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/ApplicationPaths.cc
r10624 r10765 84 84 // get executable module 85 85 TCHAR buffer[1024]; 86 if (GetModuleFileName( NULL, buffer, 1024) == 0)86 if (GetModuleFileName(nullptr, buffer, 1024) == 0) 87 87 ThrowException(General, "Could not retrieve executable path."); 88 88 -
code/branches/cpp11_v2/src/libraries/core/BaseObject.cc
r10624 r10765 205 205 Template* link; 206 206 assert(!(link = Template::getTemplate(temp->getLink())) || !link->isLink()); 207 link = NULL;207 link = nullptr; 208 208 } 209 209 else -
code/branches/cpp11_v2/src/libraries/core/BaseObject.h
r10624 r10765 265 265 return this->weakPtr_; 266 266 else 267 return NULL;267 return nullptr; 268 268 } 269 269 -
code/branches/cpp11_v2/src/libraries/core/ConfigurablePaths.cc
r10624 r10765 122 122 char* userDataPathPtr(getenv("APPDATA")); 123 123 #endif 124 if (userDataPathPtr == NULL)124 if (userDataPathPtr == nullptr) 125 125 ThrowException(General, "Could not retrieve user data path."); 126 126 bf::path userDataPath(userDataPathPtr); -
code/branches/cpp11_v2/src/libraries/core/Core.cc
r10624 r10765 95 95 96 96 Core::Core(const std::string& cmdLine) 97 : applicationPaths_( NULL)98 , configurablePaths_( NULL)99 , dynLibManager_( NULL)100 , signalHandler_( NULL)101 , configFileManager_( NULL)102 , languageInstance_( NULL)103 , loaderInstance_( NULL)104 , ioConsole_( NULL)105 , tclBind_( NULL)106 , tclThreadManager_( NULL)107 , rootScope_( NULL)108 , graphicsManager_( NULL)109 , inputManager_( NULL)110 , guiManager_( NULL)111 , graphicsScope_( NULL)97 : applicationPaths_(nullptr) 98 , configurablePaths_(nullptr) 99 , dynLibManager_(nullptr) 100 , signalHandler_(nullptr) 101 , configFileManager_(nullptr) 102 , languageInstance_(nullptr) 103 , loaderInstance_(nullptr) 104 , ioConsole_(nullptr) 105 , tclBind_(nullptr) 106 , tclThreadManager_(nullptr) 107 , rootScope_(nullptr) 108 , graphicsManager_(nullptr) 109 , inputManager_(nullptr) 110 , guiManager_(nullptr) 111 , graphicsScope_(nullptr) 112 112 , bGraphicsLoaded_(false) 113 , staticInitHandler_( NULL)114 , pluginManager_( NULL)115 , rootModule_( NULL)116 , config_( NULL)113 , staticInitHandler_(nullptr) 114 , pluginManager_(nullptr) 115 , rootModule_(nullptr) 116 , config_(nullptr) 117 117 , destructionHelper_(this) 118 118 { … … 176 176 177 177 // initialize root context 178 Context::setRootContext(new Context( NULL));178 Context::setRootContext(new Context(nullptr)); 179 179 180 180 // Do this soon after the ConfigFileManager has been created to open up the … … 326 326 module->deleteAllStaticallyInitializedInstances(); 327 327 this->dynLibManager_->unload(module->getDynLib()); 328 module->setDynLib( NULL);328 module->setDynLib(nullptr); 329 329 } 330 330 … … 471 471 } 472 472 // Process console events and status line 473 if (this->ioConsole_ != NULL)473 if (this->ioConsole_ != nullptr) 474 474 this->ioConsole_->preUpdate(time); 475 475 // Process thread commands -
code/branches/cpp11_v2/src/libraries/core/CoreConfig.cc
r10624 r10765 137 137 void CoreConfig::updateLastLevelTimestamp() 138 138 { 139 ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time( NULL)));139 ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time(nullptr))); 140 140 } 141 141 142 142 void CoreConfig::updateOgreConfigTimestamp() 143 143 { 144 ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time( NULL)));144 ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(nullptr))); 145 145 } 146 146 -
code/branches/cpp11_v2/src/libraries/core/CoreIncludes.h
r10624 r10765 120 120 */ 121 121 #define RegisterAbstractClass(ClassName) \ 122 RegisterClassWithFactory(ClassName, static_cast<ClassFactory<ClassName>*>( NULL), false)122 RegisterClassWithFactory(ClassName, static_cast<ClassFactory<ClassName>*>(nullptr), false) 123 123 124 124 /** -
code/branches/cpp11_v2/src/libraries/core/GUIManager.cc
r10624 r10765 268 268 */ 269 269 GUIManager::GUIManager(const std::pair<int, int>& mousePosition) 270 : guiRenderer_( NULL)271 , resourceProvider_( NULL)270 : guiRenderer_(nullptr) 271 , resourceProvider_(nullptr) 272 272 #ifndef ORXONOX_OLD_CEGUI 273 , rqListener_( NULL)274 , imageCodec_( NULL)275 #endif 276 , luaState_( NULL)277 , scriptModule_( NULL)278 , guiSystem_( NULL)279 , ceguiLogger_( NULL)280 , rootWindow_( NULL)281 , hudRootWindow_( NULL)282 , menuRootWindow_( NULL)283 , camera_( NULL)273 , rqListener_(nullptr) 274 , imageCodec_(nullptr) 275 #endif 276 , luaState_(nullptr) 277 , scriptModule_(nullptr) 278 , guiSystem_(nullptr) 279 , ceguiLogger_(nullptr) 280 , rootWindow_(nullptr) 281 , hudRootWindow_(nullptr) 282 , menuRootWindow_(nullptr) 283 , camera_(nullptr) 284 284 , destructionHelper_(this) 285 285 { … … 467 467 { 468 468 #ifdef ORXONOX_OLD_CEGUI 469 if (camera == NULL)469 if (camera == nullptr) 470 470 this->guiRenderer_->setTargetSceneManager(0); 471 471 else 472 472 this->guiRenderer_->setTargetSceneManager(camera->getSceneManager()); 473 473 #else 474 if (camera_ != NULL && camera_->getSceneManager() != NULL)474 if (camera_ != nullptr && camera_->getSceneManager() != nullptr) 475 475 camera_->getSceneManager()->removeRenderQueueListener(rqListener_); 476 if (camera != NULL && camera->getSceneManager() != NULL)476 if (camera != nullptr && camera->getSceneManager() != nullptr) 477 477 camera->getSceneManager()->addRenderQueueListener(rqListener_); 478 478 #endif … … 876 876 return; 877 877 878 CEGUI::Font* font = NULL;878 CEGUI::Font* font = nullptr; 879 879 CEGUI::XMLAttributes xmlAttributes; 880 880 … … 892 892 893 893 font = CEGUI::FontManager::getSingleton().createFont("FreeType", xmlAttributes); 894 if(font != NULL)894 if(font != nullptr) 895 895 font->load(); 896 896 #else -
code/branches/cpp11_v2/src/libraries/core/Game.cc
r10624 r10765 77 77 78 78 Game::Game(const std::string& cmdLine) 79 : gameClock_( NULL)80 , core_( NULL)79 : gameClock_(nullptr) 80 , core_(nullptr) 81 81 , bChangingState_(false) 82 82 , bAbort_(false) 83 , config_( NULL)83 , config_(nullptr) 84 84 , destructionHelper_(this) 85 85 { … … 398 398 // Check parent and all its grand parents 399 399 shared_ptr<GameStateTreeNode> currentNode = lastRequestedNode; 400 while (currentNode != NULL)400 while (currentNode != nullptr) 401 401 { 402 402 if (currentNode->name_ == name) … … 405 405 requestedNodes.push_back(currentNode); 406 406 } 407 if (currentNode == NULL)407 if (currentNode == nullptr) 408 408 requestedNodes.clear(); 409 409 } -
code/branches/cpp11_v2/src/libraries/core/GraphicsManager.cc
r10624 r10765 178 178 void GraphicsManager::upgradeToGraphics() 179 179 { 180 if (renderWindow_ != NULL)180 if (renderWindow_ != nullptr) 181 181 return; 182 182 -
code/branches/cpp11_v2/src/libraries/core/GraphicsManager.h
r10624 r10765 96 96 void loadDebugOverlay(); 97 97 void unloadDebugOverlay(); 98 bool rendererLoaded() const { return renderWindow_ != NULL; }98 bool rendererLoaded() const { return renderWindow_ != nullptr; } 99 99 100 100 void setCamera(Ogre::Camera* camera); -
code/branches/cpp11_v2/src/libraries/core/Loader.cc
r10624 r10765 89 89 { 90 90 shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename()); 91 if (info == NULL)91 if (info == nullptr) 92 92 { 93 93 orxout(user_error, context::loader) << "Could not find XML file '" << file->getFilename() << "'." << endl; -
code/branches/cpp11_v2/src/libraries/core/LuaState.cc
r10265 r10765 48 48 LuaState::LuaState() 49 49 : bIsRunning_(false) 50 , includeParseFunction_( NULL)50 , includeParseFunction_(nullptr) 51 51 { 52 52 // Create new lua state and configure it … … 84 84 shared_ptr<ResourceInfo> sourceInfo = Resource::getInfo(sourceFileInfo_->path + filename); 85 85 // Continue search in root directories 86 if (sourceInfo == NULL&& !sourceFileInfo_->path.empty())86 if (sourceInfo == nullptr && !sourceFileInfo_->path.empty()) 87 87 sourceInfo = Resource::getInfo(filename); 88 88 return sourceInfo; … … 92 92 { 93 93 shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename); 94 if (sourceInfo != NULL)94 if (sourceInfo != nullptr) 95 95 return this->includeString(Resource::open(sourceInfo)->getAsString(), sourceInfo); 96 96 else … … 105 105 // Parse string with provided include parser (otherwise don't preparse at all) 106 106 std::string luaInput; 107 if (includeParseFunction_ != NULL)107 if (includeParseFunction_ != nullptr) 108 108 luaInput = (*includeParseFunction_)(code); 109 109 else 110 110 luaInput = code; 111 111 112 if (sourceFileInfo != NULL)112 if (sourceFileInfo != nullptr) 113 113 { 114 114 // Also fill a map with the actual source code. This is just for the include* commands … … 119 119 bool returnValue = this->doString(luaInput, sourceFileInfo); 120 120 121 if (sourceFileInfo != NULL)121 if (sourceFileInfo != nullptr) 122 122 { 123 123 // Delete source code entry 124 if (sourceFileInfo != NULL)124 if (sourceFileInfo != nullptr) 125 125 this->sourceCodeMap_.erase(sourceFileInfo->filename); 126 126 } … … 132 132 { 133 133 shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename); 134 if (sourceInfo != NULL)134 if (sourceInfo != nullptr) 135 135 return this->doString(Resource::open(sourceInfo)->getAsString(), sourceInfo); 136 136 else … … 146 146 shared_ptr<ResourceInfo> oldSourceFileInfo = sourceFileInfo_; 147 147 // Only override if sourceFileInfo provides useful information 148 if (sourceFileInfo != NULL)148 if (sourceFileInfo != nullptr) 149 149 sourceFileInfo_ = sourceFileInfo; 150 150 151 151 std::string chunkname; 152 if (sourceFileInfo != NULL)152 if (sourceFileInfo != nullptr) 153 153 { 154 154 // Provide lua_load with the filename for debug purposes … … 286 286 { 287 287 shared_ptr<ResourceInfo> info = this->getFileInfo(filename); 288 if (info == NULL)288 if (info == nullptr) 289 289 return false; 290 290 else … … 301 301 return it->second; 302 302 shared_ptr<ResourceInfo> info = Resource::getInfo(filename); 303 if (info == NULL)303 if (info == nullptr) 304 304 return ""; 305 305 else -
code/branches/cpp11_v2/src/libraries/core/Resource.cc
r9675 r10765 102 102 ptr->size = it->uncompressedSize; 103 103 #if OGRE_VERSION >= 0x010800 104 if (dynamic_cast<const Ogre::FileSystemArchive*>(it->archive) != NULL)104 if (dynamic_cast<const Ogre::FileSystemArchive*>(it->archive) != nullptr) 105 105 #else 106 if (dynamic_cast<Ogre::FileSystemArchive*>(it->archive) != NULL)106 if (dynamic_cast<Ogre::FileSystemArchive*>(it->archive) != nullptr) 107 107 #endif 108 108 { -
code/branches/cpp11_v2/src/libraries/core/class/Identifiable.h
r9667 r10765 98 98 registered in the class hierarchy. 99 99 @return 100 Returns NULLif the no pointer was found.100 Returns nullptr if the no pointer was found. 101 101 */ 102 102 ORX_FORCEINLINE void* getDerivedPointer(unsigned int classID) … … 107 107 return this->objectPointers_[i].second; 108 108 } 109 return NULL;109 return nullptr; 110 110 } 111 111 -
code/branches/cpp11_v2/src/libraries/core/class/Identifier.h
r10624 r10765 279 279 ClassIdentifier(const std::string& name, Factory* factory, bool bLoadable) : Identifier(name, factory, bLoadable) 280 280 { 281 OrxVerify(ClassIdentifier<T>::classIdentifier_s == NULL, "Assertion failed in ClassIdentifier of type " << typeid(T).name());281 OrxVerify(ClassIdentifier<T>::classIdentifier_s == nullptr, "Assertion failed in ClassIdentifier of type " << typeid(T).name()); 282 282 ClassIdentifier<T>::classIdentifier_s = this; 283 283 … … 334 334 /*static*/ inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier() 335 335 { 336 if (ClassIdentifier<T>::classIdentifier_s == NULL)336 if (ClassIdentifier<T>::classIdentifier_s == nullptr) 337 337 ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*) IdentifierManager::getInstance().getIdentifierByTypeInfo(typeid(T)); 338 338 339 OrxVerify(ClassIdentifier<T>::classIdentifier_s != NULL, "Did you forget to register the class of type " << typeid(T).name() << "?");339 OrxVerify(ClassIdentifier<T>::classIdentifier_s != nullptr, "Did you forget to register the class of type " << typeid(T).name() << "?"); 340 340 return ClassIdentifier<T>::classIdentifier_s; 341 341 } … … 451 451 void ClassIdentifier<T>::updateConfigValues(bool updateChildren) const 452 452 { 453 this->updateConfigValues(updateChildren, static_cast<T*>( NULL));453 this->updateConfigValues(updateChildren, static_cast<T*>(nullptr)); 454 454 } 455 455 … … 483 483 registered in the class hierarchy. 484 484 @return 485 Returns NULLif the cast is not possible485 Returns nullptr if the cast is not possible 486 486 @note 487 In case of NULLreturn (and using MSVC), a dynamic_cast might still be possible if487 In case of nullptr return (and using MSVC), a dynamic_cast might still be possible if 488 488 a class forgot to register its objects. 489 489 Also note that the function is implemented differently for GCC/MSVC. … … 494 494 #ifdef ORXONOX_COMPILER_MSVC 495 495 typedef Loki::TypeTraits<typename Loki::TypeTraits<T>::PointeeType>::NonConstType ClassType; 496 if (source != NULL)496 if (source != nullptr) 497 497 return source->template getDerivedPointer<ClassType>(ClassIdentifier<ClassType>::getIdentifier()->getClassID()); 498 498 else 499 return NULL;499 return nullptr; 500 500 #else 501 501 return dynamic_cast<T>(source); -
code/branches/cpp11_v2/src/libraries/core/class/IdentifierManager.cc
r10624 r10765 49 49 { 50 50 this->hierarchyCreatingCounter_s = 0; 51 this->recordTraceForIdentifier_ = NULL;51 this->recordTraceForIdentifier_ = nullptr; 52 52 } 53 53 … … 92 92 // iterate over all identifiers, create one instance of each class and initialize the identifiers 93 93 { 94 Context temporaryContext( NULL);94 Context temporaryContext(nullptr); 95 95 for (std::set<Identifier*>::const_iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); ++it) 96 96 { … … 108 108 Identifiable* temp = identifier->fabricate(&temporaryContext); 109 109 110 this->recordTraceForIdentifier_ = NULL;110 this->recordTraceForIdentifier_ = nullptr; 111 111 112 112 if (temp->getIdentifier() != identifier) … … 149 149 150 150 // for all initialized identifiers, check if a sample instance behaves as expected according to the class hierarchy 151 Context temporaryContext( NULL);151 Context temporaryContext(nullptr); 152 152 for (std::set<Identifier*>::const_iterator it1 = initializedIdentifiers.begin(); it1 != initializedIdentifiers.end(); ++it1) 153 153 { -
code/branches/cpp11_v2/src/libraries/core/class/SubclassIdentifier.h
r9667 r10765 127 127 else 128 128 { 129 orxout(internal_error) << "Can't assign NULLidentifier" << endl;129 orxout(internal_error) << "Can't assign nullptr identifier" << endl; 130 130 } 131 131 } -
code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc
r10624 r10765 119 119 /** 120 120 @brief Executes the command which was evaluated by this object and returns its return-value. 121 @param error A pointer to an integer (or NULL) which will be used to write error codes to (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")121 @param error A pointer to an integer (or nullptr) which will be used to write error codes to (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 122 122 @return Returns the result of the command (or MultiType::Null if there is no return value) 123 123 */ -
code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.h
r8079 r10765 137 137 static std::string getCommonBegin(const ArgumentCompletionList& list); 138 138 139 const ConsoleCommand* execCommand_; ///< The command that will be executed (can be NULLif the command is not valid)139 const ConsoleCommand* execCommand_; ///< The command that will be executed (can be nullptr if the command is not valid) 140 140 const ConsoleCommand* hintCommand_; ///< The command that is used to display hints and argument lists (can be different to execCommand_ in some cases) 141 141 SubString tokens_; ///< The single words of the command string, split into tokens -
code/branches/cpp11_v2/src/libraries/core/command/CommandExecutor.cc
r10624 r10765 81 81 @brief Executes a command and returns its return-value. 82 82 @param command A string containing the command 83 @param error A pointer to a value (or NULL) where the error-code should be written to (see @ref CommandExecutorErrorCodes "error codes")83 @param error A pointer to a value (or nullptr) where the error-code should be written to (see @ref CommandExecutorErrorCodes "error codes") 84 84 @param useTcl If true, the command is passed to tcl (see TclBind) 85 85 @return Returns the return-value of the command (if any - MultiType::Null otherwise) … … 127 127 @brief Executes a command and returns its return-value as string. 128 128 @param command A string containing the command 129 @param error A pointer to a value (or NULL) where the error-code should be written to (see @ref CommandExecutorErrorCodes "error codes")129 @param error A pointer to a value (or nullptr) where the error-code should be written to (see @ref CommandExecutorErrorCodes "error codes") 130 130 @param useTcl If true, the command is passed to tcl (see TclBind) 131 131 @return Returns the return-value of the command converted to a string (or "" if there's no return value) -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc
r10624 r10765 348 348 349 349 /** 350 @brief Sets the functor to NULL(which also deactivates the command).350 @brief Sets the functor to nullptr (which also deactivates the command). 351 351 */ 352 352 void ConsoleCommand::resetFunction() -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.h
r10624 r10765 195 195 { if (this->command_) { this->command_->popFunction(); } return *this; } 196 196 197 /// Sets the current function-pointer to NULL, which also deactivates the command.197 /// Sets the current function-pointer to nullptr, which also deactivates the command. 198 198 inline ConsoleCommandManipulator& resetFunction() 199 199 { if (this->command_) { this->command_->resetFunction(); } return *this; } … … 205 205 inline ConsoleCommandManipulator& pushObject(void* object) 206 206 { if (this->command_) { this->command_->pushObject(object); } return *this; } 207 /// Removes the current object from the object-stack and restores the old object (or NULLif there's no object left on the stack).207 /// Removes the current object from the object-stack and restores the old object (or nullptr if there's no object left on the stack). 208 208 inline ConsoleCommandManipulator& popObject() 209 209 { if (this->command_) { this->command_->popObject(); } return *this; } -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommandIncludes.h
r10624 r10765 331 331 @brief Returns a manipulator for a command with the given name. 332 332 333 @note If the command doesn't exist, the manipulator contains a NULL pointer to the command,333 @note If the command doesn't exist, the manipulator contains a nullptr to the command, 334 334 but it can still be used without checks, because all functions of ConsoleCommandManipulator 335 335 check internally if the command exists. … … 340 340 @brief Returns a manipulator for a command with the given group and name. 341 341 342 @note If the command doesn't exist, the manipulator contains a NULL pointer to the command,342 @note If the command doesn't exist, the manipulator contains a nullptr to the command, 343 343 but it can still be used without checks, because all functions of ConsoleCommandManipulator 344 344 check internally if the command exists. -
code/branches/cpp11_v2/src/libraries/core/command/Executor.cc
r9550 r10765 76 76 @brief Calls the wrapped function with arguments that are passed in a string. 77 77 @param arguments The arguments that should be passed to the function, separated by @a delimiter 78 @param error A pointer to a variable (or NULL) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")78 @param error A pointer to a variable (or nullptr) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 79 79 @param delimiter The delimiter that is used to separate the arguments in the string @a arguments 80 80 @param bPrintError If true, errors are printed to the console if the function couldn't be executed with the given arguments … … 89 89 @brief Calls the wrapped function with arguments that are passed as tokens in a SubString 90 90 @param arguments The arguments that should be passed to the function 91 @param error A pointer to a variable (or NULL) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")91 @param error A pointer to a variable (or nullptr) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 92 92 @param delimiter The delimiter that was used to separate the arguments in the SubString @a arguments (used to join the surplus arguments) 93 93 @param bPrintError If true, errors are printed to the console if the function couldn't be executed with the given arguments … … 127 127 @param arguments The arguments that should be converted 128 128 @param arg An array of MultiType where the converted arguments will be stored 129 @param error A pointer to a variable (or NULL) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")129 @param error A pointer to a variable (or nullptr) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 130 130 @param delimiter The delimiter that was used to separate the arguments in the SubString @a arguments (used to join the surplus arguments) 131 131 @return Returns the number of evaluated arguments -
code/branches/cpp11_v2/src/libraries/core/command/Functor.h
r9667 r10765 215 215 virtual void* getRawObjectPointer() const = 0; 216 216 217 /// Enables or disables the safe mode which causes the functor to change the object pointer to NULLif the object is deleted (only member functors).217 /// Enables or disables the safe mode which causes the functor to change the object pointer to nullptr if the object is deleted (only member functors). 218 218 virtual void setSafeMode(bool bSafeMode) = 0; 219 219 … … 245 245 virtual ~FunctorMember() { if (this->bSafeMode_) { this->unregisterObject(this->object_); } } 246 246 247 /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be NULL. @return Returns the return-value of the function (if any; MultiType::Null otherwise)247 /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be nullptr. @return Returns the return-value of the function (if any; MultiType::Null otherwise) 248 248 virtual MultiType operator()(O* object, const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null) = 0; 249 249 … … 312 312 { this->object_ = 0; } 313 313 314 O* object_; ///< The stored object-pointer, used to execute a member-function (or NULLfor static functions)315 bool bSafeMode_; ///< If true, the functor is in safe mode and registers itself as listener at the object and changes the pointer to NULLif the object is deleted314 O* object_; ///< The stored object-pointer, used to execute a member-function (or nullptr for static functions) 315 bool bSafeMode_; ///< If true, the functor is in safe mode and registers itself as listener at the object and changes the pointer to nullptr if the object is deleted 316 316 }; 317 317 … … 324 324 FunctorMember(void* object = 0) {} 325 325 326 /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be NULL. @return Returns the return-value of the function (if any; MultiType::Null otherwise)326 /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be nullptr. @return Returns the return-value of the function (if any; MultiType::Null otherwise) 327 327 virtual MultiType operator()(void* object, const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null) = 0; 328 328 -
code/branches/cpp11_v2/src/libraries/core/command/IOConsolePOSIX.cc
r9667 r10765 44 44 namespace orxonox 45 45 { 46 IOConsole* IOConsole::singletonPtr_s = NULL;46 IOConsole* IOConsole::singletonPtr_s = nullptr; 47 47 48 48 namespace EscapeMode … … 353 353 const char* s; 354 354 if (!this->terminalWidth_ && (s = getenv("COLUMNS"))) 355 this->terminalWidth_ = strtol(s, NULL, 10);355 this->terminalWidth_ = strtol(s, nullptr, 10); 356 356 if (!this->terminalWidth_) 357 357 this->terminalWidth_ = 80; 358 358 if (!this->terminalHeight_ && (s = getenv("LINES"))) 359 this->terminalHeight_ = strtol(s, NULL, 10);359 this->terminalHeight_ = strtol(s, nullptr, 10); 360 360 if (!this->terminalHeight_) 361 361 this->terminalHeight_ = 24; -
code/branches/cpp11_v2/src/libraries/core/command/IOConsoleWindows.cc
r9676 r10765 41 41 namespace orxonox 42 42 { 43 IOConsole* IOConsole::singletonPtr_s = NULL;43 IOConsole* IOConsole::singletonPtr_s = nullptr; 44 44 45 45 //! Redirects std::cout, creates the corresponding Shell and changes the terminal mode … … 300 300 this->terminalWidth_ - 1, this->inputLineRow_ + this->inputLineHeight_ + this->statusLines_ - 1); 301 301 this->inputLineRow_ += linesDown; 302 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, this->inputLineRow_), &fillChar);302 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, nullptr, makeCOORD(0, this->inputLineRow_), &fillChar); 303 303 // Move cursor down to the new bottom so the user can see the status lines 304 304 COORD pos = makeCOORD(0, this->inputLineRow_ + this->inputLineHeight_ - 1 + this->statusLines_); … … 312 312 // Scroll output up 313 313 SMALL_RECT oldRect = makeSMALL_RECT(0, lines - linesDown, this->terminalWidth_ - 1, this->inputLineRow_ - 1); 314 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, 0), &fillChar);314 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, nullptr, makeCOORD(0, 0), &fillChar); 315 315 } 316 316 } … … 360 360 SMALL_RECT oldRect = makeSMALL_RECT(0, statusLineRow, this->terminalWidth_ - 1, statusLineRow + this->statusLines_); 361 361 CHAR_INFO fillChar = {{' '}, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED}; 362 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, statusLineRow + newLines), &fillChar);362 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, nullptr, makeCOORD(0, statusLineRow + newLines), &fillChar); 363 363 // Clear potential leftovers 364 364 if (-newLines - this->statusLines_ > 0) -
code/branches/cpp11_v2/src/libraries/core/command/TclBind.cc
r10624 r10765 228 228 @brief Executes Tcl-code and returns the return-value. 229 229 @param tclcode A string that contains Tcl-code 230 @param error A pointer to an integer (or NULL) that is used to write an error-code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")230 @param error A pointer to an integer (or nullptr) that is used to write an error-code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 231 231 @return Returns the return-value of the executed code (or an empty string if there's no return-value) 232 232 */ -
code/branches/cpp11_v2/src/libraries/core/config/ConfigFile.cc
r10733 r10765 275 275 276 276 /** 277 @brief Returns a pointer to the section with given name (or NULLif the section doesn't exist).277 @brief Returns a pointer to the section with given name (or nullptr if the section doesn't exist). 278 278 */ 279 279 ConfigFileSection* ConfigFile::getSection(const std::string& section) const … … 282 282 if ((*it)->getName() == section) 283 283 return (*it); 284 return NULL;284 return nullptr; 285 285 } 286 286 -
code/branches/cpp11_v2/src/libraries/core/config/ConfigFileManager.cc
r9559 r10765 44 44 ConfigFileManager* ConfigFileManager::singletonPtr_s = 0; 45 45 46 /// Constructor: Initializes the array of config files with NULL.46 /// Constructor: Initializes the array of config files with nullptr. 47 47 ConfigFileManager::ConfigFileManager() 48 48 { 49 this->configFiles_.assign( NULL);49 this->configFiles_.assign(nullptr); 50 50 } 51 51 -
code/branches/cpp11_v2/src/libraries/core/config/ConfigFileSection.cc
r9559 r10765 99 99 100 100 /** 101 @brief Returns the entry with given name (or NULLif it doesn't exist).101 @brief Returns the entry with given name (or nullptr if it doesn't exist). 102 102 103 103 @param name The name of the entry … … 110 110 return *it; 111 111 } 112 return NULL;112 return nullptr; 113 113 } 114 114 115 115 /** 116 @brief Returns the entry of a vector element with given name and index (or NULLif it doesn't exist).116 @brief Returns the entry of a vector element with given name and index (or nullptr if it doesn't exist). 117 117 118 118 @param name The name of the vector … … 126 126 return *it; 127 127 } 128 return NULL;128 return nullptr; 129 129 } 130 130 -
code/branches/cpp11_v2/src/libraries/core/config/ConfigValueContainer.h
r9667 r10765 223 223 inline const std::string& getSectionName() const 224 224 { return this->sectionname_; } 225 /// Returns the associated identifier (can be NULL).225 /// Returns the associated identifier (can be nullptr). 226 226 inline Identifier* getIdentifier() const 227 227 { return this->identifier_; } -
code/branches/cpp11_v2/src/libraries/core/config/SettingsConfigFile.cc
r10624 r10765 106 106 void SettingsConfigFile::addConfigValueContainer(ConfigValueContainer* container) 107 107 { 108 if (container == NULL)108 if (container == nullptr) 109 109 return; 110 110 std::pair<std::string, ConfigValueContainer*> second(getLowercase(container->getName()), container); … … 118 118 void SettingsConfigFile::removeConfigValueContainer(ConfigValueContainer* container) 119 119 { 120 if (container == NULL)120 if (container == nullptr) 121 121 return; 122 122 const std::string& sectionLC = getLowercase(container->getSectionName()); … … 269 269 { 270 270 std::string value; 271 it->second.second->getValue<std::string, void>(&value, NULL);271 it->second.second->getValue<std::string, void>(&value, nullptr); 272 272 return value; 273 273 } -
code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
r10624 r10765 210 210 catch (const std::exception& ex) 211 211 { 212 oisInputManager_ = NULL;212 oisInputManager_ = nullptr; 213 213 internalState_ |= Bad; 214 214 ThrowException(InitialisationFailed, "Could not initialise the input system: " << ex.what()); … … 312 312 BOOST_FOREACH(InputDevice*& device, devices_) 313 313 { 314 if (device == NULL)314 if (device == nullptr) 315 315 continue; 316 316 const std::string& className = device->getClassName(); … … 321 321 devices_.resize(InputDeviceEnumerator::FirstJoyStick); 322 322 323 assert(oisInputManager_ != NULL);323 assert(oisInputManager_ != nullptr); 324 324 try 325 325 { … … 331 331 << "Potential resource leak!" << endl; 332 332 } 333 oisInputManager_ = NULL;333 oisInputManager_ = nullptr; 334 334 335 335 internalState_ |= Bad; … … 388 388 // No event gets triggered here yet! 389 389 BOOST_FOREACH(InputDevice* device, devices_) 390 if (device != NULL)390 if (device != nullptr) 391 391 device->update(time); 392 392 … … 419 419 for (unsigned int i = 0; i < devices_.size(); ++i) 420 420 { 421 if (devices_[i] == NULL)421 if (devices_[i] == nullptr) 422 422 continue; 423 423 std::vector<InputState*>& states = devices_[i]->getStateListRef(); … … 439 439 std::set<InputState*> tempSet; 440 440 for (unsigned int i = 0; i < devices_.size(); ++i) 441 if (devices_[i] != NULL)441 if (devices_[i] != nullptr) 442 442 for (unsigned int iState = 0; iState < devices_[i]->getStateListRef().size(); ++iState) 443 443 tempSet.insert(devices_[i]->getStateListRef()[iState]); … … 467 467 { 468 468 BOOST_FOREACH(InputDevice* device, devices_) 469 if (device != NULL)469 if (device != nullptr) 470 470 device->clearBuffers(); 471 471 } … … 477 477 478 478 BOOST_FOREACH(InputDevice* device, devices_) 479 if (device != NULL)479 if (device != nullptr) 480 480 device->startCalibration(); 481 481 … … 488 488 { 489 489 BOOST_FOREACH(InputDevice* device, devices_) 490 if (device != NULL)490 if (device != nullptr) 491 491 device->stopCalibration(); 492 492 … … 509 509 { 510 510 Mouse* mouse = static_cast<Mouse*>(devices_[InputDeviceEnumerator::Mouse]); 511 if (mouse != NULL)511 if (mouse != nullptr) 512 512 { 513 513 const OIS::MouseState state = mouse->getOISDevice()->getMouseState(); -
code/branches/cpp11_v2/src/libraries/core/input/InputManager.h
r8729 r10765 134 134 Returns a pointer to a InputState referenced by name. 135 135 @return 136 Returns NULLif state was not found.136 Returns nullptr if state was not found. 137 137 */ 138 138 InputState* getState(const std::string& name); -
code/branches/cpp11_v2/src/libraries/core/input/InputState.cc
r8729 r10765 49 49 priority_ = 0; 50 50 51 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + this->getJoyStickList().size(), NULL);51 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + this->getJoyStickList().size(), nullptr); 52 52 } 53 53 … … 55 55 { 56 56 if (device < handlers_.size()) 57 return handlers_[device] != NULL;57 return handlers_[device] != nullptr; 58 58 else 59 59 return false; … … 64 64 { 65 65 unsigned int oldSize = handlers_.size(); 66 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + joyStickList.size(), NULL);66 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + joyStickList.size(), nullptr); 67 67 68 68 for (unsigned int i = oldSize; i < handlers_.size(); ++i) -
code/branches/cpp11_v2/src/libraries/core/input/InputState.h
r8729 r10765 179 179 { 180 180 for (unsigned int i = 0; i < handlers_.size(); ++i) 181 if (handlers_[i] != NULL)181 if (handlers_[i] != nullptr) 182 182 INPUT_STATE_PUSH_CALL(i, allDevicesUpdated, dt); 183 183 } … … 188 188 { 189 189 case InputDeviceEnumerator::Keyboard: 190 if (handlers_[keyboardIndex_s] != NULL)190 if (handlers_[keyboardIndex_s] != nullptr) 191 191 INPUT_STATE_PUSH_CALL(keyboardIndex_s, keyboardUpdated, dt); 192 192 break; 193 193 194 194 case InputDeviceEnumerator::Mouse: 195 if (handlers_[mouseIndex_s] != NULL)195 if (handlers_[mouseIndex_s] != nullptr) 196 196 INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseUpdated, dt); 197 197 break; 198 198 199 199 default: // joy sticks 200 if (handlers_[device] != NULL)200 if (handlers_[device] != nullptr) 201 201 INPUT_STATE_PUSH_CALL(device, joyStickUpdated, device - firstJoyStickIndex_s, dt); 202 202 break; … … 208 208 { 209 209 assert(device < handlers_.size()); 210 if (handlers_[device] != NULL)210 if (handlers_[device] != nullptr) 211 211 { 212 212 // We have to store the function pointer to tell the compiler about its actual type because of overloading … … 218 218 ORX_FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) 219 219 { 220 if (handlers_[mouseIndex_s] != NULL)220 if (handlers_[mouseIndex_s] != nullptr) 221 221 INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseMoved, abs, rel, clippingSize); 222 222 } … … 224 224 ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel) 225 225 { 226 if (handlers_[mouseIndex_s] != NULL)226 if (handlers_[mouseIndex_s] != nullptr) 227 227 INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseScrolled, abs, rel); 228 228 } … … 231 231 { 232 232 assert(device < handlers_.size()); 233 if (handlers_[device] != NULL)233 if (handlers_[device] != nullptr) 234 234 INPUT_STATE_PUSH_CALL(device, axisMoved, device - firstJoyStickIndex_s, axis, value); 235 235 } -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc
r10624 r10765 53 53 : deriveTime_(0.0f) 54 54 , filename_(filename) 55 , configFile_( NULL)56 , fallbackConfigFile_( NULL)55 , configFile_(nullptr) 56 , fallbackConfigFile_(nullptr) 57 57 { 58 58 mouseRelative_[0] = 0; … … 170 170 171 171 // load the bindings if required 172 if (configFile_ != NULL)172 if (configFile_ != nullptr) 173 173 { 174 174 for (unsigned int iDev = oldValue; iDev < joySticks_.size(); ++iDev) -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.h
r9978 r10765 159 159 //! Name of the file used in this KeyBinder (constant!) 160 160 const std::string filename_; 161 //! Config file used. NULLin case of KeyDetector. Also indicates whether we've already loaded.161 //! Config file used. nullptr in case of KeyDetector. Also indicates whether we've already loaded. 162 162 ConfigFile* configFile_; 163 163 //! Config file from the data directory that only serves as fallback -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc
r10624 r10765 56 56 57 57 KeyBinderManager::KeyBinderManager() 58 : currentBinder_( NULL)58 : currentBinder_(nullptr) 59 59 , bDefaultFileLoaded_(true) 60 60 , bBinding_(false) -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.h
r9667 r10765 107 107 108 108 // KeyBinder management 109 KeyBinder* currentBinder_; //! Currently selected KeyBinder (never NULL!)109 KeyBinder* currentBinder_; //! Currently selected KeyBinder (never nullptr!) 110 110 std::map<std::string, KeyBinder*> binders_; //! All loaded KeyBinders 111 111 bool bDefaultFileLoaded_; //! Tells whether the default one is loaded -
code/branches/cpp11_v2/src/libraries/core/input/KeyDetector.cc
r10624 r10765 62 62 KeyDetector::~KeyDetector() 63 63 { 64 inputState_->setHandler( NULL);64 inputState_->setHandler(nullptr); 65 65 InputManager::getInstance().destroyState("detector"); 66 66 ModifyConsoleCommand(__CC_KeyDetector_callback_name).resetFunction(); -
code/branches/cpp11_v2/src/libraries/core/module/DynLib.cc
r10540 r10765 56 56 { 57 57 mName = name; 58 m_hInst = NULL;58 m_hInst = nullptr; 59 59 } 60 60 … … 127 127 FORMAT_MESSAGE_FROM_SYSTEM | 128 128 FORMAT_MESSAGE_IGNORE_INSERTS, 129 NULL,129 nullptr, 130 130 GetLastError(), 131 131 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 132 132 (LPTSTR) &lpMsgBuf, 133 133 0, 134 NULL134 nullptr 135 135 ); 136 136 std::string ret = (char*)lpMsgBuf; -
code/branches/cpp11_v2/src/libraries/core/module/DynLib.h
r10541 r10765 45 45 #if defined(ORXONOX_PLATFORM_WINDOWS) 46 46 # define DYNLIB_HANDLE hInstance 47 # define DYNLIB_LOAD( a ) LoadLibraryEx( a, NULL, LOAD_WITH_ALTERED_SEARCH_PATH )47 # define DYNLIB_LOAD( a ) LoadLibraryEx( a, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH ) 48 48 # define DYNLIB_GETSYM( a, b ) GetProcAddress( a, b ) 49 49 # define DYNLIB_UNLOAD( a ) !FreeLibrary( a ) … … 104 104 the symbol. 105 105 @par 106 If the function fails, the returned value is <b> NULL</b>.106 If the function fails, the returned value is <b>nullptr</b>. 107 107 108 108 */ -
code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc
r10549 r10765 33 33 namespace orxonox 34 34 { 35 ModuleInstance* ModuleInstance::currentModuleInstance_s = NULL;35 ModuleInstance* ModuleInstance::currentModuleInstance_s = nullptr; 36 36 37 37 ModuleInstance::ModuleInstance(const std::string& libraryName) 38 38 : libraryName_(libraryName) 39 , dynLib_( NULL)39 , dynLib_(nullptr) 40 40 { 41 41 } -
code/branches/cpp11_v2/src/libraries/core/module/Plugin.cc
r10553 r10765 38 38 { 39 39 this->referenceCounter_ = 0; 40 this->moduleInstance_ = NULL;40 this->moduleInstance_ = nullptr; 41 41 } 42 42 43 43 Plugin::~Plugin() 44 44 { 45 if (this->moduleInstance_ != NULL)45 if (this->moduleInstance_ != nullptr) 46 46 { 47 47 this->referenceCounter_ = 1; // force unloading … … 77 77 Core::getInstance().unloadModule(this->moduleInstance_); 78 78 delete this->moduleInstance_; 79 this->moduleInstance_ = NULL;79 this->moduleInstance_ = nullptr; 80 80 } 81 81 else -
code/branches/cpp11_v2/src/libraries/core/module/PluginManager.cc
r10580 r10765 56 56 PluginManager::~PluginManager() 57 57 { 58 ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject( NULL);59 ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject( NULL);58 ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject(nullptr); 59 ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(nullptr); 60 60 61 61 for (std::map<std::string, PluginReference*>::iterator it = this->references_.begin(); it != this->references_.end(); ++it) … … 89 89 { 90 90 Plugin* plugin = this->plugins_[name]; 91 if (plugin != NULL)91 if (plugin != nullptr) 92 92 plugin->load(); 93 93 else … … 98 98 { 99 99 Plugin* plugin = this->plugins_[name]; 100 if (plugin != NULL)100 if (plugin != nullptr) 101 101 plugin->unload(); 102 102 else … … 109 109 void PluginManager::loadPlugin(const std::string& name) 110 110 { 111 if (this->references_[name] == NULL)111 if (this->references_[name] == nullptr) 112 112 { 113 113 this->references_[name] = new PluginReference(name); … … 124 124 { 125 125 PluginReference* reference = this->references_[name]; 126 if (reference != NULL)126 if (reference != nullptr) 127 127 { 128 this->references_[name] = NULL;128 this->references_[name] = nullptr; 129 129 delete reference; 130 130 } -
code/branches/cpp11_v2/src/libraries/core/object/Context.cc
r10624 r10765 46 46 static size_t count = 0; 47 47 // the first time this is called, ++count returns 1 and the context is created 48 // the second time this is called, ++count returns 2 and NULLis returned because we're in the constructor of the context itself48 // the second time this is called, ++count returns 2 and nullptr is returned because we're in the constructor of the context itself 49 49 // for each future call the context (now completely created) is returned 50 50 if (++count == 2) 51 return NULL;51 return nullptr; 52 52 else 53 53 { 54 static Context context( NULL);54 static Context context(nullptr); 55 55 return &context; 56 56 } … … 82 82 { 83 83 delete Context::rootContext_s; 84 Context::rootContext_s = NULL;84 Context::rootContext_s = nullptr; 85 85 } 86 86 87 87 /*static*/ Context* Context::getRootContext() 88 88 { 89 OrxVerify(Context::rootContext_s != NULL, "Root Context is undefined");89 OrxVerify(Context::rootContext_s != nullptr, "Root Context is undefined"); 90 90 return Context::rootContext_s; 91 91 } … … 105 105 ObjectListBase* objectList = this->getObjectList(identifier); 106 106 delete objectList; 107 this->objectLists_[identifier->getClassID()] = NULL;107 this->objectLists_[identifier->getClassID()] = nullptr; 108 108 } 109 109 } -
code/branches/cpp11_v2/src/libraries/core/object/Destroyable.cc
r10624 r10765 66 66 void Destroyable::destroy() 67 67 { 68 assert(this); // Just in case someone tries to delete a NULL pointer68 assert(this); // Just in case someone tries to delete a nullptr 69 69 this->requestedDestruction_ = true; 70 70 if (this->referenceCount_ == 0) -
code/branches/cpp11_v2/src/libraries/core/object/IteratorBase.h
r10736 r10765 58 58 @brief Constructor: Sets the element, whereon the iterator points, to the given element. 59 59 */ 60 inline IteratorBase(ObjectListElement<T>* element = NULL)60 inline IteratorBase(ObjectListElement<T>* element = nullptr) 61 61 { 62 62 this->element_ = element; … … 151 151 inline operator bool() const 152 152 { 153 return (this->element_ != NULL);153 return (this->element_ != nullptr); 154 154 } 155 155 … … 208 208 } 209 209 else 210 this->list_ = NULL;210 this->list_ = nullptr; 211 211 } 212 212 -
code/branches/cpp11_v2/src/libraries/core/object/StrongPtr.h
r10745 r10765 248 248 } 249 249 250 /// Returns true if the wrapped pointer is NULL.250 /// Returns true if the wrapped pointer is nullptr. 251 251 inline bool operator!() const 252 252 { … … 269 269 } 270 270 271 /// Resets the strong pointer (equivalent to assigning a NULL pointer).271 /// Resets the strong pointer (equivalent to assigning a nullptr). 272 272 inline void reset() 273 273 { -
code/branches/cpp11_v2/src/libraries/core/object/WeakPtr.h
r10745 r10765 37 37 38 38 A WeakPtr wraps a pointer to an object. If the object gets deleted, the WeakPtr becomes 39 NULL. This can be used to store pointers to objects without knowing when they will be39 nullptr. This can be used to store pointers to objects without knowing when they will be 40 40 destroyed. 41 41 … … 50 50 WeakPtr<MyClass> pointer = object; // create a WeakPtr and assign the object 51 51 52 if (pointer) // checks if pointer is not NULL(which is true)52 if (pointer) // checks if pointer is not nullptr (which is true) 53 53 pointer->someFunction(); // calls MyClass::someFunction() 54 54 55 55 object->destroy(); // calls destroy() which deletes the object 56 56 57 if (pointer) // checks if pointer is not NULL(which is now false)57 if (pointer) // checks if pointer is not nullptr (which is now false) 58 58 pointer->someFunction(); // this will not be executed 59 59 @endcode … … 91 91 { 92 92 /** 93 @brief WeakPtr wraps a pointer to an object, which becomes NULLif the object is deleted.93 @brief WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted. 94 94 95 95 @see See @ref WeakPtrExample "this description" for more information and an example. … … 183 183 } 184 184 185 /// Returns true if the wrapped pointer is NULL.185 /// Returns true if the wrapped pointer is nullptr. 186 186 inline bool operator!() const 187 187 { … … 210 210 } 211 211 212 /// Resets the weak pointer (equivalent to assigning a NULL pointer).212 /// Resets the weak pointer (equivalent to assigning a nullptr). 213 213 inline void reset() 214 214 { -
code/branches/cpp11_v2/src/libraries/core/singleton/ScopedSingletonIncludes.h
r10535 r10765 71 71 */ 72 72 #define ManageScopedSingleton(className, scope, allowedToFail) \ 73 className* className::singletonPtr_s = NULL; \73 className* className::singletonPtr_s = nullptr; \ 74 74 static ScopedSingletonWrapper& className##ScopedSingletonWrapper \ 75 75 = (new orxonox::SI_SSW(new ClassScopedSingletonWrapper<className, allowedToFail>(#className), scope))->getWrapper() -
code/branches/cpp11_v2/src/libraries/core/singleton/ScopedSingletonWrapper.h
r10528 r10765 91 91 ClassScopedSingletonWrapper(const std::string& className) 92 92 : ScopedSingletonWrapper(className) 93 , singletonPtr_( NULL)93 , singletonPtr_(nullptr) 94 94 { 95 95 } … … 104 104 void activated() 105 105 { 106 assert(singletonPtr_ == NULL);106 assert(singletonPtr_ == nullptr); 107 107 singletonPtr_ = new T(); 108 108 } … … 111 111 void deactivated() 112 112 { 113 assert(singletonPtr_ != NULL);113 assert(singletonPtr_ != nullptr); 114 114 this->destroy(singletonPtr_); 115 singletonPtr_ = NULL;115 singletonPtr_ = nullptr; 116 116 } 117 117 … … 146 146 ClassScopedSingletonWrapper(const std::string& className) 147 147 : ScopedSingletonWrapper(className) 148 , singletonPtr_( NULL)148 , singletonPtr_(nullptr) 149 149 { 150 150 } … … 159 159 void activated() 160 160 { 161 assert(singletonPtr_ == NULL);161 assert(singletonPtr_ == nullptr); 162 162 try 163 163 { singletonPtr_ = new T(); } … … 171 171 void deactivated() 172 172 { 173 if (singletonPtr_ != NULL)173 if (singletonPtr_ != nullptr) 174 174 { 175 175 this->destroy(singletonPtr_); 176 singletonPtr_ = NULL;176 singletonPtr_ = nullptr; 177 177 } 178 178 } -
code/branches/cpp11_v2/src/libraries/network/ClientConnection.cc
r8858 r10765 44 44 Connection(NETWORK_PEER_ID_SERVER), 45 45 established_(false), 46 server_( NULL)46 server_(nullptr) 47 47 { 48 48 this->serverAddress_ = new ENetAddress(); … … 72 72 73 73 // create host 74 this->host_ = enet_host_create( NULL, NETWORK_CLIENT_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0);74 this->host_ = enet_host_create(nullptr, NETWORK_CLIENT_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0); 75 75 76 if ( this->host_ == NULL)76 if ( this->host_ == nullptr ) 77 77 { 78 orxout(internal_error, context::network) << "ClientConnection: host_ == NULL" << endl;78 orxout(internal_error, context::network) << "ClientConnection: host_ == nullptr" << endl; 79 79 // error handling 80 80 return false; … … 93 93 94 94 this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CHANNEL_COUNT, 0); 95 if ( this->server_== NULL)95 if ( this->server_==nullptr ) 96 96 { 97 orxout(internal_error, context::network) << "ClientConnection: server_ == NULL" << endl;97 orxout(internal_error, context::network) << "ClientConnection: server_ == nullptr" << endl; 98 98 // error handling 99 99 return false; -
code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc
r10624 r10765 48 48 bool FunctionCall::execute(){ 49 49 NetworkFunctionBase* fct = NetworkFunctionManager::getInstance().getFunctionByNetworkId( this->functionID_ ); 50 assert( fct != NULL);50 assert( fct != nullptr ); 51 51 assert( this->nrOfArguments_==this->arguments_.size() ); 52 52 switch(this->nrOfArguments_) -
code/branches/cpp11_v2/src/libraries/network/LANDiscoverable.cc
r10622 r10765 85 85 assert( this->host_ == 0 ); 86 86 this->host_ = enet_host_create( &bindAddress, 10, 0, 0, 0 ); 87 if ( this->host_ == NULL)88 orxout(internal_error, context::network) << "LANDiscoverable: host_ == NULL" << endl;87 if ( this->host_ == nullptr ) 88 orxout(internal_error, context::network) << "LANDiscoverable: host_ == nullptr" << endl; 89 89 } 90 90 else -
code/branches/cpp11_v2/src/libraries/network/LANDiscovery.cc
r10624 r10765 42 42 LANDiscovery::LANDiscovery() 43 43 { 44 this->host_ = enet_host_create( NULL, 10, 0, 0, 0 );45 if ( this->host_ == NULL)46 orxout(internal_error, context::network) << "LANDiscovery: host_ == NULL" << endl;44 this->host_ = enet_host_create(nullptr, 10, 0, 0, 0 ); 45 if ( this->host_ == nullptr ) 46 orxout(internal_error, context::network) << "LANDiscovery: host_ == nullptr" << endl; 47 47 } 48 48 49 49 LANDiscovery::~LANDiscovery() 50 50 { 51 if (this->host_ != NULL)51 if (this->host_ != nullptr) 52 52 enet_host_destroy(this->host_); 53 53 } … … 65 65 address.host = ENET_HOST_BROADCAST; 66 66 peer = enet_host_connect(this->host_, &address, 0, 0); 67 if (peer == NULL)67 if (peer == nullptr) 68 68 orxout(internal_error, context::network) << "Could not send LAN discovery to IPv4 Broadcast." << endl; 69 69 … … 71 71 enet_address_set_host(&address, "ff02::1"); // TODO: use a multicast group 72 72 peer = enet_host_connect(this->host_, &address, 0, 0); 73 if (peer == NULL)73 if (peer == nullptr) 74 74 orxout(internal_error, context::network) << "Could not send LAN discovery to IPv6 Multicast." << endl; 75 75 -
code/branches/cpp11_v2/src/libraries/network/MasterServer.cc
r10624 r10765 43 43 44 44 /* forward declaration so the linker doesn't complain */ 45 MasterServer *MasterServer::instance = NULL;45 MasterServer *MasterServer::instance = nullptr; 46 46 47 47 /* command: list servers */ … … 345 345 /***** ENTER MAIN LOOP *****/ 346 346 ENetEvent *event = (ENetEvent *)calloc(sizeof(ENetEvent), sizeof(char)); 347 if( event == NULL)347 if( event == nullptr ) 348 348 { 349 349 orxout(user_error, context::master_server) << "Could not create ENetEvent structure, exiting." << endl; -
code/branches/cpp11_v2/src/libraries/network/MasterServerComm.cc
r8858 r10765 54 54 55 55 /* initiate the client */ 56 this->client = enet_host_create( NULL/* create a client host */,56 this->client = enet_host_create( nullptr /* create a client host */, 57 57 1, 58 58 2, /* allow up 2 channels to be used, 0 and 1 */ … … 61 61 62 62 /* see if it worked */ 63 if (this->client == NULL)63 if (this->client == nullptr) 64 64 { orxout(internal_error, context::master_server) << "An error occurred while trying to create an " 65 65 << "ENet client host." << endl; … … 85 85 this->peer = enet_host_connect(this->client, &this->address, 2, 0); 86 86 87 if( this->peer == NULL)87 if( this->peer == nullptr ) 88 88 { orxout(internal_error, context::master_server) << "No available peers for initiating an ENet" 89 89 << " connection." << endl; … … 157 157 158 158 /* address buffer */ 159 char *addrconv = NULL;159 char *addrconv = nullptr; 160 160 int retval = 0; 161 161 … … 193 193 194 194 /* call the supplied callback, if any. */ 195 if( listener != NULL)195 if( listener != nullptr ) 196 196 retval = listener->rhandler( addrconv, &(this->event) ); 197 197 -
code/branches/cpp11_v2/src/libraries/network/NetworkFunctionManager.cc
r10624 r10765 71 71 return it->second; 72 72 else 73 return NULL;73 return nullptr; 74 74 } 75 75 -
code/branches/cpp11_v2/src/libraries/network/PeerList.cc
r10622 r10765 41 41 PeerList::addPeer( ENetPeer *toadd ) 42 42 { /* error correction */ 43 if( toadd == NULL)43 if( toadd == nullptr ) 44 44 { orxout(internal_error, context::master_server) << "PeerList::addPeer: empty peer given." << endl; 45 45 return -1; … … 92 92 93 93 /* not found */ 94 return NULL;94 return nullptr; 95 95 } 96 96 -
code/branches/cpp11_v2/src/libraries/network/Server.cc
r10622 r10765 244 244 { 245 245 // ClientInformation *temp = ClientInformation::getBegin(); 246 // if( temp == NULL)246 // if( temp == nullptr ) 247 247 //no client connected 248 248 if( this->clientIDs_.size()==0 ) … … 255 255 } 256 256 // orxout(verbose, context::network) << "sending DeleteObjects" << endl; 257 // while(temp != NULL){257 // while(temp != nullptr){ 258 258 // if( !(temp->getSynched()) ) 259 259 // { -
code/branches/cpp11_v2/src/libraries/network/ServerConnection.cc
r8858 r10765 73 73 this->host_ = enet_host_create(this->bindAddress_, NETWORK_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0); 74 74 75 if ( this->host_ == NULL)75 if ( this->host_ == nullptr ) 76 76 { 77 orxout(internal_error, context::network) << "ServerConnection: host_ == NULL" << endl;77 orxout(internal_error, context::network) << "ServerConnection: host_ == nullptr" << endl; 78 78 return false; 79 79 } -
code/branches/cpp11_v2/src/libraries/network/packet/ClassID.cc
r9667 r10765 58 58 for(;it != IdentifierManager::getInstance().getIdentifierByStringMap().end();++it){ 59 59 id = it->second; 60 if(id == NULL|| !id->hasFactory())60 if(id == nullptr || !id->hasFactory()) 61 61 continue; 62 62 const std::string& classname = id->getName(); … … 144 144 id=ClassByString( std::string((const char*)classname) ); 145 145 orxout(internal_info, context::packets) << "processing classid: " << networkID << " name: " << classname << " id: " << id << endl; 146 if(id== NULL){146 if(id==nullptr){ 147 147 orxout(user_error, context::packets) << "Received a bad classname" << endl; 148 148 abort(); -
code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc
r9667 r10765 608 608 609 609 if(dest_length==0) 610 return NULL;610 return nullptr; 611 611 612 612 uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()]; … … 645 645 646 646 if(dest_length==0) 647 return NULL;647 return nullptr; 648 648 649 649 uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()]; -
code/branches/cpp11_v2/src/libraries/network/packet/Packet.cc
r8858 r10765 122 122 // Destroy the ENetPacket if necessary. 123 123 // Note: For the case ENet used the callback to destroy the packet, we have already set 124 // enetPacket_ to NULLto avoid destroying it again.124 // enetPacket_ to nullptr to avoid destroying it again. 125 125 if (this->enetPacket_) 126 126 { -
code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc
r10624 r10765 105 105 uint32_t Synchronisable::findContextID(Context* context) 106 106 { 107 if (context == NULL)107 if (context == nullptr) 108 108 return OBJECTID_UNKNOWN; 109 109 110 110 Synchronisable* synchronisableContext = orxonox_cast<Synchronisable*>(context); 111 if (synchronisableContext != NULL)111 if (synchronisableContext != nullptr) 112 112 return synchronisableContext->getObjectID(); 113 113 else … … 226 226 return it1->second; 227 227 // if the objects not in the map it should'nt exist at all anymore 228 return NULL;228 return nullptr; 229 229 } 230 230 -
code/branches/cpp11_v2/src/libraries/tools/ResourceCollection.cc
r9667 r10765 93 93 { 94 94 if (index >= resourceLocations_.size()) 95 return NULL;95 return nullptr; 96 96 else 97 97 return resourceLocations_[index]; -
code/branches/cpp11_v2/src/libraries/tools/Shader.cc
r10727 r10765 109 109 { 110 110 // For the moment, we get the viewport always from the graphics manager 111 // TODO: Try to support multiple viewports - note however that scenemanager_->getCurrentViewport() returns NULL111 // TODO: Try to support multiple viewports - note however that scenemanager_->getCurrentViewport() returns nullptr 112 112 // after switching to a camera in a different scene (only for the first time this scene is displayed though) 113 113 this->changedCompositorName(GraphicsManager::getInstance().getViewport()); -
code/branches/cpp11_v2/src/libraries/util/Clipboard.cc
r8858 r10765 93 93 { 94 94 HANDLE hData = GetClipboardData(CF_TEXT); 95 if (hData == NULL)95 if (hData == nullptr) 96 96 return ""; 97 97 std::string output(static_cast<char*>(GlobalLock(hData))); -
code/branches/cpp11_v2/src/libraries/util/DestructionHelper.h
r8423 r10765 36 36 /** Deletes an object and resets the pointer 37 37 @param object 38 Pointer to an object. Handing over NULLis safe.38 Pointer to an object. Handing over nullptr is safe. 39 39 */ 40 40 template <class T> … … 42 42 { 43 43 delete *object; 44 *object = NULL;44 *object = nullptr; 45 45 } 46 46 -
code/branches/cpp11_v2/src/libraries/util/SharedPtr.h
r10745 r10765 215 215 216 216 public: 217 /// Default constructor, the pointer is set to NULL.217 /// Default constructor, the pointer is set to nullptr. 218 218 inline SharedPtr() : pointer_(0), counter_(0) 219 219 { … … 310 310 } 311 311 312 /// Returns true if the pointer is not NULL.312 /// Returns true if the pointer is not nullptr. 313 313 inline operator bool() const 314 314 { -
code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc
r9682 r10765 44 44 namespace orxonox 45 45 { 46 SignalHandler* SignalHandler::singletonPtr_s = NULL;46 SignalHandler* SignalHandler::singletonPtr_s = nullptr; 47 47 } 48 48 … … 175 175 dup2( gdbErr[1], STDERR_FILENO ); 176 176 177 execlp( "sh", "sh", "-c", "gdb", static_cast<void*>( NULL));177 execlp( "sh", "sh", "-c", "gdb", static_cast<void*>(nullptr)); 178 178 } 179 179 … … 186 186 perror("pipe failed!\n"); 187 187 kill( gdbPid, SIGTERM ); 188 waitpid( gdbPid, NULL, 0 );188 waitpid( gdbPid, nullptr, 0 ); 189 189 exit(EXIT_FAILURE); 190 190 } … … 196 196 perror("fork failed!\n"); 197 197 kill( gdbPid, SIGTERM ); 198 waitpid( gdbPid, NULL, 0 );198 waitpid( gdbPid, nullptr, 0 ); 199 199 exit(EXIT_FAILURE); 200 200 } … … 297 297 298 298 299 waitpid( sigPid, NULL, 0 );300 waitpid( gdbPid, NULL, 0 );299 waitpid( sigPid, nullptr, 0 ); 300 waitpid( gdbPid, nullptr, 0 ); 301 301 302 302 int wsRemoved = 0; … … 312 312 bt.erase(0, 1); 313 313 314 time_t now = time( NULL);314 time_t now = time(nullptr); 315 315 316 316 std::string timeString = … … 388 388 SignalHandler::SignalHandler() 389 389 { 390 this->prevExceptionFilter_ = NULL;390 this->prevExceptionFilter_ = nullptr; 391 391 } 392 392 … … 394 394 SignalHandler::~SignalHandler() 395 395 { 396 if (this->prevExceptionFilter_ != NULL)396 if (this->prevExceptionFilter_ != nullptr) 397 397 { 398 398 // Remove the unhandled exception filter function 399 399 SetUnhandledExceptionFilter(this->prevExceptionFilter_); 400 this->prevExceptionFilter_ = NULL;400 this->prevExceptionFilter_ = nullptr; 401 401 } 402 402 } … … 408 408 409 409 // don't register twice 410 assert(this->prevExceptionFilter_ == NULL);411 412 if (this->prevExceptionFilter_ == NULL)410 assert(this->prevExceptionFilter_ == nullptr); 411 412 if (this->prevExceptionFilter_ == nullptr) 413 413 { 414 414 // Install the unhandled exception filter function … … 441 441 std::ofstream crashlog(SignalHandler::getInstance().filename_.c_str()); 442 442 443 time_t now = time( NULL);443 time_t now = time(nullptr); 444 444 445 445 crashlog << "=======================================================" << endl; … … 480 480 } 481 481 482 /// Returns the stack trace for either the current function, or, if @a pExceptionInfo is not NULL, for the given exception context.482 /// Returns the stack trace for either the current function, or, if @a pExceptionInfo is not nullptr, for the given exception context. 483 483 /* static */ std::string SignalHandler::getStackTrace(PEXCEPTION_POINTERS pExceptionInfo) 484 484 { … … 625 625 #ifdef ORXONOX_COMPILER_GCC 626 626 int status; 627 char* demangled = __cxxabiv1::__cxa_demangle(symbol->Name, NULL, NULL, &status);627 char* demangled = __cxxabiv1::__cxa_demangle(symbol->Name, nullptr, nullptr, &status); 628 628 if (demangled) 629 629 { … … 684 684 HMODULE hModule; 685 685 686 std::string output = (GetModuleFileName( NULL, szModule, MAX_PATH) ? SignalHandler::getModuleName(szModule) : "Application");686 std::string output = (GetModuleFileName(nullptr, szModule, MAX_PATH) ? SignalHandler::getModuleName(szModule) : "Application"); 687 687 output += " caused "; 688 688 -
code/branches/cpp11_v2/src/libraries/util/SignalHandler.h
r9550 r10765 113 113 void doCatch(const std::string& appName, const std::string& filename); 114 114 115 static std::string getStackTrace(PEXCEPTION_POINTERS pExceptionInfo = NULL);115 static std::string getStackTrace(PEXCEPTION_POINTERS pExceptionInfo = nullptr); 116 116 static std::string getExceptionType(PEXCEPTION_POINTERS pExceptionInfo); 117 117 -
code/branches/cpp11_v2/src/libraries/util/Singleton.h
r10624 r10765 66 66 And don't forget to initialize the static singleton pointer in the source (*.cc) %file: 67 67 @code 68 TestSingleton* TestSingleton::singletonPtr_s = NULL;68 TestSingleton* TestSingleton::singletonPtr_s = nullptr; 69 69 @endcode 70 70 … … 118 118 static T& getInstance() 119 119 { 120 OrxVerify(T::singletonPtr_s != NULL, "T=" << typeid(T).name());120 OrxVerify(T::singletonPtr_s != nullptr, "T=" << typeid(T).name()); 121 121 return *T::singletonPtr_s; 122 122 } … … 125 125 static bool exists() 126 126 { 127 return (T::singletonPtr_s != NULL);127 return (T::singletonPtr_s != nullptr); 128 128 } 129 129 … … 132 132 Singleton() 133 133 { 134 OrxVerify(T::singletonPtr_s == NULL, "T=" << typeid(T).name());134 OrxVerify(T::singletonPtr_s == nullptr, "T=" << typeid(T).name()); 135 135 T::singletonPtr_s = static_cast<T*>(this); 136 136 } … … 139 139 virtual ~Singleton() 140 140 { 141 OrxVerify(T::singletonPtr_s != NULL, "T=" << typeid(T).name());142 T::singletonPtr_s = NULL;141 OrxVerify(T::singletonPtr_s != nullptr, "T=" << typeid(T).name()); 142 T::singletonPtr_s = nullptr; 143 143 } 144 144 -
code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc
r7401 r10765 97 97 setNext(block + i * this->chunkSize_, block + (i + 1) * this->chunkSize_); 98 98 99 // the next_ pointer of the last chunk must point to NULL99 // the next_ pointer of the last chunk must point to nullptr 100 100 setNext(block + (this->numChunksPerBlock_ - 1) * this->chunkSize_, 0); 101 101 -
code/branches/cpp11_v2/src/modules/designtools/ScreenshotManager.cc
r10624 r10765 69 69 Constructor. 70 70 */ 71 ScreenshotManager::ScreenshotManager() : finalPicturePB_( NULL), data_(NULL)71 ScreenshotManager::ScreenshotManager() : finalPicturePB_(nullptr), data_(nullptr) 72 72 { 73 73 RegisterObject(ScreenshotManager); … … 90 90 void ScreenshotManager::cleanup(void) 91 91 { 92 if(this->finalPicturePB_ != NULL)92 if(this->finalPicturePB_ != nullptr) 93 93 { 94 94 delete this->finalPicturePB_; 95 this->finalPicturePB_ = NULL;96 } 97 if(this->data_ != NULL)95 this->finalPicturePB_ = nullptr; 96 } 97 if(this->data_ != nullptr) 98 98 { 99 99 delete this->data_; 100 this->data_ = NULL;100 this->data_ = nullptr; 101 101 } 102 102 if(!this->tempTexture_.isNull()) … … 151 151 // Get the screenshot. 152 152 Ogre::Image* finalImage = getScreenshot(); 153 if(finalImage != NULL)153 if(finalImage != nullptr) 154 154 { 155 155 // Save it. … … 173 173 Ogre::Image* ScreenshotManager::getScreenshot() 174 174 { 175 if(CameraManager::getInstance().getActiveCamera() == NULL)176 return NULL;175 if(CameraManager::getInstance().getActiveCamera() == nullptr ) 176 return nullptr; 177 177 return this->getScreenshot(CameraManager::getInstance().getActiveCamera()->getOgreCamera()); 178 178 } … … 189 189 Ogre::Image* ScreenshotManager::getScreenshot(Ogre::Camera* camera) 190 190 { 191 if(camera == NULL)192 return NULL;191 if(camera == nullptr) 192 return nullptr; 193 193 194 194 // Update the internal parameters. -
code/branches/cpp11_v2/src/modules/designtools/SkyboxGenerator.cc
r10624 r10765 146 146 } 147 147 148 ControllableEntity* entity = NULL;149 if(HumanController::getLocalControllerSingleton() != NULL && HumanController::getLocalControllerSingleton()->getControllableEntity() != NULL)148 ControllableEntity* entity = nullptr; 149 if(HumanController::getLocalControllerSingleton() != nullptr && HumanController::getLocalControllerSingleton()->getControllableEntity() != nullptr) 150 150 entity = HumanController::getLocalControllerSingleton()->getControllableEntity(); 151 151 else -
code/branches/cpp11_v2/src/modules/docking/Dock.cc
r10624 r10765 87 87 88 88 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 89 PlayerInfo* player = NULL;89 PlayerInfo* player = nullptr; 90 90 91 91 // Check whether it is a player trigger and extract pawn from it 92 if(pTrigger != NULL)92 if(pTrigger != nullptr) 93 93 { 94 94 if(!pTrigger->isForPlayer()) { // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 103 103 return false; 104 104 } 105 if(player == NULL)105 if(player == nullptr) 106 106 { 107 107 orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl; … … 131 131 { 132 132 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 133 PlayerInfo* player = NULL;133 PlayerInfo* player = nullptr; 134 134 135 135 // Check whether it is a player trigger and extract pawn from it 136 if(pTrigger != NULL)136 if(pTrigger != nullptr) 137 137 { 138 138 if(!pTrigger->isForPlayer()) { // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 147 147 return false; 148 148 } 149 if(player == NULL)149 if(player == nullptr) 150 150 { 151 151 orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl; … … 315 315 } 316 316 } 317 return NULL;317 return nullptr; 318 318 } 319 319 … … 333 333 i--; 334 334 } 335 return NULL;335 return nullptr; 336 336 } 337 337 … … 352 352 i--; 353 353 } 354 return NULL;354 return nullptr; 355 355 } 356 356 } -
code/branches/cpp11_v2/src/modules/docking/DockToShip.cc
r9974 r10765 72 72 73 73 DockingTarget *target = DockingEffect::findTarget(this->target_); 74 if (target == NULL) {74 if (target == nullptr) { 75 75 orxout(internal_warning, context::docking) << "Can't retrieve target for '" << this->target_ << "'.." << endl; 76 76 return false; … … 78 78 79 79 ControllableEntity *dockTo = (ControllableEntity*) target->getParent(); 80 if (dockTo == NULL) {80 if (dockTo == nullptr) { 81 81 orxout(internal_warning, context::docking) << "Parent is not a ControllableEntity.." << endl; 82 82 return false; -
code/branches/cpp11_v2/src/modules/docking/DockingAnimation.cc
r10624 r10765 45 45 RegisterObject(DockingAnimation); 46 46 47 this->parent_ = NULL;47 this->parent_ = nullptr; 48 48 } 49 49 -
code/branches/cpp11_v2/src/modules/docking/DockingController.cc
r9667 r10765 44 44 RegisterObject(DockingController); 45 45 46 this->dock_ = NULL;47 this->player_ = NULL;48 this->entity_ = NULL;46 this->dock_ = nullptr; 47 this->player_ = nullptr; 48 this->entity_ = nullptr; 49 49 } 50 50 … … 122 122 this->player_->startControl(this->entity_); 123 123 this->setActive(false); 124 this->controllableEntity_ = NULL;124 this->controllableEntity_ = nullptr; 125 125 126 126 if (this->docking_) -
code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc
r10624 r10765 70 70 return (*it); 71 71 } 72 return NULL;72 return nullptr; 73 73 } 74 74 } -
code/branches/cpp11_v2/src/modules/dodgerace/DodgeRace.cc
r10624 r10765 67 67 { 68 68 level++; 69 if (getPlayer() != NULL)69 if (getPlayer() != nullptr) 70 70 { 71 71 for (int i = 0; i < 7; i++) … … 85 85 void DodgeRace::tick(float dt) 86 86 { 87 if (getPlayer() != NULL)87 if (getPlayer() != nullptr) 88 88 { 89 89 currentPosition = getPlayer()->getWorldPosition().x; … … 134 134 DodgeRaceShip* DodgeRace::getPlayer() 135 135 { 136 if (player == NULL)136 if (player == nullptr) 137 137 { 138 138 for (ObjectList<DodgeRaceShip>::iterator it = ObjectList<DodgeRaceShip>::begin(); it != ObjectList<DodgeRaceShip>::end(); ++it) … … 173 173 this->bForceSpawn_ = false; 174 174 175 if (this->center_ == NULL) // abandon mission!175 if (this->center_ == nullptr) // abandon mission! 176 176 { 177 177 orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl; -
code/branches/cpp11_v2/src/modules/dodgerace/DodgeRaceCenterPoint.cc
r10624 r10765 56 56 void DodgeRaceCenterPoint::checkGametype() 57 57 { 58 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(DodgeRace)))58 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(DodgeRace))) 59 59 { 60 60 DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/dodgerace/DodgeRaceShip.cc
r10624 r10765 91 91 // Camera 92 92 Camera* camera = this->getCamera(); 93 if (camera != NULL)93 if (camera != nullptr) 94 94 { 95 95 // camera->setPosition(Vector3(-pos.z, -posforeward, 0)); … … 152 152 DodgeRace* DodgeRaceShip::getGame() 153 153 { 154 if (game == NULL)154 if (game == nullptr) 155 155 { 156 156 for (ObjectList<DodgeRace>::iterator it = ObjectList<DodgeRace>::begin(); it != ObjectList<DodgeRace>::end(); ++it) -
code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc
r9973 r10765 125 125 } 126 126 } 127 return NULL;127 return nullptr; 128 128 } 129 129 -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc
r10318 r10765 98 98 RaceCheckPoint* point2 = findCheckpoint((*numb)); 99 99 100 //if(point2 != NULL)100 //if(point2 != nullptr) 101 101 //placeVirtualCheckpoints((*it), point2); 102 102 } … … 126 126 staticRacePoints_ = findStaticCheckpoints(nextRaceCheckpoint_, checkpoints); 127 127 // initialisation of currentRaceCheckpoint_ 128 currentRaceCheckpoint_ = NULL;128 currentRaceCheckpoint_ = nullptr; 129 129 130 130 int i; 131 for (i = -2; findCheckpoint(i) != NULL; i--)131 for (i = -2; findCheckpoint(i) != nullptr; i--) 132 132 { 133 133 continue; … … 194 194 continue; 195 195 } 196 if (findCheckpoint(*it) == NULL)196 if (findCheckpoint(*it) == nullptr) 197 197 orxout(internal_warning) << "Problematic Point: " << (*it) << endl; 198 198 else … … 209 209 float SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint) 210 210 { 211 if (this->getControllableEntity() != NULL)211 if (this->getControllableEntity() != nullptr) 212 212 { 213 213 return (CheckPoint->getPosition()- this->getControllableEntity()->getPosition()).length(); … … 223 223 { 224 224 float minDistance = 0; 225 RaceCheckPoint* minNextRaceCheckPoint = NULL;225 RaceCheckPoint* minNextRaceCheckPoint = nullptr; 226 226 227 227 // find the next checkpoint with the minimal distance … … 231 231 float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition()); 232 232 233 if (distance < minDistance || minNextRaceCheckPoint == NULL)233 if (distance < minDistance || minNextRaceCheckPoint == nullptr) 234 234 { 235 235 minDistance = distance; … … 271 271 RaceCheckPoint* SpaceRaceController::adjustNextPoint() 272 272 { 273 if (currentRaceCheckpoint_ == NULL) // no Adjust possible273 if (currentRaceCheckpoint_ == nullptr) // no Adjust possible 274 274 275 275 { … … 292 292 if (this->checkpoints_[i]->getCheckpointIndex() == index) 293 293 return this->checkpoints_[i]; 294 return NULL;294 return nullptr; 295 295 } 296 296 … … 347 347 void SpaceRaceController::tick(float dt) 348 348 { 349 if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL)349 if (this->getControllableEntity() == nullptr || this->getControllableEntity()->getPlayer() == nullptr ) 350 350 { 351 351 //orxout()<< this->getControllableEntity() << " in tick"<<endl; … … 419 419 { 420 420 btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape(); 421 if(currentShape == NULL)421 if(currentShape == nullptr) 422 422 continue; 423 423 … … 447 447 { 448 448 btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape(); 449 if(currentShape == NULL)449 if(currentShape == nullptr) 450 450 continue; 451 451 … … 491 491 { 492 492 493 if (dynamic_cast<RaceCheckPoint*>(*it) != NULL)493 if (dynamic_cast<RaceCheckPoint*>(*it) != nullptr) 494 494 { 495 495 continue; … … 537 537 // btVector3 positionObject; 538 538 // btScalar radiusObject; 539 // if((*it)== NULL)539 // if((*it)==nullptr) 540 540 // { orxout()<<"Problempoint 1.1"<<endl; continue;} 541 541 // //TODO: Probably it points on a wrong object 542 542 // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++) 543 543 // { 544 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()== NULL)544 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr) 545 545 // { continue;} 546 546 // … … 570 570 // btVector3 positionObject; 571 571 // btScalar radiusObject; 572 // if((*it)== NULL)572 // if((*it)==nullptr) 573 573 // { orxout()<<"Problempoint 1"<<endl; continue;} 574 574 // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++) 575 575 // { 576 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()== NULL)576 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr) 577 577 // { orxout()<<"Problempoint 2.2"<<endl; continue;} 578 578 // (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject); -
code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc
r10624 r10765 71 71 this->players_ = this->race_->getPlayers(); 72 72 73 if (this->checkpoints_[0] != NULL&& !this->firstcheckpointvisible_)73 if (this->checkpoints_[0] != nullptr && !this->firstcheckpointvisible_) 74 74 { 75 75 this->checkpoints_[0]->setRadarVisibility(true); … … 121 121 bool SpaceRaceManager::reachedValidCheckpoint(RaceCheckPoint* oldCheckpoint, RaceCheckPoint* newCheckpoint, PlayerInfo* player) const 122 122 { 123 if (oldCheckpoint != NULL)123 if (oldCheckpoint != nullptr) 124 124 { 125 125 // the player already visited an old checkpoint; see which checkpoints are possible now -
code/branches/cpp11_v2/src/modules/invader/Invader.cc
r10733 r10765 78 78 { 79 79 level++; 80 if (getPlayer() != NULL)80 if (getPlayer() != nullptr) 81 81 { 82 82 for (int i = 0; i < 7; i++) … … 96 96 InvaderShip* Invader::getPlayer() 97 97 { 98 if (player == NULL)98 if (player == nullptr) 99 99 { 100 100 for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it) … … 106 106 void Invader::spawnEnemy() 107 107 { 108 if (getPlayer() == NULL)108 if (getPlayer() == nullptr) 109 109 return; 110 110 … … 158 158 this->bForceSpawn_ = true; 159 159 160 if (this->center_ == NULL) // abandon mission!160 if (this->center_ == nullptr) // abandon mission! 161 161 { 162 162 orxout(internal_error) << "Invader: No Centerpoint specified." << endl; -
code/branches/cpp11_v2/src/modules/invader/InvaderCenterPoint.cc
r10624 r10765 56 56 void InvaderCenterPoint::checkGametype() 57 57 { 58 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Invader)))58 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Invader))) 59 59 { 60 60 Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/invader/InvaderEnemy.cc
r10733 r10765 56 56 removeHealth(2000); 57 57 58 if (player != NULL)58 if (player != nullptr) 59 59 { 60 60 float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z); … … 73 73 Invader* InvaderEnemy::getGame() 74 74 { 75 if (game == NULL)75 if (game == nullptr) 76 76 { 77 77 for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it) … … 84 84 { 85 85 Pawn::damage(damage, healthdamage, shielddamage, originator, cs); 86 if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL&& getHealth() <= 0)86 if (getGame() && orxonox_cast<InvaderShip*>(originator) != nullptr && getHealth() <= 0) 87 87 getGame()->addPoints(42); 88 88 } -
code/branches/cpp11_v2/src/modules/invader/InvaderEnemyShooter.cc
r10733 r10765 59 59 removeHealth(2000); 60 60 61 if (player != NULL)61 if (player != nullptr) 62 62 { 63 63 float distPlayer = player->getPosition().z - getPosition().z; … … 77 77 { 78 78 Pawn::damage(damage, healthdamage, shielddamage, originator, cs); 79 if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL&& getHealth() <= 0)79 if (getGame() && orxonox_cast<InvaderShip*>(originator) != nullptr && getHealth() <= 0) 80 80 getGame()->addPoints(3*42); 81 81 } -
code/branches/cpp11_v2/src/modules/invader/InvaderShip.cc
r10733 r10765 95 95 // Camera 96 96 Camera* camera = this->getCamera(); 97 if (camera != NULL)97 if (camera != nullptr) 98 98 { 99 99 camera->setPosition(Vector3(-pos.z, -posforeward, 0)); … … 154 154 Projectile* shot = orxonox_cast<Projectile*>(otherObject); 155 155 // ensure that this gets only called once per enemy. 156 if (enemy != NULL&& lastEnemy != enemy)156 if (enemy != nullptr && lastEnemy != enemy) 157 157 { 158 158 lastEnemy = enemy; … … 165 165 } 166 166 // was shot, decrease multiplier 167 else if (shot != NULL&& lastShot != shot)167 else if (shot != nullptr && lastShot != shot) 168 168 { 169 if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != NULL)169 if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != nullptr) 170 170 { 171 171 if (getGame()->multiplier > 1) … … 182 182 Invader* InvaderShip::getGame() 183 183 { 184 if (game == NULL)184 if (game == nullptr) 185 185 { 186 186 for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it) -
code/branches/cpp11_v2/src/modules/jump/Jump.cc
r10733 r10765 83 83 SUPER(Jump, tick, dt); 84 84 85 if (figure_ != NULL)85 if (figure_ != nullptr) 86 86 { 87 87 Vector3 figurePosition = figure_->getPosition(); … … 130 130 131 131 132 if (camera != NULL)132 if (camera != nullptr) 133 133 { 134 134 Vector3 cameraPosition = Vector3(0, totalScreenShift_, 0); … … 275 275 void Jump::start() 276 276 { 277 if (center_ != NULL) // There needs to be a JumpCenterpoint, i.e. the area the game takes place.278 { 279 if (figure_ == NULL)277 if (center_ != nullptr) // There needs to be a JumpCenterpoint, i.e. the area the game takes place. 278 { 279 if (figure_ == nullptr) 280 280 { 281 281 figure_ = new JumpFigure(center_->getContext()); … … 298 298 Deathmatch::start(); 299 299 300 if (figure_ != NULL)300 if (figure_ != nullptr) 301 301 { 302 302 camera = figure_->getCamera(); … … 325 325 assert(player); 326 326 327 if (figure_->getPlayer() == NULL)327 if (figure_->getPlayer() == nullptr) 328 328 { 329 329 player->startControl(figure_); … … 334 334 PlayerInfo* Jump::getPlayer() const 335 335 { 336 if (this->figure_ != NULL)336 if (this->figure_ != nullptr) 337 337 { 338 338 return this->figure_->getPlayer(); … … 346 346 void Jump::addPlatform(JumpPlatform* newPlatform, std::string platformTemplate, float xPosition, float zPosition) 347 347 { 348 if (newPlatform != NULL && center_ != NULL)348 if (newPlatform != nullptr && center_ != nullptr) 349 349 { 350 350 newPlatform->addTemplate(platformTemplate); … … 414 414 { 415 415 JumpProjectile* newProjectile = new JumpProjectile(center_->getContext()); 416 if (newProjectile != NULL && center_ != NULL)416 if (newProjectile != nullptr && center_ != nullptr) 417 417 { 418 418 newProjectile->addTemplate(center_->getProjectileTemplate()); … … 427 427 { 428 428 JumpSpring* newSpring = new JumpSpring(center_->getContext()); 429 if (newSpring != NULL && center_ != NULL)429 if (newSpring != nullptr && center_ != nullptr) 430 430 { 431 431 newSpring->addTemplate(center_->getSpringTemplate()); … … 440 440 { 441 441 JumpSpring* newSpring = new JumpSpring(center_->getContext()); 442 if (newSpring != NULL && center_ != NULL)442 if (newSpring != nullptr && center_ != nullptr) 443 443 { 444 444 newSpring->addTemplate(center_->getSpringTemplate()); … … 453 453 { 454 454 JumpRocket* newRocket = new JumpRocket(center_->getContext()); 455 if (newRocket != NULL && center_ != NULL)455 if (newRocket != nullptr && center_ != nullptr) 456 456 { 457 457 newRocket->addTemplate(center_->getRocketTemplate()); … … 466 466 { 467 467 JumpRocket* newRocket = new JumpRocket(center_->getContext()); 468 if (newRocket != NULL && center_ != NULL)468 if (newRocket != nullptr && center_ != nullptr) 469 469 { 470 470 newRocket->addTemplate(center_->getRocketTemplate()); … … 479 479 { 480 480 JumpPropeller* newPropeller = new JumpPropeller(center_->getContext()); 481 if (newPropeller != NULL && center_ != NULL)481 if (newPropeller != nullptr && center_ != nullptr) 482 482 { 483 483 newPropeller->addTemplate(center_->getPropellerTemplate()); … … 492 492 { 493 493 JumpPropeller* newPropeller = new JumpPropeller(center_->getContext()); 494 if (newPropeller != NULL && center_ != NULL)494 if (newPropeller != nullptr && center_ != nullptr) 495 495 { 496 496 newPropeller->addTemplate(center_->getPropellerTemplate()); … … 505 505 { 506 506 JumpBoots* newBoots = new JumpBoots(center_->getContext()); 507 if (newBoots != NULL && center_ != NULL)507 if (newBoots != nullptr && center_ != nullptr) 508 508 { 509 509 newBoots->addTemplate(center_->getBootsTemplate()); … … 518 518 { 519 519 JumpBoots* newBoots = new JumpBoots(center_->getContext()); 520 if (newBoots != NULL && center_ != NULL)520 if (newBoots != nullptr && center_ != nullptr) 521 521 { 522 522 newBoots->addTemplate(center_->getBootsTemplate()); … … 531 531 { 532 532 JumpShield* newShield = new JumpShield(center_->getContext()); 533 if (newShield != NULL && center_ != NULL)533 if (newShield != nullptr && center_ != nullptr) 534 534 { 535 535 newShield->addTemplate(center_->getShieldTemplate()); … … 544 544 { 545 545 JumpShield* newShield = new JumpShield(center_->getContext()); 546 if (newShield != NULL && center_ != NULL)546 if (newShield != nullptr && center_ != nullptr) 547 547 { 548 548 newShield->addTemplate(center_->getShieldTemplate()); … … 557 557 { 558 558 JumpEnemy* newEnemy = new JumpEnemy(center_->getContext()); 559 if (newEnemy != NULL && center_ != NULL)559 if (newEnemy != nullptr && center_ != nullptr) 560 560 { 561 561 switch (type) … … 1270 1270 float Jump::getFuel() const 1271 1271 { 1272 if (this->figure_ != NULL)1273 { 1274 if (this->figure_->rocketActive_ != NULL)1272 if (this->figure_ != nullptr) 1273 { 1274 if (this->figure_->rocketActive_ != nullptr) 1275 1275 { 1276 1276 return this->figure_->rocketActive_->getFuelState(); 1277 1277 } 1278 else if (this->figure_->propellerActive_ != NULL)1278 else if (this->figure_->propellerActive_ != nullptr) 1279 1279 { 1280 1280 return this->figure_->propellerActive_->getFuelState(); 1281 1281 } 1282 else if (this->figure_->shieldActive_ != NULL)1282 else if (this->figure_->shieldActive_ != nullptr) 1283 1283 { 1284 1284 return this->figure_->shieldActive_->getFuelState(); 1285 1285 } 1286 else if (this->figure_->bootsActive_ != NULL)1286 else if (this->figure_->bootsActive_ != nullptr) 1287 1287 { 1288 1288 return this->figure_->bootsActive_->getFuelState(); -
code/branches/cpp11_v2/src/modules/jump/JumpBoots.cc
r10733 r10765 72 72 Vector3 rocketPosition = getWorldPosition(); 73 73 74 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 75 75 { 76 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpCenterpoint.cc
r10733 r10765 83 83 void JumpCenterpoint::checkGametype() 84 84 { 85 if (getGametype() != NULL&& this->getGametype()->isA(Class(Jump)))85 if (getGametype() != nullptr && this->getGametype()->isA(Class(Jump))) 86 86 { 87 87 Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/jump/JumpEnemy.cc
r10733 r10765 119 119 Vector3 enemyPosition = getPosition(); 120 120 121 if (figure_ != NULL)121 if (figure_ != nullptr) 122 122 { 123 123 Vector3 figurePosition = figure_->getPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpFigure.cc
r10733 r10765 51 51 52 52 // initialize variables 53 leftHand_ = NULL;54 rightHand_ = NULL;53 leftHand_ = nullptr; 54 rightHand_ = nullptr; 55 55 fieldHeight_ = 0; 56 56 fieldWidth_ = 0; … … 75 75 animateHands_ = false; 76 76 turnUp_ = false; 77 rocketActive_ = NULL;78 propellerActive_ = NULL;79 bootsActive_ = NULL;80 shieldActive_ = NULL;77 rocketActive_ = nullptr; 78 propellerActive_ = nullptr; 79 bootsActive_ = nullptr; 80 shieldActive_ = nullptr; 81 81 rocketSpeed_ = 0.0; 82 82 propellerSpeed_ = 0.0; … … 111 111 // Move up/down 112 112 Vector3 velocity = getVelocity(); 113 if (rocketActive_ != NULL)113 if (rocketActive_ != nullptr) 114 114 { 115 115 velocity.z = rocketSpeed_; 116 116 } 117 else if (propellerActive_ != NULL)117 else if (propellerActive_ != nullptr) 118 118 { 119 119 velocity.z = propellerSpeed_; … … 144 144 } 145 145 146 if (leftHand_ != NULL)146 if (leftHand_ != nullptr) 147 147 { 148 148 leftHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(-handAngle_)); 149 149 } 150 if (rightHand_ != NULL)150 if (rightHand_ != nullptr) 151 151 { 152 152 rightHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(handAngle_)); … … 212 212 { 213 213 Vector3 velocity = getVelocity(); 214 if (bootsActive_ == NULL)214 if (bootsActive_ == nullptr) 215 215 { 216 216 velocity.z = 1.2f*jumpSpeed_; … … 239 239 void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy) 240 240 { 241 if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)241 if (rocketActive_ == nullptr && propellerActive_ == nullptr && shieldActive_ == nullptr) 242 242 { 243 243 dead_ = true; … … 247 247 bool JumpFigure::StartRocket(JumpRocket* rocket) 248 248 { 249 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)249 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 250 250 { 251 251 attach(rocket); … … 266 266 detach(rocket); 267 267 rocket->destroy(); 268 rocketActive_ = NULL;268 rocketActive_ = nullptr; 269 269 } 270 270 271 271 bool JumpFigure::StartPropeller(JumpPropeller* propeller) 272 272 { 273 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)273 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 274 274 { 275 275 attach(propeller); … … 290 290 detach(propeller); 291 291 propeller->destroy(); 292 propellerActive_ = NULL;292 propellerActive_ = nullptr; 293 293 } 294 294 295 295 bool JumpFigure::StartBoots(JumpBoots* boots) 296 296 { 297 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)297 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 298 298 { 299 299 attach(boots); … … 314 314 detach(boots); 315 315 boots->destroy(); 316 bootsActive_ = NULL;316 bootsActive_ = nullptr; 317 317 } 318 318 … … 338 338 detach(shield); 339 339 shield->destroy(); 340 shieldActive_ = NULL;340 shieldActive_ = nullptr; 341 341 } 342 342 -
code/branches/cpp11_v2/src/modules/jump/JumpPlatform.cc
r10733 r10765 86 86 Vector3 platformPosition = this->getPosition(); 87 87 88 if (figure_ != NULL)88 if (figure_ != nullptr) 89 89 { 90 90 Vector3 figurePosition = figure_->getPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpPlatformTimer.cc
r10733 r10765 47 47 RegisterObject(JumpPlatformTimer); 48 48 49 particleSpawner_ = NULL;49 particleSpawner_ = nullptr; 50 50 51 51 setProperties(3.0); … … 71 71 72 72 time_ -= dt; 73 if (time_ < effectStartTime_ && particleSpawner_ == NULL)73 if (time_ < effectStartTime_ && particleSpawner_ == nullptr) 74 74 { 75 75 -
code/branches/cpp11_v2/src/modules/jump/JumpPropeller.cc
r10733 r10765 72 72 Vector3 PropellerPosition = getWorldPosition(); 73 73 74 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 75 75 { 76 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpRocket.cc
r10733 r10765 72 72 Vector3 rocketPosition = getWorldPosition(); 73 73 74 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 75 75 { 76 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpScore.cc
r10733 r10765 48 48 RegisterObject(JumpScore); 49 49 50 owner_ = NULL;50 owner_ = nullptr; 51 51 showScore_ = false; 52 52 showFuel_ = false; … … 73 73 SUPER(JumpScore, tick, dt); 74 74 75 if (owner_ != NULL)75 if (owner_ != nullptr) 76 76 { 77 77 if (!owner_->hasEnded()) … … 79 79 player_ = owner_->getPlayer(); 80 80 81 if (player_ != NULL)81 if (player_ != nullptr) 82 82 { 83 83 if (showScore_ == true) … … 116 116 SUPER(JumpScore, changedOwner); 117 117 118 if (this->getOwner() != NULL&& this->getOwner()->getGametype())118 if (this->getOwner() != nullptr && this->getOwner()->getGametype()) 119 119 { 120 120 this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype()); … … 122 122 else 123 123 { 124 this->owner_ = NULL;124 this->owner_ = nullptr; 125 125 } 126 126 } -
code/branches/cpp11_v2/src/modules/jump/JumpShield.cc
r10733 r10765 72 72 Vector3 shieldPosition = getWorldPosition(); 73 73 74 if (attachedToFigure_ == false && figure_ != NULL)74 if (attachedToFigure_ == false && figure_ != nullptr) 75 75 { 76 76 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v2/src/modules/jump/JumpSpring.cc
r10733 r10765 77 77 Vector3 springPosition = getWorldPosition(); 78 78 79 if (figure_ != NULL)79 if (figure_ != nullptr) 80 80 { 81 81 Vector3 figurePosition = figure_->getWorldPosition(); -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.cc
r10624 r10765 88 88 void Mini4Dgame::cleanup() 89 89 { 90 if(this->board_ != NULL)// Destroy the board, if present.90 if(this->board_ != nullptr)// Destroy the board, if present. 91 91 { 92 92 //this->board_->destroy(); … … 101 101 void Mini4Dgame::start() 102 102 { 103 if (this->board_ != NULL) // There needs to be a Mini4DgameCenterpoint, i.e. the area the game takes place.103 if (this->board_ != nullptr) // There needs to be a Mini4DgameCenterpoint, i.e. the area the game takes place. 104 104 { 105 105 /* 106 if (this->board_ == NULL)106 if (this->board_ == nullptr) 107 107 { 108 108 this->board_ = new Mini4DgameBoard(this->board_->getContext()); … … 174 174 assert(player); 175 175 176 if(false)//this->player_ == NULL)176 if(false)//this->player_ == nullptr) 177 177 { 178 178 //this->player_ = player; -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameBoard.cc
r10624 r10765 905 905 void Mini4DgameBoard::checkGametype() 906 906 { 907 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Mini4Dgame)))907 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Mini4Dgame))) 908 908 { 909 909 Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/notifications/NotificationDispatcher.cc
r10624 r10765 177 177 178 178 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 179 PlayerInfo* player = NULL;179 PlayerInfo* player = nullptr; 180 180 181 181 // If the trigger is a PlayerTrigger. 182 if(pTrigger != NULL)182 if(pTrigger != nullptr) 183 183 { 184 184 if(!pTrigger->isForPlayer()) // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 190 190 return false; 191 191 192 if(player == NULL)192 if(player == nullptr) 193 193 { 194 194 orxout(verbose, context::notifications) << "The NotificationDispatcher was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl; -
code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc
r10624 r10765 334 334 // If all senders are the target of the NotificationQueue, then the list of Notifications for that specific NotificationQueue is the same as the list of all Notifications. 335 335 bool bAll = set.find(NotificationListener::ALL) != set.end(); 336 std::multimap<std::time_t, Notification*>* map = NULL;336 std::multimap<std::time_t, Notification*>* map = nullptr; 337 337 if(bAll) 338 338 this->notificationLists_[queue->getName()] = &this->allNotificationsList_; … … 395 395 The name of the NotificationQueue. 396 396 @return 397 Returns a pointer to the NotificationQueue with the input name. Returns NULLif no NotificationQueue with such a name exists.397 Returns a pointer to the NotificationQueue with the input name. Returns nullptr if no NotificationQueue with such a name exists. 398 398 */ 399 399 NotificationQueue* NotificationManager::getQueue(const std::string & name) 400 400 { 401 401 std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.find(name); 402 // Returns NULLif no such NotificationQueue exists.402 // Returns nullptr if no such NotificationQueue exists. 403 403 if(it == this->queues_.end()) 404 return NULL;404 return nullptr; 405 405 406 406 return (*it).second; -
code/branches/cpp11_v2/src/modules/notifications/NotificationQueueCEGUI.cc
r10258 r10765 290 290 The name of the NotificationQueueCEGUI to be got. 291 291 @return 292 Returns a pointer to the NotificationQueueCEGUI, or NULLif it doesn't exist.292 Returns a pointer to the NotificationQueueCEGUI, or nullptr if it doesn't exist. 293 293 */ 294 294 /*static*/ NotificationQueueCEGUI* NotificationQueueCEGUI::getQueue(const std::string& name) 295 295 { 296 296 NotificationQueue* queue = NotificationManager::getInstance().getQueue(name); 297 if(queue == NULL|| !queue->isA(Class(NotificationQueueCEGUI)))298 return NULL;297 if(queue == nullptr || !queue->isA(Class(NotificationQueueCEGUI))) 298 return nullptr; 299 299 return static_cast<NotificationQueueCEGUI*>(queue); 300 300 } -
code/branches/cpp11_v2/src/modules/objects/Script.cc
r10624 r10765 140 140 141 141 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 142 PlayerInfo* player = NULL;142 PlayerInfo* player = nullptr; 143 143 144 144 // If the trigger is a PlayerTrigger. 145 if(pTrigger != NULL)145 if(pTrigger != nullptr) 146 146 { 147 147 if(!pTrigger->isForPlayer()) // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 153 153 return false; 154 154 155 if(player == NULL) //TODO: Will this ever happen? If not, change in NotificationDispatcher as well.155 if(player == nullptr) //TODO: Will this ever happen? If not, change in NotificationDispatcher as well. 156 156 { 157 157 orxout(internal_warning) << "The Script was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl; -
code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc
r10624 r10765 61 61 for( std::vector<BillboardAdministration>::iterator current = this->billboards_.begin(); current != this->billboards_.end(); current++) 62 62 { 63 if( current->billy != NULL)63 if( current->billy != nullptr) 64 64 { 65 65 delete current->billy; … … 127 127 void SpaceBoundaries::setBillboardOptions(Billboard *billy) 128 128 { 129 if(billy != NULL)129 if(billy != nullptr) 130 130 { 131 131 billy->setMaterial("Grid"); … … 250 250 float SpaceBoundaries::computeDistance(WorldEntity *item) 251 251 { 252 if(item != NULL)252 if(item != nullptr) 253 253 { 254 254 Vector3 itemPosition = item->getWorldPosition(); … … 310 310 bool SpaceBoundaries::isHumanPlayer(Pawn *item) 311 311 { 312 if(item != NULL)312 if(item != nullptr) 313 313 { 314 314 if(item->getPlayer()) -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceMultiTrigger.cc
r10624 r10765 97 97 { 98 98 99 std::queue<MultiTriggerState*>* queue = NULL;99 std::queue<MultiTriggerState*>* queue = nullptr; 100 100 101 101 // Check for objects that were in range but no longer are. Iterate through all objects, that are in range. … … 105 105 106 106 // If the entity no longer exists. 107 if(entity == NULL)107 if(entity == nullptr) 108 108 { 109 109 this->range_.erase(it++); … … 118 118 119 119 // If no queue has been created, yet. 120 if(queue == NULL)120 if(queue == nullptr) 121 121 queue = new std::queue<MultiTriggerState*>(); 122 122 … … 186 186 187 187 // If no queue has been created, yet. 188 if(queue == NULL)188 if(queue == nullptr) 189 189 queue = new std::queue<MultiTriggerState*>(); 190 190 -
code/branches/cpp11_v2/src/modules/objects/triggers/DistanceTrigger.cc
r10624 r10765 106 106 this->setForPlayer(true); 107 107 108 if (targetId == NULL)108 if (targetId == nullptr) 109 109 { 110 110 orxout(internal_error, context::triggers) << "\"" << targetStr << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << endl; … … 147 147 { 148 148 // Check whether there is a cached object, it still exists and whether it is still in range, if so nothing further needs to be done. 149 if(this->cache_ != NULL)149 if(this->cache_ != nullptr) 150 150 { 151 151 if((this->cache_->getWorldPosition() - this->getWorldPosition()).length() < this->distance_) … … 206 206 207 207 Pawn* pawn = orxonox_cast<Pawn*>(entity); 208 if(pawn != NULL)208 if(pawn != nullptr) 209 209 this->setTriggeringPawn(pawn); 210 210 else 211 orxout(internal_warning, context::triggers) << "Pawn was NULL." << endl;211 orxout(internal_warning, context::triggers) << "Pawn was nullptr." << endl; 212 212 } 213 213 -
code/branches/cpp11_v2/src/modules/objects/triggers/EventMultiTrigger.cc
r9667 r10765 96 96 { 97 97 // If the originator is a MultiTriggerContainer, the event originates from a MultiTrigger and thus the event only triggers the EventMultiTrigger for the originator that caused the MultiTrigger to trigger. 98 if(originator != NULL&& originator->isA(ClassIdentifier<MultiTriggerContainer>::getIdentifier()))98 if(originator != nullptr && originator->isA(ClassIdentifier<MultiTriggerContainer>::getIdentifier())) 99 99 { 100 100 MultiTriggerContainer* container = static_cast<MultiTriggerContainer*>(originator); -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc
r9667 r10765 124 124 // Let the MultiTrigger return the states that trigger and process the new states if there are any. 125 125 std::queue<MultiTriggerState*>* queue = this->letTrigger(); 126 if(queue != NULL)126 if(queue != nullptr) 127 127 { 128 128 while(queue->size() > 0) 129 129 { 130 130 MultiTriggerState* state = queue->front(); 131 // If the state is NULL. (This really shouldn't happen)132 if(state == NULL)131 // If the state is nullptr. (This really shouldn't happen) 132 if(state == nullptr) 133 133 { 134 orxout(internal_error, context::triggers) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was NULL. State ignored." << endl;134 orxout(internal_error, context::triggers) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was nullptr. State ignored." << endl; 135 135 queue->pop(); 136 136 continue; … … 227 227 { 228 228 // If the MultiTrigger is set to broadcast and has no originator a boradcast is fired. 229 if(this->getBroadcast() && state->originator == NULL)229 if(this->getBroadcast() && state->originator == nullptr) 230 230 this->broadcast(bActive); 231 231 // Else a normal event is fired. … … 240 240 { 241 241 // Print some debug output if the state has changed. 242 if(state->originator != NULL)242 if(state->originator != nullptr) 243 243 orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: " << state->originator->getIdentifier()->getName() << " (&" << state->originator << "), active: " << bActive << ", triggered: " << state->bTriggered << "." << endl; 244 244 else 245 orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: NULL, active: " << bActive << ", triggered: " << state->bTriggered << "." << endl;245 orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: nullptr, active: " << bActive << ", triggered: " << state->bTriggered << "." << endl; 246 246 247 247 // If the MultiTrigger has a parent trigger, that is itself a MultiTrigger, it needs to call a method to notify him, that its activity has changed. 248 if(this->parent_ != NULL&& this->parent_->isMultiTrigger())248 if(this->parent_ != nullptr && this->parent_->isMultiTrigger()) 249 249 static_cast<MultiTrigger*>(this->parent_)->childActivityChanged(state->originator); 250 250 } … … 299 299 300 300 // If the target is not a valid class name display an error. 301 if (target == NULL)301 if (target == nullptr) 302 302 { 303 303 orxout(internal_error, context::triggers) << "'" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << endl; … … 327 327 328 328 // If the target is not a valid class name display an error. 329 if (target == NULL)329 if (target == nullptr) 330 330 { 331 331 orxout(internal_error, context::triggers) << "'" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << endl; … … 346 346 std::queue<MultiTriggerState*>* MultiTrigger::letTrigger(void) 347 347 { 348 return NULL;348 return nullptr; 349 349 } 350 350 … … 443 443 void MultiTrigger::fire(bool status, BaseObject* originator) 444 444 { 445 // If the originator is NULL, a normal event without MultiTriggerContainer is sent.446 if(originator == NULL)445 // If the originator is nullptr, a normal event without MultiTriggerContainer is sent. 446 if(originator == nullptr) 447 447 { 448 448 this->fireEvent(status); … … 479 479 bool MultiTrigger::addState(MultiTriggerState* state) 480 480 { 481 assert(state); // The state really shouldn't be NULL.481 assert(state); // The state really shouldn't be nullptr. 482 482 483 483 // If the originator is no target of this MultiTrigger. -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.h
r9667 r10765 76 76 - @b simultaneousTriggerers The number of simultaneous triggerers limits the number of objects that are allowed to trigger the MultiTrigger at the same time. Or more precisely, the number of distinct objects the MultiTrigger has <em>triggered</em> states for, at each point in time. The default is <code>-1</code>, which denotes infinity. 77 77 - @b mode The mode describes how the MultiTrigger acts in relation to all the triggers, that are appended to it. There are 3 modes: <em>and</em>, meaning that the MultiTrigger can only be triggered if all the appended triggers are active. <em>or</em>, meaning that the MultiTrigger can only triggered if at least one of the appended triggers is active. And <em>xor</em>, meaning that the MultiTrigger can only be triggered if one and only one appended trigger is active. Note, that I wrote <em>can only be active</em>, that implies, that there is an additional condition to the <em>activity</em> of the MultiTrigger and that is the fulfillment of the triggering condition (the MultiTrigger itself doesn't have one, but all derived classes should). Also bear in mind, that the <em>activity</em> of a MultiTrigger is still coupled to the object that triggered it. The default is <em>and</em>. 78 - @b broadcast Broadcast is a boolean, if true the MutliTrigger is in <em>broadcast-mode</em>, meaning, that all trigger events that are caused by no originator (originator is NULL) are broadcast as having come from every possible originator, or more precisely as having come from all objects that are specified targets of this MultiTrigger. The default is false.78 - @b broadcast Broadcast is a boolean, if true the MutliTrigger is in <em>broadcast-mode</em>, meaning, that all trigger events that are caused by no originator (originator is nullptr) are broadcast as having come from every possible originator, or more precisely as having come from all objects that are specified targets of this MultiTrigger. The default is false. 79 79 - @b target The target describes the kind of objects that are allowed to trigger this MultiTrigger. The default is @ref orxonox::Pawn "Pawn". 80 80 - Also there is the possibility of appending triggers (as long as they inherit from TriggerBase) to the MultiTrigger just by adding them as children in the XML description of your MultiTrigger. … … 110 110 */ 111 111 inline bool isActive(void) const 112 { return this->isActive( NULL); }113 bool isActive(BaseObject* triggerer = NULL) const; //!< Check whether the MultiTrigger is active for a given object.112 { return this->isActive(nullptr); } 113 bool isActive(BaseObject* triggerer = nullptr) const; //!< Check whether the MultiTrigger is active for a given object. 114 114 115 115 /** … … 145 145 */ 146 146 inline bool isTarget(BaseObject* target) 147 { if(target == NULL) return true; else return targetMask_.isIncluded(target->getIdentifier()); }147 { if(target == nullptr) return true; else return targetMask_.isIncluded(target->getIdentifier()); } 148 148 149 149 void addTarget(const std::string& targets); //!< Add some target to the MultiTrigger. … … 152 152 virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at. 153 153 154 void changeTriggered(BaseObject* originator = NULL); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator.155 156 bool isModeTriggered(BaseObject* triggerer = NULL); //!< Checks whether the MultiTrigger is triggered concerning it's children.157 bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object.158 159 virtual void fire(bool status, BaseObject* originator = NULL); //!< Helper method. Creates an Event for the given status and originator and fires it.154 void changeTriggered(BaseObject* originator = nullptr); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator. 155 156 bool isModeTriggered(BaseObject* triggerer = nullptr); //!< Checks whether the MultiTrigger is triggered concerning it's children. 157 bool isTriggered(BaseObject* triggerer = nullptr); //!< Get whether the MultiTrigger is triggered for a given object. 158 159 virtual void fire(bool status, BaseObject* originator = nullptr); //!< Helper method. Creates an Event for the given status and originator and fires it. 160 160 void broadcast(bool status); //!< Helper method. Broadcasts an Event for every object that is a target. 161 161 -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTriggerContainer.cc
r9667 r10765 50 50 The creator. 51 51 */ 52 MultiTriggerContainer::MultiTriggerContainer(Context* context) : BaseObject(context), originator_( NULL), data_(NULL)52 MultiTriggerContainer::MultiTriggerContainer(Context* context) : BaseObject(context), originator_(nullptr), data_(nullptr) 53 53 { 54 54 RegisterObject(MultiTriggerContainer); … … 70 70 71 71 Pawn* pawn = orxonox_cast<Pawn*>(data); 72 if(pawn != NULL)72 if(pawn != nullptr) 73 73 { 74 74 this->setForPlayer(true); -
code/branches/cpp11_v2/src/modules/objects/triggers/TriggerBase.cc
r9667 r10765 67 67 this->mode_ = TriggerMode::EventTriggerAND; 68 68 69 this->parent_ = NULL;69 this->parent_ = nullptr; 70 70 71 71 this->bMultiTrigger_ = false; … … 170 170 The index. 171 171 @return 172 Returns a pointer ot the trigger. NULLif no such trigger exists.172 Returns a pointer ot the trigger. nullptr if no such trigger exists. 173 173 */ 174 174 const TriggerBase* TriggerBase::getTrigger(unsigned int index) const … … 176 176 // If the index is greater than the number of children. 177 177 if (this->children_.size() <= index) 178 return NULL;178 return nullptr; 179 179 180 180 std::set<TriggerBase*>::const_iterator it; -
code/branches/cpp11_v2/src/modules/overlays/GUIOverlay.cc
r9667 r10765 92 92 ControllableEntity* entity = orxonox_cast<ControllableEntity*>(this->getOwner()); 93 93 if (entity) 94 GUIManager::getInstance().setPlayer(name, entity->getPlayer()); //Set Player is going to be NULL, so it needs to be set in changedVisibility() as well.94 GUIManager::getInstance().setPlayer(name, entity->getPlayer()); //Set Player is going to be nullptr, so it needs to be set in changedVisibility() as well. 95 95 } 96 96 } -
code/branches/cpp11_v2/src/modules/overlays/hud/HUDEnemyHealthBar.cc
r9667 r10765 62 62 void HUDEnemyHealthBar::updateTarget() 63 63 { 64 Pawn* pawn = NULL;64 Pawn* pawn = nullptr; 65 65 if (this->owner_ && this->useEnemyBar_) 66 66 { … … 73 73 // Don't show the HealthBar if the pawn is invisible 74 74 if (pawn && !pawn->isVisible()) 75 pawn = NULL;75 pawn = nullptr; 76 76 } 77 77 // Set the pawn as owner of the HealthBar 78 78 this->setHealthBarOwner(pawn); 79 this->setVisible(pawn != NULL);79 this->setVisible(pawn != nullptr); 80 80 } 81 81 -
code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc
r10624 r10765 134 134 for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it) 135 135 { 136 if (it->second.text_ != NULL)136 if (it->second.text_ != nullptr) 137 137 it->second.text_->setFontName(this->fontName_); 138 138 } … … 183 183 184 184 Camera* cam = CameraManager::getInstance().getActiveCamera(); 185 if (cam == NULL)185 if (cam == nullptr) 186 186 return; 187 187 const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix(); … … 476 476 if(!it->second.selected_ 477 477 || it->first->getRVVelocity().squaredLength() == 0 478 || pawn == NULL478 || pawn == nullptr 479 479 /* TODO : improve getTeam in such a way that it works 480 * || humanPawn == NULL480 * || humanPawn == nullptr 481 481 * || pawn->getTeam() == humanPawn->getTeam()*/) 482 482 { … … 534 534 for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it) 535 535 { 536 if (it->second.health_ != NULL)536 if (it->second.health_ != nullptr) 537 537 it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale); 538 if (it->second.healthLevel_ != NULL)538 if (it->second.healthLevel_ != nullptr) 539 539 it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale); 540 if (it->second.panel_ != NULL)540 if (it->second.panel_ != nullptr) 541 541 it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale); 542 if (it->second.text_ != NULL)542 if (it->second.text_ != nullptr) 543 543 it->second.text_->setCharHeight(this->textSize_ * yScale); 544 if (it->second.target_ != NULL)544 if (it->second.target_ != nullptr) 545 545 it->second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale); 546 546 } … … 553 553 554 554 if (this->activeObjectList_.size() >= this->markerLimit_) 555 if (object == NULL)555 if (object == nullptr) 556 556 return; 557 557 -
code/branches/cpp11_v2/src/modules/pickup/CollectiblePickup.cc
r10624 r10765 47 47 Registers the object and initializes variables. 48 48 */ 49 CollectiblePickup::CollectiblePickup() : collection_( NULL)49 CollectiblePickup::CollectiblePickup() : collection_(nullptr) 50 50 { 51 51 RegisterObject(CollectiblePickup); … … 103 103 void CollectiblePickup::wasRemovedFromCollection(void) 104 104 { 105 this->collection_ = NULL;105 this->collection_ = nullptr; 106 106 } 107 107 } -
code/branches/cpp11_v2/src/modules/pickup/CollectiblePickup.h
r9348 r10765 69 69 */ 70 70 bool isInCollection(void) const 71 { return this->collection_ != NULL; }71 { return this->collection_ != nullptr; } 72 72 73 73 private: -
code/branches/cpp11_v2/src/modules/pickup/PickupCollection.cc
r9667 r10765 148 148 for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it) 149 149 { 150 if(this->getCarrier() == NULL)151 (*it)->setCarrier( NULL);150 if(this->getCarrier() == nullptr) 151 (*it)->setCarrier(nullptr); 152 152 else 153 153 (*it)->setCarrier(this->getCarrier()->getTarget(*it)); … … 227 227 bool PickupCollection::addPickupable(CollectiblePickup* pickup) 228 228 { 229 if(pickup == NULL)229 if(pickup == nullptr) 230 230 return false; 231 231 … … 247 247 { 248 248 if(this->pickups_.size() >= index) 249 return NULL;249 return nullptr; 250 250 251 251 std::list<CollectiblePickup*>::const_iterator it = this->pickups_.begin(); -
code/branches/cpp11_v2/src/modules/pickup/PickupManager.cc
r10624 r10765 68 68 Constructor. Registers the PickupManager and creates the default PickupRepresentation. 69 69 */ 70 PickupManager::PickupManager() : guiLoaded_(false), pickupHighestIndex_(0), defaultRepresentation_( NULL)70 PickupManager::PickupManager() : guiLoaded_(false), pickupHighestIndex_(0), defaultRepresentation_(nullptr) 71 71 { 72 72 RegisterObject(PickupManager); … … 85 85 { 86 86 // Destroying the default representation. 87 if(this->defaultRepresentation_ != NULL)87 if(this->defaultRepresentation_ != nullptr) 88 88 this->defaultRepresentation_->destroy(); 89 89 … … 184 184 CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(pickup); 185 185 // If the Pickupable is part of a PickupCollection it isn't displayed in the PickupInventory, just the PickupCollection is. 186 if(collectible != NULL&& collectible->isInCollection())186 if(collectible != nullptr && collectible->isInCollection()) 187 187 return; 188 188 189 189 // Getting clientId of the host this change of the pickup's used status concerns. 190 190 PickupCarrier* carrier = pickup->getCarrier(); 191 while(carrier->getCarrierParent() != NULL)191 while(carrier->getCarrierParent() != nullptr) 192 192 carrier = carrier->getCarrierParent(); 193 193 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 194 if(pawn == NULL)194 if(pawn == nullptr) 195 195 return; 196 196 PlayerInfo* info = pawn->getPlayer(); 197 if(info == NULL)197 if(info == nullptr) 198 198 return; 199 199 unsigned int clientId = info->getClientID(); … … 265 265 CollectiblePickup* collectible = orxonox_cast<CollectiblePickup*>(pickup); 266 266 // If the Pickupable is part of a PickupCollection it isn't displayed in the PickupInventory, just the PickupCollection is. 267 if(collectible != NULL&& collectible->isInCollection())267 if(collectible != nullptr && collectible->isInCollection()) 268 268 return; 269 269 270 270 // Getting clientId of the host this change of the pickup's pickedUp status concerns. 271 271 PickupCarrier* carrier = pickup->getCarrier(); 272 while(carrier->getCarrierParent() != NULL)272 while(carrier->getCarrierParent() != nullptr) 273 273 carrier = carrier->getCarrierParent(); 274 274 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 275 if(pawn == NULL)275 if(pawn == nullptr) 276 276 return; 277 277 PlayerInfo* info = pawn->getFormerPlayer(); 278 if(info == NULL)278 if(info == nullptr) 279 279 return; 280 280 unsigned int clientId = info->getClientID(); … … 399 399 return; 400 400 Pickupable* pickupable = this->pickups_.find(pickup)->second; 401 if(pickupable != NULL)401 if(pickupable != nullptr) 402 402 pickupable->drop(); 403 403 } … … 442 442 return; 443 443 Pickupable* pickupable = this->pickups_.find(pickup)->second; 444 if(pickupable != NULL)444 if(pickupable != nullptr) 445 445 pickupable->setUsed(use); 446 446 } -
code/branches/cpp11_v2/src/modules/pickup/PickupRepresentation.cc
r9667 r10765 52 52 This is primarily for use of the PickupManager in creating a default PickupRepresentation. 53 53 */ 54 PickupRepresentation::PickupRepresentation() : BaseObject( NULL), Synchronisable(NULL), spawnerRepresentation_(NULL)54 PickupRepresentation::PickupRepresentation() : BaseObject(nullptr), Synchronisable(nullptr), spawnerRepresentation_(nullptr) 55 55 { 56 56 RegisterObject(PickupRepresentation); … … 64 64 Default Constructor. Registers the object and initializes its member variables. 65 65 */ 66 PickupRepresentation::PickupRepresentation(Context* context) : BaseObject(context), Synchronisable(context), spawnerRepresentation_( NULL)66 PickupRepresentation::PickupRepresentation(Context* context) : BaseObject(context), Synchronisable(context), spawnerRepresentation_(nullptr) 67 67 { 68 68 RegisterObject(PickupRepresentation); … … 78 78 PickupRepresentation::~PickupRepresentation() 79 79 { 80 if(this->spawnerRepresentation_ != NULL)80 if(this->spawnerRepresentation_ != nullptr) 81 81 this->spawnerRepresentation_->destroy(); 82 82 … … 135 135 StaticEntity* PickupRepresentation::createSpawnerRepresentation(PickupSpawner* spawner) 136 136 { 137 if(this->spawnerRepresentation_ == NULL)137 if(this->spawnerRepresentation_ == nullptr) 138 138 { 139 139 orxout(verbose, context::pickups) << "PickupRepresentation: No spawner representation found." << endl; … … 149 149 this->spawnerRepresentation_->setVisible(true); 150 150 StaticEntity* temp = this->spawnerRepresentation_; 151 this->spawnerRepresentation_ = NULL;151 this->spawnerRepresentation_ = nullptr; 152 152 153 153 return temp; … … 164 164 { 165 165 this->spawnerRepresentation_ = representation; 166 if(this->spawnerRepresentation_ != NULL)166 if(this->spawnerRepresentation_ != nullptr) 167 167 this->spawnerRepresentation_->setVisible(false); 168 168 } -
code/branches/cpp11_v2/src/modules/pickup/PickupRepresentation.h
r9667 r10765 119 119 @brief Get the StaticEntity that defines how the PickupSpawner of the Pickupable represented by this PickupRepresentation looks like. 120 120 @param index The index. 121 @return Returns (for index = 0) a pointer to the StaticEntity. For index > 0 it returns NULL.121 @return Returns (for index = 0) a pointer to the StaticEntity. For index > 0 it returns nullptr. 122 122 */ 123 123 inline const StaticEntity* getSpawnerRepresentationIndex(unsigned int index) const 124 { if(index == 0) return this->spawnerRepresentation_; return NULL; }124 { if(index == 0) return this->spawnerRepresentation_; return nullptr; } 125 125 /** 126 126 @brief Get the name of the image representing the pickup in the PickupInventory. -
code/branches/cpp11_v2/src/modules/pickup/PickupSpawner.cc
r10624 r10765 55 55 Pointer to the object which created this item. 56 56 */ 57 PickupSpawner::PickupSpawner(Context* context) : StaticEntity(context), pickup_( NULL), representation_(NULL), pickupTemplate_(NULL)57 PickupSpawner::PickupSpawner(Context* context) : StaticEntity(context), pickup_(nullptr), representation_(nullptr), pickupTemplate_(nullptr) 58 58 { 59 59 RegisterObject(PickupSpawner); … … 74 74 this->selfDestruct_ = false; 75 75 76 this->setPickupable( NULL);76 this->setPickupable(nullptr); 77 77 } 78 78 … … 83 83 PickupSpawner::~PickupSpawner() 84 84 { 85 if(this->isInitialized() && this->selfDestruct_ && this->pickup_ != NULL)85 if(this->isInitialized() && this->selfDestruct_ && this->pickup_ != nullptr) 86 86 this->pickup_->destroy(); 87 87 } … … 160 160 for(ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) 161 161 { 162 if(spawner == NULL) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute).162 if(spawner == nullptr) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute). 163 163 break; 164 164 … … 166 166 PickupCarrier* carrier = static_cast<PickupCarrier*>(*it); 167 167 // If a PickupCarrier, that fits the target-range of the Pickupable spawned by this PickupSpawner, is in trigger-distance and the carrier is not blocked. 168 if(distance.length() < this->triggerDistance_ && carrier != NULL&& this->blocked_.find(carrier) == this->blocked_.end())168 if(distance.length() < this->triggerDistance_ && carrier != nullptr && this->blocked_.find(carrier) == this->blocked_.end()) 169 169 { 170 170 if(carrier->isTarget(this->pickup_)) … … 195 195 pickedUp = false; // To avoid compiler warning. 196 196 197 this->setPickupable( NULL);197 this->setPickupable(nullptr); 198 198 this->decrementSpawnsRemaining(); 199 199 } … … 282 282 { 283 283 orxout(internal_error, context::pickups) << "Massive Error: PickupSpawner still alive until having spawned last item." << endl; 284 return NULL;285 } 286 287 if (this->pickupTemplate_ != NULL)284 return nullptr; 285 } 286 287 if (this->pickupTemplate_ != nullptr) 288 288 { 289 289 Identifier* identifier = this->pickupTemplate_->getBaseclassIdentifier(); 290 if (identifier != NULL)290 if (identifier != nullptr) 291 291 { 292 292 Pickupable* pickup = orxonox_cast<Pickupable*>(identifier->fabricate(this->getContext())); … … 298 298 } 299 299 300 return NULL;300 return nullptr; 301 301 } 302 302 … … 309 309 void PickupSpawner::setPickupable(Pickupable* pickup) 310 310 { 311 if (this->representation_ != NULL)311 if (this->representation_ != nullptr) 312 312 { 313 313 this->representation_->destroy(); 314 this->representation_ = NULL;315 } 316 317 if (pickup != NULL)318 { 319 if (this->pickup_ != NULL)314 this->representation_ = nullptr; 315 } 316 317 if (pickup != nullptr) 318 { 319 if (this->pickup_ != nullptr) 320 320 this->pickup_->destroy(); 321 321 -
code/branches/cpp11_v2/src/modules/pickup/items/DamageBoostPickup.cc
r9667 r10765 106 106 107 107 SpaceShip* ship = this->carrierToSpaceShipHelper(); 108 if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.108 if(ship == nullptr) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed. 109 109 this->Pickupable::destroy(); 110 110 … … 152 152 Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails. 153 153 @return 154 A pointer to the SpaceShip, or NULLif the conversion failed.154 A pointer to the SpaceShip, or nullptr if the conversion failed. 155 155 */ 156 156 SpaceShip* DamageBoostPickup::carrierToSpaceShipHelper(void) … … 159 159 SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier); 160 160 161 if(ship == NULL)161 if(ship == nullptr) 162 162 { 163 163 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DamageBoostPickup." << endl; -
code/branches/cpp11_v2/src/modules/pickup/items/DronePickup.cc
r9667 r10765 122 122 123 123 Pawn* pawn = this->carrierToPawnHelper(); 124 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.124 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 125 125 this->Pickupable::destroy(); 126 126 … … 131 131 Controller* controller = drone->getController(); 132 132 DroneController* droneController = orxonox_cast<DroneController*>(controller); 133 if(droneController != NULL)133 if(droneController != nullptr) 134 134 { 135 135 droneController->setOwner(pawn); … … 156 156 Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 157 157 @return 158 A pointer to the Pawn, or NULLif the conversion failed.158 A pointer to the Pawn, or nullptr if the conversion failed. 159 159 */ 160 160 Pawn* DronePickup::carrierToPawnHelper(void) … … 163 163 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 164 164 165 if(pawn == NULL)165 if(pawn == nullptr) 166 166 { 167 167 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DronePickup." << endl; -
code/branches/cpp11_v2/src/modules/pickup/items/HealthPickup.cc
r9667 r10765 114 114 { 115 115 Pawn* pawn = this->carrierToPawnHelper(); 116 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.116 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 117 117 this->Pickupable::destroy(); 118 118 … … 168 168 { 169 169 Pawn* pawn = this->carrierToPawnHelper(); 170 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.170 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 171 171 this->Pickupable::destroy(); 172 172 … … 206 206 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 207 207 208 if(pawn == NULL)208 if(pawn == nullptr) 209 209 { 210 210 orxout(internal_error, context::pickups) << "Something went horribly wrong in Health Pickup. PickupCarrier is '" << carrier->getIdentifier()->getName() << "' instead of Pawn." << endl; … … 233 233 Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 234 234 @return 235 A pointer to the Pawn, or NULLif the conversion failed.235 A pointer to the Pawn, or nullptr if the conversion failed. 236 236 */ 237 237 Pawn* HealthPickup::carrierToPawnHelper(void) … … 240 240 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 241 241 242 if(pawn == NULL)242 if(pawn == nullptr) 243 243 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in HealthPickup." << endl; 244 244 -
code/branches/cpp11_v2/src/modules/pickup/items/InvisiblePickup.cc
r9667 r10765 139 139 { 140 140 Pawn* pawn = this->carrierToPawnHelper(); 141 if(pawn == NULL)141 if(pawn == nullptr) 142 142 return false; 143 143 … … 163 163 Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 164 164 @return 165 A pointer to the Pawn, or NULLif the conversion failed.165 A pointer to the Pawn, or nullptr if the conversion failed. 166 166 */ 167 167 Pawn* InvisiblePickup::carrierToPawnHelper(void) … … 170 170 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 171 171 172 if(pawn == NULL)172 if(pawn == nullptr) 173 173 { 174 174 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in InvisiblePickup." << endl; -
code/branches/cpp11_v2/src/modules/pickup/items/MetaPickup.cc
r9667 r10765 107 107 { 108 108 PickupCarrier* carrier = this->getCarrier(); 109 if(this->getMetaType() != pickupMetaType::none && carrier != NULL)109 if(this->getMetaType() != pickupMetaType::none && carrier != nullptr) 110 110 { 111 111 // If the metaType is destroyCarrier, then the PickupCarrier is destroyed. … … 121 121 { 122 122 Pickupable* pickup = (*it); 123 if(pickup == NULL|| pickup == this)123 if(pickup == nullptr || pickup == this) 124 124 continue; 125 125 -
code/branches/cpp11_v2/src/modules/pickup/items/ShieldPickup.cc
r9667 r10765 99 99 100 100 Pawn* pawn = this->carrierToPawnHelper(); 101 if(pawn == NULL)101 if(pawn == nullptr) 102 102 this->Pickupable::destroy(); 103 103 … … 143 143 Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 144 144 @return 145 A pointer to the Pawn, or NULLif the conversion failed.145 A pointer to the Pawn, or nullptr if the conversion failed. 146 146 */ 147 147 Pawn* ShieldPickup::carrierToPawnHelper(void) … … 150 150 Pawn* pawn = orxonox_cast<Pawn*>(carrier); 151 151 152 if(pawn == NULL)152 if(pawn == nullptr) 153 153 { 154 154 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in ShieldPickup." << endl; -
code/branches/cpp11_v2/src/modules/pickup/items/ShrinkPickup.cc
r10624 r10765 146 146 { 147 147 Pawn* pawn = this->carrierToPawnHelper(); 148 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.148 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 149 149 { 150 150 this->Pickupable::destroy(); … … 173 173 //TODO: Deploy particle effect. 174 174 Pawn* pawn = this->carrierToPawnHelper(); 175 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.175 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 176 176 return; 177 177 … … 187 187 { 188 188 CameraPosition* cameraPos = pawn->getCameraPosition(index); 189 if(cameraPos == NULL)189 if(cameraPos == nullptr) 190 190 continue; 191 191 cameraPos->setPosition(cameraPos->getPosition()/factor); … … 201 201 //TODO: Deploy particle effect. 202 202 Pawn* pawn = this->carrierToPawnHelper(); 203 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.203 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 204 204 return; 205 205 … … 213 213 { 214 214 CameraPosition* cameraPos = pawn->getCameraPosition(index); 215 if(cameraPos == NULL)215 if(cameraPos == nullptr) 216 216 continue; 217 217 cameraPos->setPosition(cameraPos->getPosition()/this->shrinkFactor_); … … 237 237 { 238 238 Pawn* pawn = this->carrierToPawnHelper(); 239 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.239 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 240 240 { 241 241 this->Pickupable::destroy(); … … 268 268 { 269 269 CameraPosition* cameraPos = pawn->getCameraPosition(index); 270 if(cameraPos == NULL)270 if(cameraPos == nullptr) 271 271 continue; 272 272 cameraPos->setPosition(cameraPos->getPosition()/factor); … … 277 277 { 278 278 Pawn* pawn = this->carrierToPawnHelper(); 279 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.279 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 280 280 this->Pickupable::destroy(); 281 281 … … 309 309 { 310 310 CameraPosition* cameraPos = pawn->getCameraPosition(index); 311 if(cameraPos == NULL)311 if(cameraPos == nullptr) 312 312 continue; 313 313 cameraPos->setPosition(cameraPos->getPosition()/factor); -
code/branches/cpp11_v2/src/modules/pickup/items/SpeedPickup.cc
r9667 r10765 99 99 100 100 SpaceShip* ship = this->carrierToSpaceShipHelper(); 101 if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.101 if(ship == nullptr) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed. 102 102 this->Pickupable::destroy(); 103 103 … … 143 143 Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails. 144 144 @return 145 A pointer to the SpaceShip, or NULLif the conversion failed.145 A pointer to the SpaceShip, or nullptr if the conversion failed. 146 146 */ 147 147 SpaceShip* SpeedPickup::carrierToSpaceShipHelper(void) … … 150 150 SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier); 151 151 152 if(ship == NULL)152 if(ship == nullptr) 153 153 { 154 154 orxout(internal_error, context::pickups) << "Invalid PickupCarrier in SpeedPickup." << endl; -
code/branches/cpp11_v2/src/modules/pong/Pong.cc
r9939 r10765 103 103 void Pong::cleanup() 104 104 { 105 if (this->ball_ != NULL) // Destroy the ball, if present.105 if (this->ball_ != nullptr) // Destroy the ball, if present. 106 106 { 107 107 this->ball_->destroy(); … … 112 112 for (size_t i = 0; i < 2; ++i) 113 113 { 114 if (this->bat_[0] != NULL)114 if (this->bat_[0] != nullptr) 115 115 { 116 116 this->bat_[0]->destroy(); … … 127 127 void Pong::start() 128 128 { 129 if (this->center_ != NULL) // There needs to be a PongCenterpoint, i.e. the area the game takes place.130 { 131 if (this->ball_ == NULL) // If there is no ball, create a new ball.129 if (this->center_ != nullptr) // There needs to be a PongCenterpoint, i.e. the area the game takes place. 130 { 131 if (this->ball_ == nullptr) // If there is no ball, create a new ball. 132 132 { 133 133 this->ball_ = new PongBall(this->center_->getContext()); … … 147 147 for (size_t i = 0; i < 2; ++i) 148 148 { 149 if (this->bat_[i] == NULL)149 if (this->bat_[i] == nullptr) 150 150 { 151 151 this->bat_[i] = new PongBat(this->center_->getContext()); … … 231 231 232 232 // If the first (left) bat has no player. 233 if (this->bat_[0]->getPlayer() == NULL)233 if (this->bat_[0]->getPlayer() == nullptr) 234 234 { 235 235 player->startControl(this->bat_[0]); … … 237 237 } 238 238 // If the second (right) bat has no player. 239 else if (this->bat_[1]->getPlayer() == NULL)239 else if (this->bat_[1]->getPlayer() == nullptr) 240 240 { 241 241 player->startControl(this->bat_[1]); … … 247 247 248 248 // If the player is an AI, it receives a pointer to the ball. 249 if (player->getController() != NULL&& player->getController()->isA(Class(PongAI)))249 if (player->getController() != nullptr && player->getController()->isA(Class(PongAI))) 250 250 { 251 251 PongAI* ai = orxonox_cast<PongAI*>(player->getController()); … … 262 262 Deathmatch::playerScored(player, score); 263 263 264 if (this->center_ != NULL) // If there is a centerpoint.264 if (this->center_ != nullptr) // If there is a centerpoint. 265 265 { 266 266 // Fire an event for the player that has scored, to be able to react to it in the level, e.g. by displaying fireworks. … … 271 271 272 272 // Also announce, that the player has scored. 273 if (player != NULL)273 if (player != nullptr) 274 274 this->gtinfo_->sendAnnounceMessage(player->getName() + " scored"); 275 275 } 276 276 277 277 // If there is a ball present, reset its position, velocity and acceleration. 278 if (this->ball_ != NULL)278 if (this->ball_ != nullptr) 279 279 { 280 280 this->ball_->setPosition(Vector3::ZERO); … … 285 285 286 286 // If there are bats reset them to the middle position. 287 if (this->bat_[0] != NULL && this->bat_[1] != NULL)287 if (this->bat_[0] != nullptr && this->bat_[1] != nullptr) 288 288 { 289 289 this->bat_[0]->setPosition(-this->center_->getFieldDimension().x / 2, 0, 0); … … 292 292 293 293 // If a player gets enough points, he won the game -> end of game 294 PlayerInfo* winningPlayer = NULL;294 PlayerInfo* winningPlayer = nullptr; 295 295 if (this->getLeftPlayer() && this->getScore(this->getLeftPlayer()) >= scoreLimit_) 296 296 winningPlayer = this->getLeftPlayer(); … … 314 314 void Pong::startBall() 315 315 { 316 if (this->ball_ != NULL && this->center_ != NULL)316 if (this->ball_ != nullptr && this->center_ != nullptr) 317 317 this->ball_->setSpeed(this->center_->getBallSpeed()); 318 318 } … … 322 322 Get the left player. 323 323 @return 324 Returns a pointer to the player playing on the left. If there is no left player, NULLis returned.324 Returns a pointer to the player playing on the left. If there is no left player, nullptr is returned. 325 325 */ 326 326 PlayerInfo* Pong::getLeftPlayer() const 327 327 { 328 if (this->bat_ != NULL && this->bat_[0] != NULL)328 if (this->bat_ != nullptr && this->bat_[0] != nullptr) 329 329 return this->bat_[0]->getPlayer(); 330 330 else … … 336 336 Get the right player. 337 337 @return 338 Returns a pointer to the player playing on the right. If there is no right player, NULLis returned.338 Returns a pointer to the player playing on the right. If there is no right player, nullptr is returned. 339 339 */ 340 340 PlayerInfo* Pong::getRightPlayer() const 341 341 { 342 if (this->bat_ != NULL && this->bat_[1] != NULL)342 if (this->bat_ != nullptr && this->bat_[1] != nullptr) 343 343 return this->bat_[1]->getPlayer(); 344 344 else -
code/branches/cpp11_v2/src/modules/pong/PongAI.cc
r10727 r10765 101 101 { 102 102 // If either the ball, or the controllable entity (i.e. the bat) don't exist (or aren't set). 103 if (this->ball_ == NULL || this->getControllableEntity() == NULL)103 if (this->ball_ == nullptr || this->getControllableEntity() == nullptr) 104 104 return; 105 105 -
code/branches/cpp11_v2/src/modules/pong/PongBall.cc
r9945 r10765 163 163 float distance = 0; 164 164 165 if (this->bat_ != NULL) // If there are bats.165 if (this->bat_ != nullptr) // If there are bats. 166 166 { 167 167 // If the right boundary has been crossed. 168 if (position.x > this->fieldWidth_ / 2 && this->bat_[1] != NULL)168 if (position.x > this->fieldWidth_ / 2 && this->bat_[1] != nullptr) 169 169 { 170 170 // Calculate the distance (in z-direction) between the ball and the center of the bat, weighted by half of the effective length of the bat (with additional 10%) … … 195 195 } 196 196 // If the left boundary has been crossed. 197 else if (position.x < -this->fieldWidth_ / 2 && this->bat_[0] != NULL)197 else if (position.x < -this->fieldWidth_ / 2 && this->bat_[0] != nullptr) 198 198 { 199 199 // Calculate the distance (in z-direction) between the ball and the center of the bat, weighted by half of the effective length of the bat (with additional 10%) … … 285 285 { 286 286 // Make space for the bats, if they don't exist, yet. 287 if (this->bat_ == NULL)287 if (this->bat_ == nullptr) 288 288 { 289 289 this->bat_ = new WeakPtr<PongBat>[2]; -
code/branches/cpp11_v2/src/modules/pong/PongCenterpoint.cc
r10624 r10765 84 84 void PongCenterpoint::checkGametype() 85 85 { 86 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Pong)))86 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Pong))) 87 87 { 88 88 Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/pong/PongScore.cc
r10624 r10765 97 97 98 98 // If the owner is set. The owner being a Pong game. 99 if (this->owner_ != NULL)99 if (this->owner_ != nullptr) 100 100 { 101 101 if (!this->owner_->hasEnded()) … … 113 113 114 114 // Save the name and score of each player as a string. 115 if (player1_ != NULL)115 if (player1_ != nullptr) 116 116 { 117 117 name1 = player1_->getName(); 118 118 score1 = multi_cast<std::string>(this->owner_->getScore(player1_)); 119 119 } 120 if (player2_ != NULL)120 if (player2_ != nullptr) 121 121 { 122 122 name2 = player2_->getName(); … … 128 128 if (this->bShowLeftPlayer_) 129 129 { 130 if (this->bShowName_ && this->bShowScore_ && player1_ != NULL)130 if (this->bShowName_ && this->bShowScore_ && player1_ != nullptr) 131 131 output1 = name1 + " - " + score1; 132 132 else if (this->bShowScore_) … … 139 139 if (this->bShowRightPlayer_) 140 140 { 141 if (this->bShowName_ && this->bShowScore_ && player2_ != NULL)141 if (this->bShowName_ && this->bShowScore_ && player2_ != nullptr) 142 142 output2 = score2 + " - " + name2; 143 143 else if (this->bShowScore_) … … 163 163 @brief 164 164 Is called when the owner changes. 165 Sets the owner to NULL, if it is not a pointer to a Pong game.165 Sets the owner to nullptr, if it is not a pointer to a Pong game. 166 166 */ 167 167 void PongScore::changedOwner() … … 169 169 SUPER(PongScore, changedOwner); 170 170 171 if (this->getOwner() != NULL&& this->getOwner()->getGametype())171 if (this->getOwner() != nullptr && this->getOwner()->getGametype()) 172 172 this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype()); 173 173 else -
code/branches/cpp11_v2/src/modules/portals/PortalEndPoint.cc
r9667 r10765 48 48 std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s; 49 49 50 PortalEndPoint::PortalEndPoint(Context* context) : StaticEntity(context), RadarViewable(this, static_cast<WorldEntity*>(this)), id_(0), trigger_( NULL), reenterDelay_(0)50 PortalEndPoint::PortalEndPoint(Context* context) : StaticEntity(context), RadarViewable(this, static_cast<WorldEntity*>(this)), id_(0), trigger_(nullptr), reenterDelay_(0) 51 51 { 52 52 RegisterObject(PortalEndPoint); … … 70 70 PortalEndPoint::~PortalEndPoint() 71 71 { 72 if(this->isInitialized() && this->trigger_ != NULL)72 if(this->isInitialized() && this->trigger_ != nullptr) 73 73 delete this->trigger_; 74 74 } -
code/branches/cpp11_v2/src/modules/questsystem/GlobalQuest.cc
r9667 r10765 138 138 bool GlobalQuest::isStartable(const PlayerInfo* player) const 139 139 { 140 if(!(this->getParentQuest() == NULL|| this->getParentQuest()->isActive(player)))140 if(!(this->getParentQuest() == nullptr || this->getParentQuest()->isActive(player))) 141 141 return false; 142 142 … … 198 198 The status to be set. 199 199 @return 200 Returns false if player is NULL.200 Returns false if player is nullptr. 201 201 */ 202 202 bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status) … … 249 249 i--; 250 250 } 251 return NULL;251 return nullptr; 252 252 } 253 253 -
code/branches/cpp11_v2/src/modules/questsystem/LocalQuest.cc
r9667 r10765 128 128 bool LocalQuest::isStartable(const PlayerInfo* player) const 129 129 { 130 if(!(this->getParentQuest() == NULL|| this->getParentQuest()->isActive(player)))130 if(!(this->getParentQuest() == nullptr || this->getParentQuest()->isActive(player))) 131 131 return false; 132 132 … … 188 188 The status to be set. 189 189 @return 190 Returns false if player is NULL.190 Returns false if player is nullptr. 191 191 */ 192 192 bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status) -
code/branches/cpp11_v2/src/modules/questsystem/Quest.cc
r10624 r10765 55 55 RegisterObject(Quest); 56 56 57 this->parentQuest_ = NULL;57 this->parentQuest_ = nullptr; 58 58 } 59 59 … … 183 183 The index. 184 184 @return 185 Returns a pointer to the sub-quest at the given index. NULLif there is no element at the given index.185 Returns a pointer to the sub-quest at the given index. nullptr if there is no element at the given index. 186 186 */ 187 187 const Quest* Quest::getSubQuest(unsigned int index) const … … 198 198 } 199 199 200 return NULL; // If the index is greater than the number of elements in the list.200 return nullptr; // If the index is greater than the number of elements in the list. 201 201 } 202 202 … … 207 207 The index. 208 208 @return 209 Returns a pointer to the QuestHint at the given index. NULLif there is no element at the given index.209 Returns a pointer to the QuestHint at the given index. nullptr if there is no element at the given index. 210 210 */ 211 211 const QuestHint* Quest::getHint(unsigned int index) const … … 221 221 i--; 222 222 } 223 return NULL; // If the index is greater than the number of elements in the list.223 return nullptr; // If the index is greater than the number of elements in the list. 224 224 } 225 225 … … 230 230 The index. 231 231 @return 232 Returns a pointer to the fail QuestEffect at the given index. NULLif there is no element at the given index.232 Returns a pointer to the fail QuestEffect at the given index. nullptr if there is no element at the given index. 233 233 */ 234 234 const QuestEffect* Quest::getFailEffect(unsigned int index) const … … 244 244 i--; 245 245 } 246 return NULL; // If the index is greater than the number of elements in the list.246 return nullptr; // If the index is greater than the number of elements in the list. 247 247 } 248 248 … … 253 253 The index. 254 254 @return 255 Returns a pointer to the complete QuestEffect at the given index. NULLif there is no element at the given index.255 Returns a pointer to the complete QuestEffect at the given index. nullptr if there is no element at the given index. 256 256 */ 257 257 const QuestEffect* Quest::getCompleteEffect(unsigned int index) const … … 267 267 i--; 268 268 } 269 return NULL; // If the index is greater than the number of elements in the list.269 return nullptr; // If the index is greater than the number of elements in the list. 270 270 } 271 271 … … 280 280 bool Quest::isInactive(const PlayerInfo* player) const 281 281 { 282 if(player == NULL)282 if(player == nullptr) 283 283 return true; 284 284 return this->getStatus(player) == QuestStatus::Inactive; … … 295 295 bool Quest::isActive(const PlayerInfo* player) const 296 296 { 297 if(player == NULL)297 if(player == nullptr) 298 298 return false; 299 299 return this->getStatus(player) == QuestStatus::Active; … … 310 310 bool Quest::isFailed(const PlayerInfo* player) const 311 311 { 312 if(player == NULL)312 if(player == nullptr) 313 313 return false; 314 314 return this->getStatus(player) == QuestStatus::Failed; … … 325 325 bool Quest::isCompleted(const PlayerInfo* player) const 326 326 { 327 if(player == NULL)327 if(player == nullptr) 328 328 return false; 329 329 return this->getStatus(player) == QuestStatus::Completed; -
code/branches/cpp11_v2/src/modules/questsystem/QuestEffectBeacon.cc
r9667 r10765 113 113 114 114 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 115 PlayerInfo* player = NULL;115 PlayerInfo* player = nullptr; 116 116 117 117 // If the trigger is a PlayerTrigger. 118 if(pTrigger != NULL)118 if(pTrigger != nullptr) 119 119 { 120 120 if(!pTrigger->isForPlayer()) // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. … … 126 126 return false; 127 127 128 if(player == NULL)128 if(player == nullptr) 129 129 { 130 130 orxout(verbose, context::quests) << "The QuestEffectBeacon was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl; … … 243 243 i--; 244 244 } 245 return NULL;245 return nullptr; 246 246 } 247 247 -
code/branches/cpp11_v2/src/modules/questsystem/QuestHint.cc
r9667 r10765 88 88 bool QuestHint::isActive(const PlayerInfo* player) const 89 89 { 90 if(player == NULL) // If the player is NULL, the Quest obviously can't be active.90 if(player == nullptr) // If the player is nullptr, the Quest obviously can't be active. 91 91 return false; 92 92 -
code/branches/cpp11_v2/src/modules/questsystem/QuestListener.cc
r9667 r10765 59 59 60 60 this->mode_ = QuestListenerMode::All; 61 this->quest_ = NULL;61 this->quest_ = nullptr; 62 62 } 63 63 … … 81 81 XMLPortParam(QuestListener, "mode", setMode, getMode, xmlelement, mode); 82 82 83 if(this->quest_ != NULL)83 if(this->quest_ != nullptr) 84 84 this->quest_->addListener(this); // Adds the QuestListener to the Quests list of listeners. 85 85 … … 117 117 this->quest_ = QuestManager::getInstance().findQuest(id); // Find the Quest corresponding to the given questId. 118 118 119 if(this->quest_ == NULL) // If there is no such Quest.119 if(this->quest_ == nullptr) // If there is no such Quest. 120 120 { 121 121 ThrowException(Argument, "This is bad! The QuestListener has not found a Quest with a corresponding id.."); -
code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc
r10624 r10765 93 93 bool QuestManager::registerQuest(Quest* quest) 94 94 { 95 if(quest == NULL)96 { 97 orxout(internal_error, context::quests) << "Quest pointer is NULL." << endl;95 if(quest == nullptr) 96 { 97 orxout(internal_error, context::quests) << "Quest pointer is nullptr." << endl; 98 98 return false; 99 99 } … … 135 135 bool QuestManager::registerHint(QuestHint* hint) 136 136 { 137 if(hint == NULL)138 { 139 orxout(internal_error, context::quests) << "Quest pointer is NULL." << endl;137 if(hint == nullptr) 138 { 139 orxout(internal_error, context::quests) << "Quest pointer is nullptr." << endl; 140 140 return false; 141 141 } … … 173 173 @return 174 174 Returns a pointer to the Quest with the input id. 175 Returns NULLif there is no Quest with the given questId.175 Returns nullptr if there is no Quest with the given questId. 176 176 @throws 177 177 Throws an exception if the given questId is invalid. … … 188 188 else 189 189 { 190 quest = NULL;190 quest = nullptr; 191 191 orxout(internal_warning, context::quests) << "The quest with id {" << questId << "} is nowhere to be found." << endl; 192 192 } … … 202 202 @return 203 203 Returns a pointer to the QuestHint with the input id. 204 Returns NULLif there is no QuestHint with the given hintId.204 Returns nullptr if there is no QuestHint with the given hintId. 205 205 @throws 206 206 Throws an exception if the given hintId is invalid. … … 217 217 else 218 218 { 219 hint = NULL;219 hint = nullptr; 220 220 orxout(internal_warning, context::quests) << "The hint with id {" << hintId << "} is nowhere to be found." << endl; 221 221 } … … 237 237 for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++) 238 238 { 239 if(it->second->getParentQuest() == NULL&& !it->second->isInactive(player))239 if(it->second->getParentQuest() == nullptr && !it->second->isInactive(player)) 240 240 numQuests++; 241 241 } … … 257 257 for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++) 258 258 { 259 if(it->second->getParentQuest() == NULL&& !it->second->isInactive(player) && index-- == 0)259 if(it->second->getParentQuest() == nullptr && !it->second->isInactive(player) && index-- == 0) 260 260 return it->second; 261 261 } 262 return NULL;262 return nullptr; 263 263 } 264 264 … … 275 275 int QuestManager::getNumSubQuests(Quest* quest, PlayerInfo* player) 276 276 { 277 if(quest == NULL)277 if(quest == nullptr) 278 278 return this->getNumRootQuests(player); 279 279 … … 300 300 Quest* QuestManager::getSubQuest(Quest* quest, PlayerInfo* player, int index) 301 301 { 302 if(quest == NULL)302 if(quest == nullptr) 303 303 return this->getRootQuest(player, index); 304 304 … … 309 309 return *it; 310 310 } 311 return NULL;311 return nullptr; 312 312 } 313 313 … … 354 354 return *it; 355 355 } 356 return NULL;356 return nullptr; 357 357 } 358 358 … … 367 367 Quest* QuestManager::getParentQuest(Quest* quest) 368 368 { 369 OrxAssert(quest, "The input Quest is NULL.");369 OrxAssert(quest, "The input Quest is nullptr."); 370 370 return quest->getParentQuest(); 371 371 } … … 381 381 QuestDescription* QuestManager::getDescription(Quest* item) 382 382 { 383 OrxAssert(item, "The input Quest is NULL.");383 OrxAssert(item, "The input Quest is nullptr."); 384 384 return item->getDescription(); 385 385 } … … 395 395 QuestDescription* QuestManager::getDescription(QuestHint* item) 396 396 { 397 OrxAssert(item, "The input QuestHint is NULL.");397 OrxAssert(item, "The input QuestHint is nullptr."); 398 398 return item->getDescription(); 399 399 } … … 409 409 const std::string QuestManager::getId(Quest* item) const 410 410 { 411 OrxAssert(item, "The input Quest is NULL.");411 OrxAssert(item, "The input Quest is nullptr."); 412 412 return item->getId(); 413 413 } … … 423 423 const std::string QuestManager::getId(QuestHint* item) const 424 424 { 425 OrxAssert(item, "The input QuestHint is NULL.");425 OrxAssert(item, "The input QuestHint is nullptr."); 426 426 return item->getId(); 427 427 } … … 440 440 { 441 441 PlayerInfo* player = GUIManager::getInstance().getPlayer(guiName); 442 if(player == NULL)442 if(player == nullptr) 443 443 { 444 444 orxout(internal_error, context::quests) << "GUIOverlay with name '" << guiName << "' has no player." << endl; 445 return NULL;445 return nullptr; 446 446 } 447 447 -
code/branches/cpp11_v2/src/modules/questsystem/effects/AddQuest.cc
r9667 r10765 90 90 { 91 91 Quest* quest = QuestManager::getInstance().findQuest(this->getQuestId()); 92 if(quest == NULL|| !quest->start(player))92 if(quest == nullptr || !quest->start(player)) 93 93 return false; 94 94 } -
code/branches/cpp11_v2/src/modules/questsystem/effects/AddQuestHint.cc
r9667 r10765 113 113 { 114 114 QuestHint* hint = QuestManager::getInstance().findHint(this->hintId_); 115 if(hint == NULL|| !hint->setActive(player))115 if(hint == nullptr || !hint->setActive(player)) 116 116 return false; 117 117 } -
code/branches/cpp11_v2/src/modules/questsystem/effects/AddReward.cc
r9667 r10765 90 90 i--; 91 91 } 92 return NULL;92 return nullptr; 93 93 } 94 94 -
code/branches/cpp11_v2/src/modules/questsystem/effects/CompleteQuest.cc
r9667 r10765 92 92 { 93 93 quest = QuestManager::getInstance().findQuest(this->getQuestId()); 94 if(quest == NULL|| !quest->complete(player))94 if(quest == nullptr || !quest->complete(player)) 95 95 return false; 96 96 } -
code/branches/cpp11_v2/src/modules/questsystem/effects/FailQuest.cc
r9667 r10765 91 91 { 92 92 quest = QuestManager::getInstance().findQuest(this->getQuestId()); 93 if(quest == NULL|| !quest->fail(player))93 if(quest == nullptr || !quest->fail(player)) 94 94 return false; 95 95 } -
code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
r10624 r10765 72 72 this->starttimer_.stopTimer(); 73 73 74 this->player_ = NULL;74 this->player_ = nullptr; 75 75 this->setHUDTemplate("TetrisHUD"); 76 76 this->futureBrick_ = 0; … … 113 113 SUPER(Tetris, tick, dt); 114 114 115 if((this->activeBrick_ != NULL)&&(!this->hasEnded()))115 if((this->activeBrick_ != nullptr)&&(!this->hasEnded())) 116 116 { 117 117 if(!this->isValidBrickPosition(this->activeBrick_)) … … 290 290 void Tetris::start() 291 291 { 292 if (this->center_ != NULL) // There needs to be a TetrisCenterpoint, i.e. the area the game takes place.292 if (this->center_ != nullptr) // There needs to be a TetrisCenterpoint, i.e. the area the game takes place. 293 293 { 294 294 // Create the first brick. … … 323 323 { 324 324 this->activeBrick_->setVelocity(Vector3::ZERO); 325 if(this->activeBrick_ != NULL)325 if(this->activeBrick_ != nullptr) 326 326 { 327 327 this->player_->stopControl(); … … 351 351 if(player && player->isHumanPlayer()) 352 352 { 353 if(this->activeBrick_ != NULL)353 if(this->activeBrick_ != nullptr) 354 354 { 355 355 this->player_->stopControl(); … … 370 370 assert(player); 371 371 372 if(this->player_ == NULL)372 if(this->player_ == nullptr) 373 373 { 374 374 this->player_ = player; … … 381 381 void Tetris::startBrick(void) 382 382 { 383 if(this->player_ == NULL)383 if(this->player_ == nullptr) 384 384 return; 385 385 386 386 unsigned int cameraIndex = 0; 387 if(this->activeBrick_ != NULL)387 if(this->activeBrick_ != nullptr) 388 388 { 389 389 // Get camera settings … … 437 437 Get the player. 438 438 @return 439 Returns a pointer to the player. If there is no player, NULLis returned.439 Returns a pointer to the player. If there is no player, nullptr is returned. 440 440 */ 441 441 PlayerInfo* Tetris::getPlayer(void) const -
code/branches/cpp11_v2/src/modules/tetris/TetrisBrick.cc
r10624 r10765 81 81 this->attach(stone); 82 82 this->formBrick(stone, i); 83 if(this->tetris_ != NULL)83 if(this->tetris_ != nullptr) 84 84 { 85 85 stone->setGame(this->tetris_); 86 if(this->tetris_->getCenterpoint() != NULL)86 if(this->tetris_->getCenterpoint() != nullptr) 87 87 stone->addTemplate(this->tetris_->getCenterpoint()->getStoneTemplate()); 88 88 else 89 orxout()<< "tetris_->getCenterpoint == NULLin TetrisBrick.cc"<< endl;89 orxout()<< "tetris_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl; 90 90 } 91 91 else 92 orxout()<< "tetris_ == NULLin TetrisBrick.cc"<< endl;92 orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl; 93 93 } 94 94 } … … 161 161 if(i < this->brickStones_.size()) 162 162 return this->brickStones_[i]; 163 else return NULL;163 else return nullptr; 164 164 } 165 165 … … 167 167 Tetris* TetrisBrick::getTetris() 168 168 { 169 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Tetris)))169 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Tetris))) 170 170 { 171 171 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype()); 172 172 return tetrisGametype; 173 173 } 174 return NULL;174 return nullptr; 175 175 } 176 176 -
code/branches/cpp11_v2/src/modules/tetris/TetrisCenterpoint.cc
r10624 r10765 84 84 void TetrisCenterpoint::checkGametype() 85 85 { 86 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Tetris)))86 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Tetris))) 87 87 { 88 88 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/tetris/TetrisScore.cc
r10624 r10765 57 57 58 58 this->owner_ = 0; 59 this->player_ = NULL;59 this->player_ = nullptr; 60 60 } 61 61 … … 89 89 90 90 // If the owner is set. The owner being a Tetris game. 91 if (this->owner_ != NULL)91 if (this->owner_ != nullptr) 92 92 { 93 93 std::string score("0"); … … 101 101 { 102 102 // Save the name and score of each player as a string. 103 if (player_ != NULL)103 if (player_ != nullptr) 104 104 score = multi_cast<std::string>(this->owner_->getScore(player_)); 105 105 } … … 111 111 @brief 112 112 Is called when the owner changes. 113 Sets the owner to NULL, if it is not a pointer to a Tetris game.113 Sets the owner to nullptr, if it is not a pointer to a Tetris game. 114 114 */ 115 115 void TetrisScore::changedOwner() … … 117 117 SUPER(TetrisScore, changedOwner); 118 118 119 if (this->getOwner() != NULL&& this->getOwner()->getGametype())119 if (this->getOwner() != nullptr && this->getOwner()->getGametype()) 120 120 this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype()); 121 121 else -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc
r10727 r10765 90 90 RegisterObject(TowerDefense); 91 91 92 selecter = NULL;93 this->player_ = NULL;92 selecter = nullptr; 93 this->player_ = nullptr; 94 94 this->setHUDTemplate("TowerDefenseHUD"); 95 95 this->waveNumber_ = 0; … … 117 117 void TowerDefense::start() 118 118 { 119 if (center_ != NULL) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place.120 { 121 if (selecter == NULL)119 if (center_ != nullptr) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place. 120 { 121 if (selecter == nullptr) 122 122 { 123 123 selecter = new TowerDefenseSelecter(this->center_->getContext()); … … 176 176 WaypointController* controller = (WaypointController*)(en1->getXMLController()); 177 177 178 if (controller != NULL&& waypoints_.size() > 1)178 if (controller != nullptr && waypoints_.size() > 1) 179 179 { 180 180 en1->setPosition(waypoints_.at(0)->getPosition() + offset_); … … 208 208 player_ = player; 209 209 210 if (selecter->getPlayer() == NULL)210 if (selecter->getPlayer() == nullptr) 211 211 { 212 212 player_->startControl(selecter); … … 219 219 Get the player. 220 220 @return 221 Returns a pointer to the player. If there is no player, NULLis returned.221 Returns a pointer to the player. If there is no player, nullptr is returned. 222 222 */ 223 223 PlayerInfo* TowerDefense::getPlayer(void) const … … 265 265 SUPER(TowerDefense, tick, dt); 266 266 267 if (hasStarted() == false || player_ == NULL)267 if (hasStarted() == false || player_ == nullptr) 268 268 { 269 269 return; … … 273 273 274 274 //build/upgrade tower at selecter position 275 if (selecter != NULL&& selecter->buildTower_ == true)275 if (selecter != nullptr && selecter->buildTower_ == true) 276 276 { 277 277 selecter->buildTower_ = false; … … 289 289 for (std::list<WeakPtr<TowerDefenseEnemy> >::iterator it = enemies_.begin(); it != enemies_.end(); ) 290 290 { 291 if (*it == NULL)291 if (*it == nullptr) 292 292 { 293 293 // the enemy was destroyed by a tower - remove it from the list … … 365 365 TDCoordinate* thisCoord = &startCoord; 366 366 TDCoordinate* nextCoord; 367 while ((nextCoord = getNextStreetCoord(thisCoord)) != NULL)367 while ((nextCoord = getNextStreetCoord(thisCoord)) != nullptr) 368 368 { 369 369 waypoints_.push_back(fields_[nextCoord->GetX()][nextCoord->GetY()]); … … 381 381 if (thisField->getType() != STREET && thisField->getType() != START) 382 382 { 383 return NULL;383 return nullptr; 384 384 } 385 385 … … 406 406 } 407 407 408 return NULL;408 return nullptr; 409 409 } 410 410 } -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseCenterpoint.cc
r10629 r10765 92 92 void TowerDefenseCenterpoint::checkGametype() 93 93 { 94 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(TowerDefense)))94 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(TowerDefense))) 95 95 { 96 96 // Sets the centerpoint of the gametype. The gametype uses this to later spawn in towers, he needs the tower template stored in the center point -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseEnemy.cc
r10629 r10765 47 47 WeakPtr<TowerDefense> TowerDefenseEnemy::getGame() 48 48 { 49 if (game == NULL)49 if (game == nullptr) 50 50 { 51 51 for (ObjectList<TowerDefense>::iterator it = ObjectList<TowerDefense>::begin(); it != ObjectList<TowerDefense>::end(); ++it) -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseField.cc
r10629 r10765 49 49 RegisterObject(TowerDefenseField); 50 50 51 tower_ = NULL;51 tower_ = nullptr; 52 52 type_ = FREE; 53 center_ = NULL;53 center_ = nullptr; 54 54 upgrade_ = 0; 55 55 setPosition(0,0,0); … … 119 119 bool TowerDefenseField::canUpgrade() 120 120 { 121 if (tower_ != NULL&& upgrade_ < 5)121 if (tower_ != nullptr && upgrade_ < 5) 122 122 { 123 123 return true; … … 129 129 void TowerDefenseField::setAngle(int newAngle) 130 130 { 131 if (modelGround_ != NULL)131 if (modelGround_ != nullptr) 132 132 { 133 133 switch (newAngle) … … 152 152 } 153 153 154 if (modelObject_ != NULL)154 if (modelObject_ != nullptr) 155 155 { 156 156 switch (newAngle) … … 185 185 { 186 186 modelGround_->setMeshSource("TD_F1.mesh"); 187 tower_ = NULL;187 tower_ = nullptr; 188 188 type_ = FREE; 189 189 setUpgrade(0); … … 194 194 { 195 195 modelGround_->setMeshSource("TD_S5.mesh"); 196 tower_ = NULL;196 tower_ = nullptr; 197 197 type_ = START; 198 198 setUpgrade(0); … … 204 204 { 205 205 modelGround_->setMeshSource("TD_S4.mesh"); 206 tower_ = NULL;206 tower_ = nullptr; 207 207 type_ = END; 208 208 setUpgrade(0); … … 213 213 { 214 214 modelGround_->setMeshSource("TD_S1.mesh"); 215 tower_ = NULL;215 tower_ = nullptr; 216 216 type_ = STREET; 217 217 setUpgrade(0); … … 222 222 { 223 223 modelGround_->setMeshSource("TD_S2.mesh"); 224 tower_ = NULL;224 tower_ = nullptr; 225 225 type_ = STREET; 226 226 setUpgrade(0); … … 231 231 { 232 232 modelGround_->setMeshSource("TD_S3.mesh"); 233 tower_ = NULL;233 tower_ = nullptr; 234 234 type_ = STREET; 235 235 setUpgrade(0); … … 241 241 modelGround_->setMeshSource("TD_F1.mesh"); 242 242 modelObject_->setMeshSource("TD_O1.mesh"); 243 tower_ = NULL;243 tower_ = nullptr; 244 244 type_ = OBSTACLE; 245 245 setUpgrade(0); … … 249 249 void TowerDefenseField::createTower(int upgrade) 250 250 { 251 if (tower_ == NULL)251 if (tower_ == nullptr) 252 252 { 253 253 modelGround_->setMeshSource("TD_F1.mesh"); … … 256 256 type_ = TOWER; 257 257 setUpgrade(upgrade); 258 if (upgrade_ > 0 && modelObject_ != NULL)258 if (upgrade_ > 0 && modelObject_ != nullptr) 259 259 { 260 260 switch (upgrade_) … … 287 287 void TowerDefenseField::destroyTower() 288 288 { 289 if (tower_ != NULL)289 if (tower_ != nullptr) 290 290 { 291 291 tower_->destroy(); 292 tower_ = NULL;292 tower_ = nullptr; 293 293 } 294 294 } -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseTower.cc
r10727 r10765 25 25 { 26 26 RegisterObject(TowerDefenseTower); 27 game_ = NULL;27 game_ =nullptr; 28 28 this->setCollisionType(WorldEntity::None); 29 29 upgrade = 1; -
code/branches/cpp11_v2/src/modules/weapons/IceGunFreezer.cc
r10629 r10765 101 101 102 102 // Check if the freezer is attached to a parent and check if the parent is a SpaceShip 103 if (parent != NULL&& parent->isA(Class(SpaceShip)))103 if (parent != nullptr && parent->isA(Class(SpaceShip))) 104 104 { 105 105 freezedSpaceShip_ = orxonox_cast<SpaceShip*>(parent); … … 118 118 void IceGunFreezer::stopFreezing() 119 119 { 120 if (freezedSpaceShip_ != NULL&& freezeFactor_ != 0.0)120 if (freezedSpaceShip_ != nullptr && freezeFactor_ != 0.0) 121 121 { 122 122 freezedSpaceShip_->addSpeedFactor(1/freezeFactor_); -
code/branches/cpp11_v2/src/modules/weapons/projectiles/BasicProjectile.cc
r10293 r10765 88 88 // The projectile is destroyed by its tick()-function (in the following tick). 89 89 90 Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is NULL90 Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is nullptr 91 91 92 92 WorldEntity* entity = orxonox_cast<WorldEntity*>(this); … … 146 146 bool BasicProjectile::isObjectRelatedToShooter(WorldEntity* otherObject) 147 147 { 148 for (WorldEntity* shooter = this->getShooter(); shooter != NULL; shooter = shooter->getParent())148 for (WorldEntity* shooter = this->getShooter(); shooter != nullptr; shooter = shooter->getParent()) 149 149 if (otherObject == shooter) 150 150 return true; 151 for (WorldEntity* object = otherObject; object != NULL; object = object->getParent())151 for (WorldEntity* object = otherObject; object != nullptr; object = object->getParent()) 152 152 if (otherObject == this->getShooter()) 153 153 return true; -
code/branches/cpp11_v2/src/modules/weapons/projectiles/GravityBombField.cc
r10622 r10765 137 137 float damage = FORCE_FIELD_EXPLOSION_DAMMAGE*(1-distanceVector.length()/EXPLOSION_RADIUS); 138 138 //orxout(debug_output) << "Damage: " << damage << endl; 139 it->hit(shooter_, it->getWorldPosition(), NULL, damage, 0,0);139 it->hit(shooter_, it->getWorldPosition(), nullptr, damage, 0,0); 140 140 victimsAlreadyDamaged_.push_back(*it); 141 141 } -
code/branches/cpp11_v2/src/modules/weapons/projectiles/Projectile.cc
r10629 r10765 94 94 void Projectile::setCollisionShapeRadius(float radius) 95 95 { 96 if (collisionShape_ != NULL&& radius > 0)96 if (collisionShape_ != nullptr && radius > 0) 97 97 { 98 98 collisionShape_->setRadius(radius); -
code/branches/cpp11_v2/src/orxonox/CameraManager.cc
r10624 r10765 93 93 this->cameraList_.front()->setFocus(); 94 94 else 95 this->useCamera( NULL);95 this->useCamera(nullptr); 96 96 } 97 97 else -
code/branches/cpp11_v2/src/orxonox/LevelManager.cc
r10624 r10765 154 154 Get the currently active Level. 155 155 @return 156 Returns a pointer to the currently active level or NULLif there currently are no active Levels.156 Returns a pointer to the currently active level or nullptr if there currently are no active Levels. 157 157 */ 158 158 Level* LevelManager::getActiveLevel() … … 218 218 { 219 219 if(index >= this->availableLevels_.size()) 220 return NULL;220 return nullptr; 221 221 222 222 // If this index directly follows the last we can optimize a lot. … … 272 272 if (it->find("old/") != 0) 273 273 { 274 LevelInfoItem* info = NULL;274 LevelInfoItem* info = nullptr; 275 275 276 276 // Load the LevelInfo object from the level file. … … 286 286 Loader::getInstance().unload(&file); 287 287 288 if(info == NULL)288 if(info == nullptr) 289 289 { 290 290 // Create a default LevelInfoItem object that merely contains the name -
code/branches/cpp11_v2/src/orxonox/Scene.cc
r10727 r10765 66 66 this->bShadows_ = true; 67 67 this->bDebugDrawPhysics_ = false; 68 this->debugDrawer_ = NULL;68 this->debugDrawer_ = nullptr; 69 69 this->soundReferenceDistance_ = 20.0; 70 70 this->bIsUpdatingPhysics_ = false; -
code/branches/cpp11_v2/src/orxonox/chat/ChatInputHandler.cc
r10624 r10765 79 79 this->inpbuf = new InputBuffer(); 80 80 this->disp_offset = 0; 81 assert( this->inpbuf != NULL);81 assert( this->inpbuf != nullptr ); 82 82 83 83 /* generate chatbox ui and chatbox-inputonly ui */ -
code/branches/cpp11_v2/src/orxonox/collisionshapes/CollisionShape.h
r9667 r10765 181 181 182 182 btCollisionShape* collisionShape_; //!< The bullet collision shape of this CollisionShape. 183 CompoundCollisionShape* parent_; //!< The CompoundCollisionShape this CollisionShape belongs to, NULLif it doesn't belong to one.183 CompoundCollisionShape* parent_; //!< The CompoundCollisionShape this CollisionShape belongs to, nullptr if it doesn't belong to one. 184 184 unsigned int parentID_; //!< The objectID of the parent of this CollisionShape, which can either be a CompoundCollisionShape or a WorldEntity. 185 185 -
code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc
r10624 r10765 72 72 it->first->destroy(); 73 73 if (this->collisionShape_ == it->second) 74 this->collisionShape_ = NULL; // don't destroy it twice74 this->collisionShape_ = nullptr; // don't destroy it twice 75 75 } 76 76 77 77 delete this->compoundShape_; 78 78 if (this->collisionShape_ == this->compoundShape_) 79 this->collisionShape_ = NULL; // don't destroy it twice79 this->collisionShape_ = nullptr; // don't destroy it twice 80 80 } 81 81 } … … 96 96 void CompoundCollisionShape::attach(CollisionShape* shape) 97 97 { 98 // If either the input shape is NULLor we try to attach the CollisionShape to itself.98 // If either the input shape is nullptr or we try to attach the CollisionShape to itself. 99 99 if (!shape || static_cast<CollisionShape*>(this) == shape) 100 100 return; -
code/branches/cpp11_v2/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc
r10624 r10765 43 43 RegisterObject(WorldEntityCollisionShape); 44 44 45 this->worldEntityOwner_ = NULL;45 this->worldEntityOwner_ = nullptr; 46 46 // suppress synchronisation 47 47 this->setSyncMode(ObjectDirection::None); -
code/branches/cpp11_v2/src/orxonox/controllers/AIController.cc
r9667 r10765 249 249 } 250 250 else 251 this->setPreviousMode();//If bot dies -> getControllableEntity == NULL-> get out of ROCKET mode251 this->setPreviousMode();//If bot dies -> getControllableEntity == nullptr -> get out of ROCKET mode 252 252 }//END_OF ROCKET MODE 253 253 -
code/branches/cpp11_v2/src/orxonox/controllers/ArtificialController.cc
r10733 r10765 56 56 this->currentWaypoint_ = 0; 57 57 this->setAccuracy(5); 58 this->defaultWaypoint_ = NULL;58 this->defaultWaypoint_ = nullptr; 59 59 this->mode_ = DEFAULT;//Vector-implementation: mode_.push_back(DEFAULT); 60 60 } … … 222 222 { 223 223 SpaceShip* ship = orxonox_cast<SpaceShip*>(this->getControllableEntity()); 224 if(ship == NULL) return;224 if(ship == nullptr) return; 225 225 if(ship->getBoostPower()*1.5f > ship->getInitialBoostPower() ) //upper limit ->boost 226 226 this->getControllableEntity()->boost(true); … … 258 258 void ArtificialController::updatePointsOfInterest(std::string name, float searchDistance) 259 259 { 260 WorldEntity* waypoint = NULL;260 WorldEntity* waypoint = nullptr; 261 261 for (WorldEntity* we : ObjectList<WorldEntity>()) 262 262 { -
code/branches/cpp11_v2/src/orxonox/controllers/ControllerDirector.cc
r10622 r10765 32 32 33 33 // Initialize member variables 34 this->player_ = NULL;35 this->entity_ = NULL;36 this->pTrigger_ = NULL;34 this->player_ = nullptr; 35 this->entity_ = nullptr; 36 this->pTrigger_ = nullptr; 37 37 this->context_ = context; 38 38 } … … 110 110 { 111 111 this->pTrigger_ = orxonox_cast<PlayerTrigger*>(trigger); 112 this->player_ = NULL;112 this->player_ = nullptr; 113 113 114 114 orxout(verbose) << "Preparation to take Control!" << endl; 115 115 116 116 // Check whether it is a player trigger and extract pawn from it 117 if(this->pTrigger_ != NULL)117 if(this->pTrigger_ != nullptr) 118 118 { 119 119 // Get the object which triggered the event. … … 121 121 122 122 // Check if there actually was a player returned. 123 if( this->player_ == NULL) return false;123 if( this->player_ == nullptr) return false; 124 124 } 125 125 else -
code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc
r10631 r10765 773 773 { 774 774 775 Pawn *humanPawn = NULL;776 NewHumanController *currentHumanController = NULL;775 Pawn *humanPawn = nullptr; 776 NewHumanController *currentHumanController = nullptr; 777 777 std::vector<FormationController*> allMasters; 778 778 … … 800 800 } 801 801 802 if((humanPawn != NULL) && (allMasters.size() != 0))802 if((humanPawn != nullptr) && (allMasters.size() != 0)) 803 803 { 804 804 float posHuman = humanPawn->getPosition().length(); … … 826 826 void FormationController::followInit(Pawn* pawn, const bool always, const int secondsToFollow) 827 827 { 828 if (pawn == NULL|| this->state_ != MASTER)828 if (pawn == nullptr || this->state_ != MASTER) 829 829 return; 830 830 this->specificMasterAction_ = FOLLOW; … … 844 844 { 845 845 846 Pawn *humanPawn = NULL;847 NewHumanController *currentHumanController = NULL;846 Pawn *humanPawn = nullptr; 847 NewHumanController *currentHumanController = nullptr; 848 848 849 849 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) … … 861 861 } 862 862 863 if((humanPawn != NULL))863 if((humanPawn != nullptr)) 864 864 this->followInit(humanPawn); 865 865 } -
code/branches/cpp11_v2/src/orxonox/controllers/HumanController.cc
r10624 r10765 321 321 return orxonox_cast<Pawn*>(HumanController::localController_s->getControllableEntity()); 322 322 else 323 return NULL;323 return nullptr; 324 324 } 325 325 -
code/branches/cpp11_v2/src/orxonox/controllers/NewHumanController.cc
r10631 r10765 62 62 NewHumanController::NewHumanController(Context* context) 63 63 : HumanController(context) 64 , crossHairOverlay_( NULL)65 , centerOverlay_( NULL)66 , damageOverlayTop_( NULL)67 , damageOverlayRight_( NULL)68 , damageOverlayBottom_( NULL)69 , damageOverlayLeft_( NULL)64 , crossHairOverlay_(nullptr) 65 , centerOverlay_(nullptr) 66 , damageOverlayTop_(nullptr) 67 , damageOverlayRight_(nullptr) 68 , damageOverlayBottom_(nullptr) 69 , damageOverlayLeft_(nullptr) 70 70 , damageOverlayTT_(0) 71 71 , damageOverlayTR_(0) 72 72 , damageOverlayTB_(0) 73 73 , damageOverlayTL_(0) 74 , arrowsOverlay1_( NULL)75 , arrowsOverlay2_( NULL)76 , arrowsOverlay3_( NULL)77 , arrowsOverlay4_( NULL)74 , arrowsOverlay1_(nullptr) 75 , arrowsOverlay2_(nullptr) 76 , arrowsOverlay3_(nullptr) 77 , arrowsOverlay4_(nullptr) 78 78 { 79 79 RegisterObject(NewHumanController); -
code/branches/cpp11_v2/src/orxonox/controllers/ScriptController.cc
r10622 r10765 64 64 /* Set default values for all variables */ 65 65 /* - pointers to zero */ 66 this->player_ = NULL;67 this->entity_ = NULL;66 this->player_ = nullptr; 67 this->entity_ = nullptr; 68 68 69 69 /* - times */ … … 138 138 139 139 } 140 return NULL;140 return nullptr; 141 141 } 142 142 -
code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc
r10624 r10765 156 156 { 157 157 ModifyConsoleCommand(__CC_changeGame_name).deactivate(); 158 ModifyConsoleCommand(__CC_reloadLevel_name).setObject( NULL).deactivate();158 ModifyConsoleCommand(__CC_reloadLevel_name).setObject(nullptr).deactivate(); 159 159 } 160 160 } -
code/branches/cpp11_v2/src/orxonox/gamestates/GSLevelMemento.h
r10281 r10765 48 48 protected: 49 49 /** 50 * Returns the state of this memento. Returns NULLif no state needed to persist.50 * Returns the state of this memento. Returns nullptr if no state needed to persist. 51 51 */ 52 52 virtual GSLevelMementoState* exportMementoState() = 0; -
code/branches/cpp11_v2/src/orxonox/gamestates/GSMainMenu.cc
r10624 r10765 73 73 74 74 // create an empty Scene 75 this->scene_ = new Scene( NULL);75 this->scene_ = new Scene(nullptr); 76 76 this->scene_->setSyncMode( 0x0 ); 77 77 // and a Camera -
code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc
r10624 r10765 92 92 this->gtinfo_->destroy(); 93 93 94 ModifyConsoleCommand(__CC_addBots_name).setObject( NULL);95 ModifyConsoleCommand(__CC_killBots_name).setObject( NULL);94 ModifyConsoleCommand(__CC_addBots_name).setObject(nullptr); 95 ModifyConsoleCommand(__CC_killBots_name).setObject(nullptr); 96 96 } 97 97 } … … 337 337 { 338 338 // Fallback spawn point if there is no active one, choose a random one. 339 SpawnPoint* fallbackSpawnPoint = NULL;339 SpawnPoint* fallbackSpawnPoint = nullptr; 340 340 unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size()))); 341 341 unsigned int index = 0; … … 346 346 fallbackSpawnPoint = (*it); 347 347 348 if (*it != NULL&& (*it)->isActive())348 if (*it != nullptr && (*it)->isActive()) 349 349 activeSpawnPoints.push_back(*it); 350 350 … … 552 552 } 553 553 554 return NULL;554 return nullptr; 555 555 } 556 556 … … 558 558 { 559 559 // find correct memento state 560 GametypeMementoState* state = NULL;560 GametypeMementoState* state = nullptr; 561 561 for (size_t i = 0; i < states.size(); ++i) 562 562 { … … 570 570 571 571 // find correct scene 572 Scene* scene = NULL;572 Scene* scene = nullptr; 573 573 for (ObjectList<Scene>::iterator it = ObjectList<Scene>::begin(); it != ObjectList<Scene>::end(); ++it) 574 574 { -
code/branches/cpp11_v2/src/orxonox/gametypes/TeamGametype.cc
r9941 r10765 75 75 void TeamGametype::playerEntered(PlayerInfo* player) 76 76 { 77 if(player == NULL) return; // catch null pointers77 if(player == nullptr) return; // catch null pointers 78 78 Gametype::playerEntered(player); 79 79 this->findAndSetTeam(player); … … 96 96 void TeamGametype::findAndSetTeam(PlayerInfo* player) 97 97 { 98 if(player == NULL) return; // catch null pointers98 if(player == nullptr) return; // catch null pointers 99 99 std::vector<unsigned int> playersperteam(this->teams_, 0); 100 100 … … 235 235 } 236 236 237 SpawnPoint* fallbackSpawnPoint = NULL;237 SpawnPoint* fallbackSpawnPoint = nullptr; 238 238 if (teamSpawnPoints.size() > 0) 239 239 { … … 328 328 void TeamGametype::setDefaultObjectColour(Pawn* pawn) 329 329 { 330 if(pawn == NULL)330 if(pawn == nullptr) 331 331 return; 332 332 … … 350 350 ArtificialController* artificial = orxonox_cast<ArtificialController*>(controller); 351 351 //get Teamnumber - get the data 352 if(artificial == NULL)352 if(artificial == nullptr) 353 353 return; 354 354 teamnumber= artificial->getTeam(); … … 360 360 void TeamGametype::colourPawn(Pawn* pawn, int teamNr) 361 361 {// catch: no-colouring-case and wrong input 362 if(teamNr < 0 || teamNr+1 > int(this->teamcolours_.size()) ||pawn == NULL) return;362 if(teamNr < 0 || teamNr+1 > int(this->teamcolours_.size()) ||pawn == nullptr) return; 363 363 pawn->setRadarObjectColour(this->teamcolours_[teamNr]); 364 364 -
code/branches/cpp11_v2/src/orxonox/graphics/Billboard.cc
r9667 r10765 139 139 { 140 140 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 141 if( bSet != NULL)141 if( bSet != nullptr ) 142 142 { 143 143 bSet->setBillboardType(bbt); … … 148 148 { 149 149 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 150 if( bSet != NULL)150 if( bSet != nullptr ) 151 151 { 152 152 bSet->setCommonDirection( vec ); … … 157 157 { 158 158 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 159 if( bSet != NULL)159 if( bSet != nullptr ) 160 160 { 161 161 bSet->setCommonUpVector( vec ); … … 166 166 { 167 167 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 168 if( bSet != NULL)168 if( bSet != nullptr ) 169 169 { 170 170 bSet->setDefaultDimensions(width, height); -
code/branches/cpp11_v2/src/orxonox/graphics/Model.cc
r10728 r10765 157 157 BaseObject* creatorPtr = this; 158 158 159 while(creatorPtr!= NULL&&orxonox_cast<WorldEntity*>(creatorPtr))159 while(creatorPtr!=nullptr&&orxonox_cast<WorldEntity*>(creatorPtr)) 160 160 { 161 161 scaleFactor *= getBiggestScale(((WorldEntity*) creatorPtr)->getScale3D()); -
code/branches/cpp11_v2/src/orxonox/infos/PlayerInfo.cc
r10624 r10765 181 181 182 182 RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity); 183 if (radarviewable != NULL)183 if (radarviewable != nullptr) 184 184 radarviewable->setRadarName(this->getName()); 185 185 } … … 235 235 236 236 Controller* tmp =this->controllableEntity_->getController(); 237 if (tmp == NULL)238 { 239 orxout(verbose) << "PlayerInfo: pauseControl, Controller is NULL" << endl;237 if (tmp == nullptr) 238 { 239 orxout(verbose) << "PlayerInfo: pauseControl, Controller is nullptr " << endl; 240 240 return; 241 241 } 242 242 tmp->setActive(false); 243 //this->controllableEntity_->getController()->setControllableEntity( NULL);243 //this->controllableEntity_->getController()->setControllableEntity(nullptr); 244 244 this->controllableEntity_->setController(0); 245 245 } … … 249 249 ControllableEntity* entity = this->controllableEntity_; 250 250 251 assert(this->controllableEntity_ != NULL);251 assert(this->controllableEntity_ != nullptr); 252 252 if( !entity || this->previousControllableEntity_.size() == 0 ) 253 253 return; … … 260 260 do { 261 261 this->controllableEntity_ = this->previousControllableEntity_.back(); 262 } while(this->controllableEntity_ == NULL&& this->previousControllableEntity_.size() > 0);262 } while(this->controllableEntity_ == nullptr && this->previousControllableEntity_.size() > 0); 263 263 this->controllableEntityID_ = this->controllableEntity_->getObjectID(); 264 264 this->previousControllableEntity_.pop_back(); 265 265 266 if ( this->controllableEntity_ != NULL && this->controller_ != NULL)266 if ( this->controllableEntity_ != nullptr && this->controller_ != nullptr) 267 267 this->controller_->setControllableEntity(this->controllableEntity_); 268 268 269 269 // HACK-ish 270 if(this->controllableEntity_ != NULL&& this->isHumanPlayer())270 if(this->controllableEntity_ != nullptr && this->isHumanPlayer()) 271 271 this->controllableEntity_->createHud(); 272 272 -
code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc
r10624 r10765 127 127 { 128 128 if(!this->isTarget(pickup)) 129 return NULL;129 return nullptr; 130 130 131 131 if(pickup->isTarget(this)) // If the PickupCarrier itself is a target. 132 132 return this; 133 133 134 PickupCarrier* target = NULL;134 PickupCarrier* target = nullptr; 135 135 // Go recursively through all children to check whether they are the target. 136 136 std::vector<PickupCarrier*>* children = this->getCarrierChildren(); -
code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.h
r9667 r10765 59 59 But this structure has to be established first. 60 60 - <b>getCarrierChildren()</b> To this end a PickupCarrier needs to implement getCarrierChildren() which returns a list of its direct PickupCarrier children. If you need an example, have a look at @ref orxonox::Pawn "Pawn" and @ref orxonox::Engine "Engine". 61 - <b>getCarrierParent()</b> This is the method in the other direction. It returns the parent of this PickupCarrier, or NULLif the PickupCarrier is a root node in this hierarchy.61 - <b>getCarrierParent()</b> This is the method in the other direction. It returns the parent of this PickupCarrier, or nullptr if the PickupCarrier is a root node in this hierarchy. 62 62 63 63 @author -
code/branches/cpp11_v2/src/orxonox/interfaces/Pickupable.cc
r10624 r10765 56 56 RegisterObject(Pickupable); 57 57 58 this->carrier_ = NULL;58 this->carrier_ = nullptr; 59 59 60 60 this->beingDestroyed_ = false; … … 143 143 bool Pickupable::isTarget(const PickupCarrier* carrier) const 144 144 { 145 if(carrier == NULL)145 if(carrier == nullptr) 146 146 return false; 147 147 … … 210 210 bool Pickupable::pickup(PickupCarrier* carrier) 211 211 { 212 if(carrier == NULL || this->isPickedUp()) // If carrier is NULLor the Pickupable is already picked up.212 if(carrier == nullptr || this->isPickedUp()) // If carrier is nullptr or the Pickupable is already picked up. 213 213 return false; 214 214 … … 237 237 return false; 238 238 239 assert(this->getCarrier()); // The Carrier cannot be NULLat this point.239 assert(this->getCarrier()); // The Carrier cannot be nullptr at this point. 240 240 if(!this->getCarrier()->removePickup(this)) //TODO Shouldn't this be a little later? 241 241 orxout(internal_warning, context::pickups) << "Pickupable (&" << this << ", " << this->getIdentifier()->getName() << ") is being dropped, but it was not present in the PickupCarriers list of pickups." << endl; … … 249 249 created = this->createSpawner(); 250 250 251 this->setCarrier( NULL);251 this->setCarrier(nullptr); 252 252 253 253 if(!created && createSpawner) // If a PickupSpawner should have been created but wasn't. … … 301 301 orxout(verbose, context::pickups) << "Pickupable (&" << this << ") changed Carrier (& " << carrier << ")." << endl; 302 302 303 if(carrier != NULL&& tell)303 if(carrier != nullptr && tell) 304 304 { 305 305 if(!carrier->addPickup(this)) -
code/branches/cpp11_v2/src/orxonox/items/Engine.cc
r9667 r10765 155 155 void Engine::run(float dt) 156 156 { 157 if (this->ship_ == NULL)157 if (this->ship_ == nullptr) 158 158 { 159 159 if (this->shipID_ != 0) … … 161 161 this->networkcallback_shipID(); 162 162 163 if (this->ship_ == NULL)163 if (this->ship_ == nullptr) 164 164 return; 165 165 } -
code/branches/cpp11_v2/src/orxonox/items/Engine.h
r9667 r10765 67 67 /** 68 68 @brief Get the SpaceShip this Engine is mounted on. 69 @return Returns a pointer to the SpaceShip. NULLif it isn't mounted on any ship.69 @return Returns a pointer to the SpaceShip. nullptr if it isn't mounted on any ship. 70 70 */ 71 71 inline SpaceShip* getShip() const -
code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc
r9939 r10765 205 205 void MultiStateEngine::addEffectContainer(EffectContainer* effect) 206 206 { 207 if (effect == NULL)207 if (effect == nullptr) 208 208 return; 209 209 effect->setLuaState(this->lua_, 'f' + multi_cast<std::string>(this->effectContainers_.size())); … … 224 224 return (*it); 225 225 } 226 return NULL;226 return nullptr; 227 227 } 228 228 -
code/branches/cpp11_v2/src/orxonox/items/ShipPart.cc
r10624 r10765 50 50 51 51 ShipPart::ShipPart(Context* context) 52 : Item(context), parent_( NULL)52 : Item(context), parent_(nullptr) 53 53 { 54 54 RegisterObject(ShipPart); … … 122 122 void ShipPart::addEntity(StaticEntity* entity) 123 123 { 124 OrxAssert(entity != NULL, "The Entity cannot be NULL.");124 OrxAssert(entity != nullptr, "The Entity cannot be nullptr."); 125 125 this->entityList_.push_back(entity); 126 126 } … … 130 130 Get the i-th StaticEntity of the ShipPart. 131 131 @return 132 Returns a pointer to the i-the StaticEntity. NULLif there is no StaticEntity with that index.132 Returns a pointer to the i-the StaticEntity. nullptr if there is no StaticEntity with that index. 133 133 */ 134 134 StaticEntity* ShipPart::getEntity(unsigned int index) 135 135 { 136 136 if(this->entityList_.size() >= index) 137 return NULL;137 return nullptr; 138 138 else 139 139 return this->entityList_[index]; … … 164 164 void ShipPart::addDestructionEvent(PartDestructionEvent* event) 165 165 { 166 OrxAssert(event != NULL, "The PartDestructionEvent cannot be NULL.");166 OrxAssert(event != nullptr, "The PartDestructionEvent cannot be nullptr."); 167 167 event->setParent(this); 168 168 this->eventList_.push_back(event); … … 173 173 Get the i-th PartDestructionEvent of the ShipPart. 174 174 @return 175 Returns a pointer to the i-the PartDestructionEvent. NULLif there is no PartDestructionEvent with that index.175 Returns a pointer to the i-the PartDestructionEvent. nullptr if there is no PartDestructionEvent with that index. 176 176 */ 177 177 PartDestructionEvent* ShipPart::getDestructionEvent(unsigned int index) 178 178 { 179 179 if(this->eventList_.size() <= index) 180 return NULL;180 return nullptr; 181 181 else 182 182 return this->eventList_[index]; -
code/branches/cpp11_v2/src/orxonox/sound/AmbientSound.cc
r10624 r10765 93 93 const std::string& path = "ambient/" + mood + '/' + this->ambientSource_; 94 94 shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path); 95 if (fileInfo != NULL)95 if (fileInfo != nullptr) 96 96 { 97 97 orxout(user_info) << "Loading ambient sound " << path << "..." << endl; // TODO: make this output internal if we implement sound streaming -
code/branches/cpp11_v2/src/orxonox/sound/BaseSound.cc
r10624 r10765 66 66 this->stop(); 67 67 // Release buffer 68 if (this->soundBuffer_ != NULL)68 if (this->soundBuffer_ != nullptr) 69 69 { 70 70 assert(GameMode::playsSound()); … … 84 84 { 85 85 this->state_ = Playing; 86 if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != NULL)86 if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != nullptr) 87 87 { 88 88 if (!alIsSource(this->audioSource_)) … … 151 151 orxout(internal_warning, context::sound) << "Setting source parameters to 0 failed: " 152 152 << SoundManager::getALErrorString(error) << endl; 153 assert(this->soundBuffer_ != NULL);153 assert(this->soundBuffer_ != nullptr); 154 154 alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer()); 155 155 if (ALuint error = alGetError()) … … 209 209 } 210 210 211 if (this->soundBuffer_ != NULL)211 if (this->soundBuffer_ != nullptr) 212 212 { 213 213 if (this->soundBuffer_->getFilename() == source) … … 233 233 // Get new sound buffer 234 234 this->soundBuffer_ = SoundManager::getInstance().getSoundBuffer(this->source_); 235 if (this->soundBuffer_ == NULL)235 if (this->soundBuffer_ == nullptr) 236 236 return; 237 237 -
code/branches/cpp11_v2/src/orxonox/sound/SoundBuffer.cc
r8858 r10765 45 45 { 46 46 if (this->filename_.empty()) 47 ThrowException(General, "SoundBuffer construction: fileInfo was NULL");47 ThrowException(General, "SoundBuffer construction: fileInfo was nullptr"); 48 48 49 49 // Get resource info 50 50 shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename); 51 if (fileInfo == NULL)51 if (fileInfo == nullptr) 52 52 { 53 53 orxout(internal_error, context::sound) << "Sound file '" << filename << "' not found" << endl; … … 138 138 vorbisCallbacks.seek_func = &seekVorbis; 139 139 vorbisCallbacks.tell_func = &tellVorbis; 140 vorbisCallbacks.close_func = NULL;140 vorbisCallbacks.close_func = nullptr; 141 141 142 142 OggVorbis_File vf; 143 int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);143 int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks); 144 144 if (ret < 0) 145 145 { -
code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc
r10624 r10765 83 83 ThrowException(InitialisationAborted, "Sound: Not loading at all"); 84 84 #if !defined(ORXONOX_PLATFORM_APPLE) 85 if (!alutInitWithoutContext( NULL, NULL))85 if (!alutInitWithoutContext(nullptr, nullptr)) 86 86 ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError())); 87 87 Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit); … … 90 90 /* 91 91 // Get list of available sound devices and display them 92 const char* devices = alcGetString( NULL, ALC_DEVICE_SPECIFIER);92 const char* devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER); 93 93 char* device = new char[strlen(devices)+1]; 94 94 strcpy(device, devices); … … 110 110 this->device_ = alcOpenDevice(renderDevice.c_str()); 111 111 */ 112 this->device_ = alcOpenDevice( NULL);113 if (this->device_ == NULL)112 this->device_ = alcOpenDevice(nullptr); 113 if (this->device_ == nullptr) 114 114 ThrowException(InitialisationFailed, "Sound Error: Could not open sound device."); 115 115 Loki::ScopeGuard closeDeviceGuard = Loki::MakeGuard(&alcCloseDevice, this->device_); 116 116 117 117 // Create sound context and make it the currently used one 118 this->context_ = alcCreateContext(this->device_, NULL);119 if (this->context_ == NULL)118 this->context_ = alcCreateContext(this->device_, nullptr); 119 if (this->context_ == nullptr) 120 120 ThrowException(InitialisationFailed, "Sound Error: Could not create ALC context"); 121 121 Loki::ScopeGuard desroyContextGuard = Loki::MakeGuard(&alcDestroyContext, this->context_); … … 189 189 190 190 // Relieve context to destroy it 191 if (!alcMakeContextCurrent( NULL))191 if (!alcMakeContextCurrent(nullptr)) 192 192 orxout(internal_error, context::sound) << "Could not unset ALC context" << endl; 193 193 alcDestroyContext(this->context_); … … 350 350 void SoundManager::registerAmbientSound(AmbientSound* newAmbient) 351 351 { 352 if (newAmbient != NULL&& !this->bDestructorCalled_)352 if (newAmbient != nullptr && !this->bDestructorCalled_) 353 353 { 354 354 for (AmbientList::const_iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it) … … 373 373 void SoundManager::unregisterAmbientSound(AmbientSound* oldAmbient) 374 374 { 375 if (oldAmbient == NULL|| ambientSounds_.empty() || this->bDestructorCalled_)375 if (oldAmbient == nullptr || ambientSounds_.empty() || this->bDestructorCalled_) 376 376 return; 377 377 … … 405 405 void SoundManager::pauseAmbientSound(AmbientSound* ambient) 406 406 { 407 if (ambient != NULL)407 if (ambient != nullptr) 408 408 { 409 409 for (AmbientList::iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it) -
code/branches/cpp11_v2/src/orxonox/sound/SoundStreamer.cc
r8858 r10765 45 45 vorbisCallbacks.seek_func = &seekVorbis; 46 46 vorbisCallbacks.tell_func = &tellVorbis; 47 vorbisCallbacks.close_func = NULL;47 vorbisCallbacks.close_func = nullptr; 48 48 49 49 OggVorbis_File vf; 50 int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);50 int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks); 51 51 if (ret < 0) 52 52 { -
code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc
r10624 r10765 62 62 this->client_overwrite_ = 0; 63 63 this->player_ = 0; 64 this->formerPlayer_ = NULL;64 this->formerPlayer_ = nullptr; 65 65 this->playerID_ = OBJECTID_UNKNOWN; 66 66 this->hud_ = 0; … … 194 194 bool ControllableEntity::setCameraPosition(unsigned int index) 195 195 { 196 if(this->camera_ != NULL&& this->cameraPositions_.size() > 0)196 if(this->camera_ != nullptr && this->cameraPositions_.size() > 0) 197 197 { 198 198 if(index >= this->cameraPositions_.size()) … … 350 350 this->bHasLocalController_ = player->isLocalPlayer(); 351 351 this->bHasHumanController_ = player->isHumanPlayer(); 352 if(controller_ != NULL)352 if(controller_ != nullptr) 353 353 this->team_ = controller_->getTeam(); // forward controller team number 354 354 … … 434 434 void ControllableEntity::destroyHud(void) 435 435 { 436 if (this->hud_ != NULL)436 if (this->hud_ != nullptr) 437 437 { 438 438 this->hud_->destroy(); 439 this->hud_ = NULL;439 this->hud_ = nullptr; 440 440 } 441 441 } -
code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc
r9667 r10765 44 44 EffectContainer::EffectContainer(Context* context) 45 45 : BaseObject(context) 46 , lua_( NULL)46 , lua_(nullptr) 47 47 { 48 48 RegisterObject(EffectContainer); … … 92 92 if (i == index) 93 93 return (*it); 94 return NULL;94 return nullptr; 95 95 } 96 96 -
code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc
r10624 r10765 563 563 void WorldEntity::detachOgreObject(Ogre::MovableObject* object) 564 564 { 565 object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>( NULL)));565 object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(nullptr))); 566 566 this->node_->detachObject(object); 567 567 } … … 660 660 { 661 661 // If physics is enabled scale the attached CollisionShape. 662 /*if (this->hasPhysics() && this->collisionShape_ != NULL)662 /*if (this->hasPhysics() && this->collisionShape_ != nullptr) 663 663 { 664 664 this->collisionShape_->setScale3D(scale); -
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10624 r10765 94 94 for (unsigned int i=0; i < this->getAttachedObjects().size(); i++) 95 95 { 96 if (this->getAttachedObject(i) == NULL)96 if (this->getAttachedObject(i) == nullptr) 97 97 { 98 98 break; … … 151 151 return it->second; 152 152 } 153 return NULL;153 return nullptr; 154 154 } 155 155 … … 160 160 void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 161 161 { 162 if (cs != NULL && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)162 if (cs != nullptr && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != nullptr) 163 163 this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator); 164 164 else … … 212 212 void ModularSpaceShip::addShipPart(ShipPart* part) 213 213 { 214 OrxAssert(part != NULL, "The ShipPart cannot be NULL.");214 OrxAssert(part != nullptr, "The ShipPart cannot be nullptr."); 215 215 this->partList_.push_back(part); 216 216 part->setParent(this); … … 222 222 Get the i-th ShipPart of the SpaceShip. 223 223 @return 224 Returns a pointer to the i-the ShipPart. NULLif there is no ShipPart with that index.224 Returns a pointer to the i-the ShipPart. nullptr if there is no ShipPart with that index. 225 225 */ 226 226 ShipPart* ModularSpaceShip::getShipPart(unsigned int index) 227 227 { 228 228 if(this->partList_.size() <= index) 229 return NULL;229 return nullptr; 230 230 else 231 231 return this->partList_[index]; … … 238 238 The name of the ShipPart to be returned. 239 239 @return 240 Pointer to the ShipPart with the given name, or NULLif not found.240 Pointer to the ShipPart with the given name, or nullptr if not found. 241 241 */ 242 242 ShipPart* ModularSpaceShip::getShipPartByName(std::string name) … … 250 250 } 251 251 orxout(internal_warning) << "Couldn't find ShipPart with name \"" << name << "\"." << endl; 252 return NULL;252 return nullptr; 253 253 } 254 254 -
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.h
r10262 r10765 109 109 ShipPart* getPartOfEntity(StaticEntity* entity) const; 110 110 111 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);111 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = nullptr, const btCollisionShape* cs = nullptr); 112 112 113 113 static void killShipPartStatic(std::string name); -
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/Pawn.h
r10437 r10765 208 208 209 209 //virtual void damage(float damage, Pawn* originator = 0); 210 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);210 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = nullptr, const btCollisionShape* cs = nullptr); 211 211 212 212 bool bAlive_; … … 215 215 { return new std::vector<PickupCarrier*>(); } 216 216 virtual PickupCarrier* getCarrierParent(void) const 217 { return NULL; }217 { return nullptr; } 218 218 219 219 -
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/SpaceShip.cc
r10216 r10765 48 48 RegisterClass(SpaceShip); 49 49 50 SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_( NULL)50 SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_(nullptr) 51 51 { 52 52 RegisterObject(SpaceShip); … … 196 196 if(this->bEnableMotionBlur_) 197 197 { 198 if (this->boostBlur_ == NULL&& this->hasLocalController() && this->hasHumanController())198 if (this->boostBlur_ == nullptr && this->hasLocalController() && this->hasHumanController()) 199 199 { 200 200 this->boostBlur_ = new Shader(this->getScene()->getSceneManager()); … … 305 305 void SpaceShip::addEngine(orxonox::Engine* engine) 306 306 { 307 OrxAssert(engine != NULL, "The engine cannot be NULL.");307 OrxAssert(engine != nullptr, "The engine cannot be nullptr."); 308 308 this->engineList_.push_back(engine); 309 309 engine->addToSpaceShip(this); … … 330 330 Get the i-th Engine of the SpaceShip. 331 331 @return 332 Returns a pointer to the i-the Engine. NULLif there is no Engine with that index.332 Returns a pointer to the i-the Engine. nullptr if there is no Engine with that index. 333 333 */ 334 334 Engine* SpaceShip::getEngine(unsigned int i) 335 335 { 336 336 if(this->engineList_.size() >= i) 337 return NULL;337 return nullptr; 338 338 else 339 339 return this->engineList_[i]; … … 346 346 The name of the engine to be returned. 347 347 @return 348 Pointer to the engine with the given name, or NULLif not found.348 Pointer to the engine with the given name, or nullptr if not found. 349 349 */ 350 350 Engine* SpaceShip::getEngineByName(const std::string& name) … … 355 355 356 356 orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl; 357 return NULL;357 return nullptr; 358 358 } 359 359 … … 465 465 void SpaceShip::changedEnableMotionBlur() 466 466 { 467 if (!this->bEnableMotionBlur_ && this->boostBlur_ != NULL)467 if (!this->bEnableMotionBlur_ && this->boostBlur_ != nullptr) 468 468 { 469 469 delete this->boostBlur_; 470 this->boostBlur_ = NULL;470 this->boostBlur_ = nullptr; 471 471 } 472 472 } … … 510 510 { 511 511 Camera* camera = CameraManager::getInstance().getActiveCamera(); 512 if(camera != NULL)512 if(camera != nullptr) 513 513 { 514 514 this->cameraOriginalPosition_ = camera->getPosition(); -
code/branches/cpp11_v2/test/core/class/IdentifiableTest.cc
r10624 r10765 37 37 { 38 38 IdentifiableClass* test = new IdentifiableClass(); 39 ASSERT_TRUE(test != NULL);39 ASSERT_TRUE(test != nullptr); 40 40 delete test; 41 41 } -
code/branches/cpp11_v2/test/core/class/IdentifierClassHierarchyTest.cc
r10624 r10765 144 144 new IdentifierManager(); 145 145 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 146 Context::setRootContext(new Context( NULL));146 Context::setRootContext(new Context(nullptr)); 147 147 Identifier::initConfigValues_s = false; // TODO: hack! 148 148 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/class/IdentifierExternalClassHierarchyTest.cc
r10624 r10765 51 51 new IdentifierManager(); 52 52 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 53 Context::setRootContext(new Context( NULL));53 Context::setRootContext(new Context(nullptr)); 54 54 Identifier::initConfigValues_s = false; // TODO: hack! 55 55 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/class/IdentifierNestedClassHierarchyTest.cc
r10624 r10765 111 111 new IdentifierManager(); 112 112 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 113 Context::setRootContext(new Context( NULL));113 Context::setRootContext(new Context(nullptr)); 114 114 Identifier::initConfigValues_s = false; // TODO: hack! 115 115 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/class/IdentifierSimpleClassHierarchyTest.cc
r10624 r10765 53 53 new IdentifierManager(); 54 54 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 55 Context::setRootContext(new Context( NULL));55 Context::setRootContext(new Context(nullptr)); 56 56 Identifier::initConfigValues_s = false; // TODO: hack! 57 57 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/class/IdentifierTest.cc
r10624 r10765 46 46 47 47 Identifier* identifier = Class(TestClass); 48 EXPECT_TRUE(identifier != NULL);48 EXPECT_TRUE(identifier != nullptr); 49 49 } 50 50 … … 54 54 55 55 Identifier* identifier = Class(TestSubclass); 56 EXPECT_TRUE(identifier != NULL);56 EXPECT_TRUE(identifier != nullptr); 57 57 } 58 58 -
code/branches/cpp11_v2/test/core/class/OrxonoxClassTest.cc
r10624 r10765 19 19 { 20 20 new IdentifierManager(); 21 Context::setRootContext(new Context( NULL));21 Context::setRootContext(new Context(nullptr)); 22 22 } 23 23 … … 33 33 { 34 34 TestClass* test = new TestClass(); 35 ASSERT_TRUE(test != NULL);35 ASSERT_TRUE(test != nullptr); 36 36 delete test; 37 37 } -
code/branches/cpp11_v2/test/core/class/OrxonoxInterfaceTest.cc
r10624 r10765 34 34 { 35 35 new IdentifierManager(); 36 Context::setRootContext(new Context( NULL));36 Context::setRootContext(new Context(nullptr)); 37 37 } 38 38 … … 48 48 { 49 49 TestClass1* test = new TestClass1(); 50 ASSERT_TRUE(test != NULL);50 ASSERT_TRUE(test != nullptr); 51 51 delete test; 52 52 } … … 55 55 { 56 56 TestClass2* test = new TestClass2(); 57 ASSERT_TRUE(test != NULL);57 ASSERT_TRUE(test != nullptr); 58 58 delete test; 59 59 } -
code/branches/cpp11_v2/test/core/class/SubclassIdentifierTest.cc
r10624 r10765 13 13 { 14 14 public: 15 TestClass(Context* context = NULL) { RegisterObject(TestClass); }15 TestClass(Context* context = nullptr) { RegisterObject(TestClass); } 16 16 }; 17 17 … … 19 19 { 20 20 public: 21 TestSubclass(Context* context = NULL) { RegisterObject(TestSubclass); }21 TestSubclass(Context* context = nullptr) { RegisterObject(TestSubclass); } 22 22 }; 23 23 … … 33 33 new IdentifierManager(); 34 34 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 35 Context::setRootContext(new Context( NULL));35 Context::setRootContext(new Context(nullptr)); 36 36 Identifier::initConfigValues_s = false; // TODO: hack! 37 37 IdentifierManager::getInstance().createClassHierarchy(); … … 77 77 subclassIdentifier = Class(TestSubclass); 78 78 79 TestClass* instance = subclassIdentifier.fabricate( NULL);80 ASSERT_TRUE(instance != NULL);79 TestClass* instance = subclassIdentifier.fabricate(nullptr); 80 ASSERT_TRUE(instance != nullptr); 81 81 EXPECT_EQ(Class(TestSubclass), instance->getIdentifier()); 82 82 delete instance; -
code/branches/cpp11_v2/test/core/class/SuperTest.cc
r10624 r10765 14 14 { 15 15 public: 16 TestClass(Context* context = NULL) : BaseObject(context), changedNameBase_(false), xmlPortBase_(false), modeBase_(XMLPort::NOP)16 TestClass(Context* context = nullptr) : BaseObject(context), changedNameBase_(false), xmlPortBase_(false), modeBase_(XMLPort::NOP) 17 17 { 18 18 RegisterObject(TestClass); … … 38 38 { 39 39 public: 40 TestSubclass(Context* context = NULL) : TestClass(context), changedNameSubclass_(false), xmlPortSubclass_(false), modeSubclass_(XMLPort::NOP)40 TestSubclass(Context* context = nullptr) : TestClass(context), changedNameSubclass_(false), xmlPortSubclass_(false), modeSubclass_(XMLPort::NOP) 41 41 { 42 42 RegisterObject(TestSubclass); … … 74 74 new IdentifierManager(); 75 75 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 76 Context::setRootContext(new Context( NULL));76 Context::setRootContext(new Context(nullptr)); 77 77 Identifier::initConfigValues_s = false; // TODO: hack! 78 78 IdentifierManager::getInstance().createClassHierarchy(); … … 132 132 EXPECT_EQ(XMLPort::NOP, test.modeSubclass_); 133 133 134 Element* element = NULL;134 Element* element = nullptr; 135 135 test.XMLPort(*element, XMLPort::SaveObject); 136 136 -
code/branches/cpp11_v2/test/core/command/CommandTest.cc
r10624 r10765 143 143 new ConsoleCommandManager(); 144 144 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::CONSOLE_COMMAND); 145 Context::setRootContext(new Context( NULL));145 Context::setRootContext(new Context(nullptr)); 146 146 Identifier::initConfigValues_s = false; // TODO: hack! 147 147 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/object/ClassFactoryTest.cc
r10624 r10765 18 18 new IdentifierManager(); 19 19 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 20 Context::setRootContext(new Context( NULL));20 Context::setRootContext(new Context(nullptr)); 21 21 } 22 22 … … 33 33 { 34 34 Factory* factory = new ClassFactoryWithContext<BaseObject>(); 35 Identifiable* object = factory->fabricate( NULL);36 ASSERT_TRUE(object != NULL);35 Identifiable* object = factory->fabricate(nullptr); 36 ASSERT_TRUE(object != nullptr); 37 37 BaseObject* baseObject = dynamic_cast<BaseObject*>(object); 38 EXPECT_TRUE(baseObject != NULL);38 EXPECT_TRUE(baseObject != nullptr); 39 39 delete object; 40 40 // don't delete factory - it remains in the identifier -
code/branches/cpp11_v2/test/core/object/ContextTest.cc
r10624 r10765 12 12 { 13 13 public: 14 SubclassContext() : Context( NULL) { RegisterObject(SubclassContext); }14 SubclassContext() : Context(nullptr) { RegisterObject(SubclassContext); } 15 15 }; 16 16 … … 25 25 new IdentifierManager(); 26 26 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 27 Context::setRootContext(new Context( NULL));27 Context::setRootContext(new Context(nullptr)); 28 28 } 29 29 … … 39 39 TEST_F(ContextTest, CanCreateContext) 40 40 { 41 Context context( NULL);41 Context context(nullptr); 42 42 } 43 43 … … 49 49 TEST_F(ContextTest, ContextIsItsOwnContext) 50 50 { 51 Context context( NULL);51 Context context(nullptr); 52 52 EXPECT_EQ(&context, context.getContext()); 53 53 } … … 68 68 TEST_F(ContextTest, ContextIsAddedToItsOwnObjectList) 69 69 { 70 Context context( NULL);70 Context context(nullptr); 71 71 ASSERT_EQ(1u, context.getObjectList<Context>()->size()); 72 72 EXPECT_TRUE(context.getObjectList<Context>()->begin()->objectBase_ == static_cast<Listable*>(&context)); … … 75 75 TEST_F(ContextTest, ContextIsAddedToObjectListOfBaseContext) 76 76 { 77 Context baseContext( NULL);77 Context baseContext(nullptr); 78 78 Context subContext(&baseContext); 79 79 -
code/branches/cpp11_v2/test/core/object/DestroyableTest.cc
r9603 r10765 32 32 DestroyableTest* test = new DestroyableTest(destroyed); 33 33 EXPECT_FALSE(destroyed); 34 EXPECT_TRUE(test != NULL);34 EXPECT_TRUE(test != nullptr); 35 35 test->destroy(); 36 36 EXPECT_TRUE(destroyed); -
code/branches/cpp11_v2/test/core/object/IteratorTest.cc
r10736 r10765 36 36 new IdentifierManager(); 37 37 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 38 Context::setRootContext(new Context( NULL));38 Context::setRootContext(new Context(nullptr)); 39 39 } 40 40 … … 120 120 ++i; 121 121 if (i == 1u) EXPECT_EQ(&testClass, *it); 122 if (i == 2u) EXPECT_EQ( NULL, *it);122 if (i == 2u) EXPECT_EQ(nullptr, *it); 123 123 } 124 124 EXPECT_EQ(2u, i); -
code/branches/cpp11_v2/test/core/object/ListableTest.cc
r10624 r10765 41 41 new IdentifierManager(); 42 42 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 43 Context::setRootContext(new Context( NULL));43 Context::setRootContext(new Context(nullptr)); 44 44 } 45 45 … … 56 56 { 57 57 ListableClassTest* test = new ListableClassTest(); 58 ASSERT_TRUE(test != NULL);58 ASSERT_TRUE(test != nullptr); 59 59 delete test; 60 60 } … … 104 104 TEST_F(ListableTest, CanAddObjectToContext) 105 105 { 106 Context context( NULL);106 Context context(nullptr); 107 107 ListableSubclassTest test; 108 108 … … 118 118 TEST_F(ListableTest, CanAddObjectToSubContext) 119 119 { 120 Context baseContext( NULL);120 Context baseContext(nullptr); 121 121 Context subContext(&baseContext); 122 122 ListableSubclassTest test; … … 139 139 { 140 140 Context* rootContext = Context::getRootContext(); 141 Context newContext( NULL);141 Context newContext(nullptr); 142 142 ListableSubclassTest test; 143 143 -
code/branches/cpp11_v2/test/core/object/ObjectListBaseTest.cc
r9661 r10765 24 24 { 25 25 ObjectListBase list; 26 ObjectListBaseElement* element = new ObjectListElement<Listable>( NULL);26 ObjectListBaseElement* element = new ObjectListElement<Listable>(nullptr); 27 27 list.addElement(element); 28 28 EXPECT_EQ(1u, list.size()); … … 32 32 { 33 33 ObjectListBase list; 34 ObjectListBaseElement* element = new ObjectListElement<Listable>( NULL);34 ObjectListBaseElement* element = new ObjectListElement<Listable>(nullptr); 35 35 list.addElement(element); 36 36 EXPECT_EQ(1u, list.size()); … … 43 43 { 44 44 ObjectListBase list; 45 list.addElement(new ObjectListElement<Listable>( NULL));45 list.addElement(new ObjectListElement<Listable>(nullptr)); 46 46 EXPECT_EQ(1u, list.size()); 47 47 } … … 52 52 EXPECT_EQ(0u, list.size()); 53 53 { 54 ObjectListElement<Listable> element1( NULL);54 ObjectListElement<Listable> element1(nullptr); 55 55 list.addElement(&element1); 56 56 EXPECT_EQ(1u, list.size()); 57 57 { 58 ObjectListElement<Listable> element1( NULL);58 ObjectListElement<Listable> element1(nullptr); 59 59 list.addElement(&element1); 60 60 EXPECT_EQ(2u, list.size()); 61 61 { 62 ObjectListElement<Listable> element1( NULL);62 ObjectListElement<Listable> element1(nullptr); 63 63 list.addElement(&element1); 64 64 EXPECT_EQ(3u, list.size()); … … 76 76 ObjectListElementRemovalListenerMock listener; 77 77 list.registerRemovalListener(&listener); 78 ObjectListBaseElement* element = new ObjectListElement<Listable>( NULL);78 ObjectListBaseElement* element = new ObjectListElement<Listable>(nullptr); 79 79 list.addElement(element); 80 80 EXPECT_CALL(listener, removedElement(element)); -
code/branches/cpp11_v2/test/core/object/ObjectListIteratorTest.cc
r10736 r10765 36 36 new IdentifierManager(); 37 37 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 38 Context::setRootContext(new Context( NULL));38 Context::setRootContext(new Context(nullptr)); 39 39 } 40 40 -
code/branches/cpp11_v2/test/core/object/ObjectListTest.cc
r10736 r10765 28 28 new IdentifierManager(); 29 29 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 30 Context::setRootContext(new Context( NULL));30 Context::setRootContext(new Context(nullptr)); 31 31 } 32 32 -
code/branches/cpp11_v2/test/core/object/StrongPtrTest.cc
r10744 r10765 111 111 void isNull(const StrongPtr<DestroyableTest> strongPtr) 112 112 { 113 EXPECT_TRUE(strongPtr == NULL);113 EXPECT_TRUE(strongPtr == nullptr); 114 114 EXPECT_TRUE(strongPtr == 0); 115 115 EXPECT_TRUE(!strongPtr); 116 EXPECT_FALSE(strongPtr != NULL);116 EXPECT_FALSE(strongPtr != nullptr); 117 117 EXPECT_FALSE(strongPtr != 0); 118 118 EXPECT_FALSE(strongPtr); … … 126 126 } 127 127 { 128 StrongPtr<DestroyableTest> strongPtr = NULL;128 StrongPtr<DestroyableTest> strongPtr = nullptr; 129 129 isNull(strongPtr); 130 130 } 131 131 { 132 132 StrongPtr<DestroyableTest> strongPtr; 133 strongPtr = NULL;133 strongPtr = nullptr; 134 134 isNull(strongPtr); 135 135 } … … 150 150 DestroyableTest* test = new DestroyableTest(destroyed); 151 151 StrongPtr<DestroyableTest> strongPtr = test; 152 EXPECT_FALSE(strongPtr == NULL);152 EXPECT_FALSE(strongPtr == nullptr); 153 153 EXPECT_FALSE(strongPtr == 0); 154 154 EXPECT_FALSE(!strongPtr); 155 EXPECT_TRUE(strongPtr != NULL);155 EXPECT_TRUE(strongPtr != nullptr); 156 156 EXPECT_TRUE(strongPtr != 0); 157 157 EXPECT_TRUE(strongPtr); … … 166 166 // default 167 167 StrongPtr<DestroyableTest> strongPtr1; 168 EXPECT_EQ( NULL, strongPtr1.get());168 EXPECT_EQ(nullptr, strongPtr1.get()); 169 169 170 170 // pointer … … 277 277 EXPECT_EQ(1u, test->getReferenceCount()); 278 278 strongPtr.reset(); 279 EXPECT_EQ( NULL, strongPtr.get());279 EXPECT_EQ(nullptr, strongPtr.get()); 280 280 EXPECT_EQ(0u, test->getReferenceCount()); 281 281 -
code/branches/cpp11_v2/test/core/object/WeakPtrTest.cc
r10744 r10765 36 36 EXPECT_EQ(test, weakPtr.get()); 37 37 test->destroy(); 38 EXPECT_EQ( NULL, weakPtr.get());38 EXPECT_EQ(nullptr, weakPtr.get()); 39 39 } 40 40 … … 49 49 EXPECT_EQ(test, weakPtr3.get()); 50 50 test->destroy(); 51 EXPECT_EQ( NULL, weakPtr1.get());52 EXPECT_EQ( NULL, weakPtr2.get());53 EXPECT_EQ( NULL, weakPtr3.get());51 EXPECT_EQ(nullptr, weakPtr1.get()); 52 EXPECT_EQ(nullptr, weakPtr2.get()); 53 EXPECT_EQ(nullptr, weakPtr3.get()); 54 54 } 55 55 … … 66 66 void isNull(const WeakPtr<DestroyableTest> weakPtr) 67 67 { 68 EXPECT_TRUE(weakPtr == NULL);68 EXPECT_TRUE(weakPtr == nullptr); 69 69 EXPECT_TRUE(weakPtr == 0); 70 70 EXPECT_TRUE(!weakPtr); 71 EXPECT_FALSE(weakPtr != NULL);71 EXPECT_FALSE(weakPtr != nullptr); 72 72 EXPECT_FALSE(weakPtr != 0); 73 73 EXPECT_FALSE(weakPtr); … … 81 81 } 82 82 { 83 WeakPtr<DestroyableTest> weakPtr = NULL;83 WeakPtr<DestroyableTest> weakPtr = nullptr; 84 84 isNull(weakPtr); 85 85 } 86 86 { 87 87 WeakPtr<DestroyableTest> weakPtr; 88 weakPtr = NULL;88 weakPtr = nullptr; 89 89 isNull(weakPtr); 90 90 } … … 104 104 DestroyableTest* test = new DestroyableTest(); 105 105 WeakPtr<DestroyableTest> weakPtr = test; 106 EXPECT_FALSE(weakPtr == NULL);106 EXPECT_FALSE(weakPtr == nullptr); 107 107 EXPECT_FALSE(weakPtr == 0); 108 108 EXPECT_FALSE(!weakPtr); 109 EXPECT_TRUE(weakPtr != NULL);109 EXPECT_TRUE(weakPtr != nullptr); 110 110 EXPECT_TRUE(weakPtr != 0); 111 111 EXPECT_TRUE(weakPtr); … … 119 119 // default 120 120 WeakPtr<DestroyableTest> weakPtr1; 121 EXPECT_EQ( NULL, weakPtr1.get());121 EXPECT_EQ(nullptr, weakPtr1.get()); 122 122 123 123 // pointer … … 191 191 test->destroy(); 192 192 193 EXPECT_EQ( NULL, vector[0].get());194 EXPECT_EQ( NULL, vector[1].get());195 EXPECT_EQ( NULL, vector[2].get());193 EXPECT_EQ(nullptr, vector[0].get()); 194 EXPECT_EQ(nullptr, vector[1].get()); 195 EXPECT_EQ(nullptr, vector[2].get()); 196 196 } 197 197 … … 202 202 EXPECT_EQ(test, weakPtr.get()); 203 203 weakPtr.reset(); 204 EXPECT_EQ( NULL, weakPtr.get());204 EXPECT_EQ(nullptr, weakPtr.get()); 205 205 206 206 test->destroy(); -
code/branches/cpp11_v2/test/core/singleton/ScopeTest.cc
r10544 r10765 32 32 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 33 33 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::SCOPED_SINGLETON_WRAPPER); 34 Context::setRootContext(new Context( NULL));34 Context::setRootContext(new Context(nullptr)); 35 35 } 36 36 -
code/branches/cpp11_v2/test/util/SharedPtrTest.cc
r10744 r10765 192 192 // default 193 193 SharedPtr<TestChildClass> sharedPtr1; 194 EXPECT_EQ( NULL, sharedPtr1.get());194 EXPECT_EQ(nullptr, sharedPtr1.get()); 195 195 196 196 // pointer … … 221 221 // default 222 222 SharedPtr<TestChildClass> sharedPtr1; 223 EXPECT_EQ( NULL, sharedPtr1.get());223 EXPECT_EQ(nullptr, sharedPtr1.get()); 224 224 225 225 // pointer -
code/branches/cpp11_v2/test/util/SingletonTest.cc
r9114 r10765 23 23 }; 24 24 25 TestSingleton* TestSingleton::singletonPtr_s = NULL;25 TestSingleton* TestSingleton::singletonPtr_s = nullptr; 26 26 const size_t TestSingleton::MAGIC_VALUE = 0xCAFEBABE; 27 27 } -
code/branches/cpp11_v2/test/util/output/ConsoleWriterTest.cc
r10712 r10765 27 27 TEST_F(ConsoleWriterTest, Disable) 28 28 { 29 std::ostream stream( NULL);29 std::ostream stream(nullptr); 30 30 EXPECT_EQ(0U, OutputManager::getInstance().getListeners().size()); 31 31 ConsoleWriter writer(stream); … … 37 37 TEST_F(ConsoleWriterTest, Enable) 38 38 { 39 std::ostream stream( NULL);39 std::ostream stream(nullptr); 40 40 ConsoleWriter writer(stream); 41 41 writer.disable(); -
code/branches/cpp11_v2/test/util/output/OutputManagerTest.cc
r10624 r10765 54 54 TEST(OutputManagerTest, GetInstanceDoesNotCreateDefaultListeners) 55 55 { 56 EXPECT_TRUE( NULL== OutputManager::getInstance().getMemoryWriter());57 EXPECT_TRUE( NULL== OutputManager::getInstance().getConsoleWriter());58 EXPECT_TRUE( NULL== OutputManager::getInstance().getLogWriter());56 EXPECT_TRUE(nullptr == OutputManager::getInstance().getMemoryWriter()); 57 EXPECT_TRUE(nullptr == OutputManager::getInstance().getConsoleWriter()); 58 EXPECT_TRUE(nullptr == OutputManager::getInstance().getLogWriter()); 59 59 } 60 60 … … 62 62 TEST(OutputManagerTest, GetInstanceAndCreateListenersCreatesDefaultListeners) 63 63 { 64 EXPECT_TRUE( NULL!= OutputManager::getInstanceAndCreateListeners().getMemoryWriter());65 EXPECT_TRUE( NULL!= OutputManager::getInstanceAndCreateListeners().getConsoleWriter());66 EXPECT_TRUE( NULL!= OutputManager::getInstanceAndCreateListeners().getLogWriter());64 EXPECT_TRUE(nullptr != OutputManager::getInstanceAndCreateListeners().getMemoryWriter()); 65 EXPECT_TRUE(nullptr != OutputManager::getInstanceAndCreateListeners().getConsoleWriter()); 66 EXPECT_TRUE(nullptr != OutputManager::getInstanceAndCreateListeners().getLogWriter()); 67 67 } 68 68
Note: See TracChangeset
for help on using the changeset viewer.