当前位置: 首页>>代码示例>>C++>>正文


C++ OGRE_DELETE_T函数代码示例

本文整理汇总了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);
}
开发者ID:barsnadcat,项目名称:steelandconcrete,代码行数:60,代码来源:OMEFileSystemArchive.cpp

示例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;
		}
	}
开发者ID:dbabox,项目名称:aomi,代码行数:15,代码来源:ParticleUniverseTextureRotator.cpp

示例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);
		}
	}
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:25,代码来源:QuickGUITreeView.cpp

示例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;
    }
开发者ID:amerkoleci,项目名称:mogre,代码行数:35,代码来源:OgreDefaultWorkQueueStandard.cpp

示例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;

    }
开发者ID:wjwwood,项目名称:ogre,代码行数:27,代码来源:OgreDefaultWorkQueueTBB.cpp

示例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);
    }
开发者ID:jjiezheng,项目名称:pap_full,代码行数:34,代码来源:OgreFileSystem.cpp

示例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);
	}
开发者ID:terminus510,项目名称:OgreBulletTest,代码行数:33,代码来源:OgreFileSystem.cpp

示例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);
	}
开发者ID:raduetsya,项目名称:GothOgre,代码行数:34,代码来源:WinUnicodeFileSystem.cpp

示例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);
    }
开发者ID:Chimangoo,项目名称:ember,代码行数:28,代码来源:EmberOgreFileSystem.cpp

示例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;
			}
		}
开发者ID:dbabox,项目名称:aomi,代码行数:32,代码来源:ParticleUniversePhysXActorExtern.cpp

示例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;
}
开发者ID:j-rivero,项目名称:ogre-acornacorn,代码行数:32,代码来源:MeshSerializerTests.cpp

示例12: OGRE_DELETE_T

	//-----------------------------------------------------------------------
	void JetAffector::setDynAcceleration(DynamicAttribute* dynAcceleration)
	{
		if (mDynAcceleration)
			OGRE_DELETE_T(mDynAcceleration, DynamicAttribute, Ogre::MEMCATEGORY_SCENE_OBJECTS);

		mDynAcceleration = dynAcceleration;
	}
开发者ID:dbabox,项目名称:aomi,代码行数:8,代码来源:ParticleUniverseJetAffector.cpp

示例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();
	}
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:9,代码来源:OgreTerrainSceneManager.cpp

示例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);
     }
 }
开发者ID:Anti-Mage,项目名称:ogre,代码行数:10,代码来源:OgreConfigFile.cpp

示例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();
	}
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:10,代码来源:OgreMaterial.cpp


注:本文中的OGRE_DELETE_T函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。