コード例 #1
0
    void HeadlessRenderSystem::reinitialise()
    {
        LogManager::getSingleton().logMessage("HeadlessRenderSystem::reinitialise", Ogre::LML_TRIVIAL);

        shutdown();

        mTextureManager = OGRE_NEW HeadlessTextureManager();
        mHardwareBufferManager = OGRE_NEW DefaultHardwareBufferManager();
    }
コード例 #2
0
void MeshWithoutIndexDataTests::setUp()
{
	LogManager::getSingleton().createLog("MeshWithoutIndexDataTests.log", true);
	OGRE_NEW ResourceGroupManager();
	OGRE_NEW LodStrategyManager();
    mBufMgr = OGRE_NEW DefaultHardwareBufferManager();
    mMeshMgr = OGRE_NEW MeshManager();
    archiveMgr = OGRE_NEW ArchiveManager();
    archiveMgr->addArchiveFactory(OGRE_NEW FileSystemArchiveFactory());

	MaterialManager* matMgr = OGRE_NEW MaterialManager();
	matMgr->initialise();
}
コード例 #3
0
void MeshSerializerTests::setUp()
{
	errorFactor = 0.05;

	OGRE_DELETE LogManager::getSingletonPtr();
	mLogManager = OGRE_NEW LogManager();
	mLogManager->createLog("MeshWithoutIndexDataTests.log", false);
	mLogManager->setLogDetail(LL_LOW);

	mFSLayer = OGRE_NEW_T(Ogre::FileSystemLayer, Ogre::MEMCATEGORY_GENERAL)(OGRE_VERSION_NAME);

	OGRE_NEW ResourceGroupManager();
	OGRE_NEW LodStrategyManager();
	OGRE_NEW DefaultHardwareBufferManager();
	OGRE_NEW MeshManager();
	OGRE_NEW SkeletonManager();
	ArchiveManager* archiveMgr = OGRE_NEW ArchiveManager();
	archiveMgr->addArchiveFactory(OGRE_NEW FileSystemArchiveFactory());

	MaterialManager* matMgr = OGRE_NEW MaterialManager();
	matMgr->initialise();

	// Load resource paths from config file
	ConfigFile cf;
	String resourcesPath;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
	resourcesPath = mFSLayer->getConfigFilePath("resources.cfg");
#else
	resourcesPath = mFSLayer->getConfigFilePath("bin/resources.cfg");
#endif

	// Go through all sections & settings in the file
	cf.load(resourcesPath);
	ConfigFile::SectionIterator seci = cf.getSectionIterator();

	String secName, typeName, archName;
	while (seci.hasMoreElements()) {
		secName = seci.peekNextKey();
		ConfigFile::SettingsMultiMap* settings = seci.getNext();
		ConfigFile::SettingsMultiMap::iterator i;
		for (i = settings->begin(); i != settings->end(); ++i) {
			typeName = i->first;
			archName = i->second;
			if (typeName == "FileSystem") {
				ResourceGroupManager::getSingleton().addResourceLocation(
				    archName, typeName, secName);
			}

		}
	}

	mMesh = MeshManager::getSingleton().load("knot.mesh", ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);

	getResourceFullPath(mMesh, mMeshFullPath);
	if (!copyFile(mMeshFullPath + ".bak", mMeshFullPath)) {
		// If there is no backup, create one.
		copyFile(mMeshFullPath, mMeshFullPath + ".bak");
	}
	mSkeletonFullPath = "";
	mSkeleton = SkeletonManager::getSingleton().load("jaiqua.skeleton", "Popular").staticCast<Skeleton>();
	getResourceFullPath(mSkeleton, mSkeletonFullPath);
	if (!copyFile(mSkeletonFullPath + ".bak", mSkeletonFullPath)) {
		// If there is no backup, create one.
		copyFile(mSkeletonFullPath, mSkeletonFullPath + ".bak");
	}

	mMesh->reload();
#ifdef OGRE_BUILD_COMPONENT_MESHLODGENERATOR
	{
		MeshLodGenerator().generateAutoconfiguredLodLevels(mMesh);
	}
#endif /* ifdef OGRE_BUILD_COMPONENT_MESHLODGENERATOR */
	mOrigMesh = mMesh->clone(mMesh->getName() + ".orig.mesh", mMesh->getGroup());
}
コード例 #4
0
void EdgeBuilderTests::setUp()
{
    mBufMgr = OGRE_NEW DefaultHardwareBufferManager();
    //mLogMgr = OGRE_NEW LogManager();
    LogManager::getSingleton().createLog("EdgeBuilderTests.log", true);
}