|
|
|
@ -103,7 +103,75 @@ namespace MWScript
|
|
|
|
|
context.getWorld().toggleRenderMode (MWWorld::World::Render_CollisionDebug);
|
|
|
|
|
|
|
|
|
|
context.report (enabled ?
|
|
|
|
|
"Collsion Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
|
|
|
|
|
"Collision Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class OpToggleWireframe : 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 ?
|
|
|
|
|
"Wireframe Rendering -> On" : "Wireframe Rendering -> Off");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class OpFadeIn : public Interpreter::Opcode0
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
|
{
|
|
|
|
|
InterpreterContext& context =
|
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
context.getWorld().getFader()->fadeIn(time);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class OpFadeOut : public Interpreter::Opcode0
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
|
{
|
|
|
|
|
InterpreterContext& context =
|
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
context.getWorld().getFader()->fadeOut(time);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class OpFadeTo : public Interpreter::Opcode0
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
|
{
|
|
|
|
|
InterpreterContext& context =
|
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float alpha = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
context.getWorld().getFader()->fadeTo(alpha, time);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -115,6 +183,10 @@ namespace MWScript
|
|
|
|
|
const int opcodeUnlock = 0x200008c;
|
|
|
|
|
const int opcodeUnlockExplicit = 0x200008d;
|
|
|
|
|
const int opcodeToggleCollisionDebug = 0x2000132;
|
|
|
|
|
const int opcodeToggleWireframe = 0x200013b;
|
|
|
|
|
const int opcodeFadeIn = 0x200013c;
|
|
|
|
|
const int opcodeFadeOut = 0x200013d;
|
|
|
|
|
const int opcodeFadeTo = 0x200013e;
|
|
|
|
|
|
|
|
|
|
void registerExtensions (Compiler::Extensions& extensions)
|
|
|
|
|
{
|
|
|
|
@ -127,6 +199,11 @@ namespace MWScript
|
|
|
|
|
extensions.registerInstruction ("togglecollisiongrid", "", opcodeToggleCollisionDebug);
|
|
|
|
|
extensions.registerInstruction ("tcb", "", opcodeToggleCollisionDebug);
|
|
|
|
|
extensions.registerInstruction ("tcg", "", opcodeToggleCollisionDebug);
|
|
|
|
|
extensions.registerInstruction ("twf", "", opcodeToggleWireframe);
|
|
|
|
|
extensions.registerInstruction ("togglewireframe", "", opcodeToggleWireframe);
|
|
|
|
|
extensions.registerInstruction ("fadein", "f", opcodeFadeIn);
|
|
|
|
|
extensions.registerInstruction ("fadeout", "f", opcodeFadeOut);
|
|
|
|
|
extensions.registerInstruction ("fadeto", "ff", opcodeFadeTo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
|
|
|
@ -139,6 +216,10 @@ namespace MWScript
|
|
|
|
|
interpreter.installSegment5 (opcodeUnlock, new OpUnlock<ImplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeUnlockExplicit, new OpUnlock<ExplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeToggleCollisionDebug, new OpToggleCollisionDebug);
|
|
|
|
|
interpreter.installSegment5 (opcodeToggleWireframe, new OpToggleWireframe);
|
|
|
|
|
interpreter.installSegment5 (opcodeFadeIn, new OpFadeIn);
|
|
|
|
|
interpreter.installSegment5 (opcodeFadeOut, new OpFadeOut);
|
|
|
|
|
interpreter.installSegment5 (opcodeFadeTo, new OpFadeTo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|