diff --git a/apps/openmw/mwscript/extensions.cpp b/apps/openmw/mwscript/extensions.cpp index 3d6566d628..94f553b58e 100644 --- a/apps/openmw/mwscript/extensions.cpp +++ b/apps/openmw/mwscript/extensions.cpp @@ -1,6 +1,9 @@ #include "extensions.hpp" +#include +#include + #include "soundextensions.hpp" #include "cellextensions.hpp" #include "miscextensions.hpp" @@ -17,5 +20,15 @@ namespace MWScript Sound::registerExtensions (extensions); Sky::registerExtensions (extensions); } + + void installOpcodes (Interpreter::Interpreter& interpreter) + { + Interpreter::installOpcodes (interpreter); + Cell::installOpcodes (interpreter); + Misc::installOpcodes (interpreter); + Gui::installOpcodes (interpreter); + Sound::installOpcodes (interpreter); + Sky::installOpcodes (interpreter); + } } diff --git a/apps/openmw/mwscript/extensions.hpp b/apps/openmw/mwscript/extensions.hpp index a38da03400..9738367a0f 100644 --- a/apps/openmw/mwscript/extensions.hpp +++ b/apps/openmw/mwscript/extensions.hpp @@ -6,9 +6,16 @@ namespace Compiler class Extensions; } +namespace Interpreter +{ + class Interpreter; +} + namespace MWScript { void registerExtensions (Compiler::Extensions& extensions); + + void installOpcodes (Interpreter::Interpreter& interpreter); } #endif diff --git a/apps/openmw/mwscript/scriptmanager.cpp b/apps/openmw/mwscript/scriptmanager.cpp index d9bbc62c1f..542bee1fba 100644 --- a/apps/openmw/mwscript/scriptmanager.cpp +++ b/apps/openmw/mwscript/scriptmanager.cpp @@ -12,14 +12,9 @@ #include #include -#include #include -#include "soundextensions.hpp" -#include "cellextensions.hpp" -#include "miscextensions.hpp" -#include "guiextensions.hpp" -#include "skyextensions.hpp" +#include "extensions.hpp" namespace MWScript { @@ -118,15 +113,5 @@ namespace MWScript iter->second.clear(); // don't execute again. } } - - void ScriptManager::installOpcodes (Interpreter::Interpreter& interpreter) - { - Interpreter::installOpcodes (interpreter); - Cell::installOpcodes (interpreter); - Misc::installOpcodes (interpreter); - Gui::installOpcodes (interpreter); - Sound::installOpcodes (interpreter); - Sky::installOpcodes (interpreter); - } } diff --git a/apps/openmw/mwscript/scriptmanager.hpp b/apps/openmw/mwscript/scriptmanager.hpp index 17b8cc2426..5828fbcca8 100644 --- a/apps/openmw/mwscript/scriptmanager.hpp +++ b/apps/openmw/mwscript/scriptmanager.hpp @@ -46,8 +46,6 @@ namespace MWScript Compiler::Context& compilerContext); void run (const std::string& name, Interpreter::Context& interpreterContext); - - static void installOpcodes (Interpreter::Interpreter& interpreter); }; };