2010-06-16 10:13:21 +00:00
|
|
|
#ifndef ENGINE_H
|
|
|
|
#define ENGINE_H
|
|
|
|
|
2010-07-02 15:30:26 +00:00
|
|
|
#include <OgreFrameListener.h>
|
|
|
|
|
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>
|
2012-12-26 16:03:37 +00:00
|
|
|
#include <components/translation/translation.hpp>
|
2013-01-08 17:45:01 +00:00
|
|
|
#include <components/settings/settings.hpp>
|
2014-08-23 15:48:11 +00:00
|
|
|
#include <components/nifcache/nifcache.hpp>
|
|
|
|
|
2010-07-01 18:49:00 +00:00
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
#include "mwbase/environment.hpp"
|
|
|
|
|
2010-08-05 13:46:50 +00:00
|
|
|
#include "mwworld/ptr.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;
|
|
|
|
}
|
2011-10-09 11:12:44 +00:00
|
|
|
|
|
|
|
namespace Render
|
|
|
|
{
|
|
|
|
class OgreRenderer;
|
|
|
|
}
|
2010-07-17 12:01:47 +00:00
|
|
|
}
|
|
|
|
|
2012-01-21 00:14:35 +00:00
|
|
|
namespace Files
|
|
|
|
{
|
|
|
|
struct ConfigurationManager;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2012-05-04 15:20:57 +00:00
|
|
|
MWBase::Environment mEnvironment;
|
2012-12-23 19:23:24 +00:00
|
|
|
ToUTF8::FromType mEncoding;
|
2013-01-12 00:18:36 +00:00
|
|
|
ToUTF8::Utf8Encoder* mEncoder;
|
2012-01-29 19:27:03 +00:00
|
|
|
Files::PathContainer mDataDirs;
|
2013-03-09 20:08:08 +00:00
|
|
|
std::vector<std::string> mArchives;
|
2011-01-04 00:34:55 +00:00
|
|
|
boost::filesystem::path mResDir;
|
2011-10-09 11:05:38 +00:00
|
|
|
OEngine::Render::OgreRenderer *mOgre;
|
2010-06-16 10:13:21 +00:00
|
|
|
std::string mCellName;
|
2013-09-29 07:11:57 +00:00
|
|
|
std::vector<std::string> mContentFiles;
|
2012-01-16 15:33:21 +00:00
|
|
|
int mFpsLevel;
|
2010-07-02 14:18:25 +00:00
|
|
|
bool mVerboseScripts;
|
2013-11-16 10:33:20 +00:00
|
|
|
bool mSkipMenu;
|
2010-08-18 09:16:15 +00:00
|
|
|
bool mUseSound;
|
2010-10-06 12:52:53 +00:00
|
|
|
bool mCompileAll;
|
2014-02-02 13:09:59 +00:00
|
|
|
int mWarningsMode;
|
2011-10-08 08:31:23 +00:00
|
|
|
std::string mFocusName;
|
2012-04-03 00:14:39 +00:00
|
|
|
std::map<std::string,std::string> mFallbackMap;
|
2012-07-30 09:43:28 +00:00
|
|
|
bool mScriptConsoleMode;
|
2012-07-30 10:37:46 +00:00
|
|
|
std::string mStartupScript;
|
2013-01-09 03:52:18 +00:00
|
|
|
int mActivationDistanceOverride;
|
2013-11-29 19:06:54 +00:00
|
|
|
// Grab mouse?
|
|
|
|
bool mGrab;
|
2011-10-08 08:31:23 +00:00
|
|
|
|
2014-08-11 18:37:29 +00:00
|
|
|
bool mExportFonts;
|
|
|
|
|
2010-07-03 10:12:13 +00:00
|
|
|
Compiler::Extensions mExtensions;
|
2010-07-02 15:21:27 +00:00
|
|
|
Compiler::Context *mScriptContext;
|
2012-03-05 15:56:14 +00:00
|
|
|
|
2011-05-05 17:32:42 +00:00
|
|
|
Files::Collections mFileCollections;
|
2011-05-05 17:56:16 +00:00
|
|
|
bool mFSStrict;
|
2012-12-26 16:06:33 +00:00
|
|
|
Translation::Storage mTranslationDataStorage;
|
2014-07-21 07:34:10 +00:00
|
|
|
std::vector<std::string> mScriptBlacklist;
|
|
|
|
bool mScriptBlacklistUse;
|
2011-05-05 17:32:42 +00:00
|
|
|
|
2014-08-23 15:48:11 +00:00
|
|
|
Nif::Cache mNifCache;
|
|
|
|
|
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.
|
|
|
|
void addResourcesDirectory (const boost::filesystem::path& path);
|
2010-06-25 20:28:59 +00:00
|
|
|
|
2012-05-09 00:16:10 +00:00
|
|
|
/// add a .zip resource
|
|
|
|
void addZipResource (const boost::filesystem::path& path);
|
|
|
|
|
2010-07-02 14:18:25 +00:00
|
|
|
void executeLocalScripts();
|
|
|
|
|
2011-10-08 08:31:23 +00:00
|
|
|
virtual bool frameRenderingQueued (const Ogre::FrameEvent& evt);
|
2013-03-05 13:24:29 +00:00
|
|
|
virtual bool frameStarted (const Ogre::FrameEvent& evt);
|
2010-07-02 15:30:26 +00:00
|
|
|
|
2013-01-08 17:45:01 +00:00
|
|
|
/// Load settings from various files, returns the path to the user settings file
|
|
|
|
std::string loadSettings (Settings::Manager & settings);
|
|
|
|
|
|
|
|
/// Prepare engine for game play
|
|
|
|
void prepareEngine (Settings::Manager & settings);
|
|
|
|
|
2010-06-16 10:13:21 +00:00
|
|
|
public:
|
2012-01-21 00:14:35 +00:00
|
|
|
Engine(Files::ConfigurationManager& configurationManager);
|
2011-08-19 19:06:09 +00:00
|
|
|
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
|
|
|
|
2013-03-09 20:08:08 +00:00
|
|
|
/// Add BSA archive
|
|
|
|
void addArchive(const std::string& archive);
|
|
|
|
|
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
|
|
|
|
2013-09-29 07:11:57 +00:00
|
|
|
/**
|
|
|
|
* @brief addContentFile - Adds content file (ie. esm/esp, or omwgame/omwaddon) to the content files container.
|
|
|
|
* @param file - filename (extension is required)
|
|
|
|
*/
|
|
|
|
void addContentFile(const std::string& file);
|
2012-10-07 18:00:55 +00:00
|
|
|
|
2011-02-18 14:46:24 +00:00
|
|
|
/// Enable fps counter
|
2012-01-16 15:33:21 +00:00
|
|
|
void showFPS(int level);
|
2011-02-18 14:46:24 +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
|
|
|
|
2013-11-16 10:33:20 +00:00
|
|
|
void setSkipMenu (bool skipMenu);
|
|
|
|
|
2013-11-29 19:06:54 +00:00
|
|
|
void setGrabMouse(bool grab) { mGrab = grab; }
|
|
|
|
|
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
|
|
|
|
2012-02-10 18:17:49 +00:00
|
|
|
/// Write screenshot to file.
|
|
|
|
void screenshot();
|
|
|
|
|
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
|
2012-12-23 19:23:24 +00:00
|
|
|
void setEncoding(const ToUTF8::FromType& encoding);
|
2011-08-19 19:06:09 +00:00
|
|
|
|
2012-04-03 00:14:39 +00:00
|
|
|
void setFallbackValues(std::map<std::string,std::string> map);
|
2012-04-02 18:47:09 +00:00
|
|
|
|
2012-07-30 09:43:28 +00:00
|
|
|
/// Enable console-only script functionality
|
|
|
|
void setScriptConsoleMode (bool enabled);
|
|
|
|
|
2012-07-30 10:37:46 +00:00
|
|
|
/// Set path for a script that is run on startup in the console.
|
|
|
|
void setStartupScript (const std::string& path);
|
|
|
|
|
2013-01-09 03:52:18 +00:00
|
|
|
/// Override the game setting specified activation distance.
|
|
|
|
void setActivationDistanceOverride (int distance);
|
|
|
|
|
2014-02-02 13:09:59 +00:00
|
|
|
void setWarningsMode (int mode);
|
|
|
|
|
2014-07-21 07:34:10 +00:00
|
|
|
void setScriptBlacklist (const std::vector<std::string>& list);
|
|
|
|
|
|
|
|
void setScriptBlacklistUse (bool use);
|
|
|
|
|
2014-08-11 18:37:29 +00:00
|
|
|
void enableFontExport(bool exportFonts);
|
|
|
|
|
2011-08-19 19:06:09 +00:00
|
|
|
private:
|
2012-01-21 00:14:35 +00:00
|
|
|
Files::ConfigurationManager& mCfgMgr;
|
2010-06-16 10:13:21 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2011-08-19 19:06:09 +00:00
|
|
|
#endif /* ENGINE_H */
|