mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
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 <components/esm/loadscpt.hpp>
|
||||
|
||||
#include <components/compiler/locals.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/scriptmanager.hpp"
|
||||
#include <components/compiler/locals.hpp>
|
||||
|
||||
namespace MWScript
|
||||
{
|
||||
|
@ -39,9 +42,9 @@ namespace MWScript
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool Locals::setVarByInt(const std::string& script, const std::string& var, int val)
|
||||
{
|
||||
{
|
||||
Compiler::Locals locals = MWBase::Environment::get().getScriptManager()->getLocals(script);
|
||||
int index = locals.getIndex(var);
|
||||
char type = locals.getType(var);
|
||||
|
@ -51,10 +54,10 @@ namespace MWScript
|
|||
{
|
||||
case 's':
|
||||
mShorts.at (index) = val; break;
|
||||
|
||||
|
||||
case 'l':
|
||||
mLongs.at (index) = val; break;
|
||||
|
||||
|
||||
case 'f':
|
||||
mFloats.at (index) = val; break;
|
||||
}
|
||||
|
|
|
@ -3,9 +3,13 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include <components/esm/loadscpt.hpp>
|
||||
#include <components/interpreter/types.hpp>
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
struct Script;
|
||||
}
|
||||
|
||||
namespace MWScript
|
||||
{
|
||||
class Locals
|
||||
|
@ -14,11 +18,11 @@ namespace MWScript
|
|||
std::vector<Interpreter::Type_Short> mShorts;
|
||||
std::vector<Interpreter::Type_Integer> mLongs;
|
||||
std::vector<Interpreter::Type_Float> mFloats;
|
||||
|
||||
|
||||
void configure (const ESM::Script& script);
|
||||
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
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue