forked from mirror/openmw-tes3mp
bug #348: cleanup
moved files to appropriate component, moved function to namespace, added docs
This commit is contained in:
parent
a84d8e83cd
commit
b05dfeae70
6 changed files with 63 additions and 25 deletions
|
@ -6,8 +6,8 @@
|
|||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include <components/files/configurationmanager.hpp>
|
||||
#include <components/files/ogreplugin.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
#include <components/ogreplugin/ogreplugin.h>
|
||||
|
||||
#include "graphicspage.hpp"
|
||||
#include "naturalsort.hpp"
|
||||
|
@ -120,8 +120,8 @@ bool GraphicsPage::setupOgre()
|
|||
|
||||
pluginDir = absPluginPath.string();
|
||||
|
||||
loadOgrePlugin(pluginDir, "RenderSystem_GL", *mOgre);
|
||||
loadOgrePlugin(pluginDir, "RenderSystem_Direct3D9", *mOgre);
|
||||
Files::loadOgrePlugin(pluginDir, "RenderSystem_GL", *mOgre);
|
||||
Files::loadOgrePlugin(pluginDir, "RenderSystem_Direct3D9", *mOgre);
|
||||
|
||||
#ifdef ENABLE_PLUGIN_GL
|
||||
mGLPlugin = new Ogre::GLPlugin();
|
||||
|
|
|
@ -52,7 +52,7 @@ add_component_dir (misc
|
|||
|
||||
add_component_dir (files
|
||||
linuxpath windowspath macospath fixedpath multidircollection collections fileops configurationmanager
|
||||
filelibrary
|
||||
filelibrary ogreplugin
|
||||
)
|
||||
|
||||
add_component_dir (compiler
|
||||
|
@ -66,10 +66,6 @@ add_component_dir (interpreter
|
|||
miscopcodes opcodes runtime scriptopcodes spatialopcodes types
|
||||
)
|
||||
|
||||
add_component_dir (ogreplugin
|
||||
ogreplugin
|
||||
)
|
||||
|
||||
include_directories(${BULLET_INCLUDE_DIRS})
|
||||
|
||||
add_library(components STATIC ${COMPONENT_FILES})
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
#include "ogreplugin.h"
|
||||
#include "ogreplugin.hpp"
|
||||
|
||||
#include <OgrePrerequisites.h>
|
||||
#include <OgreRoot.h>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
namespace Files {
|
||||
|
||||
bool loadOgrePlugin(const std::string &pluginDir, std::string pluginName, Ogre::Root &ogreRoot) {
|
||||
pluginName = pluginName + OGRE_PLUGIN_DEBUG_SUFFIX;
|
||||
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
||||
|
@ -33,3 +35,5 @@ bool loadOgrePlugin(const std::string &pluginDir, std::string pluginName, Ogre::
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
50
components/files/ogreplugin.hpp
Normal file
50
components/files/ogreplugin.hpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
/**
|
||||
* Open Morrowind - an opensource Elder Scrolls III: Morrowind
|
||||
* engine implementation.
|
||||
*
|
||||
* Copyright (C) 2011 Open Morrowind Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** \file components/files/ogreplugin.hpp */
|
||||
|
||||
#ifndef COMPONENTS_FILES_OGREPLUGIN_H
|
||||
#define COMPONENTS_FILES_OGREPLUGIN_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Ogre {
|
||||
class Root;
|
||||
}
|
||||
|
||||
/**
|
||||
* \namespace Files
|
||||
*/
|
||||
namespace Files {
|
||||
|
||||
/**
|
||||
* \brief Loads Ogre plugin with given name.
|
||||
*
|
||||
* \param pluginDir absolute path to plugins
|
||||
* \param pluginName plugin name, for example "RenderSystem_GL"
|
||||
* \param ogreRoot Ogre::Root instance
|
||||
*
|
||||
* \return whether plugin was located or not
|
||||
*/
|
||||
bool loadOgrePlugin(const std::string &pluginDir, std::string pluginName, Ogre::Root &ogreRoot);
|
||||
|
||||
}
|
||||
|
||||
#endif /* COMPONENTS_FILES_OGREPLUGIN_H */
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef OGREPLUGIN_H
|
||||
#define OGREPLUGIN_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Ogre {
|
||||
class Root;
|
||||
}
|
||||
|
||||
extern bool loadOgrePlugin(const std::string &pluginDir, std::string pluginName, Ogre::Root &ogreRoot);
|
||||
|
||||
#endif
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include <components/ogreplugin/ogreplugin.h>
|
||||
#include <components/files/ogreplugin.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
|
@ -117,9 +117,9 @@ void OgreRenderer::configure(const std::string &logPath,
|
|||
|
||||
pluginDir = absPluginPath.string();
|
||||
|
||||
loadOgrePlugin(pluginDir, "RenderSystem_GL", *mRoot);
|
||||
loadOgrePlugin(pluginDir, "RenderSystem_Direct3D9", *mRoot);
|
||||
loadOgrePlugin(pluginDir, "Plugin_CgProgramManager", *mRoot);
|
||||
Files::loadOgrePlugin(pluginDir, "RenderSystem_GL", *mRoot);
|
||||
Files::loadOgrePlugin(pluginDir, "RenderSystem_Direct3D9", *mRoot);
|
||||
Files::loadOgrePlugin(pluginDir, "Plugin_CgProgramManager", *mRoot);
|
||||
|
||||
RenderSystem* rs = mRoot->getRenderSystemByName(renderSystem);
|
||||
if (rs == 0)
|
||||
|
|
Loading…
Reference in a new issue