2010-06-16 10:13:21 +00:00
|
|
|
#ifndef ENGINE_H
|
|
|
|
#define ENGINE_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
|
2010-07-02 15:30:26 +00:00
|
|
|
#include <OgreFrameListener.h>
|
|
|
|
|
2010-07-16 12:26:46 +00:00
|
|
|
#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>
|
2011-05-05 17:32:42 +00:00
|
|
|
#include <components/files/collections.hpp>
|
2010-07-01 18:49:00 +00:00
|
|
|
|
2010-07-04 08:43:34 +00:00
|
|
|
#include "mwworld/environment.hpp"
|
2010-08-05 13:46:50 +00:00
|
|
|
#include "mwworld/ptr.hpp"
|
2011-08-19 19:06:09 +00:00
|
|
|
#include <components/cfg/configurationmanager.hpp>
|
2010-07-04 08:43:34 +00:00
|
|
|
|
2010-07-02 15:21:27 +00:00
|
|
|
namespace Compiler
|
|
|
|
{
|
|
|
|
class Context;
|
|
|
|
}
|
|
|
|
|
2010-07-02 14:18:25 +00:00
|
|
|
namespace MWScript
|
|
|
|
{
|
|
|
|
class ScriptManager;
|
|
|
|
}
|
|
|
|
|
2010-07-03 13:17:02 +00:00
|
|
|
namespace MWSound
|
|
|
|
{
|
|
|
|
class SoundManager;
|
|
|
|
}
|
|
|
|
|
2010-07-03 13:41:20 +00:00
|
|
|
namespace MWWorld
|
2010-06-16 10:13:21 +00:00
|
|
|
{
|
2010-07-02 07:00:06 +00:00
|
|
|
class World;
|
2010-07-03 13:41:20 +00:00
|
|
|
}
|
2010-07-02 07:00:06 +00:00
|
|
|
|
2010-07-17 12:01:47 +00:00
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
class WindowManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace OEngine
|
|
|
|
{
|
|
|
|
namespace GUI
|
|
|
|
{
|
|
|
|
class MyGUIManager;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-07-03 13:41:20 +00:00
|
|
|
namespace OMW
|
|
|
|
{
|
2010-06-16 10:13:21 +00:00
|
|
|
/// \brief Main engine class, that brings together all the components of OpenMW
|
2010-07-02 15:30:26 +00:00
|
|
|
class Engine : private Ogre::FrameListener
|
2010-06-16 10:13:21 +00:00
|
|
|
{
|
Added new command line option: "encoding"
Added new command line option: "encoding" which allow to
change font encoding used in game messages.
Currently there are three evailable encodings:
win1250 - Central and Eastern European (languages
that use Latin script, such as Polish,
Czech, Slovak, Hungarian, Slovene, Bosnian,
Croatian, Serbian (Latin script),
Romanian and Albanian)
win1251 - languages that use the Cyrillic alphabet
such as Russian, Bulgarian, Serbian Cyrillic
and others
win1252 - Western European (Latin) - default
Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
2011-07-17 20:16:50 +00:00
|
|
|
std::string mEncoding;
|
2010-06-16 10:13:21 +00:00
|
|
|
boost::filesystem::path mDataDir;
|
2011-01-04 00:34:55 +00:00
|
|
|
boost::filesystem::path mResDir;
|
2011-10-09 11:05:38 +00:00
|
|
|
OEngine::Render::OgreRenderer *mOgre;
|
2011-04-01 21:35:56 +00:00
|
|
|
OEngine::Physic::PhysicEngine* mPhysicEngine;
|
2010-06-16 10:13:21 +00:00
|
|
|
std::string mCellName;
|
|
|
|
std::string mMaster;
|
2011-02-18 14:46:24 +00:00
|
|
|
bool mShowFPS;
|
2010-07-02 11:12:05 +00:00
|
|
|
bool mDebug;
|
2010-07-02 14:18:25 +00:00
|
|
|
bool mVerboseScripts;
|
2010-07-04 14:00:32 +00:00
|
|
|
bool mNewGame;
|
2010-08-18 09:16:15 +00:00
|
|
|
bool mUseSound;
|
2010-10-06 12:52:53 +00:00
|
|
|
bool mCompileAll;
|
2011-10-08 08:31:23 +00:00
|
|
|
bool mReportFocus;
|
|
|
|
float mFocusTDiff;
|
|
|
|
std::string mFocusName;
|
|
|
|
|
2010-07-04 08:43:34 +00:00
|
|
|
MWWorld::Environment mEnvironment;
|
2010-07-02 14:18:25 +00:00
|
|
|
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;
|
2010-07-17 12:01:47 +00:00
|
|
|
OEngine::GUI::MyGUIManager *mGuiManager;
|
2010-07-02 14:18:25 +00:00
|
|
|
|
2011-05-05 17:32:42 +00:00
|
|
|
Files::Collections mFileCollections;
|
2011-05-05 17:56:16 +00:00
|
|
|
bool mFSStrict;
|
2011-05-05 17:32:42 +00:00
|
|
|
|
2010-06-16 10:13:21 +00:00
|
|
|
// not implemented
|
|
|
|
Engine (const Engine&);
|
|
|
|
Engine& operator= (const Engine&);
|
2010-06-25 20:28:59 +00:00
|
|
|
|
2010-06-16 10:58:53 +00:00
|
|
|
/// add resources directory
|
|
|
|
/// \note This function works recursively.
|
2010-12-30 13:50:35 +00:00
|
|
|
|
2010-06-16 10:58:53 +00:00
|
|
|
void addResourcesDirectory (const boost::filesystem::path& path);
|
2010-06-25 20:28:59 +00:00
|
|
|
|
2010-06-16 18:15:48 +00:00
|
|
|
/// Load all BSA files in data directory.
|
|
|
|
void loadBSA();
|
2010-06-25 20:28:59 +00:00
|
|
|
|
2010-07-02 14:18:25 +00:00
|
|
|
void executeLocalScripts();
|
|
|
|
|
2011-10-08 08:31:23 +00:00
|
|
|
void updateFocusReport (float duration);
|
2010-07-02 15:30:26 +00:00
|
|
|
|
2011-10-08 08:31:23 +00:00
|
|
|
virtual bool frameRenderingQueued (const Ogre::FrameEvent& evt);
|
2010-07-02 15:30:26 +00:00
|
|
|
|
2010-06-16 10:13:21 +00:00
|
|
|
public:
|
2011-08-19 19:06:09 +00:00
|
|
|
Engine(Cfg::ConfigurationManager& configurationManager);
|
|
|
|
virtual ~Engine();
|
2010-07-02 07:00:06 +00:00
|
|
|
|
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.
|
2011-08-19 19:06:09 +00:00
|
|
|
void enableFSStrict(bool fsStrict);
|
2011-05-05 17:56:16 +00:00
|
|
|
|
2011-05-05 17:32:42 +00:00
|
|
|
/// Set data dirs
|
2011-09-02 20:45:21 +00:00
|
|
|
void setDataDirs(const Files::PathContainer& dataDirs);
|
2010-06-16 10:13:21 +00:00
|
|
|
|
2011-01-04 00:34:55 +00:00
|
|
|
/// Set resource dir
|
2011-08-19 19:06:09 +00:00
|
|
|
void setResourceDir(const boost::filesystem::path& parResDir);
|
2011-01-04 00:34:55 +00:00
|
|
|
|
2010-06-16 10:13:21 +00:00
|
|
|
/// Set start cell name (only interiors for now)
|
2011-08-19 19:06:09 +00:00
|
|
|
void setCell(const std::string& cellName);
|
2010-06-25 20:28:59 +00:00
|
|
|
|
2010-06-16 10:13:21 +00:00
|
|
|
/// 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.
|
2011-08-19 19:06:09 +00:00
|
|
|
void addMaster(const std::string& master);
|
2010-06-16 10:13:21 +00:00
|
|
|
|
2011-02-18 14:46:24 +00:00
|
|
|
/// Enable fps counter
|
2011-08-19 19:06:09 +00:00
|
|
|
void showFPS(bool showFps);
|
2011-02-18 14:46:24 +00:00
|
|
|
|
2010-07-02 11:12:05 +00:00
|
|
|
/// Enable debug mode:
|
|
|
|
/// - non-exclusive input
|
2011-08-19 19:06:09 +00:00
|
|
|
void setDebugMode(bool debugMode);
|
2010-06-27 23:44:15 +00:00
|
|
|
|
2011-08-19 19:06:09 +00:00
|
|
|
/// Enable or disable verbose script output
|
|
|
|
void setScriptsVerbosity(bool scriptsVerbosity);
|
2010-07-05 03:17:10 +00:00
|
|
|
|
2011-08-19 19:06:09 +00:00
|
|
|
/// Disable or enable all sounds
|
|
|
|
void setSoundUsage(bool soundUsage);
|
2010-08-18 09:16:15 +00:00
|
|
|
|
2010-07-04 14:00:32 +00:00
|
|
|
/// Start as a new game.
|
2011-08-19 19:06:09 +00:00
|
|
|
void setNewGame(bool newGame);
|
2010-07-02 14:18:25 +00:00
|
|
|
|
2011-10-08 08:31:23 +00:00
|
|
|
/// Write name of focussed object to cout
|
|
|
|
void setReportFocus (bool report);
|
|
|
|
|
2010-06-16 10:13:21 +00:00
|
|
|
/// Initialise and enter main loop.
|
|
|
|
void go();
|
2010-08-05 11:36:33 +00:00
|
|
|
|
|
|
|
/// 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);
|
Added new command line option: "encoding"
Added new command line option: "encoding" which allow to
change font encoding used in game messages.
Currently there are three evailable encodings:
win1250 - Central and Eastern European (languages
that use Latin script, such as Polish,
Czech, Slovak, Hungarian, Slovene, Bosnian,
Croatian, Serbian (Latin script),
Romanian and Albanian)
win1251 - languages that use the Cyrillic alphabet
such as Russian, Bulgarian, Serbian Cyrillic
and others
win1252 - Western European (Latin) - default
Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
2011-07-17 20:16:50 +00:00
|
|
|
|
|
|
|
/// Font encoding
|
|
|
|
void setEncoding(const std::string& encoding);
|
2011-08-19 19:06:09 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Cfg::ConfigurationManager& mCfgMgr;
|
2010-06-16 10:13:21 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2011-08-19 19:06:09 +00:00
|
|
|
#endif /* ENGINE_H */
|