diff options
author | Treeki <treeki@gmail.com> | 2011-02-04 15:40:12 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-02-04 15:40:12 +0100 |
commit | db8fc350b2bffda63d27797bfe7ae4afb4af327e (patch) | |
tree | a0a89cd83615e7794d9507d10c329e30c4226670 /NW4RTools/Models/ByteCode.cs | |
download | nw4rtools-db8fc350b2bffda63d27797bfe7ae4afb4af327e.tar.gz nw4rtools-db8fc350b2bffda63d27797bfe7ae4afb4af327e.zip |
Initial commit of NW4RTools.
Supports BRRES reading for: Model Bytecode, Model Nodes, Model Vertex Data,
and incomplete Materials. Writing is completely unimplemented so far.
Diffstat (limited to '')
-rw-r--r-- | NW4RTools/Models/ByteCode.cs | 74 |
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>(); + } + } +} + |