本文整理汇总了C++中OGRE_DELETE_T函数的典型用法代码示例。如果您正苦于以下问题:C++ OGRE_DELETE_T函数的具体用法?C++ OGRE_DELETE_T怎么用?C++ OGRE_DELETE_T使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OGRE_DELETE_T函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: concatenate_path
Ogre::DataStreamPtr OMEFileSystemArchive::open(const Ogre::String& filename, bool readOnly) const
{
Ogre::String full_path = concatenate_path(mName, filename);
// Use filesystem to determine size
// (quicker than streaming to the end and back)
struct stat tagStat;
int ret = stat(full_path.c_str(), &tagStat);
assert(ret == 0 && "Problem getting file size" );
(void)ret; // Silence warning
// Always open in binary mode
// Also, always include reading
std::ios::openmode mode = std::ios::in | std::ios::binary;
std::istream* baseStream = 0;
std::ifstream* roStream = 0;
std::fstream* rwStream = 0;
if (!readOnly && isReadOnly())
{
mode |= std::ios::out;
rwStream = OGRE_NEW_T(std::fstream, Ogre::MEMCATEGORY_GENERAL)();
rwStream->open(full_path.c_str(), mode);
baseStream = rwStream;
}
else
{
roStream = OGRE_NEW_T(std::ifstream, Ogre::MEMCATEGORY_GENERAL)();
roStream->open(full_path.c_str(), mode);
baseStream = roStream;
}
// Should check ensure open succeeded, in case fail for some reason.
if (baseStream->fail())
{
OGRE_DELETE_T(roStream, basic_ifstream, Ogre::MEMCATEGORY_GENERAL);
OGRE_DELETE_T(rwStream, basic_fstream, Ogre::MEMCATEGORY_GENERAL);
OGRE_EXCEPT(Ogre::Exception::ERR_FILE_NOT_FOUND,
"Cannot open file: " + filename,
"FileSystemArchive::open");
}
/// Construct return stream, tell it to delete on destroy
Ogre::FileStreamDataStream* stream = 0;
if (rwStream)
{
// use the writeable stream
stream = OGRE_NEW Ogre::FileStreamDataStream(filename,
rwStream, (size_t)tagStat.st_size, true);
}
else
{
// read-only stream
Ogre::String newName = mName + ":" + filename;
stream = OGRE_NEW Ogre::FileStreamDataStream(newName,
roStream, (size_t)tagStat.st_size, true);
}
return Ogre::DataStreamPtr(stream);
}
示例2: OGRE_DELETE_T
//-----------------------------------------------------------------------
TextureRotator::~TextureRotator(void)
{
if (mDynRotation)
{
OGRE_DELETE_T(mDynRotation, DynamicAttribute, Ogre::MEMCATEGORY_SCENE_OBJECTS);
mDynRotation = 0;
}
if (mDynRotationSpeed)
{
OGRE_DELETE_T(mDynRotationSpeed, DynamicAttribute, Ogre::MEMCATEGORY_SCENE_OBJECTS);
mDynRotationSpeed = 0;
}
}
示例3: OGRE_DELETE_T
void TreeView::removeEventHandlers(void* obj)
{
ContainerWidget::removeEventHandlers(obj);
for(int index = 0; index < TREEVIEW_EVENT_COUNT; ++index)
{
std::vector<EventHandlerSlot*> updatedList;
std::vector<EventHandlerSlot*> listToCleanup;
for(std::vector<EventHandlerSlot*>::iterator it = mTreeViewEventHandlers[index].begin(); it != mTreeViewEventHandlers[index].end(); ++it)
{
if((*it)->getClass() == obj)
listToCleanup.push_back((*it));
else
updatedList.push_back((*it));
}
mTreeViewEventHandlers[index].clear();
for(std::vector<EventHandlerSlot*>::iterator it = updatedList.begin(); it != updatedList.end(); ++it)
mTreeViewEventHandlers[index].push_back((*it));
for(std::vector<EventHandlerSlot*>::iterator it = listToCleanup.begin(); it != listToCleanup.end(); ++it)
OGRE_DELETE_T((*it),EventHandlerSlot,Ogre::MEMCATEGORY_GENERAL);
}
}
示例4: abortAllRequests
//---------------------------------------------------------------------
void DefaultWorkQueue::shutdown()
{
if( !mIsRunning )
return;
LogManager::getSingleton().stream() <<
"DefaultWorkQueue('" << mName << "') shutting down on thread " <<
#if OGRE_THREAD_SUPPORT
OGRE_THREAD_CURRENT_ID
#else
"main"
#endif
<< ".";
mShuttingDown = true;
abortAllRequests();
#if OGRE_THREAD_SUPPORT
// wake all threads (they should check shutting down as first thing after wait)
OGRE_THREAD_NOTIFY_ALL(mRequestCondition);
// all our threads should have been woken now, so join
for (WorkerThreadList::iterator i = mWorkers.begin(); i != mWorkers.end(); ++i)
{
(*i)->join();
OGRE_THREAD_DESTROY(*i);
}
mWorkers.clear();
#endif
OGRE_DELETE_T(mWorkerFunc, WorkerFunc, MEMCATEGORY_GENERAL);
mWorkerFunc = 0;
mIsRunning = false;
}
示例5: abortAllRequests
//---------------------------------------------------------------------
void DefaultWorkQueue::shutdown()
{
LogManager::getSingleton().stream() <<
"DefaultWorkQueue('" << mName << "') shutting down.";
mShuttingDown = true;
mTaskGroup.cancel();
abortAllRequests();
// wait until all tasks have finished.
mTaskGroup.wait();
#if OGRE_NO_TBB_SCHEDULER == 0
if (mTaskScheduler.is_active())
mTaskScheduler.terminate();
#endif
if (mWorkerFunc)
{
OGRE_DELETE_T(mWorkerFunc, WorkerFunc, MEMCATEGORY_GENERAL);
mWorkerFunc = 0;
}
mIsRunning = false;
}
示例6: setlocale
//-----------------------------------------------------------------------
DataStreamPtr FileSystemArchive::open(const String& filename) const
{
#if (_MSC_VER >= 1400)
// std::locale langLocale("");
// std::locale::global(langLocale);
setlocale( LC_CTYPE, "" );
#endif
String full_path = concatenate_path(mName, filename);
// Use filesystem to determine size
// (quicker than streaming to the end and back)
struct stat tagStat;
int ret = stat(full_path.c_str(), &tagStat);
assert(ret == 0 && "Problem getting file size" );
// Always open in binary mode
std::ifstream *origStream = OGRE_NEW_T(std::ifstream, MEMCATEGORY_GENERAL)();
origStream->open(full_path.c_str(), std::ios::in | std::ios::binary);
// Should check ensure open succeeded, in case fail for some reason.
if (origStream->fail())
{
OGRE_DELETE_T(origStream, basic_ifstream, MEMCATEGORY_GENERAL);
OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND,
"Cannot open file: " + filename,
"FileSystemArchive::open");
}
/// Construct return stream, tell it to delete on destroy
FileStreamDataStream* stream = OGRE_NEW FileStreamDataStream(filename,
origStream, tagStat.st_size, true);
return DataStreamPtr(stream);
}
示例7: OGRE_EXCEPT
//---------------------------------------------------------------------
DataStreamPtr FileSystemArchive::create(const String& filename) const
{
if (isReadOnly())
{
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
"Cannot create a file in a read-only archive",
"FileSystemArchive::remove");
}
String full_path = concatenate_path(mName, filename);
// Always open in binary mode
// Also, always include reading
std::ios::openmode mode = std::ios::out | std::ios::binary;
std::fstream* rwStream = OGRE_NEW_T(std::fstream, MEMCATEGORY_GENERAL)();
rwStream->open(full_path.c_str(), mode);
// Should check ensure open succeeded, in case fail for some reason.
if (rwStream->fail())
{
OGRE_DELETE_T(rwStream, basic_fstream, MEMCATEGORY_GENERAL);
OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND,
"Cannot open file: " + filename,
"FileSystemArchive::create");
}
/// Construct return stream, tell it to delete on destroy
FileStreamDataStream* stream = OGRE_NEW FileStreamDataStream(filename,
rwStream, 0, true);
return DataStreamPtr(stream);
}
示例8: GOTHOGRE_EXCEPT
//---------------------------------------------------------------------
Ogre::DataStreamPtr UnicodeFileSystemArchive::create(const String& _filename) const
{
if (isReadOnly())
{
GOTHOGRE_EXCEPT(_filename << " - Cannot create a file in"
<< " read-only archive " << getName() << ".");
}
WString wfullpath = getFullPath(_filename);
// Always open in binary mode
// Also, always include reading
std::ios::openmode mode = std::ios::out | std::ios::binary;
std::fstream* rwStream = OGRE_NEW_T(std::fstream, MEMCATEGORY_GENERAL)();
rwStream->open(wfullpath.c_str(), mode);
// Should check ensure open succeeded, in case fail for some reason.
if (rwStream->fail())
{
OGRE_DELETE_T(rwStream, basic_fstream, MEMCATEGORY_GENERAL);
GOTHOGRE_EXCEPT(_filename << " - Cannot create file in"
<< " archive " << getName() << ".");
}
GOTHOGRE_INFO(_filename << " - " << "Saving to"
<< " archive " << getName() << ".");
/// Construct return stream, tell it to delete on destroy
FileStreamDataStream* stream = OGRE_NEW FileStreamDataStream(_filename,
rwStream, 0, true);
return DataStreamPtr(stream);
}
示例9: concatenate_path
//-----------------------------------------------------------------------
DataStreamPtr FileSystemArchive::open(const String& filename, bool readOnly) const
{
String full_path = concatenate_path(mName, filename);
// Use filesystem to determine size
// (quicker than streaming to the end and back)
struct stat tagStat;
stat(full_path.c_str(), &tagStat);
// Always open in binary mode
std::ifstream *origStream = OGRE_NEW_T(std::ifstream, MEMCATEGORY_GENERAL)();
origStream->open(full_path.c_str(), std::ios::in | std::ios::binary);
// Should check ensure open succeeded, in case fail for some reason.
if (origStream->fail())
{
OGRE_DELETE_T(origStream, basic_ifstream, MEMCATEGORY_GENERAL);
OGRE_EXCEPT(Ogre::Exception::ERR_FILE_NOT_FOUND,
"Cannot open file: " + filename,
"FileSystemArchive::open");
}
// Construct return stream, tell it to delete on destroy
FileStreamDataStream* stream = OGRE_NEW FileStreamDataStream(filename,
origStream, tagStat.st_size, true);
return DataStreamPtr(stream);
}
示例10: OGRE_DELETE_T
//-----------------------------------------------------------------------
void PhysXActorExtern::setPhysicsShape(PhysicsShapeDesc* physicsShapeDesc)
{
if (mPhysicsShapeDesc)
{
OGRE_DELETE_T(mPhysicsShapeDesc, PhysicsShapeDesc, Ogre::MEMCATEGORY_SCENE_OBJECTS);
}
switch (physicsShapeDesc->mPhysicsShapeType)
{
case ST_BOX:
{
PhysicsBoxDesc* physicsBoxDesc = static_cast<PhysicsBoxDesc*>(physicsShapeDesc);
mPhysicsShapeDesc = OGRE_NEW_T(PhysicsBoxDesc, Ogre::MEMCATEGORY_SCENE_OBJECTS)(*physicsBoxDesc);
}
break;
case ST_SPHERE:
{
PhysicsSphereDesc* physicsSphereDesc = static_cast<PhysicsSphereDesc*>(physicsShapeDesc);
mPhysicsShapeDesc = OGRE_NEW_T(PhysicsSphereDesc, Ogre::MEMCATEGORY_SCENE_OBJECTS)(*physicsSphereDesc);
}
break;
case ST_CAPSULE:
{
PhysicsCapsuleDesc* physicsCapsuleDesc = static_cast<PhysicsCapsuleDesc*>(physicsShapeDesc);
mPhysicsShapeDesc = OGRE_NEW_T(PhysicsCapsuleDesc, Ogre::MEMCATEGORY_SCENE_OBJECTS)(*physicsCapsuleDesc);
}
break;
}
}
示例11: copyFile
void MeshSerializerTests::tearDown()
{
// Copy back original file.
if (!mMeshFullPath.empty()) {
copyFile(mMeshFullPath + ".bak", mMeshFullPath);
}
if (!mSkeletonFullPath.empty()) {
copyFile(mSkeletonFullPath + ".bak", mSkeletonFullPath);
}
if (!mMesh.isNull()) {
mMesh->unload();
mMesh.setNull();
}
if (!mOrigMesh.isNull()) {
mOrigMesh->unload();
mOrigMesh.setNull();
}
if (!mSkeleton.isNull()) {
mSkeleton->unload();
mSkeleton.setNull();
}
OGRE_DELETE MeshManager::getSingletonPtr();
OGRE_DELETE SkeletonManager::getSingletonPtr();
OGRE_DELETE DefaultHardwareBufferManager::getSingletonPtr();
OGRE_DELETE ArchiveManager::getSingletonPtr();
OGRE_DELETE MaterialManager::getSingletonPtr();
OGRE_DELETE LodStrategyManager::getSingletonPtr();
OGRE_DELETE ResourceGroupManager::getSingletonPtr();
OGRE_DELETE_T(mFSLayer, FileSystemLayer, Ogre::MEMCATEGORY_GENERAL);
OGRE_DELETE mLogManager;
}
示例12: OGRE_DELETE_T
//-----------------------------------------------------------------------
void JetAffector::setDynAcceleration(DynamicAttribute* dynAcceleration)
{
if (mDynAcceleration)
OGRE_DELETE_T(mDynAcceleration, DynamicAttribute, Ogre::MEMCATEGORY_SCENE_OBJECTS);
mDynAcceleration = dynAcceleration;
}
示例13: OGRE_DELETE_T
//-----------------------------------------------------------------------
void TerrainSceneManager::destroyLevelIndexes()
{
for ( unsigned int i = 0; i < mLevelIndex.size(); i++ )
{
OGRE_DELETE_T(mLevelIndex[i], IndexMap, MEMCATEGORY_GEOMETRY);
}
mLevelIndex.clear();
}
示例14: OGRE_DELETE_T
//-----------------------------------------------------------------------
ConfigFile::~ConfigFile()
{
SettingsBySection::iterator seci, secend;
secend = mSettings.end();
for (seci = mSettings.begin(); seci != secend; ++seci)
{
OGRE_DELETE_T(seci->second, SettingsMultiMap, MEMCATEGORY_GENERAL);
}
}
示例15: OGRE_DELETE_T
//-----------------------------------------------------------------------
void Material::clearBestTechniqueList(void)
{
for (BestTechniquesBySchemeList::iterator i = mBestTechniquesBySchemeList.begin();
i != mBestTechniquesBySchemeList.end(); ++i)
{
OGRE_DELETE_T(i->second, LodTechniques, MEMCATEGORY_RESOURCE);
}
mBestTechniquesBySchemeList.clear();
}