Cleanup interpreter code a bit

ptmikheev-master-patch-38354
Matt 3 years ago committed by psi29a
parent 4e93716584
commit 34723c8ea8

@ -130,6 +130,7 @@
Feature #6534: Shader-based object texture blending
Task #6201: Remove the "Note: No relevant classes found. No output generated" warnings
Task #6264: Remove the old classes in animation.cpp
Task #6553: Simplify interpreter instruction registration
0.47.0
------

@ -553,69 +553,68 @@ namespace MWScript
}
};
void installOpcodes (Interpreter::Interpreter& interpreter)
void installOpcodes(Interpreter::Interpreter& interpreter)
{
interpreter.installSegment3 (Compiler::Ai::opcodeAIActivate, new OpAiActivate<ImplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAIActivateExplicit, new OpAiActivate<ExplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiTravel, new OpAiTravel<ImplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiTravelExplicit, new OpAiTravel<ExplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiEscort, new OpAiEscort<ImplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiEscortExplicit, new OpAiEscort<ExplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiEscortCell, new OpAiEscortCell<ImplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiEscortCellExplicit, new OpAiEscortCell<ExplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiWander, new OpAiWander<ImplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiWanderExplicit, new OpAiWander<ExplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiFollow, new OpAiFollow<ImplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiFollowExplicit, new OpAiFollow<ExplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiFollowCell, new OpAiFollowCell<ImplicitRef>);
interpreter.installSegment3 (Compiler::Ai::opcodeAiFollowCellExplicit, new OpAiFollowCell<ExplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetAiPackageDone, new OpGetAiPackageDone<ImplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetAiPackageDoneExplicit,
new OpGetAiPackageDone<ExplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetCurrentAiPackage, new OpGetCurrentAIPackage<ImplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetCurrentAiPackageExplicit, new OpGetCurrentAIPackage<ExplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetDetected, new OpGetDetected<ImplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetDetectedExplicit, new OpGetDetected<ExplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetLineOfSight, new OpGetLineOfSight<ImplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetLineOfSightExplicit, new OpGetLineOfSight<ExplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetTarget, new OpGetTarget<ImplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeGetTargetExplicit, new OpGetTarget<ExplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeStartCombat, new OpStartCombat<ImplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeStartCombatExplicit, new OpStartCombat<ExplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeStopCombat, new OpStopCombat<ImplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeStopCombatExplicit, new OpStopCombat<ExplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeToggleAI, new OpToggleAI);
interpreter.installSegment5 (Compiler::Ai::opcodeSetHello, new OpSetAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Hello));
interpreter.installSegment5 (Compiler::Ai::opcodeSetHelloExplicit, new OpSetAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Hello));
interpreter.installSegment5 (Compiler::Ai::opcodeSetFight, new OpSetAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Fight));
interpreter.installSegment5 (Compiler::Ai::opcodeSetFightExplicit, new OpSetAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Fight));
interpreter.installSegment5 (Compiler::Ai::opcodeSetFlee, new OpSetAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Flee));
interpreter.installSegment5 (Compiler::Ai::opcodeSetFleeExplicit, new OpSetAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Flee));
interpreter.installSegment5 (Compiler::Ai::opcodeSetAlarm, new OpSetAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Alarm));
interpreter.installSegment5 (Compiler::Ai::opcodeSetAlarmExplicit, new OpSetAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Alarm));
interpreter.installSegment5 (Compiler::Ai::opcodeModHello, new OpModAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Hello));
interpreter.installSegment5 (Compiler::Ai::opcodeModHelloExplicit, new OpModAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Hello));
interpreter.installSegment5 (Compiler::Ai::opcodeModFight, new OpModAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Fight));
interpreter.installSegment5 (Compiler::Ai::opcodeModFightExplicit, new OpModAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Fight));
interpreter.installSegment5 (Compiler::Ai::opcodeModFlee, new OpModAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Flee));
interpreter.installSegment5 (Compiler::Ai::opcodeModFleeExplicit, new OpModAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Flee));
interpreter.installSegment5 (Compiler::Ai::opcodeModAlarm, new OpModAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Alarm));
interpreter.installSegment5 (Compiler::Ai::opcodeModAlarmExplicit, new OpModAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Alarm));
interpreter.installSegment5 (Compiler::Ai::opcodeGetHello, new OpGetAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Hello));
interpreter.installSegment5 (Compiler::Ai::opcodeGetHelloExplicit, new OpGetAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Hello));
interpreter.installSegment5 (Compiler::Ai::opcodeGetFight, new OpGetAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Fight));
interpreter.installSegment5 (Compiler::Ai::opcodeGetFightExplicit, new OpGetAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Fight));
interpreter.installSegment5 (Compiler::Ai::opcodeGetFlee, new OpGetAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Flee));
interpreter.installSegment5 (Compiler::Ai::opcodeGetFleeExplicit, new OpGetAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Flee));
interpreter.installSegment5 (Compiler::Ai::opcodeGetAlarm, new OpGetAiSetting<ImplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Alarm));
interpreter.installSegment5 (Compiler::Ai::opcodeGetAlarmExplicit, new OpGetAiSetting<ExplicitRef>(MWMechanics::CreatureStats::AiSetting::AI_Alarm));
interpreter.installSegment5 (Compiler::Ai::opcodeFace, new OpFace<ImplicitRef>);
interpreter.installSegment5 (Compiler::Ai::opcodeFaceExplicit, new OpFace<ExplicitRef>);
interpreter.installSegment3<OpAiActivate<ImplicitRef>>(Compiler::Ai::opcodeAIActivate);
interpreter.installSegment3<OpAiActivate<ExplicitRef>>(Compiler::Ai::opcodeAIActivateExplicit);
interpreter.installSegment3<OpAiTravel<ImplicitRef>>(Compiler::Ai::opcodeAiTravel);
interpreter.installSegment3<OpAiTravel<ExplicitRef>>(Compiler::Ai::opcodeAiTravelExplicit);
interpreter.installSegment3<OpAiEscort<ImplicitRef>>(Compiler::Ai::opcodeAiEscort);
interpreter.installSegment3<OpAiEscort<ExplicitRef>>(Compiler::Ai::opcodeAiEscortExplicit);
interpreter.installSegment3<OpAiEscortCell<ImplicitRef>>(Compiler::Ai::opcodeAiEscortCell);
interpreter.installSegment3<OpAiEscortCell<ExplicitRef>>(Compiler::Ai::opcodeAiEscortCellExplicit);
interpreter.installSegment3<OpAiWander<ImplicitRef>>(Compiler::Ai::opcodeAiWander);
interpreter.installSegment3<OpAiWander<ExplicitRef>>(Compiler::Ai::opcodeAiWanderExplicit);
interpreter.installSegment3<OpAiFollow<ImplicitRef>>(Compiler::Ai::opcodeAiFollow);
interpreter.installSegment3<OpAiFollow<ExplicitRef>>(Compiler::Ai::opcodeAiFollowExplicit);
interpreter.installSegment3<OpAiFollowCell<ImplicitRef>>(Compiler::Ai::opcodeAiFollowCell);
interpreter.installSegment3<OpAiFollowCell<ExplicitRef>>(Compiler::Ai::opcodeAiFollowCellExplicit);
interpreter.installSegment5<OpGetAiPackageDone<ImplicitRef>>(Compiler::Ai::opcodeGetAiPackageDone);
interpreter.installSegment5<OpGetAiPackageDone<ExplicitRef>>(Compiler::Ai::opcodeGetAiPackageDoneExplicit);
interpreter.installSegment5<OpGetCurrentAIPackage<ImplicitRef>>(Compiler::Ai::opcodeGetCurrentAiPackage);
interpreter.installSegment5<OpGetCurrentAIPackage<ExplicitRef>>(Compiler::Ai::opcodeGetCurrentAiPackageExplicit);
interpreter.installSegment5<OpGetDetected<ImplicitRef>>(Compiler::Ai::opcodeGetDetected);
interpreter.installSegment5<OpGetDetected<ExplicitRef>>(Compiler::Ai::opcodeGetDetectedExplicit);
interpreter.installSegment5<OpGetLineOfSight<ImplicitRef>>(Compiler::Ai::opcodeGetLineOfSight);
interpreter.installSegment5<OpGetLineOfSight<ExplicitRef>>(Compiler::Ai::opcodeGetLineOfSightExplicit);
interpreter.installSegment5<OpGetTarget<ImplicitRef>>(Compiler::Ai::opcodeGetTarget);
interpreter.installSegment5<OpGetTarget<ExplicitRef>>(Compiler::Ai::opcodeGetTargetExplicit);
interpreter.installSegment5<OpStartCombat<ImplicitRef>>(Compiler::Ai::opcodeStartCombat);
interpreter.installSegment5<OpStartCombat<ExplicitRef>>(Compiler::Ai::opcodeStartCombatExplicit);
interpreter.installSegment5<OpStopCombat<ImplicitRef>>(Compiler::Ai::opcodeStopCombat);
interpreter.installSegment5<OpStopCombat<ExplicitRef>>(Compiler::Ai::opcodeStopCombatExplicit);
interpreter.installSegment5<OpToggleAI>(Compiler::Ai::opcodeToggleAI);
interpreter.installSegment5<OpSetAiSetting<ImplicitRef>>(Compiler::Ai::opcodeSetHello, MWMechanics::CreatureStats::AiSetting::AI_Hello);
interpreter.installSegment5<OpSetAiSetting<ExplicitRef>>(Compiler::Ai::opcodeSetHelloExplicit, MWMechanics::CreatureStats::AiSetting::AI_Hello);
interpreter.installSegment5<OpSetAiSetting<ImplicitRef>>(Compiler::Ai::opcodeSetFight, MWMechanics::CreatureStats::AiSetting::AI_Fight);
interpreter.installSegment5<OpSetAiSetting<ExplicitRef>>(Compiler::Ai::opcodeSetFightExplicit, MWMechanics::CreatureStats::AiSetting::AI_Fight);
interpreter.installSegment5<OpSetAiSetting<ImplicitRef>>(Compiler::Ai::opcodeSetFlee, MWMechanics::CreatureStats::AiSetting::AI_Flee);
interpreter.installSegment5<OpSetAiSetting<ExplicitRef>>(Compiler::Ai::opcodeSetFleeExplicit, MWMechanics::CreatureStats::AiSetting::AI_Flee);
interpreter.installSegment5<OpSetAiSetting<ImplicitRef>>(Compiler::Ai::opcodeSetAlarm, MWMechanics::CreatureStats::AiSetting::AI_Alarm);
interpreter.installSegment5<OpSetAiSetting<ExplicitRef>>(Compiler::Ai::opcodeSetAlarmExplicit, MWMechanics::CreatureStats::AiSetting::AI_Alarm);
interpreter.installSegment5<OpModAiSetting<ImplicitRef>>(Compiler::Ai::opcodeModHello, MWMechanics::CreatureStats::AiSetting::AI_Hello);
interpreter.installSegment5<OpModAiSetting<ExplicitRef>>(Compiler::Ai::opcodeModHelloExplicit, MWMechanics::CreatureStats::AiSetting::AI_Hello);
interpreter.installSegment5<OpModAiSetting<ImplicitRef>>(Compiler::Ai::opcodeModFight, MWMechanics::CreatureStats::AiSetting::AI_Fight);
interpreter.installSegment5<OpModAiSetting<ExplicitRef>>(Compiler::Ai::opcodeModFightExplicit, MWMechanics::CreatureStats::AiSetting::AI_Fight);
interpreter.installSegment5<OpModAiSetting<ImplicitRef>>(Compiler::Ai::opcodeModFlee, MWMechanics::CreatureStats::AiSetting::AI_Flee);
interpreter.installSegment5<OpModAiSetting<ExplicitRef>>(Compiler::Ai::opcodeModFleeExplicit, MWMechanics::CreatureStats::AiSetting::AI_Flee);
interpreter.installSegment5<OpModAiSetting<ImplicitRef>>(Compiler::Ai::opcodeModAlarm, MWMechanics::CreatureStats::AiSetting::AI_Alarm);
interpreter.installSegment5<OpModAiSetting<ExplicitRef>>(Compiler::Ai::opcodeModAlarmExplicit, MWMechanics::CreatureStats::AiSetting::AI_Alarm);
interpreter.installSegment5<OpGetAiSetting<ImplicitRef>>(Compiler::Ai::opcodeGetHello, MWMechanics::CreatureStats::AiSetting::AI_Hello);
interpreter.installSegment5<OpGetAiSetting<ExplicitRef>>(Compiler::Ai::opcodeGetHelloExplicit, MWMechanics::CreatureStats::AiSetting::AI_Hello);
interpreter.installSegment5<OpGetAiSetting<ImplicitRef>>(Compiler::Ai::opcodeGetFight, MWMechanics::CreatureStats::AiSetting::AI_Fight);
interpreter.installSegment5<OpGetAiSetting<ExplicitRef>>(Compiler::Ai::opcodeGetFightExplicit, MWMechanics::CreatureStats::AiSetting::AI_Fight);
interpreter.installSegment5<OpGetAiSetting<ImplicitRef>>(Compiler::Ai::opcodeGetFlee, MWMechanics::CreatureStats::AiSetting::AI_Flee);
interpreter.installSegment5<OpGetAiSetting<ExplicitRef>>(Compiler::Ai::opcodeGetFleeExplicit, MWMechanics::CreatureStats::AiSetting::AI_Flee);
interpreter.installSegment5<OpGetAiSetting<ImplicitRef>>(Compiler::Ai::opcodeGetAlarm, MWMechanics::CreatureStats::AiSetting::AI_Alarm);
interpreter.installSegment5<OpGetAiSetting<ExplicitRef>>(Compiler::Ai::opcodeGetAlarmExplicit, MWMechanics::CreatureStats::AiSetting::AI_Alarm);
interpreter.installSegment5<OpFace<ImplicitRef>>(Compiler::Ai::opcodeFace);
interpreter.installSegment5<OpFace<ExplicitRef>>(Compiler::Ai::opcodeFaceExplicit);
}
}
}

@ -101,12 +101,12 @@ namespace MWScript
void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::Animation::opcodeSkipAnim, new OpSkipAnim<ImplicitRef>);
interpreter.installSegment5 (Compiler::Animation::opcodeSkipAnimExplicit, new OpSkipAnim<ExplicitRef>);
interpreter.installSegment3 (Compiler::Animation::opcodePlayAnim, new OpPlayAnim<ImplicitRef>);
interpreter.installSegment3 (Compiler::Animation::opcodePlayAnimExplicit, new OpPlayAnim<ExplicitRef>);
interpreter.installSegment3 (Compiler::Animation::opcodeLoopAnim, new OpLoopAnim<ImplicitRef>);
interpreter.installSegment3 (Compiler::Animation::opcodeLoopAnimExplicit, new OpLoopAnim<ExplicitRef>);
interpreter.installSegment5<OpSkipAnim<ImplicitRef>>(Compiler::Animation::opcodeSkipAnim);
interpreter.installSegment5<OpSkipAnim<ExplicitRef>>(Compiler::Animation::opcodeSkipAnimExplicit);
interpreter.installSegment3<OpPlayAnim<ImplicitRef>>(Compiler::Animation::opcodePlayAnim);
interpreter.installSegment3<OpPlayAnim<ExplicitRef>>(Compiler::Animation::opcodePlayAnimExplicit);
interpreter.installSegment3<OpLoopAnim<ImplicitRef>>(Compiler::Animation::opcodeLoopAnim);
interpreter.installSegment3<OpLoopAnim<ExplicitRef>>(Compiler::Animation::opcodeLoopAnimExplicit);
}
}
}

