Imported Upstream version 0.26.0

This commit is contained in:
Bret Curtis 2013-10-17 16:37:22 +02:00
commit 9a2b6c69b6
1398 changed files with 212217 additions and 0 deletions

View file

@ -0,0 +1,43 @@
#ifndef INTERPRETER_SPATIALOPCODES_H_INCLUDED
#define INTERPRETER_SPATIALOPCODES_H_INCLUDED
#include "opcodes.hpp"
#include "runtime.hpp"
namespace Interpreter
{
class OpGetDistance : public Opcode0
{
public:
virtual void execute (Runtime& runtime)
{
std::string name = runtime.getStringLiteral (runtime[0].mInteger);
Type_Float distance = runtime.getContext().getDistance (name);
runtime[0].mFloat = distance;
}
};
class OpGetDistanceExplicit : public Opcode0
{
public:
virtual void execute (Runtime& runtime)
{
int index = runtime[0].mInteger;
runtime.pop();
std::string id = runtime.getStringLiteral (index);
std::string name = runtime.getStringLiteral (runtime[0].mInteger);
Type_Float distance = runtime.getContext().getDistance (name, id);
runtime[0].mFloat = distance;
}
};
}
#endif