mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-23 16:53:51 +00:00
33 lines
760 B
C++
33 lines
760 B
C++
#ifndef INTERPRETER_GENERICOPCODES_H_INCLUDED
|
|
#define INTERPRETER_GENERICOPCODES_H_INCLUDED
|
|
|
|
#include "opcodes.hpp"
|
|
#include "runtime.hpp"
|
|
|
|
namespace Interpreter
|
|
{
|
|
class OpPushInt : public Opcode1
|
|
{
|
|
public:
|
|
|
|
virtual void execute (Runtime& runtime, unsigned int arg0)
|
|
{
|
|
runtime.push (arg0);
|
|
}
|
|
};
|
|
|
|
class OpIntToFloat : public Opcode0
|
|
{
|
|
public:
|
|
|
|
virtual void execute (Runtime& runtime)
|
|
{
|
|
Type_Data data = runtime[0];
|
|
Type_Float floatValue = static_cast<Type_Float> (data);
|
|
runtime[0] = *reinterpret_cast<Type_Data *> (&floatValue);
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif
|
|
|