@ -250,16 +250,16 @@ namespace MWScript
void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::Cell::opcodeCellChanged, new OpCellChanged);
interpreter.installSegment5 (Compiler::Cell::opcodeTestCells, new OpTestCells);
interpreter.installSegment5 (Compiler::Cell::opcodeTestInteriorCells, new OpTestInteriorCells);
interpreter.installSegment5 (Compiler::Cell::opcodeCOC, new OpCOC);
interpreter.installSegment5 (Compiler::Cell::opcodeCOE, new OpCOE);
interpreter.installSegment5 (Compiler::Cell::opcodeGetInterior, new OpGetInterior);
interpreter.installSegment5 (Compiler::Cell::opcodeGetPCCell, new OpGetPCCell);
interpreter.installSegment5 (Compiler::Cell::opcodeGetWaterLevel, new OpGetWaterLevel);
interpreter.installSegment5 (Compiler::Cell::opcodeSetWaterLevel, new OpSetWaterLevel);
interpreter.installSegment5 (Compiler::Cell::opcodeModWaterLevel, new OpModWaterLevel);
interpreter.installSegment5<OpCellChanged>(Compiler::Cell::opcodeCellChanged);
interpreter.installSegment5<OpTestCells>(Compiler::Cell::opcodeTestCells);
interpreter.installSegment5<OpTestInteriorCells>(Compiler::Cell::opcodeTestInteriorCells);
interpreter.installSegment5<OpCOC>(Compiler::Cell::opcodeCOC);
interpreter.installSegment5<OpCOE>(Compiler::Cell::opcodeCOE);
interpreter.installSegment5<OpGetInterior>(Compiler::Cell::opcodeGetInterior);
interpreter.installSegment5<OpGetPCCell>(Compiler::Cell::opcodeGetPCCell);
interpreter.installSegment5<OpGetWaterLevel>(Compiler::Cell::opcodeGetWaterLevel);
interpreter.installSegment5<OpSetWaterLevel>(Compiler::Cell::opcodeSetWaterLevel);
interpreter.installSegment5<OpModWaterLevel>(Compiler::Cell::opcodeModWaterLevel);
}
}
}

@ -488,22 +488,22 @@ namespace MWScript
void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::Container::opcodeAddItem, new OpAddItem<ImplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeAddItemExplicit, new OpAddItem<ExplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeGetItemCount, new OpGetItemCount<ImplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeGetItemCountExplicit, new OpGetItemCount<ExplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeRemoveItem, new OpRemoveItem<ImplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeRemoveItemExplicit, new OpRemoveItem<ExplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeEquip, new OpEquip<ImplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeEquipExplicit, new OpEquip<ExplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeGetArmorType, new OpGetArmorType<ImplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeGetArmorTypeExplicit, new OpGetArmorType<ExplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeHasItemEquipped, new OpHasItemEquipped<ImplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeHasItemEquippedExplicit, new OpHasItemEquipped<ExplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeHasSoulGem, new OpHasSoulGem<ImplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeHasSoulGemExplicit, new OpHasSoulGem<ExplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeGetWeaponType, new OpGetWeaponType<ImplicitRef>);
interpreter.installSegment5 (Compiler::Container::opcodeGetWeaponTypeExplicit, new OpGetWeaponType<ExplicitRef>);
interpreter.installSegment5<OpAddItem<ImplicitRef>>(Compiler::Container::opcodeAddItem);
interpreter.installSegment5<OpAddItem<ExplicitRef>>(Compiler::Container::opcodeAddItemExplicit);
interpreter.installSegment5<OpGetItemCount<ImplicitRef>>(Compiler::Container::opcodeGetItemCount);
interpreter.installSegment5<OpGetItemCount<ExplicitRef>>(Compiler::Container::opcodeGetItemCountExplicit);
interpreter.installSegment5<OpRemoveItem<ImplicitRef>>(Compiler::Container::opcodeRemoveItem);
interpreter.installSegment5<OpRemoveItem<ExplicitRef>>(Compiler::Container::opcodeRemoveItemExplicit);
interpreter.installSegment5<OpEquip<ImplicitRef>>(Compiler::Container::opcodeEquip);
interpreter.installSegment5<OpEquip<ExplicitRef>>(Compiler::Container::opcodeEquipExplicit);
interpreter.installSegment5<OpGetArmorType<ImplicitRef>>(Compiler::Container::opcodeGetArmorType);
interpreter.installSegment5<OpGetArmorType<ExplicitRef>>(Compiler::Container::opcodeGetArmorTypeExplicit);
interpreter.installSegment5<OpHasItemEquipped<ImplicitRef>>(Compiler::Container::opcodeHasItemEquipped);
interpreter.installSegment5<OpHasItemEquipped<ExplicitRef>>(Compiler::Container::opcodeHasItemEquippedExplicit);
interpreter.installSegment5<OpHasSoulGem<ImplicitRef>>(Compiler::Container::opcodeHasSoulGem);
interpreter.installSegment5<OpHasSoulGem<ExplicitRef>>(Compiler::Container::opcodeHasSoulGemExplicit);
interpreter.installSegment5<OpGetWeaponType<ImplicitRef>>(Compiler::Container::opcodeGetWeaponType);
interpreter.installSegment5<OpGetWeaponType<ExplicitRef>>(Compiler::Container::opcodeGetWeaponTypeExplicit);
}
}
}

@ -188,67 +188,51 @@ namespace MWScript
};
void installOpcodes (Interpreter::Interpreter& interpreter)
void installOpcodes(Interpreter::Interpreter& interpreter)
{
for (int i=0; i<Compiler::Control::numberOfControls; ++i)
for (int i = 0; i < Compiler::Control::numberOfControls; ++i)
{
interpreter.installSegment5 (Compiler::Control::opcodeEnable+i, new OpSetControl (Compiler::Control::controls[i], true));
interpreter.installSegment5 (Compiler::Control::opcodeDisable+i, new OpSetControl (Compiler::Control::controls[i], false));
interpreter.installSegment5 (Compiler::Control::opcodeGetDisabled+i, new OpGetDisabled (Compiler::Control::controls[i]));
interpreter.installSegment5<OpSetControl>(Compiler::Control::opcodeEnable + i, Compiler::Control::controls[i], true);
interpreter.installSegment5<OpSetControl>(Compiler::Control::opcodeDisable + i, Compiler::Control::controls[i], false);
interpreter.installSegment5<OpGetDisabled>(Compiler::Control::opcodeGetDisabled + i, Compiler::Control::controls[i]);
}
interpreter.installSegment5 (Compiler::Control::opcodeToggleCollision, new OpToggleCollision);
interpreter.installSegment5<OpToggleCollision>(Compiler::Control::opcodeToggleCollision);
//Force Run
interpreter.installSegment5 (Compiler::Control::opcodeClearForceRun,
new OpClearMovementFlag<ImplicitRef> (MWMechanics::CreatureStats::Flag_ForceRun));
interpreter.installSegment5 (Compiler::Control::opcodeClearForceRunExplicit,
new OpClearMovementFlag<ExplicitRef> (MWMechanics::CreatureStats::Flag_ForceRun));
interpreter.installSegment5 (Compiler::Control::opcodeForceRun,
new OpSetMovementFlag<ImplicitRef> (MWMechanics::CreatureStats::Flag_ForceRun));
interpreter.installSegment5 (Compiler::Control::opcodeForceRunExplicit,
new OpSetMovementFlag<ExplicitRef> (MWMechanics::CreatureStats::Flag_ForceRun));
interpreter.installSegment5<OpClearMovementFlag<ImplicitRef>>(Compiler::Control::opcodeClearForceRun, MWMechanics::CreatureStats::Flag_ForceRun);
interpreter.installSegment5<OpClearMovementFlag<ExplicitRef>>(Compiler::Control::opcodeClearForceRunExplicit, MWMechanics::CreatureStats::Flag_ForceRun);
interpreter.installSegment5<OpSetMovementFlag<ImplicitRef>>(Compiler::Control::opcodeForceRun, MWMechanics::CreatureStats::Flag_ForceRun);
interpreter.installSegment5<OpSetMovementFlag<ExplicitRef>>(Compiler::Control::opcodeForceRunExplicit, MWMechanics::CreatureStats::Flag_ForceRun);
//Force Jump
interpreter.installSegment5 (Compiler::Control::opcodeClearForceJump,
new OpClearMovementFlag<ImplicitRef> (MWMechanics::CreatureStats::Flag_ForceJump));
interpreter.installSegment5 (Compiler::Control::opcodeClearForceJumpExplicit,
new OpClearMovementFlag<ExplicitRef> (MWMechanics::CreatureStats::Flag_ForceJump));
interpreter.installSegment5 (Compiler::Control::opcodeForceJump,
new OpSetMovementFlag<ImplicitRef> (MWMechanics::CreatureStats::Flag_ForceJump));
interpreter.installSegment5 (Compiler::Control::opcodeForceJumpExplicit,
new OpSetMovementFlag<ExplicitRef> (MWMechanics::CreatureStats::Flag_ForceJump));
interpreter.installSegment5<OpClearMovementFlag<ImplicitRef>>(Compiler::Control::opcodeClearForceJump, MWMechanics::CreatureStats::Flag_ForceJump);
interpreter.installSegment5<OpClearMovementFlag<ExplicitRef>>(Compiler::Control::opcodeClearForceJumpExplicit, MWMechanics::CreatureStats::Flag_ForceJump);
interpreter.installSegment5<OpSetMovementFlag<ImplicitRef>>(Compiler::Control::opcodeForceJump, MWMechanics::CreatureStats::Flag_ForceJump);
interpreter.installSegment5<OpSetMovementFlag<ExplicitRef>>(Compiler::Control::opcodeForceJumpExplicit, MWMechanics::CreatureStats::Flag_ForceJump);
//Force MoveJump
interpreter.installSegment5 (Compiler::Control::opcodeClearForceMoveJump,
new OpClearMovementFlag<ImplicitRef> (MWMechanics::CreatureStats::Flag_ForceMoveJump));
interpreter.installSegment5 (Compiler::Control::opcodeClearForceMoveJumpExplicit,
new OpClearMovementFlag<ExplicitRef> (MWMechanics::CreatureStats::Flag_ForceMoveJump));
interpreter.installSegment5 (Compiler::Control::opcodeForceMoveJump,
new OpSetMovementFlag<ImplicitRef> (MWMechanics::CreatureStats::Flag_ForceMoveJump));
interpreter.installSegment5 (Compiler::Control::opcodeForceMoveJumpExplicit,
new OpSetMovementFlag<ExplicitRef> (MWMechanics::CreatureStats::Flag_ForceMoveJump));
interpreter.installSegment5<OpClearMovementFlag<ImplicitRef>>(Compiler::Control::opcodeClearForceMoveJump, MWMechanics::CreatureStats::Flag_ForceMoveJump);
interpreter.installSegment5<OpClearMovementFlag<ExplicitRef>>(Compiler::Control::opcodeClearForceMoveJumpExplicit, MWMechanics::CreatureStats::Flag_ForceMoveJump);
interpreter.installSegment5<OpSetMovementFlag<ImplicitRef>>(Compiler::Control::opcodeForceMoveJump, MWMechanics::CreatureStats::Flag_ForceMoveJump);
interpreter.installSegment5<OpSetMovementFlag<ExplicitRef>>(Compiler::Control::opcodeForceMoveJumpExplicit, MWMechanics::CreatureStats::Flag_ForceMoveJump);
//Force Sneak
interpreter.installSegment5 (Compiler::Control::opcodeClearForceSneak,
new OpClearMovementFlag<ImplicitRef> (MWMechanics::CreatureStats::Flag_ForceSneak));
interpreter.installSegment5 (Compiler::Control::opcodeClearForceSneakExplicit,
new OpClearMovementFlag<ExplicitRef> (MWMechanics::CreatureStats::Flag_ForceSneak));
interpreter.installSegment5 (Compiler::Control::opcodeForceSneak,
new OpSetMovementFlag<ImplicitRef> (MWMechanics::CreatureStats::Flag_ForceSneak));
interpreter.installSegment5 (Compiler::Control::opcodeForceSneakExplicit,
new OpSetMovementFlag<ExplicitRef> (MWMechanics::CreatureStats::Flag_ForceSneak));
interpreter.installSegment5 (Compiler::Control::opcodeGetPcRunning, new OpGetPcRunning);
interpreter.installSegment5 (Compiler::Control::opcodeGetPcSneaking, new OpGetPcSneaking);
interpreter.installSegment5 (Compiler::Control::opcodeGetForceRun, new OpGetForceRun<ImplicitRef>);
interpreter.installSegment5 (Compiler::Control::opcodeGetForceRunExplicit, new OpGetForceRun<ExplicitRef>);
interpreter.installSegment5 (Compiler::Control::opcodeGetForceJump, new OpGetForceJump<ImplicitRef>);
interpreter.installSegment5 (Compiler::Control::opcodeGetForceJumpExplicit, new OpGetForceJump<ExplicitRef>);
interpreter.installSegment5 (Compiler::Control::opcodeGetForceMoveJump, new OpGetForceMoveJump<ImplicitRef>);
interpreter.installSegment5 (Compiler::Control::opcodeGetForceMoveJumpExplicit, new OpGetForceMoveJump<ExplicitRef>);
interpreter.installSegment5 (Compiler::Control::opcodeGetForceSneak, new OpGetForceSneak<ImplicitRef>);
interpreter.installSegment5 (Compiler::Control::opcodeGetForceSneakExplicit, new OpGetForceSneak<ExplicitRef>);
interpreter.installSegment5<OpClearMovementFlag<ImplicitRef>>(Compiler::Control::opcodeClearForceSneak, MWMechanics::CreatureStats::Flag_ForceSneak);
interpreter.installSegment5<OpClearMovementFlag<ExplicitRef>>(Compiler::Control::opcodeClearForceSneakExplicit, MWMechanics::CreatureStats::Flag_ForceSneak);
interpreter.installSegment5<OpSetMovementFlag<ImplicitRef>>(Compiler::Control::opcodeForceSneak, MWMechanics::CreatureStats::Flag_ForceSneak);
interpreter.installSegment5<OpSetMovementFlag<ExplicitRef>>(Compiler::Control::opcodeForceSneakExplicit, MWMechanics::CreatureStats::Flag_ForceSneak);
interpreter.installSegment5<OpGetPcRunning>(Compiler::Control::opcodeGetPcRunning);
interpreter.installSegment5<OpGetPcSneaking>(Compiler::Control::opcodeGetPcSneaking);
interpreter.installSegment5<OpGetForceRun<ImplicitRef>>(Compiler::Control::opcodeGetForceRun);
interpreter.installSegment5<OpGetForceRun<ExplicitRef>>(Compiler::Control::opcodeGetForceRunExplicit);
interpreter.installSegment5<OpGetForceJump<ImplicitRef>>(Compiler::Control::opcodeGetForceJump);
interpreter.installSegment5<OpGetForceJump<ExplicitRef>>(Compiler::Control::opcodeGetForceJumpExplicit);
interpreter.installSegment5<OpGetForceMoveJump<ImplicitRef>>(Compiler::Control::opcodeGetForceMoveJump);
interpreter.installSegment5<OpGetForceMoveJump<ExplicitRef>>(Compiler::Control::opcodeGetForceMoveJumpExplicit);
interpreter.installSegment5<OpGetForceSneak<ImplicitRef>>(Compiler::Control::opcodeGetForceSneak);
interpreter.installSegment5<OpGetForceSneak<ExplicitRef>>(Compiler::Control::opcodeGetForceSneakExplicit);
}
}
}

@ -284,28 +284,28 @@ namespace MWScript
void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::Dialogue::opcodeJournal, new OpJournal<ImplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeJournalExplicit, new OpJournal<ExplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeSetJournalIndex, new OpSetJournalIndex);
interpreter.installSegment5 (Compiler::Dialogue::opcodeGetJournalIndex, new OpGetJournalIndex);
interpreter.installSegment5 (Compiler::Dialogue::opcodeAddTopic, new OpAddTopic);
interpreter.installSegment3 (Compiler::Dialogue::opcodeChoice,new OpChoice);
interpreter.installSegment5 (Compiler::Dialogue::opcodeForceGreeting, new OpForceGreeting<ImplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeForceGreetingExplicit, new OpForceGreeting<ExplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeGoodbye, new OpGoodbye);
interpreter.installSegment5 (Compiler::Dialogue::opcodeGetReputation, new OpGetReputation<ImplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeSetReputation, new OpSetReputation<ImplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeModReputation, new OpModReputation<ImplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeSetReputationExplicit, new OpSetReputation<ExplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeModReputationExplicit, new OpModReputation<ExplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeGetReputationExplicit, new OpGetReputation<ExplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeSameFaction, new OpSameFaction<ImplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeSameFactionExplicit, new OpSameFaction<ExplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeModFactionReaction, new OpModFactionReaction);
interpreter.installSegment5 (Compiler::Dialogue::opcodeSetFactionReaction, new OpSetFactionReaction);
interpreter.installSegment5 (Compiler::Dialogue::opcodeGetFactionReaction, new OpGetFactionReaction);
interpreter.installSegment5 (Compiler::Dialogue::opcodeClearInfoActor, new OpClearInfoActor<ImplicitRef>);
interpreter.installSegment5 (Compiler::Dialogue::opcodeClearInfoActorExplicit, new OpClearInfoActor<ExplicitRef>);
interpreter.installSegment5<OpJournal<ImplicitRef>>(Compiler::Dialogue::opcodeJournal);
interpreter.installSegment5<OpJournal<ExplicitRef>>(Compiler::Dialogue::opcodeJournalExplicit);
interpreter.installSegment5<OpSetJournalIndex>(Compiler::Dialogue::opcodeSetJournalIndex);
interpreter.installSegment5<OpGetJournalIndex>(Compiler::Dialogue::opcodeGetJournalIndex);
interpreter.installSegment5<OpAddTopic>(Compiler::Dialogue::opcodeAddTopic);
interpreter.installSegment3<OpChoice>(Compiler::Dialogue::opcodeChoice);
interpreter.installSegment5<OpForceGreeting<ImplicitRef>>(Compiler::Dialogue::opcodeForceGreeting);
interpreter.installSegment5<OpForceGreeting<ExplicitRef>>(Compiler::Dialogue::opcodeForceGreetingExplicit);
interpreter.installSegment5<OpGoodbye>(Compiler::Dialogue::opcodeGoodbye);
interpreter.installSegment5<OpGetReputation<ImplicitRef>>(Compiler::Dialogue::opcodeGetReputation);
interpreter.installSegment5<OpSetReputation<ImplicitRef>>(Compiler::Dialogue::opcodeSetReputation);
interpreter.installSegment5<OpModReputation<ImplicitRef>>(Compiler::Dialogue::opcodeModReputation);
interpreter.installSegment5<OpSetReputation<ExplicitRef>>(Compiler::Dialogue::opcodeSetReputationExplicit);
interpreter.installSegment5<OpModReputation<ExplicitRef>>(Compiler::Dialogue::opcodeModReputationExplicit);
interpreter.installSegment5<OpGetReputation<ExplicitRef>>(Compiler::Dialogue::opcodeGetReputationExplicit);
interpreter.installSegment5<OpSameFaction<ImplicitRef>>(Compiler::Dialogue::opcodeSameFaction);
interpreter.installSegment5<OpSameFaction<ExplicitRef>>(Compiler::Dialogue::opcodeSameFactionExplicit);
interpreter.installSegment5<OpModFactionReaction>(Compiler::Dialogue::opcodeModFactionReaction);
interpreter.installSegment5<OpSetFactionReaction>(Compiler::Dialogue::opcodeSetFactionReaction);
interpreter.installSegment5<OpGetFactionReaction>(Compiler::Dialogue::opcodeGetFactionReaction);
interpreter.installSegment5<OpClearInfoActor<ImplicitRef>>(Compiler::Dialogue::opcodeClearInfoActor);
interpreter.installSegment5<OpClearInfoActor<ExplicitRef>>(Compiler::Dialogue::opcodeClearInfoActorExplicit);
}
}

@ -218,45 +218,33 @@ namespace MWScript
void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::Gui::opcodeEnableBirthMenu,
new OpShowDialogue (MWGui::GM_Birth));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableClassMenu,
new OpShowDialogue (MWGui::GM_Class));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableNameMenu,
new OpShowDialogue (MWGui::GM_Name));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableRaceMenu,
new OpShowDialogue (MWGui::GM_Race));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableStatsReviewMenu,
new OpShowDialogue (MWGui::GM_Review));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableLevelupMenu,
new OpShowDialogue (MWGui::GM_Levelup));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableInventoryMenu,
new OpEnableWindow (MWGui::GW_Inventory));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableMagicMenu,
new OpEnableWindow (MWGui::GW_Magic));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableMapMenu,
new OpEnableWindow (MWGui::GW_Map));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableStatsMenu,
new OpEnableWindow (MWGui::GW_Stats));
interpreter.installSegment5 (Compiler::Gui::opcodeEnableRest,
new OpEnableRest ());
interpreter.installSegment5 (Compiler::Gui::opcodeShowRestMenu,
new OpShowRestMenu<ImplicitRef>);
interpreter.installSegment5 (Compiler::Gui::opcodeShowRestMenuExplicit, new OpShowRestMenu<ExplicitRef>);
interpreter.installSegment5 (Compiler::Gui::opcodeGetButtonPressed, new OpGetButtonPressed);
interpreter.installSegment5 (Compiler::Gui::opcodeToggleFogOfWar, new OpToggleFogOfWar);
interpreter.installSegment5 (Compiler::Gui::opcodeToggleFullHelp, new OpToggleFullHelp);
interpreter.installSegment5 (Compiler::Gui::opcodeShowMap, new OpShowMap);
interpreter.installSegment5 (Compiler::Gui::opcodeFillMap, new OpFillMap);
interpreter.installSegment3 (Compiler::Gui::opcodeMenuTest, new OpMenuTest);
interpreter.installSegment5 (Compiler::Gui::opcodeToggleMenus, new OpToggleMenus);
interpreter.installSegment5<OpShowDialogue>(Compiler::Gui::opcodeEnableBirthMenu, MWGui::GM_Birth);
interpreter.installSegment5<OpShowDialogue>(Compiler::Gui::opcodeEnableClassMenu, MWGui::GM_Class);
interpreter.installSegment5<OpShowDialogue>(Compiler::Gui::opcodeEnableNameMenu, MWGui::GM_Name);
interpreter.installSegment5<OpShowDialogue>(Compiler::Gui::opcodeEnableRaceMenu, MWGui::GM_Race);
interpreter.installSegment5<OpShowDialogue>(Compiler::Gui::opcodeEnableStatsReviewMenu, MWGui::GM_Review);
interpreter.installSegment5<OpShowDialogue>(Compiler::Gui::opcodeEnableLevelupMenu, MWGui::GM_Levelup);
interpreter.installSegment5<OpEnableWindow>(Compiler::Gui::opcodeEnableInventoryMenu, MWGui::GW_Inventory);
interpreter.installSegment5<OpEnableWindow>(Compiler::Gui::opcodeEnableMagicMenu, MWGui::GW_Magic);
interpreter.installSegment5<OpEnableWindow>(Compiler::Gui::opcodeEnableMapMenu, MWGui::GW_Map);
interpreter.installSegment5<OpEnableWindow>(Compiler::Gui::opcodeEnableStatsMenu, MWGui::GW_Stats);
interpreter.installSegment5<OpEnableRest>(Compiler::Gui::opcodeEnableRest);
interpreter.installSegment5<OpShowRestMenu<ImplicitRef>>(Compiler::Gui::opcodeShowRestMenu);
interpreter.installSegment5<OpShowRestMenu<ExplicitRef>>(Compiler::Gui::opcodeShowRestMenuExplicit);
interpreter.installSegment5<OpGetButtonPressed>(Compiler::Gui::opcodeGetButtonPressed);
interpreter.installSegment5<OpToggleFogOfWar>(Compiler::Gui::opcodeToggleFogOfWar);
interpreter.installSegment5<OpToggleFullHelp>(Compiler::Gui::opcodeToggleFullHelp);
interpreter.installSegment5<OpShowMap>(Compiler::Gui::opcodeShowMap);
interpreter.installSegment5<OpFillMap>(Compiler::Gui::opcodeFillMap);
interpreter.installSegment3<OpMenuTest>(Compiler::Gui::opcodeMenuTest);
interpreter.installSegment5<OpToggleMenus>(Compiler::Gui::opcodeToggleMenus);
}
}
}

