mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-30 05:47:57 +03:00
Imported Upstream version 0.26.0
This commit is contained in:
commit
9a2b6c69b6
1398 changed files with 212217 additions and 0 deletions
47
components/interpreter/scriptopcodes.hpp
Normal file
47
components/interpreter/scriptopcodes.hpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
#ifndef INTERPRETER_SCRIPTOPCODES_H_INCLUDED
|
||||
#define INTERPRETER_SCRIPTOPCODES_H_INCLUDED
|
||||
|
||||
#include "opcodes.hpp"
|
||||
#include "runtime.hpp"
|
||||
#include "context.hpp"
|
||||
|
||||
namespace Interpreter
|
||||
{
|
||||
class OpScriptRunning : public Opcode0
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void execute (Runtime& runtime)
|
||||
{
|
||||
std::string name = runtime.getStringLiteral (runtime[0].mInteger);
|
||||
runtime[0].mInteger = runtime.getContext().isScriptRunning (name);
|
||||
}
|
||||
};
|
||||
|
||||
class OpStartScript : public Opcode0
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void execute (Runtime& runtime)
|
||||
{
|
||||
std::string name = runtime.getStringLiteral (runtime[0].mInteger);
|
||||
runtime.pop();
|
||||
runtime.getContext().startScript (name);
|
||||
}
|
||||
};
|
||||
|
||||
class OpStopScript : public Opcode0
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void execute (Runtime& runtime)
|
||||
{
|
||||
std::string name = runtime.getStringLiteral (runtime[0].mInteger);
|
||||
runtime.pop();
|
||||
runtime.getContext().stopScript (name);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue