Removed a workaround from Renderer, some cleanup

This commit is contained in:
scrawl 2013-10-30 13:05:28 +01:00
parent c2bbbef637
commit 4f35fd8184
8 changed files with 11 additions and 77 deletions

View file

@ -28,21 +28,6 @@ using namespace Ogre;
using namespace OEngine::Render;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
CustomRoot::CustomRoot(const Ogre::String& pluginFileName,
const Ogre::String& configFileName,
const Ogre::String& logFileName)
: Ogre::Root(pluginFileName, configFileName, logFileName)
{}
bool CustomRoot::isQueuedEnd() const
{
return mQueuedEnd;
}
#endif
void OgreRenderer::cleanup()
{
delete mFader;
@ -60,23 +45,6 @@ void OgreRenderer::cleanup()
unloadPlugins();
}
void OgreRenderer::start()
{
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
// we need this custom main loop because otherwise Ogre's Carbon message pump will
// steal input events even from our Cocoa window
// There's no way to disable Ogre's message pump other that comment pump code in Ogre's source
do {
if (!mRoot->renderOneFrame()) {
break;
}
} while (!mRoot->isQueuedEnd());
#else
mRoot->startRendering();
#endif
}
void OgreRenderer::loadPlugins()
{
#ifdef ENABLE_PLUGIN_GL
@ -158,20 +126,15 @@ void OgreRenderer::configure(const std::string &logPath,
// Set up logging first
new LogManager;
Log *log = LogManager::getSingleton().createLog(logPath + std::string("Ogre.log"));
logging = _logging;
if(logging)
if(_logging)
// Full log detail
log->setLogDetail(LL_BOREME);
else
// Disable logging
log->setDebugOutputEnabled(false);
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
mRoot = new CustomRoot("", "", "");
#else
mRoot = new Root("", "", "");
#endif
#if defined(ENABLE_PLUGIN_GL) || defined(ENABLE_PLUGIN_Direct3D9) || defined(ENABLE_PLUGIN_CgProgramManager) || defined(ENABLE_PLUGIN_OctreeSceneManager) || defined(ENABLE_PLUGIN_ParticleFX)
loadPlugins();