@ -1616,125 +1616,125 @@ namespace MWScript
void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::Misc::opcodeMenuMode, new OpMenuMode);
interpreter.installSegment5 (Compiler::Misc::opcodeRandom, new OpRandom);
interpreter.installSegment5 (Compiler::Misc::opcodeScriptRunning, new OpScriptRunning);
interpreter.installSegment5 (Compiler::Misc::opcodeStartScript, new OpStartScript<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeStartScriptExplicit, new OpStartScript<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeStopScript, new OpStopScript);
interpreter.installSegment5 (Compiler::Misc::opcodeGetSecondsPassed, new OpGetSecondsPassed);
interpreter.installSegment5 (Compiler::Misc::opcodeEnable, new OpEnable<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeEnableExplicit, new OpEnable<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeDisable, new OpDisable<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeDisableExplicit, new OpDisable<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetDisabled, new OpGetDisabled<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetDisabledExplicit, new OpGetDisabled<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeXBox, new OpXBox);
interpreter.installSegment5 (Compiler::Misc::opcodeOnActivate, new OpOnActivate<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeOnActivateExplicit, new OpOnActivate<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeActivate, new OpActivate<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeActivateExplicit, new OpActivate<ExplicitRef>);
interpreter.installSegment3 (Compiler::Misc::opcodeLock, new OpLock<ImplicitRef>);
interpreter.installSegment3 (Compiler::Misc::opcodeLockExplicit, new OpLock<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeUnlock, new OpUnlock<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeUnlockExplicit, new OpUnlock<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleCollisionDebug, new OpToggleCollisionDebug);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleCollisionBoxes, new OpToggleCollisionBoxes);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleWireframe, new OpToggleWireframe);
interpreter.installSegment5 (Compiler::Misc::opcodeFadeIn, new OpFadeIn);
interpreter.installSegment5 (Compiler::Misc::opcodeFadeOut, new OpFadeOut);
interpreter.installSegment5 (Compiler::Misc::opcodeFadeTo, new OpFadeTo);
interpreter.installSegment5 (Compiler::Misc::opcodeTogglePathgrid, new OpTogglePathgrid);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleWater, new OpToggleWater);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleWorld, new OpToggleWorld);
interpreter.installSegment5 (Compiler::Misc::opcodeDontSaveObject, new OpDontSaveObject);
interpreter.installSegment5 (Compiler::Misc::opcodePcForce1stPerson, new OpPcForce1stPerson);
interpreter.installSegment5 (Compiler::Misc::opcodePcForce3rdPerson, new OpPcForce3rdPerson);
interpreter.installSegment5 (Compiler::Misc::opcodePcGet3rdPerson, new OpPcGet3rdPerson);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleVanityMode, new OpToggleVanityMode);
interpreter.installSegment5 (Compiler::Misc::opcodeGetPcSleep, new OpGetPcSleep);
interpreter.installSegment5 (Compiler::Misc::opcodeGetPcJumping, new OpGetPcJumping);
interpreter.installSegment5 (Compiler::Misc::opcodeWakeUpPc, new OpWakeUpPc);
interpreter.installSegment5 (Compiler::Misc::opcodePlayBink, new OpPlayBink);
interpreter.installSegment5 (Compiler::Misc::opcodePayFine, new OpPayFine);
interpreter.installSegment5 (Compiler::Misc::opcodePayFineThief, new OpPayFineThief);
interpreter.installSegment5 (Compiler::Misc::opcodeGoToJail, new OpGoToJail);
interpreter.installSegment5 (Compiler::Misc::opcodeGetLocked, new OpGetLocked<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetLockedExplicit, new OpGetLocked<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetEffect, new OpGetEffect<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetEffectExplicit, new OpGetEffect<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeAddSoulGem, new OpAddSoulGem<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeAddSoulGemExplicit, new OpAddSoulGem<ExplicitRef>);
interpreter.installSegment3 (Compiler::Misc::opcodeRemoveSoulGem, new OpRemoveSoulGem<ImplicitRef>);
interpreter.installSegment3 (Compiler::Misc::opcodeRemoveSoulGemExplicit, new OpRemoveSoulGem<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeDrop, new OpDrop<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeDropExplicit, new OpDrop<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeDropSoulGem, new OpDropSoulGem<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeDropSoulGemExplicit, new OpDropSoulGem<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetAttacked, new OpGetAttacked<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetAttackedExplicit, new OpGetAttacked<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetWeaponDrawn, new OpGetWeaponDrawn<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetWeaponDrawnExplicit, new OpGetWeaponDrawn<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellReadied, new OpGetSpellReadied<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellReadiedExplicit, new OpGetSpellReadied<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellEffects, new OpGetSpellEffects<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellEffectsExplicit, new OpGetSpellEffects<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetCurrentTime, new OpGetCurrentTime);
interpreter.installSegment5 (Compiler::Misc::opcodeSetDelete, new OpSetDelete<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeSetDeleteExplicit, new OpSetDelete<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetSquareRoot, new OpGetSquareRoot);
interpreter.installSegment5 (Compiler::Misc::opcodeFall, new OpFall<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeFallExplicit, new OpFall<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetStandingPc, new OpGetStandingPc<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetStandingPcExplicit, new OpGetStandingPc<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetStandingActor, new OpGetStandingActor<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetStandingActorExplicit, new OpGetStandingActor<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetCollidingPc, new OpGetCollidingPc<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetCollidingPcExplicit, new OpGetCollidingPc<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetCollidingActor, new OpGetCollidingActor<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetCollidingActorExplicit, new OpGetCollidingActor<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeHurtStandingActor, new OpHurtStandingActor<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeHurtStandingActorExplicit, new OpHurtStandingActor<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeHurtCollidingActor, new OpHurtCollidingActor<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeHurtCollidingActorExplicit, new OpHurtCollidingActor<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetWindSpeed, new OpGetWindSpeed);
interpreter.installSegment5 (Compiler::Misc::opcodeHitOnMe, new OpHitOnMe<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeHitOnMeExplicit, new OpHitOnMe<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeHitAttemptOnMe, new OpHitAttemptOnMe<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeHitAttemptOnMeExplicit, new OpHitAttemptOnMe<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeDisableTeleporting, new OpEnableTeleporting<false>);
interpreter.installSegment5 (Compiler::Misc::opcodeEnableTeleporting, new OpEnableTeleporting<true>);
interpreter.installSegment5 (Compiler::Misc::opcodeShowVars, new OpShowVars<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeShowVarsExplicit, new OpShowVars<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeShow, new OpShow<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeShowExplicit, new OpShow<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleGodMode, new OpToggleGodMode);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleScripts, new OpToggleScripts);
interpreter.installSegment5 (Compiler::Misc::opcodeDisableLevitation, new OpEnableLevitation<false>);
interpreter.installSegment5 (Compiler::Misc::opcodeEnableLevitation, new OpEnableLevitation<true>);
interpreter.installSegment5 (Compiler::Misc::opcodeCast, new OpCast<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeCastExplicit, new OpCast<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeExplodeSpell, new OpExplodeSpell<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeExplodeSpellExplicit, new OpExplodeSpell<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeGetPcInJail, new OpGetPcInJail);
interpreter.installSegment5 (Compiler::Misc::opcodeGetPcTraveling, new OpGetPcTraveling);
interpreter.installSegment3 (Compiler::Misc::opcodeBetaComment, new OpBetaComment<ImplicitRef>);
interpreter.installSegment3 (Compiler::Misc::opcodeBetaCommentExplicit, new OpBetaComment<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeAddToLevCreature, new OpAddToLevCreature);
interpreter.installSegment5 (Compiler::Misc::opcodeRemoveFromLevCreature, new OpRemoveFromLevCreature);
interpreter.installSegment5 (Compiler::Misc::opcodeAddToLevItem, new OpAddToLevItem);
interpreter.installSegment5 (Compiler::Misc::opcodeRemoveFromLevItem, new OpRemoveFromLevItem);
interpreter.installSegment3 (Compiler::Misc::opcodeShowSceneGraph, new OpShowSceneGraph<ImplicitRef>);
interpreter.installSegment3 (Compiler::Misc::opcodeShowSceneGraphExplicit, new OpShowSceneGraph<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleBorders, new OpToggleBorders);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleNavMesh, new OpToggleNavMesh);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleActorsPaths, new OpToggleActorsPaths);
interpreter.installSegment5 (Compiler::Misc::opcodeSetNavMeshNumberToRender, new OpSetNavMeshNumberToRender);
interpreter.installSegment5 (Compiler::Misc::opcodeRepairedOnMe, new OpRepairedOnMe<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeRepairedOnMeExplicit, new OpRepairedOnMe<ExplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleRecastMesh, new OpToggleRecastMesh);
interpreter.installSegment5 (Compiler::Misc::opcodeHelp, new OpHelp);
interpreter.installSegment5 (Compiler::Misc::opcodeReloadLua, new OpReloadLua);
interpreter.installSegment5<OpMenuMode>(Compiler::Misc::opcodeMenuMode);
interpreter.installSegment5<OpRandom>(Compiler::Misc::opcodeRandom);
interpreter.installSegment5<OpScriptRunning>(Compiler::Misc::opcodeScriptRunning);
interpreter.installSegment5<OpStartScript<ImplicitRef>>(Compiler::Misc::opcodeStartScript);
interpreter.installSegment5<OpStartScript<ExplicitRef>>(Compiler::Misc::opcodeStartScriptExplicit);
interpreter.installSegment5<OpStopScript>(Compiler::Misc::opcodeStopScript);
interpreter.installSegment5<OpGetSecondsPassed>(Compiler::Misc::opcodeGetSecondsPassed);
interpreter.installSegment5<OpEnable<ImplicitRef>>(Compiler::Misc::opcodeEnable);
interpreter.installSegment5<OpEnable<ExplicitRef>>(Compiler::Misc::opcodeEnableExplicit);
interpreter.installSegment5<OpDisable<ImplicitRef>>(Compiler::Misc::opcodeDisable);
interpreter.installSegment5<OpDisable<ExplicitRef>>(Compiler::Misc::opcodeDisableExplicit);
interpreter.installSegment5<OpGetDisabled<ImplicitRef>>(Compiler::Misc::opcodeGetDisabled);
interpreter.installSegment5<OpGetDisabled<ExplicitRef>>(Compiler::Misc::opcodeGetDisabledExplicit);
interpreter.installSegment5<OpXBox>(Compiler::Misc::opcodeXBox);
interpreter.installSegment5<OpOnActivate<ImplicitRef>>(Compiler::Misc::opcodeOnActivate);
interpreter.installSegment5<OpOnActivate<ExplicitRef>>(Compiler::Misc::opcodeOnActivateExplicit);
interpreter.installSegment5<OpActivate<ImplicitRef>>(Compiler::Misc::opcodeActivate);
interpreter.installSegment5<OpActivate<ExplicitRef>>(Compiler::Misc::opcodeActivateExplicit);
interpreter.installSegment3<OpLock<ImplicitRef>>(Compiler::Misc::opcodeLock);
interpreter.installSegment3<OpLock<ExplicitRef>>(Compiler::Misc::opcodeLockExplicit);
interpreter.installSegment5<OpUnlock<ImplicitRef>>(Compiler::Misc::opcodeUnlock);
interpreter.installSegment5<OpUnlock<ExplicitRef>>(Compiler::Misc::opcodeUnlockExplicit);
interpreter.installSegment5<OpToggleCollisionDebug>(Compiler::Misc::opcodeToggleCollisionDebug);
interpreter.installSegment5<OpToggleCollisionBoxes>(Compiler::Misc::opcodeToggleCollisionBoxes);
interpreter.installSegment5<OpToggleWireframe>(Compiler::Misc::opcodeToggleWireframe);
interpreter.installSegment5<OpFadeIn>(Compiler::Misc::opcodeFadeIn);
interpreter.installSegment5<OpFadeOut>(Compiler::Misc::opcodeFadeOut);
interpreter.installSegment5<OpFadeTo>(Compiler::Misc::opcodeFadeTo);
interpreter.installSegment5<OpTogglePathgrid>(Compiler::Misc::opcodeTogglePathgrid);
interpreter.installSegment5<OpToggleWater>(Compiler::Misc::opcodeToggleWater);
interpreter.installSegment5<OpToggleWorld>(Compiler::Misc::opcodeToggleWorld);
interpreter.installSegment5<OpDontSaveObject>(Compiler::Misc::opcodeDontSaveObject);
interpreter.installSegment5<OpPcForce1stPerson>(Compiler::Misc::opcodePcForce1stPerson);
interpreter.installSegment5<OpPcForce3rdPerson>(Compiler::Misc::opcodePcForce3rdPerson);
interpreter.installSegment5<OpPcGet3rdPerson>(Compiler::Misc::opcodePcGet3rdPerson);
interpreter.installSegment5<OpToggleVanityMode>(Compiler::Misc::opcodeToggleVanityMode);
interpreter.installSegment5<OpGetPcSleep>(Compiler::Misc::opcodeGetPcSleep);
interpreter.installSegment5<OpGetPcJumping>(Compiler::Misc::opcodeGetPcJumping);
interpreter.installSegment5<OpWakeUpPc>(Compiler::Misc::opcodeWakeUpPc);
interpreter.installSegment5<OpPlayBink>(Compiler::Misc::opcodePlayBink);
interpreter.installSegment5<OpPayFine>(Compiler::Misc::opcodePayFine);
interpreter.installSegment5<OpPayFineThief>(Compiler::Misc::opcodePayFineThief);
interpreter.installSegment5<OpGoToJail>(Compiler::Misc::opcodeGoToJail);
interpreter.installSegment5<OpGetLocked<ImplicitRef>>(Compiler::Misc::opcodeGetLocked);
interpreter.installSegment5<OpGetLocked<ExplicitRef>>(Compiler::Misc::opcodeGetLockedExplicit);
interpreter.installSegment5<OpGetEffect<ImplicitRef>>(Compiler::Misc::opcodeGetEffect);
interpreter.installSegment5<OpGetEffect<ExplicitRef>>(Compiler::Misc::opcodeGetEffectExplicit);
interpreter.installSegment5<OpAddSoulGem<ImplicitRef>>(Compiler::Misc::opcodeAddSoulGem);
interpreter.installSegment5<OpAddSoulGem<ExplicitRef>>(Compiler::Misc::opcodeAddSoulGemExplicit);
interpreter.installSegment3<OpRemoveSoulGem<ImplicitRef>>(Compiler::Misc::opcodeRemoveSoulGem);
interpreter.installSegment3<OpRemoveSoulGem<ExplicitRef>>(Compiler::Misc::opcodeRemoveSoulGemExplicit);
interpreter.installSegment5<OpDrop<ImplicitRef>>(Compiler::Misc::opcodeDrop);
interpreter.installSegment5<OpDrop<ExplicitRef>>(Compiler::Misc::opcodeDropExplicit);
interpreter.installSegment5<OpDropSoulGem<ImplicitRef>>(Compiler::Misc::opcodeDropSoulGem);
interpreter.installSegment5<OpDropSoulGem<ExplicitRef>>(Compiler::Misc::opcodeDropSoulGemExplicit);
interpreter.installSegment5<OpGetAttacked<ImplicitRef>>(Compiler::Misc::opcodeGetAttacked);
interpreter.installSegment5<OpGetAttacked<ExplicitRef>>(Compiler::Misc::opcodeGetAttackedExplicit);
interpreter.installSegment5<OpGetWeaponDrawn<ImplicitRef>>(Compiler::Misc::opcodeGetWeaponDrawn);
interpreter.installSegment5<OpGetWeaponDrawn<ExplicitRef>>(Compiler::Misc::opcodeGetWeaponDrawnExplicit);
interpreter.installSegment5<OpGetSpellReadied<ImplicitRef>>(Compiler::Misc::opcodeGetSpellReadied);
interpreter.installSegment5<OpGetSpellReadied<ExplicitRef>>(Compiler::Misc::opcodeGetSpellReadiedExplicit);
interpreter.installSegment5<OpGetSpellEffects<ImplicitRef>>(Compiler::Misc::opcodeGetSpellEffects);
interpreter.installSegment5<OpGetSpellEffects<ExplicitRef>>(Compiler::Misc::opcodeGetSpellEffectsExplicit);
interpreter.installSegment5<OpGetCurrentTime>(Compiler::Misc::opcodeGetCurrentTime);
interpreter.installSegment5<OpSetDelete<ImplicitRef>>(Compiler::Misc::opcodeSetDelete);
interpreter.installSegment5<OpSetDelete<ExplicitRef>>(Compiler::Misc::opcodeSetDeleteExplicit);
interpreter.installSegment5<OpGetSquareRoot>(Compiler::Misc::opcodeGetSquareRoot);
interpreter.installSegment5<OpFall<ImplicitRef>>(Compiler::Misc::opcodeFall);
interpreter.installSegment5<OpFall<ExplicitRef>>(Compiler::Misc::opcodeFallExplicit);
interpreter.installSegment5<OpGetStandingPc<ImplicitRef>>(Compiler::Misc::opcodeGetStandingPc);
interpreter.installSegment5<OpGetStandingPc<ExplicitRef>>(Compiler::Misc::opcodeGetStandingPcExplicit);
interpreter.installSegment5<OpGetStandingActor<ImplicitRef>>(Compiler::Misc::opcodeGetStandingActor);
interpreter.installSegment5<OpGetStandingActor<ExplicitRef>>(Compiler::Misc::opcodeGetStandingActorExplicit);
interpreter.installSegment5<OpGetCollidingPc<ImplicitRef>>(Compiler::Misc::opcodeGetCollidingPc);
interpreter.installSegment5<OpGetCollidingPc<ExplicitRef>>(Compiler::Misc::opcodeGetCollidingPcExplicit);
interpreter.installSegment5<OpGetCollidingActor<ImplicitRef>>(Compiler::Misc::opcodeGetCollidingActor);
interpreter.installSegment5<OpGetCollidingActor<ExplicitRef>>(Compiler::Misc::opcodeGetCollidingActorExplicit);
interpreter.installSegment5<OpHurtStandingActor<ImplicitRef>>(Compiler::Misc::opcodeHurtStandingActor);
interpreter.installSegment5<OpHurtStandingActor<ExplicitRef>>(Compiler::Misc::opcodeHurtStandingActorExplicit);
interpreter.installSegment5<OpHurtCollidingActor<ImplicitRef>>(Compiler::Misc::opcodeHurtCollidingActor);
interpreter.installSegment5<OpHurtCollidingActor<ExplicitRef>>(Compiler::Misc::opcodeHurtCollidingActorExplicit);
interpreter.installSegment5<OpGetWindSpeed>(Compiler::Misc::opcodeGetWindSpeed);
interpreter.installSegment5<OpHitOnMe<ImplicitRef>>(Compiler::Misc::opcodeHitOnMe);
interpreter.installSegment5<OpHitOnMe<ExplicitRef>>(Compiler::Misc::opcodeHitOnMeExplicit);
interpreter.installSegment5<OpHitAttemptOnMe<ImplicitRef>>(Compiler::Misc::opcodeHitAttemptOnMe);
interpreter.installSegment5<OpHitAttemptOnMe<ExplicitRef>>(Compiler::Misc::opcodeHitAttemptOnMeExplicit);
interpreter.installSegment5<OpEnableTeleporting<false>>(Compiler::Misc::opcodeDisableTeleporting);
interpreter.installSegment5<OpEnableTeleporting<true>>(Compiler::Misc::opcodeEnableTeleporting);
interpreter.installSegment5<OpShowVars<ImplicitRef>>(Compiler::Misc::opcodeShowVars);
interpreter.installSegment5<OpShowVars<ExplicitRef>>(Compiler::Misc::opcodeShowVarsExplicit);
interpreter.installSegment5<OpShow<ImplicitRef>>(Compiler::Misc::opcodeShow);
interpreter.installSegment5<OpShow<ExplicitRef>>(Compiler::Misc::opcodeShowExplicit);
interpreter.installSegment5<OpToggleGodMode>(Compiler::Misc::opcodeToggleGodMode);
interpreter.installSegment5<OpToggleScripts>(Compiler::Misc::opcodeToggleScripts);
interpreter.installSegment5<OpEnableLevitation<false>>(Compiler::Misc::opcodeDisableLevitation);
interpreter.installSegment5<OpEnableLevitation<true>>(Compiler::Misc::opcodeEnableLevitation);
interpreter.installSegment5<OpCast<ImplicitRef>>(Compiler::Misc::opcodeCast);
interpreter.installSegment5<OpCast<ExplicitRef>>(Compiler::Misc::opcodeCastExplicit);
interpreter.installSegment5<OpExplodeSpell<ImplicitRef>>(Compiler::Misc::opcodeExplodeSpell);
interpreter.installSegment5<OpExplodeSpell<ExplicitRef>>(Compiler::Misc::opcodeExplodeSpellExplicit);
interpreter.installSegment5<OpGetPcInJail>(Compiler::Misc::opcodeGetPcInJail);
interpreter.installSegment5<OpGetPcTraveling>(Compiler::Misc::opcodeGetPcTraveling);
interpreter.installSegment3<OpBetaComment<ImplicitRef>>(Compiler::Misc::opcodeBetaComment);
interpreter.installSegment3<OpBetaComment<ExplicitRef>>(Compiler::Misc::opcodeBetaCommentExplicit);
interpreter.installSegment5<OpAddToLevCreature>(Compiler::Misc::opcodeAddToLevCreature);
interpreter.installSegment5<OpRemoveFromLevCreature>(Compiler::Misc::opcodeRemoveFromLevCreature);
interpreter.installSegment5<OpAddToLevItem>(Compiler::Misc::opcodeAddToLevItem);
interpreter.installSegment5<OpRemoveFromLevItem>(Compiler::Misc::opcodeRemoveFromLevItem);
interpreter.installSegment3<OpShowSceneGraph<ImplicitRef>>(Compiler::Misc::opcodeShowSceneGraph);
interpreter.installSegment3<OpShowSceneGraph<ExplicitRef>>(Compiler::Misc::opcodeShowSceneGraphExplicit);
interpreter.installSegment5<OpToggleBorders>(Compiler::Misc::opcodeToggleBorders);
interpreter.installSegment5<OpToggleNavMesh>(Compiler::Misc::opcodeToggleNavMesh);
interpreter.installSegment5<OpToggleActorsPaths>(Compiler::Misc::opcodeToggleActorsPaths);
interpreter.installSegment5<OpSetNavMeshNumberToRender>(Compiler::Misc::opcodeSetNavMeshNumberToRender);
interpreter.installSegment5<OpRepairedOnMe<ImplicitRef>>(Compiler::Misc::opcodeRepairedOnMe);
interpreter.installSegment5<OpRepairedOnMe<ExplicitRef>>(Compiler::Misc::opcodeRepairedOnMeExplicit);
interpreter.installSegment5<OpToggleRecastMesh>(Compiler::Misc::opcodeToggleRecastMesh);
interpreter.installSegment5<OpHelp>(Compiler::Misc::opcodeHelp);
interpreter.installSegment5<OpReloadLua>(Compiler::Misc::opcodeReloadLua);
}
}
}

