mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-31 01:15:48 -04:00
newer standards prefer nullptr over NULL - this is most of them but there are others too
This commit is contained in:
@@ -23,7 +23,7 @@ namespace ObjectWatcherListNamespace
|
||||
{
|
||||
void setRegionOfInfluenceEnabled(Object const * const object, bool const enabled, bool skipCell)
|
||||
{
|
||||
if (skipCell && NULL != object->getCellProperty())
|
||||
if (skipCell && nullptr != object->getCellProperty())
|
||||
return;
|
||||
|
||||
object->setRegionOfInfluenceEnabled(enabled);
|
||||
@@ -67,7 +67,7 @@ ObjectWatcherList::~ObjectWatcherList(void)
|
||||
/**
|
||||
* Add an Object to the ObjectWatcherList.
|
||||
*
|
||||
* This routine will call Fatal in debug compiles if it is passed a NULL
|
||||
* This routine will call Fatal in debug compiles if it is passed a nullptr
|
||||
* object.
|
||||
*
|
||||
* This routine will call Fatal in debug compiles if the object list
|
||||
@@ -85,7 +85,7 @@ void ObjectWatcherList::addObject(Object & objectToAdd)
|
||||
/**
|
||||
* Remove an Object from the ObjectWatcherList.
|
||||
*
|
||||
* This routine will call Fatal in debug compiles if it is passed a NULL
|
||||
* This routine will call Fatal in debug compiles if it is passed a nullptr
|
||||
* object.
|
||||
*
|
||||
* @param objectToRemove Pointer to the object to remove
|
||||
@@ -112,13 +112,13 @@ void ObjectWatcherList::removeObjectByIndex (const Object & object, int index)
|
||||
// Remove the last item in the vector.
|
||||
m_objectVector->pop_back();
|
||||
|
||||
// NULL the object from the alter-safe object list.
|
||||
// nullptr the object from the alter-safe object list.
|
||||
uint size = m_alterSafeObjectVector->size();
|
||||
for (uint i = 0; i < size; ++i)
|
||||
{
|
||||
if ((*m_alterSafeObjectVector)[i] == &object)
|
||||
{
|
||||
(*m_alterSafeObjectVector)[i] = NULL;
|
||||
(*m_alterSafeObjectVector)[i] = nullptr;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,7 @@ void ObjectWatcherList::alter(real time)
|
||||
|
||||
// Make sure the object is still in the object list before removing it
|
||||
|
||||
if ((*m_alterSafeObjectVector)[i] != NULL)
|
||||
if ((*m_alterSafeObjectVector)[i] != nullptr)
|
||||
{
|
||||
removeObject(*obj);
|
||||
}
|
||||
|
||||
@@ -80,8 +80,8 @@ void Appearance::setRenderHardpointFunction(RenderHardpointFunction renderHardpo
|
||||
|
||||
Appearance::Appearance(const AppearanceTemplate *newAppearanceTemplate) :
|
||||
m_appearanceTemplate(AppearanceTemplateList::fetch(newAppearanceTemplate)),
|
||||
m_extent(m_appearanceTemplate ? ExtentList::fetch(m_appearanceTemplate->getExtent()) : NULL),
|
||||
m_owner(NULL),
|
||||
m_extent(m_appearanceTemplate ? ExtentList::fetch(m_appearanceTemplate->getExtent()) : nullptr),
|
||||
m_owner(nullptr),
|
||||
m_renderedFrameNumber(0),
|
||||
m_scale(Vector::xyz111),
|
||||
m_keepAlive(false),
|
||||
@@ -100,15 +100,15 @@ Appearance::Appearance(const AppearanceTemplate *newAppearanceTemplate) :
|
||||
Appearance::~Appearance()
|
||||
{
|
||||
ExtentList::release(m_extent);
|
||||
m_extent = NULL;
|
||||
m_extent = nullptr;
|
||||
|
||||
if (m_appearanceTemplate)
|
||||
{
|
||||
AppearanceTemplateList::release(m_appearanceTemplate);
|
||||
m_appearanceTemplate = NULL;
|
||||
m_appearanceTemplate = nullptr;
|
||||
}
|
||||
|
||||
m_owner = NULL;
|
||||
m_owner = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -269,7 +269,7 @@ void Appearance::render() const
|
||||
void Appearance::objectListCameraRenderDescend(Object const & obj)
|
||||
{
|
||||
//-- don't descend through cells
|
||||
if (NULL != obj.getCellProperty())
|
||||
if (nullptr != obj.getCellProperty())
|
||||
return;
|
||||
|
||||
int const childCount = obj.getNumberOfChildObjects();
|
||||
@@ -378,7 +378,7 @@ bool Appearance::implementsCollide() const
|
||||
* CustomizationDataProperty. If there is such a property, this
|
||||
* function will invoke Appearance::setCustomizationData() with the
|
||||
* appropriate value. If the property doesn't exist, this function
|
||||
* will invoke Appearance::setCustomizationData() with NULL. Note if
|
||||
* will invoke Appearance::setCustomizationData() with nullptr. Note if
|
||||
* the caller sets the CustomizationDataProperty for an Object after
|
||||
* associating the Object instance with the appearance, the caller is
|
||||
* responsible for calling Appearance::setCustomizationData().
|
||||
@@ -457,7 +457,7 @@ const char * Appearance::getFloorName () const
|
||||
if (m_appearanceTemplate)
|
||||
return m_appearanceTemplate->getFloorName();
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -607,7 +607,7 @@ const char * Appearance::getAppearanceTemplateName () const
|
||||
|
||||
DPVS::Object *Appearance::getDpvsObject() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -748,14 +748,14 @@ SkeletalAppearance2 const * Appearance::asSkeletalAppearance2() const
|
||||
|
||||
ComponentAppearance * Appearance::asComponentAppearance()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
ComponentAppearance const * Appearance::asComponentAppearance() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -783,14 +783,14 @@ void Appearance::onEvent(LabelHash::Id /* eventId */)
|
||||
|
||||
int Appearance::getHardpointCount() const
|
||||
{
|
||||
return m_appearanceTemplate != NULL ? m_appearanceTemplate->getHardpointCount() : 0;
|
||||
return m_appearanceTemplate != nullptr ? m_appearanceTemplate->getHardpointCount() : 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
int Appearance::getHardpointIndex(CrcString const &hardpointName, bool optional) const
|
||||
{
|
||||
return m_appearanceTemplate != NULL ? m_appearanceTemplate->getHardpointIndex(hardpointName, optional) : -1;
|
||||
return m_appearanceTemplate != nullptr ? m_appearanceTemplate->getHardpointIndex(hardpointName, optional) : -1;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -855,42 +855,42 @@ bool Appearance::usesRenderEffectsFlag() const
|
||||
|
||||
ParticleEffectAppearance * Appearance::asParticleEffectAppearance()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
ParticleEffectAppearance const * Appearance::asParticleEffectAppearance() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
SwooshAppearance * Appearance::asSwooshAppearance()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
SwooshAppearance const * Appearance::asSwooshAppearance() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
LightningAppearance * Appearance::asLightningAppearance()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
LightningAppearance const * Appearance::asLightningAppearance() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -206,7 +206,7 @@ private:
|
||||
/**
|
||||
* Get the AppearanceTemplate for this Appearance.
|
||||
*
|
||||
* The AppearanceTemplate may be NULL.
|
||||
* The AppearanceTemplate may be nullptr.
|
||||
*
|
||||
* AppearanceTemplates may be shared by multiple Appearances.
|
||||
*
|
||||
|
||||
@@ -97,14 +97,14 @@ AppearanceTemplate::PreloadManager::~PreloadManager ()
|
||||
AppearanceTemplate::AppearanceTemplate(const char *newName)
|
||||
: m_referenceCount(0),
|
||||
m_crcName(new CrcLowerString(newName)),
|
||||
m_extent(NULL),
|
||||
m_collisionExtent(NULL),
|
||||
m_hardpoints(NULL),
|
||||
m_floorName(NULL),
|
||||
m_extent(nullptr),
|
||||
m_collisionExtent(nullptr),
|
||||
m_hardpoints(nullptr),
|
||||
m_floorName(nullptr),
|
||||
m_preloadManager (0)
|
||||
{
|
||||
//-- Save info on most recently constructed appearance template.
|
||||
IGNORE_RETURN(snprintf(ms_crashReportInfo, sizeof(ms_crashReportInfo) - 1, "AppearanceTemplate: %s\n", newName ? newName : "<NULL>"));
|
||||
IGNORE_RETURN(snprintf(ms_crashReportInfo, sizeof(ms_crashReportInfo) - 1, "AppearanceTemplate: %s\n", newName ? newName : "<nullptr>"));
|
||||
ms_crashReportInfo[sizeof(ms_crashReportInfo) - 1] = '\0';
|
||||
}
|
||||
|
||||
@@ -118,10 +118,10 @@ AppearanceTemplate::~AppearanceTemplate(void)
|
||||
delete m_crcName;
|
||||
|
||||
ExtentList::release(m_extent);
|
||||
m_extent = NULL;
|
||||
m_extent = nullptr;
|
||||
|
||||
ExtentList::release(m_collisionExtent);
|
||||
m_collisionExtent = NULL;
|
||||
m_collisionExtent = nullptr;
|
||||
|
||||
if (m_hardpoints)
|
||||
{
|
||||
@@ -482,7 +482,7 @@ const CrcLowerString &AppearanceTemplate::getCrcName() const
|
||||
/**
|
||||
*Get the name of this AppearanceTemplate.
|
||||
*
|
||||
*This routine may return NULL.
|
||||
*This routine may return nullptr.
|
||||
*/
|
||||
|
||||
const char *AppearanceTemplate::getName() const
|
||||
|
||||
@@ -219,7 +219,7 @@ const AppearanceTemplate *AppearanceTemplateList::fetch(const char *const fileNa
|
||||
char const * actualFileName = fileName;
|
||||
if (!fileName)
|
||||
{
|
||||
DEBUG_WARNING(true, ("AppearanceTemplateList::fetch passed NULL fileName, using default"));
|
||||
DEBUG_WARNING(true, ("AppearanceTemplateList::fetch passed nullptr fileName, using default"));
|
||||
actualFileName = getDefaultAppearanceTemplateName();
|
||||
}
|
||||
else if (!*fileName)
|
||||
@@ -246,14 +246,14 @@ const AppearanceTemplate *AppearanceTemplateList::fetch(const char *const fileNa
|
||||
|
||||
DEBUG_WARNING(true, ("AppearanceTemplateList::fetch actualFileName fetch for %s failed.", actualFileName));
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/**
|
||||
* Add a reference to the specified Appearance.
|
||||
*
|
||||
* This routine will do nothing if passed in NULL. Otherwise, it will
|
||||
* This routine will do nothing if passed in nullptr. Otherwise, it will
|
||||
* increase the reference count of the specified AppearanceTemplate
|
||||
* by one.
|
||||
*
|
||||
@@ -297,7 +297,7 @@ const AppearanceTemplate *AppearanceTemplateList::fetch(Iff *const iff)
|
||||
return 0; //lint !e527 // unreachable
|
||||
}
|
||||
|
||||
AppearanceTemplate *const appearanceTemplate = (*iter).second(NULL, iff);
|
||||
AppearanceTemplate *const appearanceTemplate = (*iter).second(nullptr, iff);
|
||||
NOT_NULL(appearanceTemplate);
|
||||
|
||||
addAnonymousAppearanceTemplate(appearanceTemplate);
|
||||
@@ -351,7 +351,7 @@ const AppearanceTemplate *AppearanceTemplateList::fetchNew(AppearanceTemplate *c
|
||||
/**
|
||||
* Remove a reference to the specified AppearanceTemplate.
|
||||
*
|
||||
* This routine will do nothing if passed in NULL.
|
||||
* This routine will do nothing if passed in nullptr.
|
||||
*
|
||||
* If the reference count drops to 0, the AppearanceTemplate will be deleted.
|
||||
*
|
||||
@@ -404,9 +404,9 @@ Appearance *AppearanceTemplateList::createAppearance(const char *const fileName)
|
||||
#endif
|
||||
|
||||
//probably should modify the macro sometime to just be quiet if this isn't defined
|
||||
if (appearanceTemplate == NULL){
|
||||
if (appearanceTemplate == nullptr){
|
||||
DEBUG_WARNING(true, ("FIX ME: Appearance template for %s could not be fetched - is it missing?", fileName));
|
||||
return NULL; // Cekis: TODO: Figure out why the template can't be fetched. DarthArgus: always is due to a missing file or one of the redirectors having a bad path
|
||||
return nullptr; // Cekis: TODO: Figure out why the template can't be fetched. DarthArgus: always is due to a missing file or one of the redirectors having a bad path
|
||||
}
|
||||
|
||||
//-- creating the appearance will increment the reference count
|
||||
@@ -581,7 +581,7 @@ AppearanceTemplate *AppearanceTemplateListNamespace::create(const char *const fi
|
||||
// DEBUG_REPORT_LOG_PRINT(true, ("Loading mesh %s\n", actualFileName.getString()));
|
||||
TagBindingMap::iterator iter = ms_tagBindingMap.find(TAG_MESH);
|
||||
if (iter != ms_tagBindingMap.end())
|
||||
appearanceTemplate = iter->second(actualFileName.getString(), NULL);
|
||||
appearanceTemplate = iter->second(actualFileName.getString(), nullptr);
|
||||
}
|
||||
|
||||
//-- we now need to create the appearance from disk
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ const ArrangementDescriptor *ArrangementDescriptorList::fetch(const CrcLowerStri
|
||||
}
|
||||
else
|
||||
{
|
||||
WARNING(true, ("default ArrangementDescriptor [%s] could not be loaded, returning NULL ArrangementDescriptor", filename.getString()));
|
||||
WARNING(true, ("default ArrangementDescriptor [%s] could not be loaded, returning nullptr ArrangementDescriptor", filename.getString()));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ ContainedByProperty::~ContainedByProperty()
|
||||
* property.
|
||||
*
|
||||
* @return Pointer to the object that contains the object with this
|
||||
* ContainedByProperty. Returns NULL if the object isn't
|
||||
* ContainedByProperty. Returns nullptr if the object isn't
|
||||
* contained by anything at the moment.
|
||||
*/
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
// ======================================================================
|
||||
//Lint suppressions.
|
||||
|
||||
//lint -esym(613, ContainerIterator::m_iterator) // (Warning -- Possible use of null pointer 'ContainerIterator::m_iterator' ) // This is an opaque data type to us. We can only check against a container::end().
|
||||
//lint -esym(613, ContainerIterator::m_iterator) // (Warning -- Possible use of nullptr pointer 'ContainerIterator::m_iterator' ) // This is an opaque data type to us. We can only check against a container::end().
|
||||
//lint -esym(1540, ContainerIterator::m_iterator) // (Warning -- Pointer member 'ContainerIterator::m_iterator' neither freed nor zero'ed by destructor -- Effective C++ #6) // It's okay, the iterator type is opaque to us, we have no idea it's a pointer.
|
||||
//lint -esym(1554, ContainerIterator::m_iterator) // (Warning -- Direct copy of pointer 'ContainerIterator::m_iterator'. // It's okay, the iterator type is opaque to us, we have no idea it's a pointer.
|
||||
//lint -esym(1555, ContainerIterator::m_iterator) // (Warning -- Direct pointer copy of member 'ContainerIterator::m_iterator' within copy assignment operator: 'ContainerIterator::operator=(const ContainerIterator &) // Opaque type, we don't know its a pointer.
|
||||
//lint -esym(1555, ContainerIterator::m_owner) // (Warning -- Direct pointer copy of member 'ContainerIterator::m_owner' within copy assignment operator: 'ContainerIterator::operator=(const ContainerIterator &) // We do not own this memory, so it's okay to overwrite the pointer. We can't leak it.
|
||||
|
||||
//lint -esym(613, ContainerConstIterator::m_iterator) // (Warning -- Possible use of null pointer 'ContainerConstIterator::m_iterator' ) // This is an opaque data type to us. We can only check against a container::end().
|
||||
//lint -esym(613, ContainerConstIterator::m_iterator) // (Warning -- Possible use of nullptr pointer 'ContainerConstIterator::m_iterator' ) // This is an opaque data type to us. We can only check against a container::end().
|
||||
//lint -esym(1540, ContainerConstIterator::m_iterator) // (Warning -- Pointer member 'ContainerConstIterator::m_iterator' neither freed nor zero'ed by destructor -- Effective C++ #6) // It's okay, the iterator type is opaque to us, we have no idea it's a pointer.
|
||||
//lint -esym(1554, ContainerConstIterator::m_iterator) // (Warning -- Direct copy of pointer 'ContainerConstIterator::m_iterator'. // It's okay, the iterator type is opaque to us, we have no idea it's a pointer.
|
||||
//lint -esym(1555, ContainerConstIterator::m_iterator) // (Warning -- Direct pointer copy of member 'ContainerConstIterator::m_iterator' within copy assignment operator: 'ContainerConstIterator::operator=(const ContainerConstIterator &) // Opaque type, we don't know its a pointer.
|
||||
@@ -108,7 +108,7 @@ ContainerIterator & ContainerIterator::operator= (const ContainerIterator & rhs)
|
||||
CachedNetworkId & ContainerIterator::operator*()
|
||||
{
|
||||
// @todo fix this interface -- it is broken. It is possible to
|
||||
// construct a ContainerIterator with a NULL m_iterator, but there is
|
||||
// construct a ContainerIterator with a nullptr m_iterator, but there is
|
||||
// no way to gracefully exit from this function since it requires a non-const
|
||||
// reference. Otherwise I would return CachedNetworkId::cms_cachedIvalid.
|
||||
NOT_NULL(m_owner);
|
||||
@@ -197,7 +197,7 @@ ContainerConstIterator & ContainerConstIterator::operator= (const ContainerConst
|
||||
const CachedNetworkId & ContainerConstIterator::operator*() const
|
||||
{
|
||||
// @todo fix this interface -- it is broken. It is possible to
|
||||
// construct a ContainerIterator with a NULL m_iterator, but there is
|
||||
// construct a ContainerIterator with a nullptr m_iterator, but there is
|
||||
// no way to gracefully exit from this function since it requires a non-const
|
||||
// reference. Otherwise I would return CachedNetworkId::cms_cachedIvalid.
|
||||
NOT_NULL(m_owner);
|
||||
@@ -677,7 +677,7 @@ void Container::debugPrint(std::string &buffer) const
|
||||
{
|
||||
Object const *const object = it->getObject();
|
||||
|
||||
sprintf(tempBuffer, "\tindex [%d]: object id [%s], template [%s]\n", index, it->getValueString().c_str(), object ? object->getObjectTemplateName() : "<getObject() reported NULL object>");
|
||||
sprintf(tempBuffer, "\tindex [%d]: object id [%s], template [%s]\n", index, it->getValueString().c_str(), object ? object->getObjectTemplateName() : "<getObject() reported nullptr object>");
|
||||
buffer += tempBuffer;
|
||||
}
|
||||
|
||||
@@ -699,7 +699,7 @@ void Container::debugLog() const
|
||||
for (Contents::const_iterator it = m_contents.begin(); it != endIt; ++it, ++index)
|
||||
{
|
||||
Object const *const object = it->getObject();
|
||||
DEBUG_REPORT_LOG(true, ("\tindex [%d]: object id [%s], template [%s]\n", index, it->getValueString().c_str(), object ? object->getObjectTemplateName() : "<getObject() reported NULL object>"));
|
||||
DEBUG_REPORT_LOG(true, ("\tindex [%d]: object id [%s], template [%s]\n", index, it->getValueString().c_str(), object ? object->getObjectTemplateName() : "<getObject() reported nullptr object>"));
|
||||
}
|
||||
|
||||
DEBUG_REPORT_LOG(true, ("====[END: container]====\n"));
|
||||
|
||||
@@ -351,7 +351,7 @@ bool SlotIdManager::isSlotPlayerModifiable(const SlotId &slotId)
|
||||
*
|
||||
* If the slot can have something put in it that directly affects what you
|
||||
* see on the client, this will return true. If this returns false,
|
||||
* getSlotHardpointName() will return a NULL string.
|
||||
* getSlotHardpointName() will return a nullptr string.
|
||||
*
|
||||
* @param slotId a SlotId instance for the slot under question.
|
||||
*
|
||||
@@ -381,9 +381,9 @@ bool SlotIdManager::isSlotAppearanceRelated(const SlotId &slotId)
|
||||
*
|
||||
* The caller should check the result of isSlotAppearanceRelated() before
|
||||
* calling this function. If the slot is not appearance related, this function
|
||||
* will always return NULL. Also, if the SlotIdManager is installed such that
|
||||
* will always return nullptr. Also, if the SlotIdManager is installed such that
|
||||
* hardpoint names are not loaded (currently the server is loaded this way),
|
||||
* the specified hardpoint name will return NULL.
|
||||
* the specified hardpoint name will return nullptr.
|
||||
*
|
||||
* @param slotId a SlotId instance for the slot under question.
|
||||
*
|
||||
|
||||
@@ -49,7 +49,7 @@ SlottedContainer::~SlottedContainer()
|
||||
if (m_slotMap)
|
||||
{
|
||||
delete m_slotMap;
|
||||
m_slotMap = NULL;
|
||||
m_slotMap = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace VolumeContainerNamespace
|
||||
return parent->getVolumeContainerProperty();
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const VolumeContainer* getVolumeContainerParent(const VolumeContainer& self)
|
||||
@@ -51,7 +51,7 @@ namespace VolumeContainerNamespace
|
||||
return parent->getVolumeContainerProperty();
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const unsigned int serverHolocronCrc = CrcLowerString::calculateCrc("object/player_quest/pgc_quest_holocron.iff");
|
||||
|
||||
@@ -69,8 +69,8 @@ public:
|
||||
private:
|
||||
bool checkVolume(const VolumeContainmentProperty &item) const;
|
||||
|
||||
bool internalRemove(const Object & item, const VolumeContainmentProperty *itemProp = NULL);
|
||||
void insertNewItem(const Object & item, const VolumeContainmentProperty *itemProp = NULL);
|
||||
bool internalRemove(const Object & item, const VolumeContainmentProperty *itemProp = nullptr);
|
||||
void insertNewItem(const Object & item, const VolumeContainmentProperty *itemProp = nullptr);
|
||||
|
||||
void childVolumeChanged(int volume, bool updateParent);
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ MessageQueue::Data* Controller::peekHeldMessage( int message, float *value, uint
|
||||
{
|
||||
HeldMessageMap::iterator iter = m_heldMessages.find( message );
|
||||
if ( iter == m_heldMessages.end() )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
if ( value )
|
||||
*value = iter->second.value;
|
||||
if ( flags )
|
||||
@@ -216,42 +216,42 @@ MessageQueue * Controller::getMessageQueue()
|
||||
|
||||
TangibleController * Controller::asTangibleController()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
TangibleController const * Controller::asTangibleController() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
CreatureController * Controller::asCreatureController()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
CreatureController const * Controller::asCreatureController() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ShipController * Controller::asShipController()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ShipController const * Controller::asShipController() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -55,7 +55,7 @@ SetupSharedObject::Data::Data()
|
||||
customizationIdManagerFilename(0),
|
||||
objectsAlterChildrenAndContents(true),
|
||||
loadObjectTemplateCrcStringTable(true),
|
||||
pobEjectionTransformFilename(NULL)
|
||||
pobEjectionTransformFilename(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
// Specifies whether or not ObjectTemplateList should load the object template crc table
|
||||
bool loadObjectTemplateCrcStringTable;
|
||||
|
||||
// Specifies the name of the POB ejection point transform override filename to use; use NULL (default) if no ejection point support.
|
||||
// Specifies the name of the POB ejection point transform override filename to use; use nullptr (default) if no ejection point support.
|
||||
char const *pobEjectionTransformFilename;
|
||||
|
||||
private:
|
||||
|
||||
@@ -277,10 +277,10 @@ CustomizationData::CustomizationData(Object &owner) :
|
||||
|
||||
void CustomizationData::addVariableTakeOwnership(const std::string &fullVariablePathName, CustomizationVariable *variable)
|
||||
{
|
||||
//-- check for null variable
|
||||
//-- check for nullptr variable
|
||||
if (!variable)
|
||||
{
|
||||
WARNING(true, ("addVariableTakeOwnership() called with null variable.\n"));
|
||||
WARNING(true, ("addVariableTakeOwnership() called with nullptr variable.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -591,7 +591,7 @@ std::string CustomizationData::writeLocalDataToString() const
|
||||
|
||||
saveToByteVector(binaryData);
|
||||
|
||||
//-- Convert binary data to string. We're escaping the 0 for the database so this is a non-null string.
|
||||
//-- Convert binary data to string. We're escaping the 0 for the database so this is a non-nullptr string.
|
||||
// We translate 0x00 => 0xff 0x01
|
||||
// 0xff => 0xff 0x02
|
||||
std::string returnValue;
|
||||
@@ -1139,7 +1139,7 @@ void CustomizationData::notifyPendingRemoteDestruction(const CustomizationData *
|
||||
//-- validate arg
|
||||
if (!customizationData)
|
||||
{
|
||||
DEBUG_WARNING(true, ("notifyPendingRemoteDestruction(): customizationData arg is null"));
|
||||
DEBUG_WARNING(true, ("notifyPendingRemoteDestruction(): customizationData arg is nullptr"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -95,7 +95,7 @@ bool CustomizationData::LocalDirectory::resolvePathNameToDirectory(const std::st
|
||||
//-- ensure we've got a directory
|
||||
if (!subdir)
|
||||
{
|
||||
WARNING(true, ("resolvePathNameToDirectory(): logic failure, subdir is null"));
|
||||
WARNING(true, ("resolvePathNameToDirectory(): logic failure, subdir is nullptr"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ bool CustomizationData::LocalDirectory::addVariableTakeOwnership(const std::stri
|
||||
//-- ensure caller passed in valid customizationVariable
|
||||
if (!variable)
|
||||
{
|
||||
WARNING(true, ("addVariableTakeOwnership(): caller passed in NULL variable"));
|
||||
WARNING(true, ("addVariableTakeOwnership(): caller passed in nullptr variable"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -210,10 +210,10 @@ CustomizationData::Directory *CustomizationData::LocalDirectory::findDirectory(c
|
||||
|
||||
void CustomizationData::LocalDirectory::deleteDirectory(Directory *childDirectory)
|
||||
{
|
||||
//-- check for null directory
|
||||
//-- check for nullptr directory
|
||||
if (!childDirectory)
|
||||
{
|
||||
WARNING(true, ("deleteDirectory(): NULL childDirectory arg"));
|
||||
WARNING(true, ("deleteDirectory(): nullptr childDirectory arg"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -255,10 +255,10 @@ void CustomizationData::LocalDirectory::iterateOverConstVariables(const std::str
|
||||
const DirectoryMap::const_iterator endIt = m_directories.end();
|
||||
for (DirectoryMap::const_iterator it = m_directories.begin(); it != endIt; ++it)
|
||||
{
|
||||
//-- check for null directory pointer (shouldn't happen but shouldn't FATAL)
|
||||
//-- check for nullptr directory pointer (shouldn't happen but shouldn't FATAL)
|
||||
if (!it->second)
|
||||
{
|
||||
WARNING(true, ("iterateOverConstVariables(): directory 0x%08x has null child directory for [%s].", this, it->first.getString()));
|
||||
WARNING(true, ("iterateOverConstVariables(): directory 0x%08x has nullptr child directory for [%s].", this, it->first.getString()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -292,10 +292,10 @@ void CustomizationData::LocalDirectory::iterateOverVariables(const std::string &
|
||||
const DirectoryMap::iterator endIt = m_directories.end();
|
||||
for (DirectoryMap::iterator it = m_directories.begin(); it != endIt; ++it)
|
||||
{
|
||||
//-- check for null directory pointer (shouldn't happen but shouldn't FATAL)
|
||||
//-- check for nullptr directory pointer (shouldn't happen but shouldn't FATAL)
|
||||
if (!it->second)
|
||||
{
|
||||
WARNING(true, ("iterateOverConstVariables(): directory 0x%08x has null child directory for [%s].", this, it->first.getString()));
|
||||
WARNING(true, ("iterateOverConstVariables(): directory 0x%08x has nullptr child directory for [%s].", this, it->first.getString()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -314,10 +314,10 @@ void CustomizationData::LocalDirectory::iterateOverVariables(const std::string &
|
||||
|
||||
void CustomizationData::LocalDirectory::replaceOrAddDirectory(const std::string &directoryPathName, int directoryNameStartIndex, Directory *directory)
|
||||
{
|
||||
//-- ensure attached directory is not null
|
||||
//-- ensure attached directory is not nullptr
|
||||
if (!directory)
|
||||
{
|
||||
WARNING(true, ("replaceOrAddDirectory(): directory arg is NULL"));
|
||||
WARNING(true, ("replaceOrAddDirectory(): directory arg is nullptr"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ std::string CustomizationData::LocalDirectory::writeLocalDirectoryToString() con
|
||||
const CustomizationVariableMap::const_iterator endIt = m_variables.end();
|
||||
for (CustomizationVariableMap::const_iterator it = m_variables.begin(); it != endIt; ++it)
|
||||
{
|
||||
//-- verify it's a non-null variable
|
||||
//-- verify it's a non-nullptr variable
|
||||
const CustomizationVariable *const variable = it->second;
|
||||
if (variable && variable->doesVariablePersist())
|
||||
{
|
||||
@@ -430,11 +430,11 @@ std::string CustomizationData::LocalDirectory::writeLocalDirectoryToString() con
|
||||
const CustomizationVariableMap::const_iterator endIt = m_variables.end();
|
||||
for (CustomizationVariableMap::const_iterator it = m_variables.begin(); it != endIt; ++it)
|
||||
{
|
||||
//-- verify it's a non-null variable
|
||||
//-- verify it's a non-nullptr variable
|
||||
const CustomizationVariable *const variable = it->second;
|
||||
if (!variable)
|
||||
{
|
||||
WARNING(true, ("writeLocalDirectoryToString: NULL variable for [%s], skipping variable writing."));
|
||||
WARNING(true, ("writeLocalDirectoryToString: nullptr variable for [%s], skipping variable writing."));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ bool CustomizationIdManager::mapIdToString(int id, char *variableName, int buffe
|
||||
NOT_NULL(variableName);
|
||||
DEBUG_FATAL(bufferLength < 1, ("CustomizationIdManager: bufferLength of [%d] too small to hold anything.", bufferLength));
|
||||
|
||||
//-- Copy variable name to user buffer, ensure it gets NULL terminated.
|
||||
//-- Copy variable name to user buffer, ensure it gets nullptr terminated.
|
||||
strncpy(variableName, NON_NULL(s_idToVariableName[static_cast<StringVector::size_type>(id)])->getString(), static_cast<size_t>(bufferLength - 1));
|
||||
variableName[bufferLength - 1] = '\0';
|
||||
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ bool ObjectTemplateCustomizationDataWriter::writeToFile(const std::string &pathN
|
||||
if (!allowOverwrite)
|
||||
{
|
||||
FILE *const testFile = fopen(pathName.c_str(), "r");
|
||||
if (testFile != NULL)
|
||||
if (testFile != nullptr)
|
||||
{
|
||||
fclose(testFile);
|
||||
DEBUG_REPORT_LOG(true, ("writeToFile(): overwrite attempt: skipped writing [%s] because it already exists and allowOverwrite == false.\n", pathName.c_str()));
|
||||
|
||||
@@ -129,7 +129,7 @@ void LotManager::addNoBuildEntry (Object const & object, float const noBuildRadi
|
||||
bool const result = m_noBuildEntryMap->insert (std::make_pair (&object, noBuildEntry)).second;
|
||||
UNREF (result);
|
||||
DEBUG_FATAL (!result, ("LotManager::addNoBuildEntry - entry already exists"));
|
||||
DEBUG_REPORT_LOG (ms_logEntries, ("LotManager: added no build entry for object %s [%s] at <%1.2f, %1.2f>\n", object.getNetworkId ().getValueString ().c_str (), object.getObjectTemplateName () ? object.getObjectTemplateName () : "null", position_w.x, position_w.z));
|
||||
DEBUG_REPORT_LOG (ms_logEntries, ("LotManager: added no build entry for object %s [%s] at <%1.2f, %1.2f>\n", object.getNetworkId ().getValueString ().c_str (), object.getObjectTemplateName () ? object.getObjectTemplateName () : "nullptr", position_w.x, position_w.z));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -150,7 +150,7 @@ void LotManager::removeNoBuildEntry (const Object& object)
|
||||
else
|
||||
DEBUG_FATAL (true, ("LotManager::removeNoBuildEntry - entry not found"));
|
||||
|
||||
DEBUG_REPORT_LOG (ms_logEntries, ("LotManager: removed no build entry for object %s [%s]\n", object.getNetworkId ().getValueString ().c_str (), object.getObjectTemplateName () ? object.getObjectTemplateName () : "null"));
|
||||
DEBUG_REPORT_LOG (ms_logEntries, ("LotManager: removed no build entry for object %s [%s]\n", object.getNetworkId ().getValueString ().c_str (), object.getObjectTemplateName () ? object.getObjectTemplateName () : "nullptr"));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -177,7 +177,7 @@ void LotManager::addStructureFootprintEntry (const Object& object, const Structu
|
||||
UNREF (result);
|
||||
DEBUG_FATAL (!result, ("LotManager::addStructureFootprintEntry - entry already exists"));
|
||||
|
||||
DEBUG_REPORT_LOG (ms_logEntries, ("LotManager: added structure footprint entry for object %s [%s] at <%1.2f, %1.2f>\n", object.getNetworkId ().getValueString ().c_str (), object.getObjectTemplateName () ? object.getObjectTemplateName () : "null", x * m_chunkWidthInMeters + m_chunkWidthInMeters * 0.5f, z * m_chunkWidthInMeters + m_chunkWidthInMeters * 0.5f));
|
||||
DEBUG_REPORT_LOG (ms_logEntries, ("LotManager: added structure footprint entry for object %s [%s] at <%1.2f, %1.2f>\n", object.getNetworkId ().getValueString ().c_str (), object.getObjectTemplateName () ? object.getObjectTemplateName () : "nullptr", x * m_chunkWidthInMeters + m_chunkWidthInMeters * 0.5f, z * m_chunkWidthInMeters + m_chunkWidthInMeters * 0.5f));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -191,7 +191,7 @@ void LotManager::removeStructureFootprintEntry (const Object& object)
|
||||
else
|
||||
DEBUG_FATAL (true, ("LotManager::removeStructureFootprintEntry - entry not found"));
|
||||
|
||||
DEBUG_REPORT_LOG (ms_logEntries, ("LotManager: removed structure footprint entry for object %s [%s]\n", object.getNetworkId ().getValueString ().c_str (), object.getObjectTemplateName () ? object.getObjectTemplateName () : "null"));
|
||||
DEBUG_REPORT_LOG (ms_logEntries, ("LotManager: removed structure footprint entry for object %s [%s]\n", object.getNetworkId ().getValueString ().c_str (), object.getObjectTemplateName () ? object.getObjectTemplateName () : "nullptr"));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -277,13 +277,13 @@ void AlterSchedulerNamespace::reportPrint()
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/**
|
||||
* NULL objects are not considered valid by this function. Do not call this on a NULL
|
||||
* nullptr objects are not considered valid by this function. Do not call this on a nullptr
|
||||
* object if that happens to be valid in the context in which this function is used.
|
||||
*/
|
||||
|
||||
void AlterSchedulerNamespace::validateObject(Object const *object)
|
||||
{
|
||||
FATAL(!object, ("validateObject(): alter scheduler found NULL object."));
|
||||
FATAL(!object, ("validateObject(): alter scheduler found nullptr object."));
|
||||
|
||||
DO_ON_VALIDATE_OBJECTS(bool isInvalid = false);
|
||||
|
||||
@@ -331,7 +331,7 @@ void AlterSchedulerNamespace::validateObject(Object const *object)
|
||||
if (isInvalid)
|
||||
{
|
||||
//-- Print out object info for the invalid object if we have it.
|
||||
ObjectInfo *objectInfo = NULL;
|
||||
ObjectInfo *objectInfo = nullptr;
|
||||
if (s_trackObjectInfo)
|
||||
{
|
||||
ObjectInfoMap::iterator findIt = s_objectInfoMap.find(const_cast<Object*>(object));
|
||||
@@ -352,7 +352,7 @@ void AlterSchedulerNamespace::validateObject(Object const *object)
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/**
|
||||
* Return true if two strings are the same (or are both NULL); otherwise, return false.
|
||||
* Return true if two strings are the same (or are both nullptr); otherwise, return false.
|
||||
*/
|
||||
|
||||
static bool SafeStringEqual(char const *string1, char const *string2)
|
||||
@@ -682,7 +682,7 @@ void AlterScheduler::alter(float elapsedTime)
|
||||
DO_ON_DEBUG(if (s_suspendExecution) return);
|
||||
|
||||
PROFILER_AUTO_BLOCK_DEFINE("AlterScheduler::alter");
|
||||
doAlterAndConcludeForAllObjects(elapsedTime, CS_none, NULL);
|
||||
doAlterAndConcludeForAllObjects(elapsedTime, CS_none, nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -702,7 +702,7 @@ void AlterScheduler::alterAndConclude(float elapsedTime)
|
||||
DO_ON_DEBUG(if (s_suspendExecution) return);
|
||||
|
||||
PROFILER_AUTO_BLOCK_DEFINE("AlterScheduler::alterAndConclude");
|
||||
doAlterAndConcludeForAllObjects(elapsedTime, CS_all, NULL);
|
||||
doAlterAndConcludeForAllObjects(elapsedTime, CS_all, nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -724,7 +724,7 @@ void AlterScheduler::initializeScheduleTimeMapIterator(Object &object)
|
||||
|
||||
bool AlterScheduler::isIteratorInScheduleTimeMap(void const *iterator)
|
||||
{
|
||||
DEBUG_FATAL(!iterator, ("AlterScheduler::isIteratorInScheduleTimeMap(): iterator pointer is NULL."));
|
||||
DEBUG_FATAL(!iterator, ("AlterScheduler::isIteratorInScheduleTimeMap(): iterator pointer is nullptr."));
|
||||
return (*static_cast<ScheduleTimeMap::iterator const*>(iterator) != s_scheduleMap.end());
|
||||
}
|
||||
|
||||
@@ -734,7 +734,7 @@ bool AlterScheduler::findObjectInAlterNowList(Object const *object)
|
||||
{
|
||||
DO_ON_HARDCORE_VALIDATION(validateAlterNowList());
|
||||
|
||||
for (Object *searchObject = s_alterNowListFirst->getNextFromAlterNowList(); searchObject != NULL; searchObject = searchObject->getNextFromAlterNowList())
|
||||
for (Object *searchObject = s_alterNowListFirst->getNextFromAlterNowList(); searchObject != nullptr; searchObject = searchObject->getNextFromAlterNowList())
|
||||
{
|
||||
if (searchObject == object)
|
||||
return true;
|
||||
@@ -751,7 +751,7 @@ bool AlterScheduler::findObjectInAlterNextFrameLists(Object const *object)
|
||||
|
||||
for (int phaseIndex = 0; phaseIndex < AS_MAX_SCHEDULE_PHASE_COUNT; ++phaseIndex)
|
||||
{
|
||||
for (Object *searchObject = s_alterNextFrameListFirst[phaseIndex]->getNextFromAlterNextFrameList(); searchObject != NULL; searchObject = searchObject->getNextFromAlterNextFrameList())
|
||||
for (Object *searchObject = s_alterNextFrameListFirst[phaseIndex]->getNextFromAlterNextFrameList(); searchObject != nullptr; searchObject = searchObject->getNextFromAlterNextFrameList())
|
||||
{
|
||||
if (searchObject == object)
|
||||
return true;
|
||||
@@ -767,7 +767,7 @@ bool AlterScheduler::findObjectInConcludeList(Object const *object)
|
||||
{
|
||||
DO_ON_HARDCORE_VALIDATION(validateConcludeList());
|
||||
|
||||
for (Object *searchObject = s_concludeListFirst->getNextFromConcludeList(); searchObject != NULL; searchObject = searchObject->getNextFromConcludeList())
|
||||
for (Object *searchObject = s_concludeListFirst->getNextFromConcludeList(); searchObject != nullptr; searchObject = searchObject->getNextFromConcludeList())
|
||||
{
|
||||
if (searchObject == object)
|
||||
return true;
|
||||
@@ -817,7 +817,7 @@ void AlterScheduler::validateAlterNowList()
|
||||
|
||||
//-- Add each object to the set and list.
|
||||
{
|
||||
for (Object *object = s_alterNowListFirst->getNextFromAlterNowList(); object != NULL; object = object->getNextFromAlterNowList())
|
||||
for (Object *object = s_alterNowListFirst->getNextFromAlterNowList(); object != nullptr; object = object->getNextFromAlterNowList())
|
||||
{
|
||||
DO_ON_VALIDATE_OBJECTS(validateObject(object));
|
||||
|
||||
@@ -836,7 +836,7 @@ void AlterScheduler::validateAlterNowList()
|
||||
{
|
||||
ObjectList::iterator const endIt = objectList.end();
|
||||
Object *object = s_alterNowListFirst->getNextFromAlterNowList();
|
||||
for (ObjectList::iterator it = objectList.begin(); (it != endIt) && (object != NULL); object = object->getNextFromAlterNowList(), ++it)
|
||||
for (ObjectList::iterator it = objectList.begin(); (it != endIt) && (object != nullptr); object = object->getNextFromAlterNowList(), ++it)
|
||||
{
|
||||
lastObject = object;
|
||||
DEBUG_WARNING(object != *it, ("validateAlterNowList(): forward linkage check failed, stl list: pointer=[%p], object id=[%s], object template=[%s].", *it, (*it)->getNetworkId().getValueString().c_str(), (*it)->getObjectTemplateName()));
|
||||
@@ -848,7 +848,7 @@ void AlterScheduler::validateAlterNowList()
|
||||
{
|
||||
ObjectList::reverse_iterator const endIt = objectList.rend();
|
||||
Object *object = lastObject;
|
||||
for (ObjectList::reverse_iterator it = objectList.rbegin(); (it != endIt) && (object != NULL); object = object->getPreviousFromAlterNowList(), ++it)
|
||||
for (ObjectList::reverse_iterator it = objectList.rbegin(); (it != endIt) && (object != nullptr); object = object->getPreviousFromAlterNowList(), ++it)
|
||||
{
|
||||
DEBUG_WARNING(object != *it, ("validateAlterNowList(): reverse linkage check failed, stl list: pointer=[%p], object id=[%s], object template=[%s].", *it, (*it)->getNetworkId().getValueString().c_str(), (*it)->getObjectTemplateName()));
|
||||
DEBUG_FATAL(object != *it, ("validateAlterNowList(): reverse linkage check failed, alter scheduler list: pointer=[%p], object id=[%s], object template=[%s].", object, object->getNetworkId().getValueString().c_str(), object->getObjectTemplateName()));
|
||||
@@ -867,7 +867,7 @@ void AlterScheduler::validateAlterNextFrameLists()
|
||||
{
|
||||
//-- Add each object to the set and list.
|
||||
{
|
||||
for (Object *object = s_alterNextFrameListFirst[phaseIndex]->getNextFromAlterNextFrameList(); object != NULL; object = object->getNextFromAlterNextFrameList())
|
||||
for (Object *object = s_alterNextFrameListFirst[phaseIndex]->getNextFromAlterNextFrameList(); object != nullptr; object = object->getNextFromAlterNextFrameList())
|
||||
{
|
||||
DO_ON_VALIDATE_OBJECTS(validateObject(object));
|
||||
|
||||
@@ -886,7 +886,7 @@ void AlterScheduler::validateAlterNextFrameLists()
|
||||
{
|
||||
ObjectList::iterator const endIt = objectList.end();
|
||||
Object *object = s_alterNextFrameListFirst[phaseIndex]->getNextFromAlterNextFrameList();
|
||||
for (ObjectList::iterator it = objectList.begin(); (it != endIt) && (object != NULL); object = object->getNextFromAlterNextFrameList(), ++it)
|
||||
for (ObjectList::iterator it = objectList.begin(); (it != endIt) && (object != nullptr); object = object->getNextFromAlterNextFrameList(), ++it)
|
||||
{
|
||||
lastObject = object;
|
||||
DEBUG_WARNING(object != *it, ("validateAlterNextFrameList(): forward linkage check failed, stl list: pointer=[%p], object id=[%s], object template=[%s].", *it, (*it)->getNetworkId().getValueString().c_str(), (*it)->getObjectTemplateName()));
|
||||
@@ -898,7 +898,7 @@ void AlterScheduler::validateAlterNextFrameLists()
|
||||
{
|
||||
ObjectList::reverse_iterator const endIt = objectList.rend();
|
||||
Object *object = lastObject;
|
||||
for (ObjectList::reverse_iterator it = objectList.rbegin(); (it != endIt) && (object != NULL); object = object->getPreviousFromAlterNextFrameList(), ++it)
|
||||
for (ObjectList::reverse_iterator it = objectList.rbegin(); (it != endIt) && (object != nullptr); object = object->getPreviousFromAlterNextFrameList(), ++it)
|
||||
{
|
||||
DEBUG_WARNING(object != *it, ("validateAlterNextFrameList(): reverse linkage check failed, stl list: pointer=[%p], object id=[%s], object template=[%s].", *it, (*it)->getNetworkId().getValueString().c_str(), (*it)->getObjectTemplateName()));
|
||||
DEBUG_FATAL(object != *it, ("validateAlterNextFrameList(): reverse linkage check failed, alter scheduler list: pointer=[%p], object id=[%s], object template=[%s].", object, object->getNetworkId().getValueString().c_str(), object->getObjectTemplateName()));
|
||||
@@ -919,7 +919,7 @@ void AlterScheduler::validateConcludeList()
|
||||
|
||||
//-- Add each object to the set and list.
|
||||
{
|
||||
for (Object *object = s_concludeListFirst->getNextFromConcludeList(); object != NULL; object = object->getNextFromConcludeList())
|
||||
for (Object *object = s_concludeListFirst->getNextFromConcludeList(); object != nullptr; object = object->getNextFromConcludeList())
|
||||
{
|
||||
DO_ON_VALIDATE_OBJECTS(validateObject(object));
|
||||
|
||||
@@ -938,7 +938,7 @@ void AlterScheduler::validateConcludeList()
|
||||
{
|
||||
ObjectList::iterator const endIt = objectList.end();
|
||||
Object *object = s_concludeListFirst->getNextFromConcludeList();
|
||||
for (ObjectList::iterator it = objectList.begin(); (it != endIt) && (object != NULL); object = object->getNextFromConcludeList(), ++it)
|
||||
for (ObjectList::iterator it = objectList.begin(); (it != endIt) && (object != nullptr); object = object->getNextFromConcludeList(), ++it)
|
||||
{
|
||||
lastObject = object;
|
||||
DEBUG_WARNING(object != *it, ("validateConcludeList(): forward linkage check failed, stl list: pointer=[%p], object id=[%s], object template=[%s].", *it, (*it)->getNetworkId().getValueString().c_str(), (*it)->getObjectTemplateName()));
|
||||
@@ -950,7 +950,7 @@ void AlterScheduler::validateConcludeList()
|
||||
{
|
||||
ObjectList::reverse_iterator const endIt = objectList.rend();
|
||||
Object *object = lastObject;
|
||||
for (ObjectList::reverse_iterator it = objectList.rbegin(); (it != endIt) && (object != NULL); object = object->getPreviousFromConcludeList(), ++it)
|
||||
for (ObjectList::reverse_iterator it = objectList.rbegin(); (it != endIt) && (object != nullptr); object = object->getPreviousFromConcludeList(), ++it)
|
||||
{
|
||||
DEBUG_WARNING(object != *it, ("validateConcludeList(): reverse linkage check failed, stl list: pointer=[%p], object id=[%s], object template=[%s].", *it, (*it)->getNetworkId().getValueString().c_str(), (*it)->getObjectTemplateName()));
|
||||
DEBUG_FATAL(object != *it, ("validateConcludeList(): reverse linkage check failed, alter scheduler list: pointer=[%p], object id=[%s], object template=[%s].", object, object->getNetworkId().getValueString().c_str(), object->getObjectTemplateName()));
|
||||
@@ -1184,8 +1184,8 @@ void AlterScheduler::moveObjectsFromAlterNextFrameListToAlterNowList(int schedul
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("copy next frame");
|
||||
|
||||
//if (s_alterNextFrameListFirst != NULL) {
|
||||
for (Object *object = s_alterNextFrameListFirst[schedulePhaseIndex]->getNextFromAlterNextFrameList(); object != NULL; )
|
||||
//if (s_alterNextFrameListFirst != nullptr) {
|
||||
for (Object *object = s_alterNextFrameListFirst[schedulePhaseIndex]->getNextFromAlterNextFrameList(); object != nullptr; )
|
||||
{
|
||||
//-- Add object to alter now list. This removes the object from the alter next frame list.
|
||||
DO_ON_VALIDATE_OBJECTS(validateObject(object));
|
||||
@@ -1222,7 +1222,7 @@ void AlterScheduler::alterSingleObject(Object *object, ConcludeStyle concludeSty
|
||||
DO_ON_DEBUG(s_currentlyAlteringObject = object);
|
||||
|
||||
#if defined(_WIN32) && defined(_DEBUG)
|
||||
char const * const typeName = s_profileAlterByType ? typeid(*object).name() : NULL;
|
||||
char const * const typeName = s_profileAlterByType ? typeid(*object).name() : nullptr;
|
||||
PROFILER_BLOCK_DEFINE(profilerBlock, typeName);
|
||||
if (typeName)
|
||||
PROFILER_BLOCK_ENTER(profilerBlock);
|
||||
@@ -1245,7 +1245,7 @@ void AlterScheduler::alterSingleObject(Object *object, ConcludeStyle concludeSty
|
||||
PROFILER_BLOCK_LEAVE(profilerBlock);
|
||||
#endif
|
||||
|
||||
DO_ON_DEBUG(s_currentlyAlteringObject = NULL);
|
||||
DO_ON_DEBUG(s_currentlyAlteringObject = nullptr);
|
||||
DO_ON_VALIDATE_OBJECTS(validateObject(object));
|
||||
}
|
||||
|
||||
@@ -1254,7 +1254,7 @@ void AlterScheduler::alterSingleObject(Object *object, ConcludeStyle concludeSty
|
||||
nextObject = object->getNextFromAlterNowList();
|
||||
|
||||
#if VALIDATE_OBJECTS
|
||||
if (nextObject != NULL)
|
||||
if (nextObject != nullptr)
|
||||
{
|
||||
DO_ON_HARDCORE_VALIDATION(DEBUG_FATAL(!findObjectInAlterNowList(nextObject), ("didn't find object in alter now list, unexpected.")));
|
||||
validateObject(nextObject);
|
||||
@@ -1343,7 +1343,7 @@ void AlterScheduler::alterSingleObject(Object *object, ConcludeStyle concludeSty
|
||||
ScheduleTime const absoluteScheduleTime = s_currentTime + dt;
|
||||
|
||||
// Add it to the schedule list for the specified scheduler time.
|
||||
// If this object is NULL, it means it returned an AlterResult that indicated it should still be alive but it somehow got killed.
|
||||
// If this object is nullptr, it means it returned an AlterResult that indicated it should still be alive but it somehow got killed.
|
||||
//DEBUG_REPORT_LOG(object->getNetworkId() != NetworkId::cms_invalid, ("[aitest] scheduling %s to alter at %lu (%lu + %lu)\n",
|
||||
// object->getNetworkId().getValueString().c_str(),
|
||||
// static_cast<unsigned long>(absoluteScheduleTime),
|
||||
@@ -1363,7 +1363,7 @@ void AlterScheduler::concludeAndRemoveAllConcludeEntries()
|
||||
PROFILER_AUTO_BLOCK_DEFINE("conclude");
|
||||
|
||||
Object *nextObject;
|
||||
for (Object *object = s_concludeListFirst->getNextFromConcludeList(); object != NULL; object = nextObject)
|
||||
for (Object *object = s_concludeListFirst->getNextFromConcludeList(); object != nullptr; object = nextObject)
|
||||
{
|
||||
//-- Conclude the object.
|
||||
DO_ON_VALIDATE_OBJECTS(validateObject(object));
|
||||
@@ -1400,7 +1400,7 @@ void AlterScheduler::doAlterAndConcludeForAllObjects(float schedulerElapsedTime,
|
||||
DO_ON_HARDCORE_VALIDATION(validateAllContainers());
|
||||
|
||||
Object *nextObject;
|
||||
for (Object *object = s_alterNowListFirst->getNextFromAlterNowList(); object != NULL; object = nextObject)
|
||||
for (Object *object = s_alterNowListFirst->getNextFromAlterNowList(); object != nullptr; object = nextObject)
|
||||
alterSingleObject(object, concludeStyle, nextObject);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ void CachedNetworkId::checkValidity() const
|
||||
|
||||
CachedNetworkId::CachedNetworkId() :
|
||||
m_id(cms_invalid),
|
||||
m_object(NULL)
|
||||
m_object(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ m_object(NULL)
|
||||
|
||||
CachedNetworkId::CachedNetworkId(const NetworkId& id) :
|
||||
m_id(id),
|
||||
m_object(NULL)
|
||||
m_object(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ m_object(NULL)
|
||||
|
||||
CachedNetworkId::CachedNetworkId(NetworkId::NetworkIdType value) :
|
||||
m_id(value),
|
||||
m_object(NULL)
|
||||
m_object(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -66,7 +66,7 @@ m_object(const_cast<Object*>(&object))
|
||||
|
||||
CachedNetworkId::CachedNetworkId(const std::string &value) :
|
||||
m_id(value),
|
||||
m_object(NULL)
|
||||
m_object(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -98,7 +98,7 @@ CachedNetworkId& CachedNetworkId::operator= (const CachedNetworkId& rhs)
|
||||
CachedNetworkId& CachedNetworkId::operator= (const NetworkId& rhs)
|
||||
{
|
||||
m_id = rhs;
|
||||
m_object = NULL;
|
||||
m_object = nullptr;
|
||||
return *this;
|
||||
}
|
||||
// ----------------------------------------------------------
|
||||
@@ -178,7 +178,7 @@ Object* CachedNetworkId::getObject() const
|
||||
return m_object;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
||||
@@ -515,7 +515,7 @@ void ObjectNamespace::remove()
|
||||
#endif
|
||||
|
||||
delete ms_transformMemoryBlockManager;
|
||||
ms_transformMemoryBlockManager = NULL;
|
||||
ms_transformMemoryBlockManager = nullptr;
|
||||
|
||||
DEBUG_WARNING(static_cast<int>(ms_freeDpvsObjectsList.size()) != ms_allocatedDpvsObjects, ("Leaked %d DpvsObjects lists", ms_allocatedDpvsObjects - static_cast<int>(ms_freeDpvsObjectsList.size())));
|
||||
while (!ms_systemAllocatedDpvsObjectsList.empty())
|
||||
@@ -570,11 +570,11 @@ void ObjectNamespace::validatePosition(Object const & object, Vector const & pos
|
||||
object.getNetworkId().getValueString().c_str(),
|
||||
object.getObjectTemplateName(),
|
||||
&object,
|
||||
object.getAppearance() ? object.getAppearance()->getAppearanceTemplateName() : NULL,
|
||||
parent ? parent->getNetworkId().getValueString().c_str() : NULL,
|
||||
parent ? parent->getObjectTemplateName() : NULL,
|
||||
parent ? parent : NULL,
|
||||
parent && parent->getAppearance() ? parent->getAppearance()->getAppearanceTemplateName() : NULL));
|
||||
object.getAppearance() ? object.getAppearance()->getAppearanceTemplateName() : nullptr,
|
||||
parent ? parent->getNetworkId().getValueString().c_str() : nullptr,
|
||||
parent ? parent->getObjectTemplateName() : nullptr,
|
||||
parent ? parent : nullptr,
|
||||
parent && parent->getAppearance() ? parent->getAppearance()->getAppearanceTemplateName() : nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,30 +703,30 @@ Object::Object():
|
||||
#if OBJECT_SUPPORTS_IS_ALTERING_FLAG
|
||||
m_isAltering(false),
|
||||
#endif
|
||||
m_objectTemplate(NULL),
|
||||
m_objectTemplate(nullptr),
|
||||
m_notificationList(NotificationListManager::getEmptyNotificationList()),
|
||||
m_debugName(NULL),
|
||||
m_debugName(nullptr),
|
||||
m_networkId(NetworkId::cms_invalid),
|
||||
m_appearance(NULL),
|
||||
m_controller(NULL),
|
||||
m_dynamics(NULL),
|
||||
m_attachedToObject(NULL),
|
||||
m_attachedObjects(NULL),
|
||||
m_dpvsObjects(NULL),
|
||||
m_appearance(nullptr),
|
||||
m_controller(nullptr),
|
||||
m_dynamics(nullptr),
|
||||
m_attachedToObject(nullptr),
|
||||
m_attachedObjects(nullptr),
|
||||
m_dpvsObjects(nullptr),
|
||||
m_rotations(0),
|
||||
m_scale(Vector::xyz111),
|
||||
m_objectToParent(),
|
||||
m_objectToWorld(NULL),
|
||||
m_objectToWorld(nullptr),
|
||||
m_watchedByList(),
|
||||
m_containerProperty(NULL),
|
||||
m_collisionProperty(NULL),
|
||||
m_containerProperty(nullptr),
|
||||
m_collisionProperty(nullptr),
|
||||
m_spatialSubdivisionHandle (0),
|
||||
m_useAlterScheduler(true),
|
||||
m_scheduleData(NULL),
|
||||
m_scheduleData(nullptr),
|
||||
m_shouldBakeIntoMesh(true),
|
||||
m_defaultAppearance(NULL),
|
||||
m_alternateAppearance(NULL),
|
||||
m_containedBy(NULL)
|
||||
m_defaultAppearance(nullptr),
|
||||
m_alternateAppearance(nullptr),
|
||||
m_containedBy(nullptr)
|
||||
{
|
||||
m_defaultAppearance = m_appearance;
|
||||
}
|
||||
@@ -752,25 +752,25 @@ Object::Object(const ObjectTemplate *objectTemplate, const NetworkId &networkId)
|
||||
m_debugName(0),
|
||||
m_networkId(networkId),
|
||||
m_appearance(0),
|
||||
m_controller(NULL),
|
||||
m_dynamics(NULL),
|
||||
m_attachedToObject(NULL),
|
||||
m_attachedObjects(NULL),
|
||||
m_dpvsObjects(NULL),
|
||||
m_controller(nullptr),
|
||||
m_dynamics(nullptr),
|
||||
m_attachedToObject(nullptr),
|
||||
m_attachedObjects(nullptr),
|
||||
m_dpvsObjects(nullptr),
|
||||
m_rotations(0),
|
||||
m_scale(Vector::xyz111),
|
||||
m_objectToParent(),
|
||||
m_objectToWorld(NULL),
|
||||
m_objectToWorld(nullptr),
|
||||
m_watchedByList(),
|
||||
m_containerProperty(NULL),
|
||||
m_collisionProperty(NULL),
|
||||
m_containerProperty(nullptr),
|
||||
m_collisionProperty(nullptr),
|
||||
m_spatialSubdivisionHandle (0),
|
||||
m_useAlterScheduler(true),
|
||||
m_scheduleData(NULL),
|
||||
m_scheduleData(nullptr),
|
||||
m_shouldBakeIntoMesh(true),
|
||||
m_defaultAppearance(NULL),
|
||||
m_alternateAppearance(NULL),
|
||||
m_containedBy(NULL)
|
||||
m_defaultAppearance(nullptr),
|
||||
m_alternateAppearance(nullptr),
|
||||
m_containedBy(nullptr)
|
||||
{
|
||||
objectTemplate->addReference();
|
||||
NetworkIdManager::addObject(*this);
|
||||
@@ -799,25 +799,25 @@ Object::Object(const ObjectTemplate *objectTemplate, InitializeFlag):
|
||||
m_debugName(0),
|
||||
m_networkId(NetworkId::cms_invalid),
|
||||
m_appearance(0),
|
||||
m_controller(NULL),
|
||||
m_dynamics(NULL),
|
||||
m_attachedToObject(NULL),
|
||||
m_attachedObjects(NULL),
|
||||
m_dpvsObjects(NULL),
|
||||
m_controller(nullptr),
|
||||
m_dynamics(nullptr),
|
||||
m_attachedToObject(nullptr),
|
||||
m_attachedObjects(nullptr),
|
||||
m_dpvsObjects(nullptr),
|
||||
m_rotations(0),
|
||||
m_scale(Vector::xyz111),
|
||||
m_objectToParent(),
|
||||
m_objectToWorld(NULL),
|
||||
m_objectToWorld(nullptr),
|
||||
m_watchedByList(),
|
||||
m_containerProperty(NULL),
|
||||
m_collisionProperty(NULL),
|
||||
m_containerProperty(nullptr),
|
||||
m_collisionProperty(nullptr),
|
||||
m_spatialSubdivisionHandle (0),
|
||||
m_useAlterScheduler(true),
|
||||
m_scheduleData(NULL),
|
||||
m_scheduleData(nullptr),
|
||||
m_shouldBakeIntoMesh(true),
|
||||
m_defaultAppearance(NULL),
|
||||
m_alternateAppearance(NULL),
|
||||
m_containedBy(NULL)
|
||||
m_defaultAppearance(nullptr),
|
||||
m_alternateAppearance(nullptr),
|
||||
m_containedBy(nullptr)
|
||||
{
|
||||
objectTemplate->addReference();
|
||||
NetworkIdManager::addObject(*this);
|
||||
@@ -836,7 +836,7 @@ Object::~Object(void)
|
||||
IGNORE_RETURN(snprintf(ms_crashReportInfo, sizeof(ms_crashReportInfo) - 1, "~Object: name=[%s] template=[%s]\n", getDebugName(), getObjectTemplateName()));
|
||||
ms_crashReportInfo[sizeof(ms_crashReportInfo) - 1] = '\0';
|
||||
|
||||
DEBUG_REPORT_LOG(ms_logObjectDelete, ("Deleting object id=[%s], template=[%s], pointer=[%p], appearance=[%s], parent id=[%s], template=[%s], pointer=[%p], appearance=[%s]\n", getNetworkId().getValueString().c_str(), getObjectTemplateName(), this, getAppearance() ? getAppearance()->getAppearanceTemplateName() : NULL, m_attachedToObject ? m_attachedToObject->getNetworkId().getValueString().c_str() : NULL, m_attachedToObject ? m_attachedToObject->getObjectTemplateName() : NULL, m_attachedToObject ? m_attachedToObject : NULL, m_attachedToObject && m_attachedToObject->getAppearance() ? m_attachedToObject->getAppearance()->getAppearanceTemplateName() : NULL));
|
||||
DEBUG_REPORT_LOG(ms_logObjectDelete, ("Deleting object id=[%s], template=[%s], pointer=[%p], appearance=[%s], parent id=[%s], template=[%s], pointer=[%p], appearance=[%s]\n", getNetworkId().getValueString().c_str(), getObjectTemplateName(), this, getAppearance() ? getAppearance()->getAppearanceTemplateName() : nullptr, m_attachedToObject ? m_attachedToObject->getNetworkId().getValueString().c_str() : nullptr, m_attachedToObject ? m_attachedToObject->getObjectTemplateName() : nullptr, m_attachedToObject ? m_attachedToObject : nullptr, m_attachedToObject && m_attachedToObject->getAppearance() ? m_attachedToObject->getAppearance()->getAppearanceTemplateName() : nullptr));
|
||||
FATAL(ConfigSharedObject::getAllowDisallowObjectDelete() && ms_disallowObjectDelete, ("Object id=[%s], template=[%s], pointer=[%p] is deleting itself when delete is not allowed", getNetworkId().getValueString().c_str(), getObjectTemplateName(), this));
|
||||
|
||||
#if OBJECT_SUPPORTS_IS_ALTERING_FLAG
|
||||
@@ -905,7 +905,7 @@ Object::~Object(void)
|
||||
}
|
||||
|
||||
deleteAttachedObjects(m_attachedObjects);
|
||||
m_attachedObjects = NULL;
|
||||
m_attachedObjects = nullptr;
|
||||
}
|
||||
|
||||
if (m_objectToWorld)
|
||||
@@ -914,9 +914,9 @@ Object::~Object(void)
|
||||
m_objectToWorld = 0;
|
||||
}
|
||||
|
||||
if (m_objectTemplate != NULL)
|
||||
if (m_objectTemplate != nullptr)
|
||||
m_objectTemplate->releaseReference();
|
||||
m_objectTemplate = NULL;
|
||||
m_objectTemplate = nullptr;
|
||||
|
||||
m_notificationList = 0;
|
||||
|
||||
@@ -1139,7 +1139,7 @@ void Object::removeFromWorld()
|
||||
{
|
||||
if (attached->isInWorld())
|
||||
{
|
||||
DEBUG_WARNING(true, ("Removing an object [id=%s template=%s] from the world with non-child attached objects [id=%s ptr=0x%08x template=%s name=%s]", getNetworkId ().getValueString ().c_str (), getObjectTemplateName () ? getObjectTemplateName () : "null", attached->getNetworkId ().getValueString ().c_str (), attached, attached->getObjectTemplateName () ? attached->getObjectTemplateName () : "null", attached->getDebugName()));
|
||||
DEBUG_WARNING(true, ("Removing an object [id=%s template=%s] from the world with non-child attached objects [id=%s ptr=0x%08x template=%s name=%s]", getNetworkId ().getValueString ().c_str (), getObjectTemplateName () ? getObjectTemplateName () : "nullptr", attached->getNetworkId ().getValueString ().c_str (), attached, attached->getObjectTemplateName () ? attached->getObjectTemplateName () : "nullptr", attached->getDebugName()));
|
||||
attached->detachFromObject(DF_parent);
|
||||
}
|
||||
}
|
||||
@@ -1369,7 +1369,7 @@ bool Object::isInWorldCell() const
|
||||
|
||||
CellProperty *Object::getParentCell() const
|
||||
{
|
||||
Property *cell = NULL;
|
||||
Property *cell = nullptr;
|
||||
|
||||
for (Object *o = const_cast<Object *>(getAttachedTo()); o && !cell; o = o->getAttachedTo())
|
||||
cell = o->getCellProperty();
|
||||
@@ -1580,7 +1580,7 @@ void Object::setAppearance(Appearance *newAppearance)
|
||||
* Steal the Appearance from this object.
|
||||
*
|
||||
* This routine will return the current appearance of this object, and
|
||||
* then reset its appearance to NULL.
|
||||
* then reset its appearance to nullptr.
|
||||
*
|
||||
* @return The current appearance of this object
|
||||
*/
|
||||
@@ -1590,18 +1590,18 @@ Appearance *Object::stealAppearance(void)
|
||||
Appearance *oldAppearance = m_appearance;
|
||||
|
||||
if(m_appearance == m_defaultAppearance)
|
||||
m_defaultAppearance = NULL;
|
||||
m_defaultAppearance = nullptr;
|
||||
else if (m_appearance == m_alternateAppearance)
|
||||
m_alternateAppearance = NULL;
|
||||
m_alternateAppearance = nullptr;
|
||||
|
||||
m_appearance = NULL;
|
||||
m_appearance = nullptr;
|
||||
|
||||
if (oldAppearance)
|
||||
{
|
||||
if (isInWorld())
|
||||
oldAppearance->removeFromWorld();
|
||||
|
||||
oldAppearance->setOwner(NULL);
|
||||
oldAppearance->setOwner(nullptr);
|
||||
}
|
||||
|
||||
return oldAppearance;
|
||||
@@ -1999,7 +1999,7 @@ void Object::detachFromObject(DetachFlags const detachFlags)
|
||||
bool const shouldAttach = (!toParentCell || noCell) ? false : m_attachedToObject != &cellProperty->getOwner();
|
||||
m_objectToParent = shouldAttach ? getTransform_o2c() : getTransform_o2w();
|
||||
deleteLocalTransform(m_objectToWorld);
|
||||
m_objectToWorld = NULL;
|
||||
m_objectToWorld = nullptr;
|
||||
setObjectToWorldDirty(true);
|
||||
|
||||
// remove from the attached objects list
|
||||
@@ -2010,7 +2010,7 @@ void Object::detachFromObject(DetachFlags const detachFlags)
|
||||
attachedObjects->pop_back();
|
||||
|
||||
// set as unattached
|
||||
m_attachedToObject = NULL;
|
||||
m_attachedToObject = nullptr;
|
||||
|
||||
bool const wasChildObject = isChildObject();
|
||||
bool const wasInWorld = isInWorld();
|
||||
@@ -2102,7 +2102,7 @@ void Object::removeChildObject(Object * childObjectToRemove, DetachFlags detachF
|
||||
|
||||
Object *Object::getRootParent(void)
|
||||
{
|
||||
DEBUG_FATAL(m_childObject && m_attachedToObject == NULL, ("am a child but attached to is NULL"));
|
||||
DEBUG_FATAL(m_childObject && m_attachedToObject == nullptr, ("am a child but attached to is nullptr"));
|
||||
return m_childObject ? NON_NULL(m_attachedToObject)->getRootParent() : this;
|
||||
}
|
||||
|
||||
@@ -2116,7 +2116,7 @@ Object *Object::getRootParent(void)
|
||||
|
||||
const Object *Object::getRootParent(void) const
|
||||
{
|
||||
DEBUG_FATAL(m_childObject && m_attachedToObject == NULL, ("am a child but attached to is NULL"));
|
||||
DEBUG_FATAL(m_childObject && m_attachedToObject == nullptr, ("am a child but attached to is nullptr"));
|
||||
return m_childObject ? NON_NULL(m_attachedToObject)->getRootParent() : this;
|
||||
}
|
||||
|
||||
@@ -2231,7 +2231,7 @@ void Object::setRecursiveScale(Vector const & scale)
|
||||
Controller* Object::stealController(void)
|
||||
{
|
||||
Controller* returnValue = m_controller;
|
||||
m_controller = NULL;
|
||||
m_controller = nullptr;
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -2362,7 +2362,7 @@ Property const *Object::getProperty(PropertyId const &id) const
|
||||
if ((*i)->getPropertyId() == id)
|
||||
return *i;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2376,7 +2376,7 @@ Property *Object::getProperty(PropertyId const &id)
|
||||
if ((*i)->getPropertyId() == id)
|
||||
return *i;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2399,13 +2399,13 @@ void Object::removeProperty(PropertyId const &id)
|
||||
}
|
||||
|
||||
if (id == CellProperty::getClassPropertyId() || id == PortalProperty::getClassPropertyId() || id == SlottedContainer::getClassPropertyId() || id == VolumeContainer::getClassPropertyId())
|
||||
m_containerProperty = NULL;
|
||||
m_containerProperty = nullptr;
|
||||
else
|
||||
if (id == ContainedByProperty::getClassPropertyId())
|
||||
m_containedBy = NULL;
|
||||
m_containedBy = nullptr;
|
||||
else
|
||||
if (id == CollisionProperty::getClassPropertyId())
|
||||
m_collisionProperty = NULL;
|
||||
m_collisionProperty = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2453,7 +2453,7 @@ void Object::lookAt_o (const Vector &position_o, const Vector &j_o)
|
||||
|
||||
void Object::setAppearanceByName(char const *path)
|
||||
{
|
||||
if (path != NULL)
|
||||
if (path != nullptr)
|
||||
{
|
||||
if (TreeFile::exists(path))
|
||||
{
|
||||
@@ -2461,7 +2461,7 @@ void Object::setAppearanceByName(char const *path)
|
||||
|
||||
Appearance *appearance = AppearanceTemplateList::createAppearance(path);
|
||||
|
||||
if (appearance != NULL)
|
||||
if (appearance != nullptr)
|
||||
{
|
||||
setAppearance(appearance);
|
||||
} else {
|
||||
@@ -2475,7 +2475,7 @@ void Object::setAppearanceByName(char const *path)
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("Object::setAppearanceByName() - NULL appearance path specified for object: %s", (getObjectTemplateName() == NULL) ? "" : getObjectTemplateName()));
|
||||
DEBUG_WARNING(true, ("Object::setAppearanceByName() - nullptr appearance path specified for object: %s", (getObjectTemplateName() == nullptr) ? "" : getObjectTemplateName()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2539,7 +2539,7 @@ SlottedContainer * Object::getSlottedContainerProperty()
|
||||
Container *container = getContainerProperty();
|
||||
if (container && container->getPropertyId() == SlottedContainer::getClassPropertyId())
|
||||
return safe_cast<SlottedContainer *>(container);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2549,7 +2549,7 @@ SlottedContainer const * Object::getSlottedContainerProperty() const
|
||||
Container const *container = getContainerProperty();
|
||||
if (container && container->getPropertyId() == SlottedContainer::getClassPropertyId())
|
||||
return safe_cast<SlottedContainer const *>(container);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2559,7 +2559,7 @@ VolumeContainer * Object::getVolumeContainerProperty()
|
||||
Container *container = getContainerProperty();
|
||||
if (container && container->getPropertyId() == VolumeContainer::getClassPropertyId())
|
||||
return safe_cast<VolumeContainer *>(container);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2569,7 +2569,7 @@ VolumeContainer const * Object::getVolumeContainerProperty() const
|
||||
Container const *container = getContainerProperty();
|
||||
if (container && container->getPropertyId() == VolumeContainer::getClassPropertyId())
|
||||
return safe_cast<VolumeContainer const *>(container);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2579,7 +2579,7 @@ CellProperty * Object::getCellProperty()
|
||||
Container *container = getContainerProperty();
|
||||
if (container && container->getPropertyId() == CellProperty::getClassPropertyId())
|
||||
return safe_cast<CellProperty *>(container);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2589,7 +2589,7 @@ CellProperty const * Object::getCellProperty() const
|
||||
Container const *container = getContainerProperty();
|
||||
if (container && container->getPropertyId() == CellProperty::getClassPropertyId())
|
||||
return safe_cast<CellProperty const *>(container);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2599,7 +2599,7 @@ PortalProperty * Object::getPortalProperty()
|
||||
Container *container = getContainerProperty();
|
||||
if (container && container->getPropertyId() == PortalProperty::getClassPropertyId())
|
||||
return safe_cast<PortalProperty *>(container);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2609,7 +2609,7 @@ PortalProperty const * Object::getPortalProperty() const
|
||||
Container const *container = getContainerProperty();
|
||||
if (container && container->getPropertyId() == PortalProperty::getClassPropertyId())
|
||||
return safe_cast<PortalProperty const *>(container);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2658,7 +2658,7 @@ ServerObject const * Object::asServerObject() const
|
||||
|
||||
bool Object::hasScheduleData() const
|
||||
{
|
||||
return (m_scheduleData != NULL);
|
||||
return (m_scheduleData != nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2697,7 +2697,7 @@ void Object::setMostRecentAlterTime(ScheduleTime mostRecentAlterTime)
|
||||
|
||||
bool Object::isInAlterNextFrameList() const
|
||||
{
|
||||
return (m_scheduleData == NULL) ? false : (m_scheduleData->getAlterNextFrameNext() != NULL) || (m_scheduleData->getAlterNextFramePrevious() != NULL);
|
||||
return (m_scheduleData == nullptr) ? false : (m_scheduleData->getAlterNextFrameNext() != nullptr) || (m_scheduleData->getAlterNextFramePrevious() != nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2708,7 +2708,7 @@ void Object::insertIntoAlterNextFrameList(Object *afterThisObject)
|
||||
DEBUG_FATAL(isInAlterNextFrameList(), ("insertIntoAlterNextFrameList(): object id=[%s],template=[%s] already in AlterNextFrame list.", getNetworkId().getValueString().c_str(), getObjectTemplateName()));
|
||||
NOT_NULL(afterThisObject);
|
||||
NOT_NULL(afterThisObject->m_scheduleData);
|
||||
DEBUG_FATAL(afterThisObject->m_scheduleData->getAlterNextFrameNext() && !afterThisObject->m_scheduleData->getAlterNextFrameNext()->m_scheduleData, ("Non-NULL forward link does not have schedule data."));
|
||||
DEBUG_FATAL(afterThisObject->m_scheduleData->getAlterNextFrameNext() && !afterThisObject->m_scheduleData->getAlterNextFrameNext()->m_scheduleData, ("Non-nullptr forward link does not have schedule data."));
|
||||
DEBUG_FATAL(afterThisObject->m_scheduleData->getAlterNextFrameNext() && (afterThisObject->m_scheduleData->getAlterNextFrameNext()->m_scheduleData->getAlterNextFramePrevious() != afterThisObject), ("List corruption: alter next frame."));
|
||||
|
||||
//-- Get new next and previous object for the list.
|
||||
@@ -2745,13 +2745,13 @@ void Object::removeFromAlterNextFrameList()
|
||||
DEBUG_FATAL(newNext && !newNext->m_scheduleData, ("Next node missing schedule data."));
|
||||
|
||||
//-- Handle previous.
|
||||
m_scheduleData->setAlterNextFramePrevious(NULL);
|
||||
m_scheduleData->setAlterNextFramePrevious(nullptr);
|
||||
if (newPrevious)
|
||||
newPrevious->m_scheduleData->setAlterNextFrameNext(newNext);
|
||||
|
||||
|
||||
//-- Handle next.
|
||||
m_scheduleData->setAlterNextFrameNext(NULL);
|
||||
m_scheduleData->setAlterNextFrameNext(nullptr);
|
||||
if (newNext)
|
||||
newNext->m_scheduleData->setAlterNextFramePrevious(newPrevious);
|
||||
|
||||
@@ -2766,7 +2766,7 @@ void Object::removeFromAlterNextFrameList()
|
||||
|
||||
int Object::getAlterSchedulePhase() const
|
||||
{
|
||||
DEBUG_FATAL(m_scheduleData == NULL, ("calling Object::getAlterSchedulePhase() when Object has no schedule data: id=[%s], template=[%s]", getNetworkId().getValueString().c_str(), getObjectTemplateName()));
|
||||
DEBUG_FATAL(m_scheduleData == nullptr, ("calling Object::getAlterSchedulePhase() when Object has no schedule data: id=[%s], template=[%s]", getNetworkId().getValueString().c_str(), getObjectTemplateName()));
|
||||
return m_scheduleData->getSchedulePhase();
|
||||
}
|
||||
|
||||
@@ -2774,7 +2774,7 @@ int Object::getAlterSchedulePhase() const
|
||||
|
||||
void Object::setAlterSchedulePhase(int schedulePhaseIndex)
|
||||
{
|
||||
DEBUG_FATAL(m_scheduleData == NULL, ("calling Object::setAlterSchedulePhase() when Object has no schedule data: id=[%s], template=[%s]", getNetworkId().getValueString().c_str(), getObjectTemplateName()));
|
||||
DEBUG_FATAL(m_scheduleData == nullptr, ("calling Object::setAlterSchedulePhase() when Object has no schedule data: id=[%s], template=[%s]", getNetworkId().getValueString().c_str(), getObjectTemplateName()));
|
||||
m_scheduleData->setSchedulePhase(schedulePhaseIndex);
|
||||
}
|
||||
|
||||
@@ -2782,7 +2782,7 @@ void Object::setAlterSchedulePhase(int schedulePhaseIndex)
|
||||
|
||||
bool Object::isInAlterNowList() const
|
||||
{
|
||||
return (m_scheduleData == NULL) ? false : (m_scheduleData->getAlterNowNext() != NULL) || (m_scheduleData->getAlterNowPrevious() != NULL);
|
||||
return (m_scheduleData == nullptr) ? false : (m_scheduleData->getAlterNowNext() != nullptr) || (m_scheduleData->getAlterNowPrevious() != nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2793,7 +2793,7 @@ void Object::insertIntoAlterNowList(Object *afterThisObject)
|
||||
DEBUG_FATAL(isInAlterNowList(), ("insertIntoAlterNowList(): object id=[%s],template=[%s] already in AlterNow list.", getNetworkId().getValueString().c_str(), getObjectTemplateName()));
|
||||
NOT_NULL(afterThisObject);
|
||||
NOT_NULL(afterThisObject->m_scheduleData);
|
||||
DEBUG_FATAL(afterThisObject->m_scheduleData->getAlterNowNext() && !afterThisObject->m_scheduleData->getAlterNowNext()->m_scheduleData, ("Non-NULL forward link does not have schedule data."));
|
||||
DEBUG_FATAL(afterThisObject->m_scheduleData->getAlterNowNext() && !afterThisObject->m_scheduleData->getAlterNowNext()->m_scheduleData, ("Non-nullptr forward link does not have schedule data."));
|
||||
DEBUG_FATAL(afterThisObject->m_scheduleData->getAlterNowNext() && (afterThisObject->m_scheduleData->getAlterNowNext()->m_scheduleData->getAlterNowPrevious() != afterThisObject), ("List corruption: alter now."));
|
||||
|
||||
//-- Get new next and previous object for the list.
|
||||
@@ -2830,12 +2830,12 @@ void Object::removeFromAlterNowList()
|
||||
DEBUG_FATAL(newNext && !newNext->m_scheduleData, ("Next node missing schedule data."));
|
||||
|
||||
//-- Handle previous.
|
||||
m_scheduleData->setAlterNowPrevious(NULL);
|
||||
m_scheduleData->setAlterNowPrevious(nullptr);
|
||||
if (newPrevious)
|
||||
newPrevious->m_scheduleData->setAlterNowNext(newNext);
|
||||
|
||||
//-- Handle next.
|
||||
m_scheduleData->setAlterNowNext(NULL);
|
||||
m_scheduleData->setAlterNowNext(nullptr);
|
||||
if (newNext)
|
||||
newNext->m_scheduleData->setAlterNowPrevious(newPrevious);
|
||||
|
||||
@@ -2849,7 +2849,7 @@ void Object::removeFromAlterNowList()
|
||||
|
||||
bool Object::isInConcludeList() const
|
||||
{
|
||||
return (m_scheduleData == NULL) ? false : (m_scheduleData->getConcludeNext() != NULL) || (m_scheduleData->getConcludePrevious() != NULL);
|
||||
return (m_scheduleData == nullptr) ? false : (m_scheduleData->getConcludeNext() != nullptr) || (m_scheduleData->getConcludePrevious() != nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -2860,7 +2860,7 @@ void Object::insertIntoConcludeList(Object *afterThisObject)
|
||||
DEBUG_FATAL(isInConcludeList(), ("insertIntoConcludeList(): object id=[%s],template=[%s] already in Conclude list.", getNetworkId().getValueString().c_str(), getObjectTemplateName()));
|
||||
NOT_NULL(afterThisObject);
|
||||
NOT_NULL(afterThisObject->m_scheduleData);
|
||||
DEBUG_FATAL(afterThisObject->m_scheduleData->getConcludeNext() && !afterThisObject->m_scheduleData->getConcludeNext()->m_scheduleData, ("Non-NULL forward link does not have schedule data."));
|
||||
DEBUG_FATAL(afterThisObject->m_scheduleData->getConcludeNext() && !afterThisObject->m_scheduleData->getConcludeNext()->m_scheduleData, ("Non-nullptr forward link does not have schedule data."));
|
||||
DEBUG_FATAL(afterThisObject->m_scheduleData->getConcludeNext() && (afterThisObject->m_scheduleData->getConcludeNext()->m_scheduleData->getConcludePrevious() != afterThisObject), ("List corruption: alter now."));
|
||||
|
||||
//-- Get new next and previous object for the list.
|
||||
@@ -2897,12 +2897,12 @@ void Object::removeFromConcludeList()
|
||||
DEBUG_FATAL(newNext && !newNext->m_scheduleData, ("Next node missing schedule data."));
|
||||
|
||||
//-- Handle previous.
|
||||
m_scheduleData->setConcludePrevious(NULL);
|
||||
m_scheduleData->setConcludePrevious(nullptr);
|
||||
if (newPrevious)
|
||||
newPrevious->m_scheduleData->setConcludeNext(newNext);
|
||||
|
||||
//-- Handle next.
|
||||
m_scheduleData->setConcludeNext(NULL);
|
||||
m_scheduleData->setConcludeNext(nullptr);
|
||||
if (newNext)
|
||||
newNext->m_scheduleData->setConcludePrevious(newPrevious);
|
||||
|
||||
@@ -3015,7 +3015,7 @@ void Object::scheduleForAlter_scheduleTopmostWorldParent()
|
||||
do
|
||||
{
|
||||
//-- Traverse parent links until there is no more parent.
|
||||
for (Object *parentObject = alterObject->getParent(); parentObject != NULL; parentObject = alterObject->getParent())
|
||||
for (Object *parentObject = alterObject->getParent(); parentObject != nullptr; parentObject = alterObject->getParent())
|
||||
alterObject = parentObject;
|
||||
|
||||
//-- Traverse container until we're at a container object that is in the world.
|
||||
@@ -3035,7 +3035,7 @@ void Object::scheduleForAlter_scheduleTopmostWorldParent()
|
||||
if (alterObject->isInWorld())
|
||||
{
|
||||
// We're done searching.
|
||||
containedByProperty = NULL;
|
||||
containedByProperty = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3052,7 +3052,7 @@ void Object::scheduleForAlter_scheduleTopmostWorldParent()
|
||||
|
||||
// New container might be a child object, make sure we test for a parent again.
|
||||
// If a parent exists, we need to run through the loop again to find the parent object.
|
||||
} while (alterObject->getParent() != NULL);
|
||||
} while (alterObject->getParent() != nullptr);
|
||||
|
||||
NOT_NULL(alterObject);
|
||||
if (alterObject->isInitialized())
|
||||
@@ -3270,13 +3270,13 @@ void Object::setAlternateAppearance(const char * path)
|
||||
if(!path)
|
||||
return;
|
||||
|
||||
Appearance *alternateAppearance = NULL;
|
||||
Appearance *alternateAppearance = nullptr;
|
||||
|
||||
if (TreeFile::exists(path))
|
||||
{
|
||||
alternateAppearance = AppearanceTemplateList::createAppearance(path);
|
||||
|
||||
if (alternateAppearance == NULL) {
|
||||
if (alternateAppearance == nullptr) {
|
||||
DEBUG_WARNING(true, ("Object::setAlternateAppearance() - Unable to change the object's appearance because the file does not exist: %s", path));
|
||||
return;
|
||||
}
|
||||
@@ -3313,7 +3313,7 @@ void Object::setAlternateAppearance(const char * path)
|
||||
|
||||
delete m_alternateAppearance;
|
||||
|
||||
m_alternateAppearance = NULL;
|
||||
m_alternateAppearance = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -495,7 +495,7 @@ inline const ObjectTemplate *Object::getObjectTemplate() const
|
||||
//
|
||||
// Remarks:
|
||||
//
|
||||
// This return may return NULL.
|
||||
// This return may return nullptr.
|
||||
|
||||
inline const char *Object::getDebugName() const
|
||||
{
|
||||
@@ -518,7 +518,7 @@ inline const Vector &Object::getScale() const
|
||||
/**
|
||||
* Get the controller for an object.
|
||||
*
|
||||
* The return value may be NULL.
|
||||
* The return value may be nullptr.
|
||||
*
|
||||
* @return Const pointer to the controller
|
||||
*/
|
||||
@@ -532,7 +532,7 @@ inline const Controller *Object::getController() const
|
||||
/**
|
||||
* Get the controller for an object.
|
||||
*
|
||||
* The return value may be NULL.
|
||||
* The return value may be nullptr.
|
||||
*
|
||||
* @return Non-const pointer to the controller
|
||||
*/
|
||||
@@ -546,7 +546,7 @@ inline Controller *Object::getController()
|
||||
/**
|
||||
* Get the dynamics for an object.
|
||||
*
|
||||
* The return value may be NULL.
|
||||
* The return value may be nullptr.
|
||||
*
|
||||
* @return Const pointer to the dynamics
|
||||
*/
|
||||
@@ -560,7 +560,7 @@ inline const Dynamics *Object::getDynamics() const
|
||||
/**
|
||||
* Get the dynamics for an object.
|
||||
*
|
||||
* The return value may be NULL.
|
||||
* The return value may be nullptr.
|
||||
*
|
||||
* @return Non-const pointer to the dynamics
|
||||
*/
|
||||
@@ -598,24 +598,24 @@ inline Appearance *Object::getAppearance()
|
||||
/**
|
||||
* Get the parent object for this object.
|
||||
*
|
||||
* This routine will return NULL if the object is not a child object.
|
||||
* This routine will return nullptr if the object is not a child object.
|
||||
*/
|
||||
|
||||
inline Object *Object::getParent()
|
||||
{
|
||||
return m_childObject ? m_attachedToObject : NULL;
|
||||
return m_childObject ? m_attachedToObject : nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/**
|
||||
* Get the parent object for this object.
|
||||
*
|
||||
* This routine will return NULL if the object is not a child object.
|
||||
* This routine will return nullptr if the object is not a child object.
|
||||
*/
|
||||
|
||||
inline const Object *Object::getParent() const
|
||||
{
|
||||
return m_childObject ? m_attachedToObject : NULL;
|
||||
return m_childObject ? m_attachedToObject : nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -63,7 +63,7 @@ ObjectList::~ObjectList()
|
||||
/**
|
||||
* Add an Object to the ObjectList.
|
||||
*
|
||||
* This routine will call Fatal in debug compiles if it is passed a NULL
|
||||
* This routine will call Fatal in debug compiles if it is passed a nullptr
|
||||
* object.
|
||||
*
|
||||
* This routine will call Fatal in debug compiles if the object list
|
||||
@@ -85,7 +85,7 @@ void ObjectList::addObject(Object *objectToAdd)
|
||||
/**
|
||||
* Remove an Object from the ObjectList.
|
||||
*
|
||||
* This routine will call Fatal in debug compiles if it is passed a NULL
|
||||
* This routine will call Fatal in debug compiles if it is passed a nullptr
|
||||
* object.
|
||||
*
|
||||
* @param objectToRemove Pointer to the object to remove
|
||||
@@ -113,13 +113,13 @@ void ObjectList::removeObjectByIndex(const Object* object, int index)
|
||||
// Remove the last item in the vector.
|
||||
m_objectVector->pop_back();
|
||||
|
||||
// NULL the object from the alter-safe object list.
|
||||
// nullptr the object from the alter-safe object list.
|
||||
uint size = m_alterSafeObjectVector->size();
|
||||
for (uint i = 0; i < size; ++i)
|
||||
{
|
||||
if ((*m_alterSafeObjectVector)[i] == object)
|
||||
{
|
||||
(*m_alterSafeObjectVector)[i] = NULL;
|
||||
(*m_alterSafeObjectVector)[i] = nullptr;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -224,7 +224,7 @@ float ObjectList::alter(real time)
|
||||
if (alterResult == AlterResult::cms_kill) //lint !e777 // Testing floats for equality // It's okay, we're using constants.
|
||||
{
|
||||
// Make sure the object is still in the object list before removing it
|
||||
if ((*m_alterSafeObjectVector)[i] != NULL)
|
||||
if ((*m_alterSafeObjectVector)[i] != nullptr)
|
||||
removeObject(obj);
|
||||
delete obj;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ ObjectTemplate::ObjectTemplate(const std::string & filename) :
|
||||
{
|
||||
//-- Track name of most recently loading object template name to give us more
|
||||
// data to work with when we receive crash info.
|
||||
IGNORE_RETURN(snprintf(s_crashReportInfoConstructor, sizeof(s_crashReportInfoConstructor) - 1, "ObjectTemplate_Constructor: %s\n", !filename.empty() ? filename.c_str() : "<NULL>"));
|
||||
IGNORE_RETURN(snprintf(s_crashReportInfoConstructor, sizeof(s_crashReportInfoConstructor) - 1, "ObjectTemplate_Constructor: %s\n", !filename.empty() ? filename.c_str() : "<nullptr>"));
|
||||
s_crashReportInfoConstructor[sizeof(s_crashReportInfoConstructor) - 1] = '\0';
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ Object *ObjectTemplate::createObject() const
|
||||
*/
|
||||
void ObjectTemplate::addReference() const
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->addReference();
|
||||
|
||||
DataResource::addReference();
|
||||
@@ -178,7 +178,7 @@ void ObjectTemplate::addReference() const
|
||||
*/
|
||||
void ObjectTemplate::releaseReference() const
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
|
||||
DataResource::releaseReference();
|
||||
@@ -199,7 +199,7 @@ void ObjectTemplate::loadFromIff(Iff &iff)
|
||||
//-- Track name of most recently loading object template name to give us more
|
||||
// data to work with when we receive crash info.
|
||||
char const *const filename = iff.getFileName();
|
||||
IGNORE_RETURN(snprintf(s_crashReportInfoLoadFromIff, sizeof(s_crashReportInfoLoadFromIff) - 1, "ObjectTemplate_Iff: %s\n", (filename && *filename) ? filename : "<NULL>"));
|
||||
IGNORE_RETURN(snprintf(s_crashReportInfoLoadFromIff, sizeof(s_crashReportInfoLoadFromIff) - 1, "ObjectTemplate_Iff: %s\n", (filename && *filename) ? filename : "<nullptr>"));
|
||||
s_crashReportInfoLoadFromIff[sizeof(s_crashReportInfoLoadFromIff) - 1] = '\0';
|
||||
|
||||
preLoad();
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
typedef DataResourceList<ObjectTemplate> ObjectTemplateListDataResourceList;
|
||||
|
||||
template <> ObjectTemplateListDataResourceList::CreateDataResourceMap *ObjectTemplateListDataResourceList::ms_bindings = NULL;
|
||||
template <> ObjectTemplateListDataResourceList::LoadedDataResourceMap *ObjectTemplateListDataResourceList::ms_loaded = NULL;
|
||||
template <> ObjectTemplateListDataResourceList::CreateDataResourceMap *ObjectTemplateListDataResourceList::ms_bindings = nullptr;
|
||||
template <> ObjectTemplateListDataResourceList::LoadedDataResourceMap *ObjectTemplateListDataResourceList::ms_loaded = nullptr;
|
||||
|
||||
namespace ObjectTemplateListNamespace
|
||||
{
|
||||
|
||||
@@ -20,12 +20,12 @@ MEMORY_BLOCK_MANAGER_IMPLEMENTATION_WITH_INSTALL(ScheduleData, true, 0, 0, 0);
|
||||
|
||||
ScheduleData::ScheduleData(AlterScheduler::ScheduleTime initialMostRecentAlterTime):
|
||||
m_mostRecentAlterTime(initialMostRecentAlterTime),
|
||||
m_alterNowNext(NULL),
|
||||
m_alterNowPrevious(NULL),
|
||||
m_alterNextFrameNext(NULL),
|
||||
m_alterNextFramePrevious(NULL),
|
||||
m_concludeNext(NULL),
|
||||
m_concludePrevious(NULL),
|
||||
m_alterNowNext(nullptr),
|
||||
m_alterNowPrevious(nullptr),
|
||||
m_alterNextFrameNext(nullptr),
|
||||
m_alterNextFramePrevious(nullptr),
|
||||
m_concludeNext(nullptr),
|
||||
m_concludePrevious(nullptr),
|
||||
m_scheduleTimeMapIterator(),
|
||||
m_schedulePhase(0)
|
||||
{
|
||||
|
||||
@@ -70,14 +70,14 @@ namespace CellPropertyNamespace
|
||||
Object *ms_worldCellObject;
|
||||
Notification ms_portalCrossingNotification;
|
||||
bool ms_renderPortals;
|
||||
CellProperty::CreateDpvsCellHookFunction ms_createDpvsCellHookFunction = NULL;
|
||||
CellProperty::DestroyDpvsCellHookFunction ms_destroyDpvsCellHookFunction = NULL;
|
||||
CellProperty::AddToRenderWorldHookFunction ms_addToRenderWorldHook = NULL;
|
||||
CellProperty::CreateDpvsCellHookFunction ms_createDpvsCellHookFunction = nullptr;
|
||||
CellProperty::DestroyDpvsCellHookFunction ms_destroyDpvsCellHookFunction = nullptr;
|
||||
CellProperty::AddToRenderWorldHookFunction ms_addToRenderWorldHook = nullptr;
|
||||
|
||||
CellProperty::PolyAppearanceFactory ms_portalBarrierFactory = NULL;
|
||||
CellProperty::PolyAppearanceFactory ms_forceFieldFactory = NULL;
|
||||
CellProperty::PolyAppearanceFactory ms_portalBarrierFactory = nullptr;
|
||||
CellProperty::PolyAppearanceFactory ms_forceFieldFactory = nullptr;
|
||||
|
||||
CellProperty::AccessAllowedHookFunction ms_accessAllowedHookFunction = NULL;
|
||||
CellProperty::AccessAllowedHookFunction ms_accessAllowedHookFunction = nullptr;
|
||||
}
|
||||
using namespace CellPropertyNamespace;
|
||||
|
||||
@@ -86,9 +86,9 @@ using namespace CellPropertyNamespace;
|
||||
bool CellPropertyNamespace::Notification::ms_enabled = true;
|
||||
|
||||
CellProperty *CellProperty::ms_worldCellProperty;
|
||||
CellProperty::TextureFetch CellProperty::ms_textureFetch = NULL;
|
||||
CellProperty::TextureRelease CellProperty::ms_textureRelease = NULL;
|
||||
CellProperty::DeleteVisibleCellProperty CellProperty::ms_deleteVisibleCellProperty = NULL;
|
||||
CellProperty::TextureFetch CellProperty::ms_textureFetch = nullptr;
|
||||
CellProperty::TextureRelease CellProperty::ms_textureRelease = nullptr;
|
||||
CellProperty::DeleteVisibleCellProperty CellProperty::ms_deleteVisibleCellProperty = nullptr;
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -148,9 +148,9 @@ bool CellPropertyNamespace::Notification::positionChanged(Object &object, bool c
|
||||
start += objUpW;
|
||||
end += objUpW;
|
||||
|
||||
CellProperty *targetCell = NULL;
|
||||
CellProperty *targetCell = nullptr;
|
||||
|
||||
CellProperty *lastCell = NULL;
|
||||
CellProperty *lastCell = nullptr;
|
||||
CellProperty *currentCell = object.getParentCell();
|
||||
|
||||
while(currentCell)
|
||||
@@ -163,7 +163,7 @@ bool CellPropertyNamespace::Notification::positionChanged(Object &object, bool c
|
||||
|
||||
if(time == 1.0f) break;
|
||||
|
||||
if(nextCell == NULL) break;
|
||||
if(nextCell == nullptr) break;
|
||||
if(nextCell == currentCell) break;
|
||||
if(nextCell == lastCell) break;
|
||||
|
||||
@@ -235,8 +235,8 @@ void CellProperty::install()
|
||||
void CellProperty::remove()
|
||||
{
|
||||
delete ms_worldCellObject;
|
||||
ms_worldCellObject = NULL;
|
||||
ms_worldCellProperty = NULL;
|
||||
ms_worldCellObject = nullptr;
|
||||
ms_worldCellProperty = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -282,7 +282,7 @@ Appearance *CellProperty::createPortalBarrier(VertexList const & verts, const Ve
|
||||
if (ms_portalBarrierFactory)
|
||||
return ms_portalBarrierFactory(verts,color);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -292,7 +292,7 @@ Appearance *CellProperty::createForceField(VertexList const & verts, const Vecto
|
||||
if (ms_forceFieldFactory)
|
||||
return ms_forceFieldFactory(verts,color);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -342,24 +342,24 @@ void CellProperty::setPortalTransitionsEnabled(bool enabled)
|
||||
|
||||
CellProperty::CellProperty(Object &owner)
|
||||
: Container(getClassPropertyId(), owner),
|
||||
m_portalProperty(NULL),
|
||||
m_portalProperty(nullptr),
|
||||
m_cellIndex(-1),
|
||||
m_appearanceObject(NULL),
|
||||
m_appearanceObject(nullptr),
|
||||
m_portalObjectList(new PortalObjectList),
|
||||
m_visible(false),
|
||||
m_floor(NULL),
|
||||
m_cellName(NULL),
|
||||
m_floor(nullptr),
|
||||
m_cellName(nullptr),
|
||||
m_cellNameCrc(0),
|
||||
m_dpvsCell(NULL),
|
||||
m_environmentTexture(NULL),
|
||||
m_dpvsCell(nullptr),
|
||||
m_environmentTexture(nullptr),
|
||||
m_fogEnabled(false),
|
||||
m_fogColor(0),
|
||||
m_fogDensity(0.f),
|
||||
m_appliedInteriorLayout(false),
|
||||
m_preVisibilityTraversalRenderHookFunctionList(NULL),
|
||||
m_enterRenderHookFunctionList(NULL),
|
||||
m_preDrawRenderHookFunctionList(NULL),
|
||||
m_exitRenderHookFunctionList(NULL)
|
||||
m_preVisibilityTraversalRenderHookFunctionList(nullptr),
|
||||
m_enterRenderHookFunctionList(nullptr),
|
||||
m_preDrawRenderHookFunctionList(nullptr),
|
||||
m_exitRenderHookFunctionList(nullptr)
|
||||
{
|
||||
if (ms_createDpvsCellHookFunction)
|
||||
m_dpvsCell = (*ms_createDpvsCellHookFunction)(this);
|
||||
@@ -379,7 +379,7 @@ CellProperty::~CellProperty()
|
||||
{
|
||||
NOT_NULL(ms_textureRelease);
|
||||
ms_textureRelease(m_environmentTexture);
|
||||
m_environmentTexture = NULL;
|
||||
m_environmentTexture = nullptr;
|
||||
}
|
||||
|
||||
if (!m_portalObjectList->empty())
|
||||
@@ -391,18 +391,18 @@ CellProperty::~CellProperty()
|
||||
delete portalList;
|
||||
}
|
||||
|
||||
m_portalProperty = NULL;
|
||||
m_portalProperty = nullptr;
|
||||
delete m_appearanceObject;
|
||||
delete m_portalObjectList;
|
||||
delete m_floor;
|
||||
m_cellName = NULL;
|
||||
m_cellName = nullptr;
|
||||
m_cellNameCrc = 0;
|
||||
|
||||
if (m_dpvsCell)
|
||||
{
|
||||
NOT_NULL(ms_destroyDpvsCellHookFunction);
|
||||
(*ms_destroyDpvsCellHookFunction)(m_dpvsCell);
|
||||
m_dpvsCell = NULL;
|
||||
m_dpvsCell = nullptr;
|
||||
}
|
||||
|
||||
delete m_preVisibilityTraversalRenderHookFunctionList;
|
||||
@@ -432,7 +432,7 @@ void CellProperty::initialize(const PortalProperty &portalProperty, int cellInde
|
||||
m_appearanceObject->attachToObject_p(&getOwner(), true);
|
||||
Appearance * const appearance = AppearanceTemplateList::createAppearance(cellTemplate.getAppearanceName());
|
||||
|
||||
if (appearance != NULL) {
|
||||
if (appearance != nullptr) {
|
||||
appearance->setShadowBlobAllowed();
|
||||
m_appearanceObject->setAppearance(appearance);
|
||||
|
||||
@@ -448,7 +448,7 @@ void CellProperty::initialize(const PortalProperty &portalProperty, int cellInde
|
||||
|
||||
if (cellTemplate.getFloorName())
|
||||
{
|
||||
m_floor = FloorManager::createFloor(cellTemplate.getFloorName(),&getOwner(),NULL,false);
|
||||
m_floor = FloorManager::createFloor(cellTemplate.getFloorName(),&getOwner(),nullptr,false);
|
||||
WARNING(!m_floor, ("Cell %s could not load floor %s", cellTemplate.getAppearanceName(), cellTemplate.getFloorName()));
|
||||
}
|
||||
else
|
||||
@@ -622,8 +622,8 @@ bool CellProperty::areAdjacent(const CellProperty *cellProperty1, const CellProp
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if ( (cellProperty1 != NULL)
|
||||
&& (cellProperty2 != NULL))
|
||||
if ( (cellProperty1 != nullptr)
|
||||
&& (cellProperty2 != nullptr))
|
||||
{
|
||||
if (cellProperty1 == cellProperty2)
|
||||
{
|
||||
@@ -640,8 +640,8 @@ bool CellProperty::areAdjacent(const CellProperty *cellProperty1, const CellProp
|
||||
|
||||
result = false;
|
||||
}
|
||||
else if ( (cellProperty1->m_portalObjectList != NULL)
|
||||
&& (cellProperty2->m_portalObjectList != NULL))
|
||||
else if ( (cellProperty1->m_portalObjectList != nullptr)
|
||||
&& (cellProperty2->m_portalObjectList != nullptr))
|
||||
{
|
||||
// Pick the list that is not the world cell property, or the
|
||||
// smallest list
|
||||
@@ -657,7 +657,7 @@ bool CellProperty::areAdjacent(const CellProperty *cellProperty1, const CellProp
|
||||
checkCellProperty = cellProperty1;
|
||||
}
|
||||
|
||||
if (portalObjectList != NULL)
|
||||
if (portalObjectList != nullptr)
|
||||
{
|
||||
//DEBUG_REPORT_LOG((portalObjectList->size() > 1), ("Portal Object List > 1 - size: %d", portalObjectList->size()));
|
||||
|
||||
@@ -714,7 +714,7 @@ void CellProperty::releaseWorldCellPropertyEnvironmentTexture()
|
||||
*
|
||||
* @param startPosition Starting position, in the space of this cell.
|
||||
* @param endPosition Ending position, in the space of this cell.
|
||||
* @return The CellProperty that an object traversing the object is in. Will return NULL if remaining in this cell.
|
||||
* @return The CellProperty that an object traversing the object is in. Will return nullptr if remaining in this cell.
|
||||
*/
|
||||
|
||||
CellProperty *CellProperty::getDestinationCell(const Vector &startPosition, const Vector &endPosition, float &closestPortalT, bool passableOnly) const
|
||||
@@ -773,8 +773,8 @@ CellProperty *CellProperty::getDestinationCell(const Vector &startPosition, cons
|
||||
|
||||
CellProperty *CellProperty::getDestinationCell(const Object *object, int portalId) const
|
||||
{
|
||||
if(portalId < 0) return NULL;
|
||||
if(object == NULL) return NULL;
|
||||
if(portalId < 0) return nullptr;
|
||||
if(object == nullptr) return nullptr;
|
||||
|
||||
const PortalObjectList::const_iterator iEnd = m_portalObjectList->end();
|
||||
for (PortalObjectList::const_iterator i = m_portalObjectList->begin(); i != iEnd; ++i)
|
||||
@@ -796,13 +796,13 @@ CellProperty *CellProperty::getDestinationCell(const Object *object, int portalI
|
||||
{
|
||||
DEBUG_WARNING(true,("CellProperty::getDestinationCell(portalId) - tried to get an invalid portal\n"));
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return portalList[static_cast<PortalList::size_type>(portalId)]->getNeighbor()->getParentCell();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -840,7 +840,7 @@ bool CellProperty::getDestinationCells(const Sphere &sphere, std::vector<CellPro
|
||||
|
||||
const Portal *neighbor = portal->getNeighbor();
|
||||
|
||||
WARNING(neighbor == NULL,("CellProperty::getDestinationCells - Cell %s has a portal without a neighbor\n",getOwner().getNetworkId().getValueString().c_str()));
|
||||
WARNING(neighbor == nullptr,("CellProperty::getDestinationCells - Cell %s has a portal without a neighbor\n",getOwner().getNetworkId().getValueString().c_str()));
|
||||
|
||||
if(neighbor)
|
||||
{
|
||||
@@ -864,7 +864,7 @@ bool CellProperty::isAdjacentTo(const CellProperty *cell) const
|
||||
{
|
||||
if(this == cell) return true;
|
||||
|
||||
if(cell == NULL) return false;
|
||||
if(cell == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -964,7 +964,7 @@ const BaseExtent *CellProperty::getCollisionExtent() const
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -982,7 +982,7 @@ const BaseClass *CellProperty::getPathGraph() const
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1111,7 +1111,7 @@ void CellProperty::drawDebugShapes(DebugShapeRenderer * const renderer) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if (renderer == NULL)
|
||||
if (renderer == nullptr)
|
||||
return;
|
||||
|
||||
Floor const * const floor = getFloor();
|
||||
@@ -1192,7 +1192,7 @@ CellProperty::PortalObjectEntry const &CellProperty::getPortalObject(int index)
|
||||
|
||||
bool CellProperty::getAccessAllowed() const
|
||||
{
|
||||
if (ms_accessAllowedHookFunction != NULL)
|
||||
if (ms_accessAllowedHookFunction != nullptr)
|
||||
return (*ms_accessAllowedHookFunction)(*this);
|
||||
else
|
||||
return true;
|
||||
@@ -1286,7 +1286,7 @@ Vector const CellProperty::getPosition_w(Location const & location)
|
||||
Vector result = location.getCoordinates();
|
||||
CellProperty const * const worldCellProperty = CellProperty::getWorldCellProperty();
|
||||
|
||||
if (worldCellProperty != NULL)
|
||||
if (worldCellProperty != nullptr)
|
||||
{
|
||||
if (location.getCell() != worldCellProperty->getOwner().getNetworkId())
|
||||
{
|
||||
@@ -1295,7 +1295,7 @@ Vector const CellProperty::getPosition_w(Location const & location)
|
||||
|
||||
Object const * const cell = NetworkIdManager::getObjectById(location.getCell());
|
||||
|
||||
if (cell != NULL)
|
||||
if (cell != nullptr)
|
||||
{
|
||||
result = cell->rotateTranslate_o2w(location.getCoordinates());
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ void Portal::install()
|
||||
void Portal::remove()
|
||||
{
|
||||
delete ms_doorStyleTable;
|
||||
ms_doorStyleTable = NULL;
|
||||
ms_doorStyleTable = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -105,11 +105,11 @@ Portal::Portal(const PortalPropertyTemplateCellPortal &portalTemplate, CellPrope
|
||||
m_template(portalTemplate),
|
||||
m_relativeToObject(relativeTo),
|
||||
m_closed(false),
|
||||
m_neighbor(NULL),
|
||||
m_neighbor(nullptr),
|
||||
m_parentCell(parentCell),
|
||||
m_dpvsPortal(NULL),
|
||||
m_door(NULL),
|
||||
m_appearance(NULL)
|
||||
m_dpvsPortal(nullptr),
|
||||
m_door(nullptr),
|
||||
m_appearance(nullptr)
|
||||
{
|
||||
if(ms_createDoors)
|
||||
{
|
||||
@@ -126,13 +126,13 @@ Portal::~Portal()
|
||||
m_relativeToObject->removeDpvsObject(m_dpvsPortal);
|
||||
NOT_NULL(ms_destroyDpvsPortalHookFunction);
|
||||
(*ms_destroyDpvsPortalHookFunction)(m_dpvsPortal);
|
||||
m_dpvsPortal = NULL;
|
||||
m_dpvsPortal = nullptr;
|
||||
}
|
||||
|
||||
m_relativeToObject = NULL;
|
||||
m_neighbor = NULL;
|
||||
m_parentCell = NULL;
|
||||
m_door = NULL;
|
||||
m_relativeToObject = nullptr;
|
||||
m_neighbor = nullptr;
|
||||
m_parentCell = nullptr;
|
||||
m_door = nullptr;
|
||||
delete m_appearance;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,9 +57,9 @@ PropertyId PortalProperty::getClassPropertyId()
|
||||
|
||||
PortalProperty::PortalProperty(Object &owner, const char *fileName)
|
||||
: Container(getClassPropertyId(), owner),
|
||||
m_template(NULL),
|
||||
m_template(nullptr),
|
||||
m_cellList(new CellList),
|
||||
m_fixupList(NULL),
|
||||
m_fixupList(nullptr),
|
||||
m_hasPassablePortalToParentCell(false)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
@@ -67,7 +67,7 @@ PortalProperty::PortalProperty(Object &owner, const char *fileName)
|
||||
#endif // _DEBUG
|
||||
|
||||
m_template = PortalPropertyTemplateList::fetch(CrcLowerString(fileName));
|
||||
m_cellList->resize(static_cast<CellList::size_type>(m_template->getNumberOfCells()), NULL);
|
||||
m_cellList->resize(static_cast<CellList::size_type>(m_template->getNumberOfCells()), nullptr);
|
||||
|
||||
#ifdef _DEBUG
|
||||
DataLint::popAsset();
|
||||
@@ -139,7 +139,7 @@ void PortalProperty::addToWorld()
|
||||
int unloaded = 0;
|
||||
int const numberOfCells = static_cast<int>(m_cellList->size());
|
||||
for (int i = 1; i < numberOfCells; ++i)
|
||||
if ((*m_cellList)[static_cast<CellList::size_type>(i)] == NULL)
|
||||
if ((*m_cellList)[static_cast<CellList::size_type>(i)] == nullptr)
|
||||
{
|
||||
WARNING(true, ("cell %d/%d not loaded", i, numberOfCells));
|
||||
++unloaded;
|
||||
@@ -215,7 +215,7 @@ bool PortalProperty::serverEndBaselines(int serverObjectCrc, std::vector<Object*
|
||||
uint const numberOfCells = m_cellList->size();
|
||||
for (uint i = 1; i < numberOfCells; ++i)
|
||||
{
|
||||
if ((*m_cellList)[i] == NULL)
|
||||
if ((*m_cellList)[i] == nullptr)
|
||||
{
|
||||
Object *object = ms_beginCreateObjectFunction(static_cast<int>(i));
|
||||
IGNORE_RETURN(addToContents(*object, tmp));
|
||||
@@ -460,7 +460,7 @@ void PortalProperty::debugPrint(std::string &buffer) const
|
||||
void PortalProperty::createAppearance()
|
||||
{
|
||||
Appearance * const appearance = AppearanceTemplateList::createAppearance(m_template->getExteriorAppearanceName());
|
||||
if (appearance != NULL) {
|
||||
if (appearance != nullptr) {
|
||||
appearance->setShadowBlobAllowed();
|
||||
getOwner().setAppearance(appearance);
|
||||
} else {
|
||||
@@ -563,7 +563,7 @@ CellProperty *PortalProperty::getCell(const char *desiredCellName)
|
||||
return (*m_cellList)[static_cast<CellList::size_type>(i)];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
typedef BaseClass * (*ExpandBuildingGraphHook)( PortalPropertyTemplate * portalTemplate, BaseClass * baseBuildingGraph );
|
||||
|
||||
ExpandBuildingGraphHook g_expandBuildingGraphHook = NULL;
|
||||
ExpandBuildingGraphHook g_expandBuildingGraphHook = nullptr;
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -257,8 +257,8 @@ PortalPropertyTemplateCellPortal::PortalPropertyTemplateCellPortal(const PortalP
|
||||
m_disabled(false),
|
||||
m_passable(false),
|
||||
m_geometryWindingClockwise(true),
|
||||
m_portalGeometry(NULL),
|
||||
m_doorStyle(NULL),
|
||||
m_portalGeometry(nullptr),
|
||||
m_doorStyle(nullptr),
|
||||
m_hasDoorHardpoint(false),
|
||||
m_doorHardpoint(),
|
||||
m_plane(),
|
||||
@@ -272,7 +272,7 @@ PortalPropertyTemplateCellPortal::PortalPropertyTemplateCellPortal(const PortalP
|
||||
|
||||
PortalPropertyTemplateCellPortal::~PortalPropertyTemplateCellPortal()
|
||||
{
|
||||
m_portalGeometry = NULL;
|
||||
m_portalGeometry = nullptr;
|
||||
delete [] m_doorStyle;
|
||||
|
||||
if (m_preloadManager)
|
||||
@@ -524,14 +524,14 @@ PortalPropertyTemplateCell::PreloadManager::~PreloadManager ()
|
||||
|
||||
PortalPropertyTemplateCell::PortalPropertyTemplateCell(const PortalPropertyTemplate &portalPropertyTemplate, int index, Iff &iff)
|
||||
:
|
||||
m_name(NULL),
|
||||
m_appearanceName(NULL),
|
||||
m_floorName(NULL),
|
||||
m_floorMesh(NULL),
|
||||
m_name(nullptr),
|
||||
m_appearanceName(nullptr),
|
||||
m_floorName(nullptr),
|
||||
m_floorMesh(nullptr),
|
||||
m_canSeeParentCell(false),
|
||||
m_lightList(NULL),
|
||||
m_lightList(nullptr),
|
||||
m_portalList(new PortalPropertyTemplateCellPortalList),
|
||||
m_collisionExtent(NULL),
|
||||
m_collisionExtent(nullptr),
|
||||
m_preloadManager (0)
|
||||
{
|
||||
load(portalPropertyTemplate, index, iff);
|
||||
@@ -556,7 +556,7 @@ PortalPropertyTemplateCell::~PortalPropertyTemplateCell()
|
||||
}
|
||||
|
||||
delete m_collisionExtent;
|
||||
m_collisionExtent = NULL;
|
||||
m_collisionExtent = nullptr;
|
||||
|
||||
if (m_preloadManager)
|
||||
{
|
||||
@@ -567,7 +567,7 @@ PortalPropertyTemplateCell::~PortalPropertyTemplateCell()
|
||||
if (m_floorMesh)
|
||||
{
|
||||
m_floorMesh->releaseReference ();
|
||||
m_floorMesh = NULL;
|
||||
m_floorMesh = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,7 +875,7 @@ const char *PortalPropertyTemplateCell::getFloorName() const
|
||||
|
||||
FloorMesh const * PortalPropertyTemplateCell::getFloorMesh() const
|
||||
{
|
||||
if(m_floorMesh == NULL)
|
||||
if(m_floorMesh == nullptr)
|
||||
{
|
||||
if(m_floorName)
|
||||
{
|
||||
@@ -885,7 +885,7 @@ FloorMesh const * PortalPropertyTemplateCell::getFloorMesh() const
|
||||
}
|
||||
else
|
||||
{
|
||||
//-- cell template r0 always has a null floor name for POBs without accessible exteriors (POB ships & POB-only dungeons)
|
||||
//-- cell template r0 always has a nullptr floor name for POBs without accessible exteriors (POB ships & POB-only dungeons)
|
||||
//-- don't warn for that cell template
|
||||
DEBUG_WARNING(ConfigSharedCollision::getReportWarnings() && strcmp(m_name, "r0"),
|
||||
("PortalPropertyTemplateCell::getFloorMesh() - Cell template %s on [%s] has no floor name", m_name, m_appearanceName));
|
||||
@@ -1039,7 +1039,7 @@ PortalPropertyTemplate::PortalPropertyTemplate(const CrcString &name)
|
||||
m_cellList(new CellList),
|
||||
m_cellNameList(new CellNameList),
|
||||
m_crc(0),
|
||||
m_pathGraph(NULL),
|
||||
m_pathGraph(nullptr),
|
||||
m_radarPortalGeometry(0)
|
||||
{
|
||||
FileName shortName(name.getString());
|
||||
@@ -1079,7 +1079,7 @@ PortalPropertyTemplate::~PortalPropertyTemplate()
|
||||
delete m_portalOwnersList;
|
||||
|
||||
delete m_pathGraph;
|
||||
m_pathGraph = NULL;
|
||||
m_pathGraph = nullptr;
|
||||
|
||||
delete m_radarPortalGeometry;
|
||||
m_radarPortalGeometry = 0;
|
||||
|
||||
@@ -373,14 +373,14 @@ inline void SphereGrid<ObjectType, ExtentAccessor>::findInRangeCapsule( Object c
|
||||
template<class ObjectType, class ExtentAccessor>
|
||||
inline void SphereGrid<ObjectType, ExtentAccessor>::findInRange( const Capsule & range, std::set<ObjectType> & results)
|
||||
{
|
||||
findInRangeCapsule( INVALID_POB, range, NULL, results );
|
||||
findInRangeCapsule( INVALID_POB, range, nullptr, results );
|
||||
}
|
||||
|
||||
|
||||
template<class ObjectType, class ExtentAccessor>
|
||||
inline void SphereGrid<ObjectType, ExtentAccessor>::findInRange( Vector const ¢er_w, float radius, std::set<ObjectType> & results)
|
||||
{
|
||||
findInRangeSphere( INVALID_POB, center_w, radius, NULL, results );
|
||||
findInRangeSphere( INVALID_POB, center_w, radius, nullptr, results );
|
||||
}
|
||||
|
||||
|
||||
@@ -401,7 +401,7 @@ inline void SphereGrid<ObjectType, ExtentAccessor>::findInRange( Vector const &c
|
||||
template<class ObjectType, class ExtentAccessor>
|
||||
inline void SphereGrid<ObjectType, ExtentAccessor>::findInRange( Object const *pob, Vector const ¢er_w, float radius, std::set<ObjectType> & results)
|
||||
{
|
||||
findInRangeSphere( pob, center_w, radius, NULL, results );
|
||||
findInRangeSphere( pob, center_w, radius, nullptr, results );
|
||||
}
|
||||
|
||||
template<class ObjectType, class ExtentAccessor>
|
||||
|
||||
@@ -23,7 +23,7 @@ PropertyId LayerProperty::getClassPropertyId()
|
||||
|
||||
LayerProperty::LayerProperty(Object& thisObject) :
|
||||
Property(getClassPropertyId(), thisObject),
|
||||
m_layer(NULL)
|
||||
m_layer(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ m_layer(NULL)
|
||||
|
||||
LayerProperty::~LayerProperty()
|
||||
{
|
||||
if (m_layer != NULL)
|
||||
if (m_layer != nullptr)
|
||||
{
|
||||
delete m_layer;
|
||||
m_layer = NULL;
|
||||
m_layer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ bool World::removeObject (const Object* object, int listIndex)
|
||||
{
|
||||
DEBUG_FATAL (!ms_installed, ("not installed"));
|
||||
NOT_NULL (object);
|
||||
DEBUG_FATAL (!object, ("World::removeObject - object is null"));
|
||||
DEBUG_FATAL (!object, ("World::removeObject - object is nullptr"));
|
||||
VALIDATE_RANGE_INCLUSIVE_EXCLUSIVE (0, listIndex, static_cast<int>(WOL_Count));
|
||||
|
||||
ms_objectSet.erase(object);
|
||||
@@ -349,7 +349,7 @@ bool World::removeObject (const Object* object, int listIndex)
|
||||
void World::queueObject (Object* object)
|
||||
{
|
||||
DEBUG_FATAL (!ms_installed, ("not installed"));
|
||||
DEBUG_FATAL (!object, ("World::queueObject - object is null"));
|
||||
DEBUG_FATAL (!object, ("World::queueObject - object is nullptr"));
|
||||
|
||||
ms_queuedObjectList->addObject (object);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user