|
|
|
@ -106,7 +106,7 @@ namespace MWScript
|
|
|
|
|
"Collision Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OpToggleWireframe : public Interpreter::Opcode0
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
@ -123,7 +123,23 @@ namespace MWScript
|
|
|
|
|
"Wireframe Rendering -> On" : "Wireframe Rendering -> Off");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OpTogglePathgrind : public Interpreter::Opcode0
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
|
{
|
|
|
|
|
InterpreterContext& context =
|
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
|
|
bool enabled =
|
|
|
|
|
context.getWorld().toggleRenderMode (MWWorld::World::Render_Wireframe);
|
|
|
|
|
|
|
|
|
|
context.report (enabled ?
|
|
|
|
|
"Path Grid rendering -> On" : "Path Grid Rendering -> Off");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class OpFadeIn : public Interpreter::Opcode0
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
@ -135,11 +151,11 @@ namespace MWScript
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.getWorld().getFader()->fadeIn(time);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OpFadeOut : public Interpreter::Opcode0
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
@ -151,11 +167,11 @@ namespace MWScript
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.getWorld().getFader()->fadeOut(time);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OpFadeTo : public Interpreter::Opcode0
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
@ -167,10 +183,10 @@ namespace MWScript
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float alpha = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.getWorld().getFader()->fadeTo(alpha, time);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -187,6 +203,7 @@ namespace MWScript
|
|
|
|
|
const int opcodeFadeIn = 0x200013c;
|
|
|
|
|
const int opcodeFadeOut = 0x200013d;
|
|
|
|
|
const int opcodeFadeTo = 0x200013e;
|
|
|
|
|
const int opcodeTogglePathgrid = 0x2000141;
|
|
|
|
|
|
|
|
|
|
void registerExtensions (Compiler::Extensions& extensions)
|
|
|
|
|
{
|
|
|
|
@ -204,6 +221,8 @@ namespace MWScript
|
|
|
|
|
extensions.registerInstruction ("fadein", "f", opcodeFadeIn);
|
|
|
|
|
extensions.registerInstruction ("fadeout", "f", opcodeFadeOut);
|
|
|
|
|
extensions.registerInstruction ("fadeto", "ff", opcodeFadeTo);
|
|
|
|
|
extensions.registerInstruction ("togglepathgrid", "", opcodeTogglePathgrid);
|
|
|
|
|
extensions.registerInstruction ("tpg", "", opcodeTogglePathgrid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
|
|
|
@ -220,6 +239,7 @@ namespace MWScript
|
|
|
|
|
interpreter.installSegment5 (opcodeFadeIn, new OpFadeIn);
|
|
|
|
|
interpreter.installSegment5 (opcodeFadeOut, new OpFadeOut);
|
|
|
|
|
interpreter.installSegment5 (opcodeFadeTo, new OpFadeTo);
|
|
|
|
|
interpreter.installSegment5 (opcodeTogglePathgrid, new OpTogglePathgrind);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|