@ -126,14 +126,14 @@ namespace MWScript
void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::Sky::opcodeToggleSky, new OpToggleSky);
interpreter.installSegment5 (Compiler::Sky::opcodeTurnMoonWhite, new OpTurnMoonWhite);
interpreter.installSegment5 (Compiler::Sky::opcodeTurnMoonRed, new OpTurnMoonRed);
interpreter.installSegment5 (Compiler::Sky::opcodeGetMasserPhase, new OpGetMasserPhase);
interpreter.installSegment5 (Compiler::Sky::opcodeGetSecundaPhase, new OpGetSecundaPhase);
interpreter.installSegment5 (Compiler::Sky::opcodeGetCurrentWeather, new OpGetCurrentWeather);
interpreter.installSegment5 (Compiler::Sky::opcodeChangeWeather, new OpChangeWeather);
interpreter.installSegment3 (Compiler::Sky::opcodeModRegion, new OpModRegion);
interpreter.installSegment5<OpToggleSky>(Compiler::Sky::opcodeToggleSky);
interpreter.installSegment5<OpTurnMoonWhite>(Compiler::Sky::opcodeTurnMoonWhite);
interpreter.installSegment5<OpTurnMoonRed>(Compiler::Sky::opcodeTurnMoonRed);
interpreter.installSegment5<OpGetMasserPhase>(Compiler::Sky::opcodeGetMasserPhase);
interpreter.installSegment5<OpGetSecundaPhase>(Compiler::Sky::opcodeGetSecundaPhase);
interpreter.installSegment5<OpGetCurrentWeather>(Compiler::Sky::opcodeGetCurrentWeather);
interpreter.installSegment5<OpChangeWeather>(Compiler::Sky::opcodeChangeWeather);
interpreter.installSegment3<OpModRegion>(Compiler::Sky::opcodeModRegion);
}
}
}

@ -104,15 +104,11 @@ namespace MWScript
}
};
template<class R>
template<class R, bool TLoop>
class OpPlaySound3D : public Interpreter::Opcode0
{
bool mLoop;
public:
OpPlaySound3D (bool loop) : mLoop (loop) {}
void execute (Interpreter::Runtime& runtime) override
{
MWWorld::Ptr ptr = R()(runtime);
@ -122,20 +118,16 @@ namespace MWScript
MWBase::Environment::get().getSoundManager()->playSound3D(ptr, sound, 1.0, 1.0,
MWSound::Type::Sfx,
mLoop ? MWSound::PlayMode::LoopRemoveAtDistance
TLoop ? MWSound::PlayMode::LoopRemoveAtDistance
: MWSound::PlayMode::Normal);
}
};
template<class R>
template<class R, bool TLoop>
class OpPlaySoundVP3D : public Interpreter::Opcode0
{
bool mLoop;
public:
OpPlaySoundVP3D (bool loop) : mLoop (loop) {}
void execute (Interpreter::Runtime& runtime) override
{
MWWorld::Ptr ptr = R()(runtime);
@ -151,7 +143,7 @@ namespace MWScript
MWBase::Environment::get().getSoundManager()->playSound3D(ptr, sound, volume, pitch,
MWSound::Type::Sfx,
mLoop ? MWSound::PlayMode::LoopRemoveAtDistance
TLoop ? MWSound::PlayMode::LoopRemoveAtDistance
: MWSound::PlayMode::Normal);
}
@ -205,34 +197,28 @@ namespace MWScript
};
void installOpcodes (Interpreter::Interpreter& interpreter)
void installOpcodes(Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::Sound::opcodeSay, new OpSay<ImplicitRef>);
interpreter.installSegment5 (Compiler::Sound::opcodeSayDone, new OpSayDone<ImplicitRef>);
interpreter.installSegment5 (Compiler::Sound::opcodeStreamMusic, new OpStreamMusic);
interpreter.installSegment5 (Compiler::Sound::opcodePlaySound, new OpPlaySound);
interpreter.installSegment5 (Compiler::Sound::opcodePlaySoundVP, new OpPlaySoundVP);
interpreter.installSegment5 (Compiler::Sound::opcodePlaySound3D, new OpPlaySound3D<ImplicitRef> (false));
interpreter.installSegment5 (Compiler::Sound::opcodePlaySound3DVP, new OpPlaySoundVP3D<ImplicitRef> (false));
interpreter.installSegment5 (Compiler::Sound::opcodePlayLoopSound3D, new OpPlaySound3D<ImplicitRef> (true));
interpreter.installSegment5 (Compiler::Sound::opcodePlayLoopSound3DVP,
new OpPlaySoundVP3D<ImplicitRef> (true));
interpreter.installSegment5 (Compiler::Sound::opcodeStopSound, new OpStopSound<ImplicitRef>);
interpreter.installSegment5 (Compiler::Sound::opcodeGetSoundPlaying, new OpGetSoundPlaying<ImplicitRef>);
interpreter.installSegment5 (Compiler::Sound::opcodeSayExplicit, new OpSay<ExplicitRef>);
interpreter.installSegment5 (Compiler::Sound::opcodeSayDoneExplicit, new OpSayDone<ExplicitRef>);
interpreter.installSegment5 (Compiler::Sound::opcodePlaySound3DExplicit,
new OpPlaySound3D<ExplicitRef> (false));
interpreter.installSegment5 (Compiler::Sound::opcodePlaySound3DVPExplicit,
new OpPlaySoundVP3D<ExplicitRef> (false));
interpreter.installSegment5 (Compiler::Sound::opcodePlayLoopSound3DExplicit,
new OpPlaySound3D<ExplicitRef> (true));
interpreter.installSegment5 (Compiler::Sound::opcodePlayLoopSound3DVPExplicit,
new OpPlaySoundVP3D<ExplicitRef> (true));
interpreter.installSegment5 (Compiler::Sound::opcodeStopSoundExplicit, new OpStopSound<ExplicitRef>);
interpreter.installSegment5 (Compiler::Sound::opcodeGetSoundPlayingExplicit,
new OpGetSoundPlaying<ExplicitRef>);
interpreter.installSegment5<OpSay<ImplicitRef>>(Compiler::Sound::opcodeSay);
interpreter.installSegment5<OpSayDone<ImplicitRef>>(Compiler::Sound::opcodeSayDone);
interpreter.installSegment5<OpStreamMusic>(Compiler::Sound::opcodeStreamMusic);
interpreter.installSegment5<OpPlaySound>(Compiler::Sound::opcodePlaySound);
interpreter.installSegment5<OpPlaySoundVP>(Compiler::Sound::opcodePlaySoundVP);
interpreter.installSegment5<OpPlaySound3D<ImplicitRef, false>>(Compiler::Sound::opcodePlaySound3D);
interpreter.installSegment5<OpPlaySoundVP3D<ImplicitRef, false>>(Compiler::Sound::opcodePlaySound3DVP);
interpreter.installSegment5<OpPlaySound3D<ImplicitRef, true>>(Compiler::Sound::opcodePlayLoopSound3D);
interpreter.installSegment5<OpPlaySoundVP3D<ImplicitRef, true>>(Compiler::Sound::opcodePlayLoopSound3DVP);
interpreter.installSegment5<OpStopSound<ImplicitRef>>(Compiler::Sound::opcodeStopSound);
interpreter.installSegment5<OpGetSoundPlaying<ImplicitRef>>(Compiler::Sound::opcodeGetSoundPlaying);
interpreter.installSegment5<OpSay<ExplicitRef>>(Compiler::Sound::opcodeSayExplicit);
interpreter.installSegment5<OpSayDone<ExplicitRef>>(Compiler::Sound::opcodeSayDoneExplicit);
interpreter.installSegment5<OpPlaySound3D<ExplicitRef, false>>(Compiler::Sound::opcodePlaySound3DExplicit);
interpreter.installSegment5<OpPlaySoundVP3D<ExplicitRef, false>>(Compiler::Sound::opcodePlaySound3DVPExplicit);
interpreter.installSegment5<OpPlaySound3D<ExplicitRef, true>>(Compiler::Sound::opcodePlayLoopSound3DExplicit);
interpreter.installSegment5<OpPlaySoundVP3D<ExplicitRef, true>>(Compiler::Sound::opcodePlayLoopSound3DVPExplicit);
interpreter.installSegment5<OpStopSound<ExplicitRef>>(Compiler::Sound::opcodeStopSoundExplicit);
interpreter.installSegment5<OpGetSoundPlaying<ExplicitRef>>(Compiler::Sound::opcodeGetSoundPlayingExplicit);
}
}
}

@ -1325,146 +1325,132 @@ namespace MWScript
{
for (int i=0; i<Compiler::Stats::numberOfAttributes; ++i)
{
interpreter.installSegment5 (Compiler::Stats::opcodeGetAttribute+i, new OpGetAttribute<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeGetAttributeExplicit+i,
new OpGetAttribute<ExplicitRef> (i));
interpreter.installSegment5<OpGetAttribute<ImplicitRef>>(Compiler::Stats::opcodeGetAttribute + i, i);
interpreter.installSegment5<OpGetAttribute<ExplicitRef>>(Compiler::Stats::opcodeGetAttributeExplicit + i, i);
interpreter.installSegment5 (Compiler::Stats::opcodeSetAttribute+i, new OpSetAttribute<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeSetAttributeExplicit+i,
new OpSetAttribute<ExplicitRef> (i));
interpreter.installSegment5<OpSetAttribute<ImplicitRef>>(Compiler::Stats::opcodeSetAttribute + i, i);
interpreter.installSegment5<OpSetAttribute<ExplicitRef>>(Compiler::Stats::opcodeSetAttributeExplicit + i, i);
interpreter.installSegment5 (Compiler::Stats::opcodeModAttribute+i, new OpModAttribute<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeModAttributeExplicit+i,
new OpModAttribute<ExplicitRef> (i));
interpreter.installSegment5<OpModAttribute<ImplicitRef>>(Compiler::Stats::opcodeModAttribute + i, i);
interpreter.installSegment5<OpModAttribute<ExplicitRef>>(Compiler::Stats::opcodeModAttributeExplicit + i, i);
}
for (int i=0; i<Compiler::Stats::numberOfDynamics; ++i)
{
interpreter.installSegment5 (Compiler::Stats::opcodeGetDynamic+i, new OpGetDynamic<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeGetDynamicExplicit+i,
new OpGetDynamic<ExplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeSetDynamic+i, new OpSetDynamic<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeSetDynamicExplicit+i,
new OpSetDynamic<ExplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeModDynamic+i, new OpModDynamic<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeModDynamicExplicit+i,
new OpModDynamic<ExplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeModCurrentDynamic+i,
new OpModCurrentDynamic<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeModCurrentDynamicExplicit+i,
new OpModCurrentDynamic<ExplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeGetDynamicGetRatio+i,
new OpGetDynamicGetRatio<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeGetDynamicGetRatioExplicit+i,
new OpGetDynamicGetRatio<ExplicitRef> (i));
interpreter.installSegment5<OpGetDynamic<ImplicitRef>>(Compiler::Stats::opcodeGetDynamic + i, i);
interpreter.installSegment5<OpGetDynamic<ExplicitRef>>(Compiler::Stats::opcodeGetDynamicExplicit + i, i);
interpreter.installSegment5<OpSetDynamic<ImplicitRef>>(Compiler::Stats::opcodeSetDynamic + i, i);
interpreter.installSegment5<OpSetDynamic<ExplicitRef>>(Compiler::Stats::opcodeSetDynamicExplicit + i, i);
interpreter.installSegment5<OpModDynamic<ImplicitRef>>(Compiler::Stats::opcodeModDynamic + i, i);
interpreter.installSegment5<OpModDynamic<ExplicitRef>>(Compiler::Stats::opcodeModDynamicExplicit + i, i);
interpreter.installSegment5<OpModCurrentDynamic<ImplicitRef>>(Compiler::Stats::opcodeModCurrentDynamic + i, i);
interpreter.installSegment5<OpModCurrentDynamic<ExplicitRef>>(Compiler::Stats::opcodeModCurrentDynamicExplicit + i, i);
interpreter.installSegment5<OpGetDynamicGetRatio<ImplicitRef>>(Compiler::Stats::opcodeGetDynamicGetRatio + i, i);
interpreter.installSegment5<OpGetDynamicGetRatio<ExplicitRef>>(Compiler::Stats::opcodeGetDynamicGetRatioExplicit + i, i);
}
for (int i=0; i<Compiler::Stats::numberOfSkills; ++i)
{
interpreter.installSegment5 (Compiler::Stats::opcodeGetSkill+i, new OpGetSkill<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeGetSkillExplicit+i, new OpGetSkill<ExplicitRef> (i));
interpreter.installSegment5<OpGetSkill<ImplicitRef>>(Compiler::Stats::opcodeGetSkill + i, i);
interpreter.installSegment5<OpGetSkill<ExplicitRef>>(Compiler::Stats::opcodeGetSkillExplicit + i, i);
interpreter.installSegment5 (Compiler::Stats::opcodeSetSkill+i, new OpSetSkill<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeSetSkillExplicit+i, new OpSetSkill<ExplicitRef> (i));
interpreter.installSegment5<OpSetSkill<ImplicitRef>>(Compiler::Stats::opcodeSetSkill + i, i);
interpreter.installSegment5<OpSetSkill<ExplicitRef>>(Compiler::Stats::opcodeSetSkillExplicit + i, i);
interpreter.installSegment5 (Compiler::Stats::opcodeModSkill+i, new OpModSkill<ImplicitRef> (i));
interpreter.installSegment5 (Compiler::Stats::opcodeModSkillExplicit+i, new OpModSkill<ExplicitRef> (i));
interpreter.installSegment5<OpModSkill<ImplicitRef>>(Compiler::Stats::opcodeModSkill + i, i);
interpreter.installSegment5<OpModSkill<ExplicitRef>>(Compiler::Stats::opcodeModSkillExplicit + i, i);
}
interpreter.installSegment5 (Compiler::Stats::opcodeGetPCCrimeLevel, new OpGetPCCrimeLevel);
interpreter.installSegment5 (Compiler::Stats::opcodeSetPCCrimeLevel, new OpSetPCCrimeLevel);
interpreter.installSegment5 (Compiler::Stats::opcodeModPCCrimeLevel, new OpModPCCrimeLevel);
interpreter.installSegment5 (Compiler::Stats::opcodeAddSpell, new OpAddSpell<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeAddSpellExplicit, new OpAddSpell<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveSpell, new OpRemoveSpell<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveSpellExplicit,
new OpRemoveSpell<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveSpellEffects, new OpRemoveSpellEffects<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveSpellEffectsExplicit,
new OpRemoveSpellEffects<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeResurrect, new OpResurrect<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeResurrectExplicit,
new OpResurrect<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveEffects, new OpRemoveEffects<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveEffectsExplicit,
new OpRemoveEffects<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetSpell, new OpGetSpell<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetSpellExplicit, new OpGetSpell<ExplicitRef>);
interpreter.installSegment3(Compiler::Stats::opcodePCRaiseRank,new OpPCRaiseRank<ImplicitRef>);
interpreter.installSegment3(Compiler::Stats::opcodePCLowerRank,new OpPCLowerRank<ImplicitRef>);
interpreter.installSegment3(Compiler::Stats::opcodePCJoinFaction,new OpPCJoinFaction<ImplicitRef>);
interpreter.installSegment3(Compiler::Stats::opcodePCRaiseRankExplicit,new OpPCRaiseRank<ExplicitRef>);
interpreter.installSegment3(Compiler::Stats::opcodePCLowerRankExplicit,new OpPCLowerRank<ExplicitRef>);
interpreter.installSegment3(Compiler::Stats::opcodePCJoinFactionExplicit,new OpPCJoinFaction<ExplicitRef>);
interpreter.installSegment3(Compiler::Stats::opcodeGetPCRank,new OpGetPCRank<ImplicitRef>);
interpreter.installSegment3(Compiler::Stats::opcodeGetPCRankExplicit,new OpGetPCRank<ExplicitRef>);
interpreter.installSegment5(Compiler::Stats::opcodeModDisposition,new OpModDisposition<ImplicitRef>);
interpreter.installSegment5(Compiler::Stats::opcodeModDispositionExplicit,new OpModDisposition<ExplicitRef>);
interpreter.installSegment5(Compiler::Stats::opcodeSetDisposition,new OpSetDisposition<ImplicitRef>);
interpreter.installSegment5(Compiler::Stats::opcodeSetDispositionExplicit,new OpSetDisposition<ExplicitRef>);
interpreter.installSegment5(Compiler::Stats::opcodeGetDisposition,new OpGetDisposition<ImplicitRef>);
interpreter.installSegment5(Compiler::Stats::opcodeGetDispositionExplicit,new OpGetDisposition<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetLevel, new OpGetLevel<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetLevelExplicit, new OpGetLevel<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeSetLevel, new OpSetLevel<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeSetLevelExplicit, new OpSetLevel<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetDeadCount, new OpGetDeadCount);
interpreter.installSegment3 (Compiler::Stats::opcodeGetPCFacRep, new OpGetPCFacRep<ImplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodeGetPCFacRepExplicit, new OpGetPCFacRep<ExplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodeSetPCFacRep, new OpSetPCFacRep<ImplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodeSetPCFacRepExplicit, new OpSetPCFacRep<ExplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodeModPCFacRep, new OpModPCFacRep<ImplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodeModPCFacRepExplicit, new OpModPCFacRep<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetCommonDisease, new OpGetCommonDisease<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetCommonDiseaseExplicit, new OpGetCommonDisease<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetBlightDisease, new OpGetBlightDisease<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetBlightDiseaseExplicit, new OpGetBlightDisease<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetRace, new OpGetRace<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetRaceExplicit, new OpGetRace<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetWerewolfKills, new OpGetWerewolfKills);
interpreter.installSegment3 (Compiler::Stats::opcodePcExpelled, new OpPcExpelled<ImplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodePcExpelledExplicit, new OpPcExpelled<ExplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodePcExpell, new OpPcExpell<ImplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodePcExpellExplicit, new OpPcExpell<ExplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodePcClearExpelled, new OpPcClearExpelled<ImplicitRef>);
interpreter.installSegment3 (Compiler::Stats::opcodePcClearExpelledExplicit, new OpPcClearExpelled<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeRaiseRank, new OpRaiseRank<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeRaiseRankExplicit, new OpRaiseRank<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeLowerRank, new OpLowerRank<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeLowerRankExplicit, new OpLowerRank<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeOnDeath, new OpOnDeath<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeOnDeathExplicit, new OpOnDeath<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeOnMurder, new OpOnMurder<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeOnMurderExplicit, new OpOnMurder<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeOnKnockout, new OpOnKnockout<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeOnKnockoutExplicit, new OpOnKnockout<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeIsWerewolf, new OpIsWerewolf<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeIsWerewolfExplicit, new OpIsWerewolf<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeBecomeWerewolf, new OpSetWerewolf<ImplicitRef, true>);
interpreter.installSegment5 (Compiler::Stats::opcodeBecomeWerewolfExplicit, new OpSetWerewolf<ExplicitRef, true>);
interpreter.installSegment5 (Compiler::Stats::opcodeUndoWerewolf, new OpSetWerewolf<ImplicitRef, false>);
interpreter.installSegment5 (Compiler::Stats::opcodeUndoWerewolfExplicit, new OpSetWerewolf<ExplicitRef, false>);
interpreter.installSegment5 (Compiler::Stats::opcodeSetWerewolfAcrobatics, new OpSetWerewolfAcrobatics<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeSetWerewolfAcrobaticsExplicit, new OpSetWerewolfAcrobatics<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetStat, new OpGetStat<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetStatExplicit, new OpGetStat<ExplicitRef>);
interpreter.installSegment5<OpGetPCCrimeLevel>(Compiler::Stats::opcodeGetPCCrimeLevel);
interpreter.installSegment5<OpSetPCCrimeLevel>(Compiler::Stats::opcodeSetPCCrimeLevel);
interpreter.installSegment5<OpModPCCrimeLevel>(Compiler::Stats::opcodeModPCCrimeLevel);
interpreter.installSegment5<OpAddSpell<ImplicitRef>>(Compiler::Stats::opcodeAddSpell);
interpreter.installSegment5<OpAddSpell<ExplicitRef>>(Compiler::Stats::opcodeAddSpellExplicit);
interpreter.installSegment5<OpRemoveSpell<ImplicitRef>>(Compiler::Stats::opcodeRemoveSpell);
interpreter.installSegment5<OpRemoveSpell<ExplicitRef>>(Compiler::Stats::opcodeRemoveSpellExplicit);
interpreter.installSegment5<OpRemoveSpellEffects<ImplicitRef>>(Compiler::Stats::opcodeRemoveSpellEffects);
interpreter.installSegment5<OpRemoveSpellEffects<ExplicitRef>>(Compiler::Stats::opcodeRemoveSpellEffectsExplicit);
interpreter.installSegment5<OpResurrect<ImplicitRef>>(Compiler::Stats::opcodeResurrect);
interpreter.installSegment5<OpResurrect<ExplicitRef>>(Compiler::Stats::opcodeResurrectExplicit);
interpreter.installSegment5<OpRemoveEffects<ImplicitRef>>(Compiler::Stats::opcodeRemoveEffects);
interpreter.installSegment5<OpRemoveEffects<ExplicitRef>>(Compiler::Stats::opcodeRemoveEffectsExplicit);
interpreter.installSegment5<OpGetSpell<ImplicitRef>>(Compiler::Stats::opcodeGetSpell);
interpreter.installSegment5<OpGetSpell<ExplicitRef>>(Compiler::Stats::opcodeGetSpellExplicit);
interpreter.installSegment3<OpPCRaiseRank<ImplicitRef>>(Compiler::Stats::opcodePCRaiseRank);
interpreter.installSegment3<OpPCLowerRank<ImplicitRef>>(Compiler::Stats::opcodePCLowerRank);
interpreter.installSegment3<OpPCJoinFaction<ImplicitRef>>(Compiler::Stats::opcodePCJoinFaction);
interpreter.installSegment3<OpPCRaiseRank<ExplicitRef>>(Compiler::Stats::opcodePCRaiseRankExplicit);
interpreter.installSegment3<OpPCLowerRank<ExplicitRef>>(Compiler::Stats::opcodePCLowerRankExplicit);
interpreter.installSegment3<OpPCJoinFaction<ExplicitRef>>(Compiler::Stats::opcodePCJoinFactionExplicit);
interpreter.installSegment3<OpGetPCRank<ImplicitRef>>(Compiler::Stats::opcodeGetPCRank);
interpreter.installSegment3<OpGetPCRank<ExplicitRef>>(Compiler::Stats::opcodeGetPCRankExplicit);
interpreter.installSegment5<OpModDisposition<ImplicitRef>>(Compiler::Stats::opcodeModDisposition);
interpreter.installSegment5<OpModDisposition<ExplicitRef>>(Compiler::Stats::opcodeModDispositionExplicit);
interpreter.installSegment5<OpSetDisposition<ImplicitRef>>(Compiler::Stats::opcodeSetDisposition);
interpreter.installSegment5<OpSetDisposition<ExplicitRef>>(Compiler::Stats::opcodeSetDispositionExplicit);
interpreter.installSegment5<OpGetDisposition<ImplicitRef>>(Compiler::Stats::opcodeGetDisposition);
interpreter.installSegment5<OpGetDisposition<ExplicitRef>>(Compiler::Stats::opcodeGetDispositionExplicit);
interpreter.installSegment5<OpGetLevel<ImplicitRef>>(Compiler::Stats::opcodeGetLevel);
interpreter.installSegment5<OpGetLevel<ExplicitRef>>(Compiler::Stats::opcodeGetLevelExplicit);
interpreter.installSegment5<OpSetLevel<ImplicitRef>>(Compiler::Stats::opcodeSetLevel);
interpreter.installSegment5<OpSetLevel<ExplicitRef>>(Compiler::Stats::opcodeSetLevelExplicit);
interpreter.installSegment5<OpGetDeadCount>(Compiler::Stats::opcodeGetDeadCount);
interpreter.installSegment3<OpGetPCFacRep<ImplicitRef>>(Compiler::Stats::opcodeGetPCFacRep);
interpreter.installSegment3<OpGetPCFacRep<ExplicitRef>>(Compiler::Stats::opcodeGetPCFacRepExplicit);
interpreter.installSegment3<OpSetPCFacRep<ImplicitRef>>(Compiler::Stats::opcodeSetPCFacRep);
interpreter.installSegment3<OpSetPCFacRep<ExplicitRef>>(Compiler::Stats::opcodeSetPCFacRepExplicit);
interpreter.installSegment3<OpModPCFacRep<ImplicitRef>>(Compiler::Stats::opcodeModPCFacRep);
interpreter.installSegment3<OpModPCFacRep<ExplicitRef>>(Compiler::Stats::opcodeModPCFacRepExplicit);
interpreter.installSegment5<OpGetCommonDisease<ImplicitRef>>(Compiler::Stats::opcodeGetCommonDisease);
interpreter.installSegment5<OpGetCommonDisease<ExplicitRef>>(Compiler::Stats::opcodeGetCommonDiseaseExplicit);
interpreter.installSegment5<OpGetBlightDisease<ImplicitRef>>(Compiler::Stats::opcodeGetBlightDisease);
interpreter.installSegment5<OpGetBlightDisease<ExplicitRef>>(Compiler::Stats::opcodeGetBlightDiseaseExplicit);
interpreter.installSegment5<OpGetRace<ImplicitRef>>(Compiler::Stats::opcodeGetRace);
interpreter.installSegment5<OpGetRace<ExplicitRef>>(Compiler::Stats::opcodeGetRaceExplicit);
interpreter.installSegment5<OpGetWerewolfKills>(Compiler::Stats::opcodeGetWerewolfKills);
interpreter.installSegment3<OpPcExpelled<ImplicitRef>>(Compiler::Stats::opcodePcExpelled);
interpreter.installSegment3<OpPcExpelled<ExplicitRef>>(Compiler::Stats::opcodePcExpelledExplicit);
interpreter.installSegment3<OpPcExpell<ImplicitRef>>(Compiler::Stats::opcodePcExpell);
interpreter.installSegment3<OpPcExpell<ExplicitRef>>(Compiler::Stats::opcodePcExpellExplicit);
interpreter.installSegment3<OpPcClearExpelled<ImplicitRef>>(Compiler::Stats::opcodePcClearExpelled);
interpreter.installSegment3<OpPcClearExpelled<ExplicitRef>>(Compiler::Stats::opcodePcClearExpelledExplicit);
interpreter.installSegment5<OpRaiseRank<ImplicitRef>>(Compiler::Stats::opcodeRaiseRank);
interpreter.installSegment5<OpRaiseRank<ExplicitRef>>(Compiler::Stats::opcodeRaiseRankExplicit);
interpreter.installSegment5<OpLowerRank<ImplicitRef>>(Compiler::Stats::opcodeLowerRank);
interpreter.installSegment5<OpLowerRank<ExplicitRef>>(Compiler::Stats::opcodeLowerRankExplicit);
interpreter.installSegment5<OpOnDeath<ImplicitRef>>(Compiler::Stats::opcodeOnDeath);
interpreter.installSegment5<OpOnDeath<ExplicitRef>>(Compiler::Stats::opcodeOnDeathExplicit);
interpreter.installSegment5<OpOnMurder<ImplicitRef>>(Compiler::Stats::opcodeOnMurder);
interpreter.installSegment5<OpOnMurder<ExplicitRef>>(Compiler::Stats::opcodeOnMurderExplicit);
interpreter.installSegment5<OpOnKnockout<ImplicitRef>>(Compiler::Stats::opcodeOnKnockout);
interpreter.installSegment5<OpOnKnockout<ExplicitRef>>(Compiler::Stats::opcodeOnKnockoutExplicit);
interpreter.installSegment5<OpIsWerewolf<ImplicitRef>>(Compiler::Stats::opcodeIsWerewolf);
interpreter.installSegment5<OpIsWerewolf<ExplicitRef>>(Compiler::Stats::opcodeIsWerewolfExplicit);
interpreter.installSegment5<OpSetWerewolf<ImplicitRef, true>>(Compiler::Stats::opcodeBecomeWerewolf);
interpreter.installSegment5<OpSetWerewolf<ExplicitRef, true>>(Compiler::Stats::opcodeBecomeWerewolfExplicit);
interpreter.installSegment5<OpSetWerewolf<ImplicitRef, false>>(Compiler::Stats::opcodeUndoWerewolf);
interpreter.installSegment5<OpSetWerewolf<ExplicitRef, false>>(Compiler::Stats::opcodeUndoWerewolfExplicit);
interpreter.installSegment5<OpSetWerewolfAcrobatics<ImplicitRef>>(Compiler::Stats::opcodeSetWerewolfAcrobatics);
interpreter.installSegment5<OpSetWerewolfAcrobatics<ExplicitRef>>(Compiler::Stats::opcodeSetWerewolfAcrobaticsExplicit);
interpreter.installSegment5<OpGetStat<ImplicitRef>>(Compiler::Stats::opcodeGetStat);
interpreter.installSegment5<OpGetStat<ExplicitRef>>(Compiler::Stats::opcodeGetStatExplicit);
static const MagicEffect sMagicEffects[] = {
{ ESM::MagicEffect::ResistMagicka, ESM::MagicEffect::WeaknessToMagicka },
@ -1498,14 +1484,14 @@ namespace MWScript
int positive = sMagicEffects[i].mPositiveEffect;
int negative = sMagicEffects[i].mNegativeEffect;
interpreter.installSegment5 (Compiler::Stats::opcodeGetMagicEffect+i, new OpGetMagicEffect<ImplicitRef> (positive, negative));
interpreter.installSegment5 (Compiler::Stats::opcodeGetMagicEffectExplicit+i, new OpGetMagicEffect<ExplicitRef> (positive, negative));
interpreter.installSegment5<OpGetMagicEffect<ImplicitRef>>(Compiler::Stats::opcodeGetMagicEffect + i, positive, negative);
interpreter.installSegment5<OpGetMagicEffect<ExplicitRef>>(Compiler::Stats::opcodeGetMagicEffectExplicit + i, positive, negative);
interpreter.installSegment5 (Compiler::Stats::opcodeSetMagicEffect+i, new OpSetMagicEffect<ImplicitRef> (positive, negative));
interpreter.installSegment5 (Compiler::Stats::opcodeSetMagicEffectExplicit+i, new OpSetMagicEffect<ExplicitRef> (positive, negative));
interpreter.installSegment5<OpSetMagicEffect<ImplicitRef>>(Compiler::Stats::opcodeSetMagicEffect + i, positive, negative);
interpreter.installSegment5<OpSetMagicEffect<ExplicitRef>>(Compiler::Stats::opcodeSetMagicEffectExplicit + i, positive, negative);
interpreter.installSegment5 (Compiler::Stats::opcodeModMagicEffect+i, new OpModMagicEffect<ImplicitRef> (positive, negative));
interpreter.installSegment5 (Compiler::Stats::opcodeModMagicEffectExplicit+i, new OpModMagicEffect<ExplicitRef> (positive, negative));
interpreter.installSegment5<OpModMagicEffect<ImplicitRef>>(Compiler::Stats::opcodeModMagicEffect + i, positive, negative);
interpreter.installSegment5<OpModMagicEffect<ExplicitRef>>(Compiler::Stats::opcodeModMagicEffectExplicit + i, positive, negative);
}
}
}

@ -799,47 +799,47 @@ namespace MWScript
void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5(Compiler::Transformation::opcodeGetDistance, new OpGetDistance<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetDistanceExplicit, new OpGetDistance<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeSetScale,new OpSetScale<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeSetScaleExplicit,new OpSetScale<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeSetAngle,new OpSetAngle<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeSetAngleExplicit,new OpSetAngle<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetScale,new OpGetScale<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetScaleExplicit,new OpGetScale<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetAngle,new OpGetAngle<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetAngleExplicit,new OpGetAngle<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetPos,new OpGetPos<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetPosExplicit,new OpGetPos<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeSetPos,new OpSetPos<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeSetPosExplicit,new OpSetPos<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetStartingPos,new OpGetStartingPos<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetStartingPosExplicit,new OpGetStartingPos<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodePosition,new OpPosition<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodePositionExplicit,new OpPosition<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodePositionCell,new OpPositionCell<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodePositionCellExplicit,new OpPositionCell<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodePlaceItemCell,new OpPlaceItemCell);
interpreter.installSegment5(Compiler::Transformation::opcodePlaceItem,new OpPlaceItem);
interpreter.installSegment5(Compiler::Transformation::opcodePlaceAtPc,new OpPlaceAt<ImplicitRef, true>);
interpreter.installSegment5(Compiler::Transformation::opcodePlaceAtMe,new OpPlaceAt<ImplicitRef, false>);
interpreter.installSegment5(Compiler::Transformation::opcodePlaceAtMeExplicit,new OpPlaceAt<ExplicitRef, false>);
interpreter.installSegment5(Compiler::Transformation::opcodeModScale,new OpModScale<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeModScaleExplicit,new OpModScale<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeRotate,new OpRotate<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeRotateExplicit,new OpRotate<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeRotateWorld,new OpRotateWorld<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeRotateWorldExplicit,new OpRotateWorld<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeSetAtStart,new OpSetAtStart<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeSetAtStartExplicit,new OpSetAtStart<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeMove,new OpMove<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeMoveExplicit,new OpMove<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeMoveWorld,new OpMoveWorld<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeMoveWorldExplicit,new OpMoveWorld<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetStartingAngle, new OpGetStartingAngle<ImplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeGetStartingAngleExplicit, new OpGetStartingAngle<ExplicitRef>);
interpreter.installSegment5(Compiler::Transformation::opcodeResetActors, new OpResetActors);
interpreter.installSegment5(Compiler::Transformation::opcodeFixme, new OpFixme);
interpreter.installSegment5<OpGetDistance<ImplicitRef>>(Compiler::Transformation::opcodeGetDistance);
interpreter.installSegment5<OpGetDistance<ExplicitRef>>(Compiler::Transformation::opcodeGetDistanceExplicit);
interpreter.installSegment5<OpSetScale<ImplicitRef>>(Compiler::Transformation::opcodeSetScale);
interpreter.installSegment5<OpSetScale<ExplicitRef>>(Compiler::Transformation::opcodeSetScaleExplicit);
interpreter.installSegment5<OpSetAngle<ImplicitRef>>(Compiler::Transformation::opcodeSetAngle);
interpreter.installSegment5<OpSetAngle<ExplicitRef>>(Compiler::Transformation::opcodeSetAngleExplicit);
interpreter.installSegment5<OpGetScale<ImplicitRef>>(Compiler::Transformation::opcodeGetScale);
interpreter.installSegment5<OpGetScale<ExplicitRef>>(Compiler::Transformation::opcodeGetScaleExplicit);
interpreter.installSegment5<OpGetAngle<ImplicitRef>>(Compiler::Transformation::opcodeGetAngle);
interpreter.installSegment5<OpGetAngle<ExplicitRef>>(Compiler::Transformation::opcodeGetAngleExplicit);
interpreter.installSegment5<OpGetPos<ImplicitRef>>(Compiler::Transformation::opcodeGetPos);
interpreter.installSegment5<OpGetPos<ExplicitRef>>(Compiler::Transformation::opcodeGetPosExplicit);
interpreter.installSegment5<OpSetPos<ImplicitRef>>(Compiler::Transformation::opcodeSetPos);
interpreter.installSegment5<OpSetPos<ExplicitRef>>(Compiler::Transformation::opcodeSetPosExplicit);
interpreter.installSegment5<OpGetStartingPos<ImplicitRef>>(Compiler::Transformation::opcodeGetStartingPos);
interpreter.installSegment5<OpGetStartingPos<ExplicitRef>>(Compiler::Transformation::opcodeGetStartingPosExplicit);
interpreter.installSegment5<OpPosition<ImplicitRef>>(Compiler::Transformation::opcodePosition);
interpreter.installSegment5<OpPosition<ExplicitRef>>(Compiler::Transformation::opcodePositionExplicit);
interpreter.installSegment5<OpPositionCell<ImplicitRef>>(Compiler::Transformation::opcodePositionCell);
interpreter.installSegment5<OpPositionCell<ExplicitRef>>(Compiler::Transformation::opcodePositionCellExplicit);
interpreter.installSegment5<OpPlaceItemCell>(Compiler::Transformation::opcodePlaceItemCell);
interpreter.installSegment5<OpPlaceItem>(Compiler::Transformation::opcodePlaceItem);
interpreter.installSegment5<OpPlaceAt<ImplicitRef, true>>(Compiler::Transformation::opcodePlaceAtPc);
interpreter.installSegment5<OpPlaceAt<ImplicitRef, false>>(Compiler::Transformation::opcodePlaceAtMe);
interpreter.installSegment5<OpPlaceAt<ExplicitRef, false>>(Compiler::Transformation::opcodePlaceAtMeExplicit);
interpreter.installSegment5<OpModScale<ImplicitRef>>(Compiler::Transformation::opcodeModScale);
interpreter.installSegment5<OpModScale<ExplicitRef>>(Compiler::Transformation::opcodeModScaleExplicit);
interpreter.installSegment5<OpRotate<ImplicitRef>>(Compiler::Transformation::opcodeRotate);
interpreter.installSegment5<OpRotate<ExplicitRef>>(Compiler::Transformation::opcodeRotateExplicit);
interpreter.installSegment5<OpRotateWorld<ImplicitRef>>(Compiler::Transformation::opcodeRotateWorld);
interpreter.installSegment5<OpRotateWorld<ExplicitRef>>(Compiler::Transformation::opcodeRotateWorldExplicit);
interpreter.installSegment5<OpSetAtStart<ImplicitRef>>(Compiler::Transformation::opcodeSetAtStart);
interpreter.installSegment5<OpSetAtStart<ExplicitRef>>(Compiler::Transformation::opcodeSetAtStartExplicit);
interpreter.installSegment5<OpMove<ImplicitRef>>(Compiler::Transformation::opcodeMove);
interpreter.installSegment5<OpMove<ExplicitRef>>(Compiler::Transformation::opcodeMoveExplicit);
interpreter.installSegment5<OpMoveWorld<ImplicitRef>>(Compiler::Transformation::opcodeMoveWorld);
interpreter.installSegment5<OpMoveWorld<ExplicitRef>>(Compiler::Transformation::opcodeMoveWorldExplicit);
interpreter.installSegment5<OpGetStartingAngle<ImplicitRef>>(Compiler::Transformation::opcodeGetStartingAngle);
interpreter.installSegment5<OpGetStartingAngle<ExplicitRef>>(Compiler::Transformation::opcodeGetStartingAngleExplicit);
interpreter.installSegment5<OpResetActors>(Compiler::Transformation::opcodeResetActors);
interpreter.installSegment5<OpFixme>(Compiler::Transformation::opcodeFixme);
}
}
}

@ -66,12 +66,12 @@ namespace MWScript
void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::User::opcodeUser1, new OpUser1);
interpreter.installSegment5 (Compiler::User::opcodeUser2, new OpUser2);
interpreter.installSegment5 (Compiler::User::opcodeUser3, new OpUser3<ImplicitRef>);
interpreter.installSegment5 (Compiler::User::opcodeUser3Explicit, new OpUser3<ExplicitRef>);
interpreter.installSegment5 (Compiler::User::opcodeUser4, new OpUser4<ImplicitRef>);
interpreter.installSegment5 (Compiler::User::opcodeUser4Explicit, new OpUser4<ExplicitRef>);
interpreter.installSegment5<OpUser1>(Compiler::User::opcodeUser1);
interpreter.installSegment5<OpUser2>(Compiler::User::opcodeUser2);
interpreter.installSegment5<OpUser3<ImplicitRef>>(Compiler::User::opcodeUser3);
interpreter.installSegment5<OpUser3<ExplicitRef>>(Compiler::User::opcodeUser3Explicit);
interpreter.installSegment5<OpUser4<ImplicitRef>>(Compiler::User::opcodeUser4);
interpreter.installSegment5<OpUser4<ExplicitRef>>(Compiler::User::opcodeUser4Explicit);
}
}
}

@ -49,10 +49,12 @@ namespace
mInterpreter.run(&script.mByteCode[0], static_cast<int>(script.mByteCode.size()), context);
}
void installOpcode(int code, Interpreter::Opcode0* opcode)
template<typename T, typename ...TArgs>
void installOpcode(int code, TArgs&& ...args)
{
mInterpreter.installSegment5(code, opcode);
mInterpreter.installSegment5<T>(code, std::forward<TArgs&&>(args)...);
}
protected:
void SetUp() override
{
@ -472,7 +474,7 @@ messagebox,"this is a %g",a
EXPECT_EQ(topic, "OpenMW Unit Test");
}
};
installOpcode(Compiler::Dialogue::opcodeAddTopic, new AddTopic(failed));
installOpcode<AddTopic>(Compiler::Dialogue::opcodeAddTopic, failed);
TestInterpreterContext context;
run(*script, context);
}
@ -715,7 +717,7 @@ messagebox,"this is a %g",a
mTopics.erase(mTopics.begin());
}
};
installOpcode(Compiler::Dialogue::opcodeAddTopic, new AddTopic(topics));
installOpcode<AddTopic>(Compiler::Dialogue::opcodeAddTopic, topics);
TestInterpreterContext context;
run(*script, context);
EXPECT_TRUE(topics.empty());
@ -826,7 +828,7 @@ messagebox,"this is a %g",a
}
};
bool ran = false;
installOpcode(Compiler::Transformation::opcodePositionCell, new PositionCell(ran));
installOpcode<PositionCell>(Compiler::Transformation::opcodePositionCell, ran);
TestInterpreterContext context;
context.setLocalShort(0, 0);
run(*script, context);

@ -11,89 +11,77 @@
namespace Interpreter
{
void installOpcodes (Interpreter& interpreter)
void installOpcodes(Interpreter& interpreter)
{
// generic
interpreter.installSegment0 (0, new OpPushInt);
interpreter.installSegment5 (3, new OpIntToFloat);
interpreter.installSegment5 (6, new OpFloatToInt);
interpreter.installSegment5 (7, new OpNegateInt);
interpreter.installSegment5 (8, new OpNegateFloat);
interpreter.installSegment5 (17, new OpIntToFloat1);
interpreter.installSegment5 (18, new OpFloatToInt1);
interpreter.installSegment0<OpPushInt>(0);
interpreter.installSegment5<OpIntToFloat>(3);
interpreter.installSegment5<OpFloatToInt>(6);
interpreter.installSegment5<OpNegateInt>(7);
interpreter.installSegment5<OpNegateFloat>(8);
interpreter.installSegment5<OpIntToFloat1>(17);
interpreter.installSegment5<OpFloatToInt1>(18);
// local variables, global variables & literals
interpreter.installSegment5 (0, new OpStoreLocalShort);
interpreter.installSegment5 (1, new OpStoreLocalLong);
interpreter.installSegment5 (2, new OpStoreLocalFloat);
interpreter.installSegment5 (4, new OpFetchIntLiteral);
interpreter.installSegment5 (5, new OpFetchFloatLiteral);
interpreter.installSegment5 (21, new OpFetchLocalShort);
interpreter.installSegment5 (22, new OpFetchLocalLong);
interpreter.installSegment5 (23, new OpFetchLocalFloat);
interpreter.installSegment5 (39, new OpStoreGlobalShort);
interpreter.installSegment5 (40, new OpStoreGlobalLong);
interpreter.installSegment5 (41, new OpStoreGlobalFloat);
interpreter.installSegment5 (42, new OpFetchGlobalShort);
interpreter.installSegment5 (43, new OpFetchGlobalLong);
interpreter.installSegment5 (44, new OpFetchGlobalFloat);
interpreter.installSegment5 (59, new OpStoreMemberShort (false));
interpreter.installSegment5 (60, new OpStoreMemberLong (false));
interpreter.installSegment5 (61, new OpStoreMemberFloat (false));
interpreter.installSegment5 (62, new OpFetchMemberShort (false));
interpreter.installSegment5 (63, new OpFetchMemberLong (false));
interpreter.installSegment5 (64, new OpFetchMemberFloat (false));
interpreter.installSegment5 (65, new OpStoreMemberShort (true));
interpreter.installSegment5 (66, new OpStoreMemberLong (true));
interpreter.installSegment5 (67, new OpStoreMemberFloat (true));
interpreter.installSegment5 (68, new OpFetchMemberShort (true));
interpreter.installSegment5 (69, new OpFetchMemberLong (true));
interpreter.installSegment5 (70, new OpFetchMemberFloat (true));
interpreter.installSegment5<OpStoreLocalShort>(0);
interpreter.installSegment5<OpStoreLocalLong>(1);
interpreter.installSegment5<OpStoreLocalFloat>(2);
interpreter.installSegment5<OpFetchIntLiteral>(4);
interpreter.installSegment5<OpFetchFloatLiteral>(5);
interpreter.installSegment5<OpFetchLocalShort>(21);
interpreter.installSegment5<OpFetchLocalLong>(22);
interpreter.installSegment5<OpFetchLocalFloat>(23);
interpreter.installSegment5<OpStoreGlobalShort>(39);
interpreter.installSegment5<OpStoreGlobalLong>(40);
interpreter.installSegment5<OpStoreGlobalFloat>(41);
interpreter.installSegment5<OpFetchGlobalShort>(42);
interpreter.installSegment5<OpFetchGlobalLong>(43);
interpreter.installSegment5<OpFetchGlobalFloat>(44);
interpreter.installSegment5<OpStoreMemberShort<false>>(59);
interpreter.installSegment5<OpStoreMemberLong<false>>(60);
interpreter.installSegment5<OpStoreMemberFloat<false>>(61);
interpreter.installSegment5<OpFetchMemberShort<false>>(62);
interpreter.installSegment5<OpFetchMemberLong<false>>(63);
interpreter.installSegment5<OpFetchMemberFloat<false>>(64);
interpreter.installSegment5<OpStoreMemberShort<true>>(65);
interpreter.installSegment5<OpStoreMemberLong<true>>(66);
interpreter.installSegment5<OpStoreMemberFloat<true>>(67);
interpreter.installSegment5<OpFetchMemberShort<true>>(68);
interpreter.installSegment5<OpFetchMemberLong<true>>(69);
interpreter.installSegment5<OpFetchMemberFloat<true>>(70);
// math
interpreter.installSegment5 (9, new OpAddInt<Type_Integer>);
interpreter.installSegment5 (10, new OpAddInt<Type_Float>);
interpreter.installSegment5 (11, new OpSubInt<Type_Integer>);
interpreter.installSegment5 (12, new OpSubInt<Type_Float>);
interpreter.installSegment5 (13, new OpMulInt<Type_Integer>);
interpreter.installSegment5 (14, new OpMulInt<Type_Float>);
interpreter.installSegment5 (15, new OpDivInt<Type_Integer>);
interpreter.installSegment5 (16, new OpDivInt<Type_Float>);
interpreter.installSegment5 (26,
new OpCompare<Type_Integer, std::equal_to<Type_Integer> >);
interpreter.installSegment5 (27,
new OpCompare<Type_Integer, std::not_equal_to<Type_Integer> >);
interpreter.installSegment5 (28,
new OpCompare<Type_Integer, std::less<Type_Integer> >);
interpreter.installSegment5 (29,
new OpCompare<Type_Integer, std::less_equal<Type_Integer> >);
interpreter.installSegment5 (30,
new OpCompare<Type_Integer, std::greater<Type_Integer> >);
interpreter.installSegment5 (31,
new OpCompare<Type_Integer, std::greater_equal<Type_Integer> >);
interpreter.installSegment5<OpAddInt<Type_Integer>>(9);
interpreter.installSegment5<OpAddInt<Type_Float>>(10);
interpreter.installSegment5<OpSubInt<Type_Integer>>(11);
interpreter.installSegment5<OpSubInt<Type_Float>>(12);
interpreter.installSegment5<OpMulInt<Type_Integer>>(13);
interpreter.installSegment5<OpMulInt<Type_Float>>(14);
interpreter.installSegment5<OpDivInt<Type_Integer>>(15);
interpreter.installSegment5<OpDivInt<Type_Float>>(16);
interpreter.installSegment5<OpCompare<Type_Integer, std::equal_to<Type_Integer> >>(26);
interpreter.installSegment5<OpCompare<Type_Integer, std::not_equal_to<Type_Integer> >>(27);
interpreter.installSegment5<OpCompare<Type_Integer, std::less<Type_Integer> >>(28);
interpreter.installSegment5<OpCompare<Type_Integer, std::less_equal<Type_Integer> >>(29);
interpreter.installSegment5<OpCompare<Type_Integer, std::greater<Type_Integer> >>(30);
interpreter.installSegment5<OpCompare<Type_Integer, std::greater_equal<Type_Integer> >>(31);
interpreter.installSegment5 (32,
new OpCompare<Type_Float, std::equal_to<Type_Float> >);
interpreter.installSegment5 (33,
new OpCompare<Type_Float, std::not_equal_to<Type_Float> >);
interpreter.installSegment5 (34,
new OpCompare<Type_Float, std::less<Type_Float> >);
interpreter.installSegment5 (35,
new OpCompare<Type_Float, std::less_equal<Type_Float> >);
interpreter.installSegment5 (36,
new OpCompare<Type_Float, std::greater<Type_Float> >);
interpreter.installSegment5 (37,
new OpCompare<Type_Float, std::greater_equal<Type_Float> >);
interpreter.installSegment5<OpCompare<Type_Float, std::equal_to<Type_Float> >>(32);
interpreter.installSegment5<OpCompare<Type_Float, std::not_equal_to<Type_Float> >>(33);
interpreter.installSegment5<OpCompare<Type_Float, std::less<Type_Float> >>(34);
interpreter.installSegment5<OpCompare<Type_Float, std::less_equal<Type_Float> >>(35);
interpreter.installSegment5<OpCompare<Type_Float, std::greater<Type_Float> >>(36);
interpreter.installSegment5<OpCompare<Type_Float, std::greater_equal<Type_Float> >>(37);
// control structures
interpreter.installSegment5 (20, new OpReturn);
interpreter.installSegment5 (24, new OpSkipZero);
interpreter.installSegment5 (25, new OpSkipNonZero);
interpreter.installSegment0 (1, new OpJumpForward);
interpreter.installSegment0 (2, new OpJumpBackward);
interpreter.installSegment5<OpReturn>(20);
interpreter.installSegment5<OpSkipZero>(24);
interpreter.installSegment5<OpSkipNonZero>(25);
interpreter.installSegment0<OpJumpForward>(1);
interpreter.installSegment0<OpJumpBackward>(2);
// misc
interpreter.installSegment3 (0, new OpMessageBox);
interpreter.installSegment5 (58, new OpReport);
interpreter.installSegment3<OpMessageBox>(0);
interpreter.installSegment5<OpReport>(58);
}
}

@ -7,92 +7,75 @@
namespace Interpreter
{
[[noreturn]] static void abortUnknownCode(int segment, int opcode)
{
const std::string error = "unknown opcode " + std::to_string(opcode) + " in segment " + std::to_string(segment);
throw std::runtime_error(error);
}
[[noreturn]] static void abortUnknownSegment(Type_Code code)
{
const std::string error = "opcode outside of the allocated segment range: " + std::to_string(code);
throw std::runtime_error(error);
}
template<typename T>
auto& getDispatcher(const T& segment, unsigned int seg, int opcode)
{
auto it = segment.find(opcode);
if (it == segment.end())
{
abortUnknownCode(seg, opcode);
}
return it->second;
}
void Interpreter::execute (Type_Code code)
{
unsigned int segSpec = code>>30;
unsigned int segSpec = code >> 30;
switch (segSpec)
{
case 0:
{
int opcode = code>>24;
unsigned int arg0 = code & 0xffffff;
const int opcode = code >> 24;
const unsigned int arg0 = code & 0xffffff;
std::map<int, Opcode1 *>::iterator iter = mSegment0.find (opcode);
if (iter==mSegment0.end())
abortUnknownCode (0, opcode);
iter->second->execute (mRuntime, arg0);
return;
return getDispatcher(mSegment0, 0, opcode)->execute(mRuntime, arg0);
}
case 2:
{
int opcode = (code>>20) & 0x3ff;
unsigned int arg0 = code & 0xfffff;
std::map<int, Opcode1 *>::iterator iter = mSegment2.find (opcode);
const int opcode = (code >> 20) & 0x3ff;
const unsigned int arg0 = code & 0xfffff;
if (iter==mSegment2.end())
abortUnknownCode (2, opcode);
iter->second->execute (mRuntime, arg0);
return;
return getDispatcher(mSegment2, 2, opcode)->execute(mRuntime, arg0);
}
}
segSpec = code>>26;
segSpec = code >> 26;
switch (segSpec)
{
case 0x30:
{
int opcode = (code>>8) & 0x3ffff;
unsigned int arg0 = code & 0xff;
std::map<int, Opcode1 *>::iterator iter = mSegment3.find (opcode);
const int opcode = (code >> 8) & 0x3ffff;
const unsigned int arg0 = code & 0xff;
if (iter==mSegment3.end())
abortUnknownCode (3, opcode);
iter->second->execute (mRuntime, arg0);
return;
return getDispatcher(mSegment3, 3, opcode)->execute(mRuntime, arg0);
}
case 0x32:
{
int opcode = code & 0x3ffffff;
std::map<int, Opcode0 *>::iterator iter = mSegment5.find (opcode);
const int opcode = code & 0x3ffffff;
if (iter==mSegment5.end())
abortUnknownCode (5, opcode);
iter->second->execute (mRuntime);
return;
return getDispatcher(mSegment5, 5, opcode)->execute(mRuntime);
}
}
abortUnknownSegment (code);
}
[[noreturn]] void Interpreter::abortUnknownCode (int segment, int opcode)
{
const std::string error = "unknown opcode " + std::to_string(opcode) + " in segment " + std::to_string(segment);
throw std::runtime_error (error);
}
[[noreturn]] void Interpreter::abortUnknownSegment (Type_Code code)
{
const std::string error = "opcode outside of the allocated segment range: " + std::to_string(code);
throw std::runtime_error (error);
}
void Interpreter::begin()
{
if (mRunning)
@ -123,49 +106,6 @@ namespace Interpreter
Interpreter::Interpreter() : mRunning (false)
{}
Interpreter::~Interpreter()
{
for (std::map<int, Opcode1 *>::iterator iter (mSegment0.begin());
iter!=mSegment0.end(); ++iter)
delete iter->second;
for (std::map<int, Opcode1 *>::iterator iter (mSegment2.begin());
iter!=mSegment2.end(); ++iter)
delete iter->second;
for (std::map<int, Opcode1 *>::iterator iter (mSegment3.begin());
iter!=mSegment3.end(); ++iter)
delete iter->second;
for (std::map<int, Opcode0 *>::iterator iter (mSegment5.begin());
iter!=mSegment5.end(); ++iter)
delete iter->second;
}
void Interpreter::installSegment0 (int code, Opcode1 *opcode)
{
assert(mSegment0.find(code) == mSegment0.end());
mSegment0.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment2 (int code, Opcode1 *opcode)
{
assert(mSegment2.find(code) == mSegment2.end());
mSegment2.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment3 (int code, Opcode1 *opcode)
{
assert(mSegment3.find(code) == mSegment3.end());
mSegment3.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment5 (int code, Opcode0 *opcode)
{
assert(mSegment5.find(code) == mSegment5.end());
mSegment5.insert (std::make_pair (code, opcode));
}
void Interpreter::run (const Type_Code *code, int codeSize, Context& context)
{
assert (codeSize>=4);

@ -3,24 +3,25 @@
#include <map>
#include <stack>
#include <memory>
#include <cassert>
#include <utility>
#include "runtime.hpp"
#include "types.hpp"
#include "opcodes.hpp"
namespace Interpreter
{
class Opcode0;
class Opcode1;
class Interpreter
{
std::stack<Runtime> mCallstack;
bool mRunning;
Runtime mRuntime;
std::map<int, Opcode1 *> mSegment0;
std::map<int, Opcode1 *> mSegment2;
std::map<int, Opcode1 *> mSegment3;
std::map<int, Opcode0 *> mSegment5;
std::map<int, std::unique_ptr<Opcode1>> mSegment0;
std::map<int, std::unique_ptr<Opcode1>> mSegment2;
std::map<int, std::unique_ptr<Opcode1>> mSegment3;
std::map<int, std::unique_ptr<Opcode0>> mSegment5;
// not implemented
Interpreter (const Interpreter&);
@ -28,31 +29,44 @@ namespace Interpreter
void execute (Type_Code code);
[[noreturn]] void abortUnknownCode (int segment, int opcode);
[[noreturn]] void abortUnknownSegment (Type_Code code);
void begin();
void end();
template<typename TSeg, typename TOp>
void installSegment(TSeg& seg, int code, TOp&& op)
{
assert(seg.find(code) == seg.end());
seg.emplace(code, std::move(op));
}
public:
Interpreter();
~Interpreter();
void installSegment0 (int code, Opcode1 *opcode);
///< ownership of \a opcode is transferred to *this.
void installSegment2 (int code, Opcode1 *opcode);
///< ownership of \a opcode is transferred to *this.
void installSegment3 (int code, Opcode1 *opcode);
///< ownership of \a opcode is transferred to *this.
void installSegment5 (int code, Opcode0 *opcode);
///< ownership of \a opcode is transferred to *this.
template<typename T, typename ...TArgs>
void installSegment0(int code, TArgs&& ...args)
{
installSegment(mSegment0, code, std::make_unique<T>(std::forward<TArgs>(args)...));
}
template<typename T, typename ...TArgs>
void installSegment2(int code, TArgs&& ...args)
{
installSegment(mSegment2, code, std::make_unique<T>(std::forward<TArgs>(args)...));
}
template<typename T, typename ...TArgs>
void installSegment3(int code, TArgs&& ...args)
{
installSegment(mSegment3, code, std::make_unique<T>(std::forward<TArgs>(args)...));
}
template<typename T, typename ...TArgs>
void installSegment5(int code, TArgs&& ...args)
{
installSegment(mSegment5, code, std::make_unique<T>(std::forward<TArgs>(args)...));
}
void run (const Type_Code *code, int codeSize, Context& context);
};

@ -206,14 +206,11 @@ namespace Interpreter
}
};
template<bool TGlobal>
class OpStoreMemberShort : public Opcode0
{
bool mGlobal;
public:
OpStoreMemberShort (bool global) : mGlobal (global) {}
void execute (Runtime& runtime) override
{
Type_Integer data = runtime[0].mInteger;
@ -222,7 +219,7 @@ namespace Interpreter
index = runtime[2].mInteger;
std::string variable = runtime.getStringLiteral (index);
runtime.getContext().setMemberShort (id, variable, data, mGlobal);
runtime.getContext().setMemberShort (id, variable, data, TGlobal);
runtime.pop();
runtime.pop();
@ -230,14 +227,11 @@ namespace Interpreter
}
};
template<bool TGlobal>
class OpStoreMemberLong : public Opcode0
{
bool mGlobal;
public:
OpStoreMemberLong (bool global) : mGlobal (global) {}
void execute (Runtime& runtime) override
{
Type_Integer data = runtime[0].mInteger;
@ -246,7 +240,7 @@ namespace Interpreter
index = runtime[2].mInteger;
std::string variable = runtime.getStringLiteral (index);
runtime.getContext().setMemberLong (id, variable, data, mGlobal);
runtime.getContext().setMemberLong (id, variable, data, TGlobal);
runtime.pop();
runtime.pop();
@ -254,14 +248,11 @@ namespace Interpreter
}
};
template<bool TGlobal>
class OpStoreMemberFloat : public Opcode0
{
bool mGlobal;
public:
OpStoreMemberFloat (bool global) : mGlobal (global) {}
void execute (Runtime& runtime) override
{
Type_Float data = runtime[0].mFloat;
@ -270,7 +261,7 @@ namespace Interpreter
index = runtime[2].mInteger;
std::string variable = runtime.getStringLiteral (index);
runtime.getContext().setMemberFloat (id, variable, data, mGlobal);
runtime.getContext().setMemberFloat (id, variable, data, TGlobal);
runtime.pop();
runtime.pop();
@ -278,14 +269,11 @@ namespace Interpreter
}
};
template<bool TGlobal>
class OpFetchMemberShort : public Opcode0
{
bool mGlobal;
public:
OpFetchMemberShort (bool global) : mGlobal (global) {}
void execute (Runtime& runtime) override
{
Type_Integer index = runtime[0].mInteger;
@ -294,19 +282,16 @@ namespace Interpreter
std::string variable = runtime.getStringLiteral (index);
runtime.pop();
int value = runtime.getContext().getMemberShort (id, variable, mGlobal);
int value = runtime.getContext().getMemberShort (id, variable, TGlobal);
runtime[0].mInteger = value;
}
};
template<bool TGlobal>
class OpFetchMemberLong : public Opcode0
{
bool mGlobal;
public:
OpFetchMemberLong (bool global) : mGlobal (global) {}
void execute (Runtime& runtime) override
{
Type_Integer index = runtime[0].mInteger;
@ -315,19 +300,16 @@ namespace Interpreter
std::string variable = runtime.getStringLiteral (index);
runtime.pop();
int value = runtime.getContext().getMemberLong (id, variable, mGlobal);
int value = runtime.getContext().getMemberLong (id, variable, TGlobal);
runtime[0].mInteger = value;
}
};
template<bool TGlobal>
class OpFetchMemberFloat : public Opcode0
{
bool mGlobal;
public:
OpFetchMemberFloat (bool global) : mGlobal (global) {}
void execute (Runtime& runtime) override
{
Type_Integer index = runtime[0].mInteger;
@ -336,7 +318,7 @@ namespace Interpreter
std::string variable = runtime.getStringLiteral (index);
runtime.pop();
float value = runtime.getContext().getMemberFloat (id, variable, mGlobal);
float value = runtime.getContext().getMemberFloat (id, variable, TGlobal);
runtime[0].mFloat = value;
}
};

Loading…
Cancel
Save