mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
34 lines
760 B
C++
34 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
|
||
|
|