forked from mirror/openmw-tes3mp
replaced an include with a forward declaration
This commit is contained in:
parent
5244362fba
commit
111ebf84bb
2 changed files with 15 additions and 8 deletions
|
@ -1,8 +1,11 @@
|
||||||
#include "locals.hpp"
|
#include "locals.hpp"
|
||||||
|
|
||||||
|
#include <components/esm/loadscpt.hpp>
|
||||||
|
|
||||||
|
#include <components/compiler/locals.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/scriptmanager.hpp"
|
#include "../mwbase/scriptmanager.hpp"
|
||||||
#include <components/compiler/locals.hpp>
|
|
||||||
|
|
||||||
namespace MWScript
|
namespace MWScript
|
||||||
{
|
{
|
||||||
|
@ -39,9 +42,9 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Locals::setVarByInt(const std::string& script, const std::string& var, int val)
|
bool Locals::setVarByInt(const std::string& script, const std::string& var, int val)
|
||||||
{
|
{
|
||||||
Compiler::Locals locals = MWBase::Environment::get().getScriptManager()->getLocals(script);
|
Compiler::Locals locals = MWBase::Environment::get().getScriptManager()->getLocals(script);
|
||||||
int index = locals.getIndex(var);
|
int index = locals.getIndex(var);
|
||||||
char type = locals.getType(var);
|
char type = locals.getType(var);
|
||||||
|
@ -51,10 +54,10 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
case 's':
|
case 's':
|
||||||
mShorts.at (index) = val; break;
|
mShorts.at (index) = val; break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
mLongs.at (index) = val; break;
|
mLongs.at (index) = val; break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
mFloats.at (index) = val; break;
|
mFloats.at (index) = val; break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,13 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <components/esm/loadscpt.hpp>
|
|
||||||
#include <components/interpreter/types.hpp>
|
#include <components/interpreter/types.hpp>
|
||||||
|
|
||||||
|
namespace ESM
|
||||||
|
{
|
||||||
|
struct Script;
|
||||||
|
}
|
||||||
|
|
||||||
namespace MWScript
|
namespace MWScript
|
||||||
{
|
{
|
||||||
class Locals
|
class Locals
|
||||||
|
@ -14,11 +18,11 @@ namespace MWScript
|
||||||
std::vector<Interpreter::Type_Short> mShorts;
|
std::vector<Interpreter::Type_Short> mShorts;
|
||||||
std::vector<Interpreter::Type_Integer> mLongs;
|
std::vector<Interpreter::Type_Integer> mLongs;
|
||||||
std::vector<Interpreter::Type_Float> mFloats;
|
std::vector<Interpreter::Type_Float> mFloats;
|
||||||
|
|
||||||
void configure (const ESM::Script& script);
|
void configure (const ESM::Script& script);
|
||||||
bool setVarByInt(const std::string& script, const std::string& var, int val);
|
bool setVarByInt(const std::string& script, const std::string& var, int val);
|
||||||
int getIntVar (const std::string& script, const std::string& var); ///< if var does not exist, returns 0
|
int getIntVar (const std::string& script, const std::string& var); ///< if var does not exist, returns 0
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue