2010-07-03 10:12:13 +00:00
|
|
|
|
|
|
|
#include "cellextensions.hpp"
|
|
|
|
|
|
|
|
#include <components/compiler/extensions.hpp>
|
|
|
|
|
|
|
|
#include <components/interpreter/interpreter.hpp>
|
|
|
|
#include <components/interpreter/runtime.hpp>
|
|
|
|
#include <components/interpreter/opcodes.hpp>
|
|
|
|
|
2010-07-03 13:41:20 +00:00
|
|
|
#include "../mwworld/world.hpp"
|
2010-07-03 13:04:00 +00:00
|
|
|
|
2010-07-03 10:12:13 +00:00
|
|
|
#include "interpretercontext.hpp"
|
|
|
|
|
|
|
|
namespace MWScript
|
|
|
|
{
|
|
|
|
namespace Cell
|
|
|
|
{
|
|
|
|
class OpCellChanged : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
InterpreterContext& context
|
|
|
|
= static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
2010-07-03 13:04:00 +00:00
|
|
|
runtime.push (context.getWorld().hasCellChanged() ? 1 : 0);
|
2010-07-03 10:12:13 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const int opcodeCellChanged = 0x2000000;
|
|
|
|
|
|
|
|
void registerExtensions (Compiler::Extensions& extensions)
|
|
|
|
{
|
|
|
|
extensions.registerFunction ("cellchanged", 'l', "", opcodeCellChanged);
|
|
|
|
}
|
|
|
|
|
|
|
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
|
|
|
{
|
|
|
|
interpreter.installSegment5 (opcodeCellChanged, new OpCellChanged);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|