summaryrefslogtreecommitdiff
path: root/NW4RTools/Models/ByteCode.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--NW4RTools/Models/ByteCode.cs74
1 files changed, 74 insertions, 0 deletions
diff --git a/NW4RTools/Models/ByteCode.cs b/NW4RTools/Models/ByteCode.cs
new file mode 100644
index 0000000..438c009
--- /dev/null
+++ b/NW4RTools/Models/ByteCode.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+
+namespace NW4RTools.Models {
+ public class ByteCode {
+ public enum OpType {
+ None, Done, AssignNodeToParentMtx, BlendMatrices, DrawShape, AssignMtxToNode
+ }
+
+ public class Instruction {
+ public virtual OpType GetOp() {
+ return OpType.None;
+ }
+ }
+
+ public class DoneInstruction : Instruction {
+ public override OpType GetOp() {
+ return OpType.Done;
+ }
+ }
+
+ public class AssignNodeToParentMtxInstruction : Instruction {
+ public override OpType GetOp() {
+ return OpType.AssignNodeToParentMtx;
+ }
+
+ public UInt16 NodeID;
+ public UInt16 ParentMatrixID;
+ }
+
+ public class BlendMatricesInstruction : Instruction {
+ public override OpType GetOp() {
+ return OpType.BlendMatrices;
+ }
+
+ public UInt16 MatrixID;
+ public BlendedMatrix[] BlendedMatrices;
+
+ public struct BlendedMatrix {
+ public UInt16 MatrixID;
+ public float Ratio;
+ }
+ }
+
+ public class DrawShapeInstruction : Instruction {
+ public override OpType GetOp() {
+ return OpType.DrawShape;
+ }
+
+ public UInt16 MaterialID;
+ public UInt16 ShapeID;
+ public UInt16 NodeID;
+ }
+
+ public class AssignMtxToNodeInstruction : Instruction {
+ public override OpType GetOp() {
+ return OpType.AssignMtxToNode;
+ }
+
+ public UInt16 MatrixID;
+ public UInt16 NodeID;
+ }
+
+
+
+
+ public List<Instruction> Instructions;
+
+ public ByteCode() {
+ Instructions = new List<Instruction>();
+ }
+ }
+}
+