forked from teamnwah/openmw-tes3coop
added return and messagebox statements (messagebox does neither formating nor buttons yet)
parent
8bb2a6039d
commit
fac8fb8fcb
@ -0,0 +1,20 @@
|
||||
#ifndef INTERPRETER_CONTROLOPCODES_H_INCLUDED
|
||||
#define INTERPRETER_CONTROLOPCODES_H_INCLUDED
|
||||
|
||||
#include "opcodes.hpp"
|
||||
#include "runtime.hpp"
|
||||
|
||||
namespace Interpreter
|
||||
{
|
||||
class OpReturn : public Opcode0
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void execute (Runtime& runtime)
|
||||
{
|
||||
runtime.setPC (-1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,31 @@
|
||||
#ifndef INTERPRETER_MISCOPCODES_H_INCLUDED
|
||||
#define INTERPRETER_MISCOPCODES_H_INCLUDED
|
||||
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "opcodes.hpp"
|
||||
#include "runtime.hpp"
|
||||
|
||||
namespace Interpreter
|
||||
{
|
||||
class OpMessageBox : public Opcode1
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void execute (Runtime& runtime, unsigned int arg0)
|
||||
{
|
||||
if (arg0!=0)
|
||||
throw std::logic_error ("message box buttons not implemented yet");
|
||||
|
||||
int index = runtime[0];
|
||||
runtime.pop();
|
||||
std::vector<std::string> buttons;
|
||||
runtime.getContext().messageBox (runtime.getStringLiteral (index), buttons);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue