mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 12:45:38 +00:00
Remove some including of mwbase/world.hpp
Since ref.hpp is rather well used in OpenMW-CS this should help compile times there
This commit is contained in:
parent
b714e5211d
commit
fce404acc5
10 changed files with 45 additions and 26 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <components/interpreter/runtime.hpp>
|
||||
#include <components/interpreter/opcodes.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/mechanicsmanager.hpp"
|
||||
|
||||
#include "interpretercontext.hpp"
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwworld/containerstore.hpp"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/inputmanager.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwworld/ptr.hpp"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/dialoguemanager.hpp"
|
||||
#include "../mwbase/journal.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/mechanicsmanager.hpp"
|
||||
|
||||
#include "interpretercontext.hpp"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
#include "../mwbase/scriptmanager.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwworld/player.hpp"
|
||||
|
|
29
apps/openmw/mwscript/ref.cpp
Normal file
29
apps/openmw/mwscript/ref.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "ref.hpp"
|
||||
|
||||
#include <components/interpreter/runtime.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "interpretercontext.hpp"
|
||||
|
||||
MWWorld::Ptr MWScript::ExplicitRef::operator() (Interpreter::Runtime& runtime, bool required,
|
||||
bool activeOnly) const
|
||||
{
|
||||
std::string id = runtime.getStringLiteral(runtime[0].mInteger);
|
||||
runtime.pop();
|
||||
|
||||
if (required)
|
||||
return MWBase::Environment::get().getWorld()->getPtr(id, activeOnly);
|
||||
else
|
||||
return MWBase::Environment::get().getWorld()->searchPtr(id, activeOnly);
|
||||
}
|
||||
|
||||
MWWorld::Ptr MWScript::ImplicitRef::operator() (Interpreter::Runtime& runtime, bool required,
|
||||
bool activeOnly) const
|
||||
{
|
||||
MWScript::InterpreterContext& context
|
||||
= static_cast<MWScript::InterpreterContext&> (runtime.getContext());
|
||||
|
||||
return context.getReference(required);
|
||||
}
|
|
@ -3,14 +3,12 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include <components/interpreter/runtime.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/ptr.hpp"
|
||||
|
||||
#include "interpretercontext.hpp"
|
||||
namespace Interpreter
|
||||
{
|
||||
class Runtime;
|
||||
}
|
||||
|
||||
namespace MWScript
|
||||
{
|
||||
|
@ -18,31 +16,16 @@ namespace MWScript
|
|||
{
|
||||
static const bool implicit = false;
|
||||
|
||||
MWWorld::Ptr operator() (Interpreter::Runtime& runtime, bool required=true,
|
||||
bool activeOnly = false) const
|
||||
{
|
||||
std::string id = runtime.getStringLiteral (runtime[0].mInteger);
|
||||
runtime.pop();
|
||||
|
||||
if (required)
|
||||
return MWBase::Environment::get().getWorld()->getPtr (id, activeOnly);
|
||||
else
|
||||
return MWBase::Environment::get().getWorld()->searchPtr (id, activeOnly);
|
||||
}
|
||||
MWWorld::Ptr operator() (Interpreter::Runtime& runtime, bool required = true,
|
||||
bool activeOnly = false) const;
|
||||
};
|
||||
|
||||
struct ImplicitRef
|
||||
{
|
||||
static const bool implicit = true;
|
||||
|
||||
MWWorld::Ptr operator() (Interpreter::Runtime& runtime, bool required=true,
|
||||
bool activeOnly = false) const
|
||||
{
|
||||
MWScript::InterpreterContext& context
|
||||
= static_cast<MWScript::InterpreterContext&> (runtime.getContext());
|
||||
|
||||
return context.getReference(required);
|
||||
}
|
||||
MWWorld::Ptr operator() (Interpreter::Runtime& runtime, bool required = true,
|
||||
bool activeOnly = false) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "../mwbase/dialoguemanager.hpp"
|
||||
#include "../mwbase/mechanicsmanager.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwworld/player.hpp"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <components/interpreter/opcodes.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
|
|
Loading…
Reference in a new issue