1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 21:49:56 +00:00
openmw-tes3mp/apps/openmw/engine.hpp

164 lines
4 KiB
C++
Raw Normal View History

#ifndef ENGINE_H
#define ENGINE_H
#include <string>
#include <boost/filesystem.hpp>
#include <OgreFrameListener.h>
#include <openengine/ogre/renderer.hpp>
2011-02-19 16:59:40 +00:00
#include <openengine/bullet/physic.hpp>
2010-07-03 10:12:13 +00:00
#include <components/compiler/extensions.hpp>
#include <components/files/collections.hpp>
2010-07-04 08:43:34 +00:00
#include "mwworld/environment.hpp"
#include "mwworld/ptr.hpp"
2010-11-08 23:01:33 +00:00
#include <boost/timer.hpp>
2010-07-04 08:43:34 +00:00
2010-07-02 15:21:27 +00:00
namespace Compiler
{
class Context;
}
namespace MWScript
{
class ScriptManager;
}
namespace MWSound
{
class SoundManager;
}
2010-07-03 13:41:20 +00:00
namespace MWWorld
{
class World;
2010-07-03 13:41:20 +00:00
}
namespace MWGui
{
class WindowManager;
}
namespace OEngine
{
namespace GUI
{
class MyGUIManager;
}
}
2010-07-03 13:41:20 +00:00
namespace OMW
{
/// \brief Main engine class, that brings together all the components of OpenMW
class Engine : private Ogre::FrameListener
{
boost::filesystem::path mDataDir;
boost::filesystem::path mResDir;
OEngine::Render::OgreRenderer mOgre;
OEngine::Physic::PhysicEngine* mPhysicEngine;
std::string mCellName;
std::string mMaster;
2011-02-18 14:46:24 +00:00
bool mShowFPS;
bool mDebug;
bool mVerboseScripts;
bool mNewGame;
2010-08-18 09:16:15 +00:00
bool mUseSound;
2010-10-06 12:52:53 +00:00
bool mCompileAll;
2010-12-30 13:50:35 +00:00
int total;
2010-07-04 08:43:34 +00:00
MWWorld::Environment mEnvironment;
MWScript::ScriptManager *mScriptManager;
2010-07-03 10:12:13 +00:00
Compiler::Extensions mExtensions;
2010-07-02 15:21:27 +00:00
Compiler::Context *mScriptContext;
OEngine::GUI::MyGUIManager *mGuiManager;
2011-01-05 21:18:21 +00:00
ESM::Region test;
boost::timer timer;
int focusFrameCounter;
static const int focusUpdateFrame = 10;
MWWorld::Ptr mIgnoreLocalPtr;
Files::Collections mFileCollections;
2011-05-05 17:56:16 +00:00
bool mFSStrict;
// not implemented
Engine (const Engine&);
Engine& operator= (const Engine&);
/// add resources directory
/// \note This function works recursively.
2010-12-30 13:50:35 +00:00
void addResourcesDirectory (const boost::filesystem::path& path);
/// Load all BSA files in data directory.
void loadBSA();
void executeLocalScripts();
virtual bool frameRenderingQueued (const Ogre::FrameEvent& evt);
/// Process pending commands
public:
Engine();
~Engine();
2011-05-05 17:56:16 +00:00
/// Enable strict filesystem mode (do not fold case)
///
/// \attention The strict mode must be specified before any path-related settings
/// are given to the engine.
void enableFSStrict();
/// Set data dirs
void setDataDirs (const std::vector<boost::filesystem::path>& dataDirs);
/// Set resource dir
void setResourceDir (const boost::filesystem::path& parResDir);
/// Set start cell name (only interiors for now)
void setCell (const std::string& cellName);
/// Set master file (esm)
/// - If the given name does not have an extension, ".esm" is added automatically
/// - Currently OpenMW only supports one master at the same time.
void addMaster (const std::string& master);
2011-02-18 14:46:24 +00:00
/// Enable fps counter
void showFPS() { mShowFPS = true; }
/// Enable debug mode:
/// - non-exclusive input
void enableDebugMode();
/// Enable the command server so external apps can send commands to the console.
/// Must be set before go().
/// Enable verbose script output
void enableVerboseScripts();
2010-08-18 09:16:15 +00:00
/// Disable all sound
void disableSound() { mUseSound = false; }
/// Start as a new game.
void setNewGame();
/// Initialise and enter main loop.
void go();
/// Activate the focussed object.
void activate();
2010-10-06 12:52:53 +00:00
/// Compile all scripts (excludign dialogue scripts) at startup?
void setCompileAll (bool all);
};
}
#endif