From db8fc350b2bffda63d27797bfe7ae4afb4af327e Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 4 Feb 2011 15:40:12 +0100 Subject: Initial commit of NW4RTools. Supports BRRES reading for: Model Bytecode, Model Nodes, Model Vertex Data, and incomplete Materials. Writing is completely unimplemented so far. --- NW4RTools/Models/ByteCode.cs | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 NW4RTools/Models/ByteCode.cs (limited to 'NW4RTools/Models/ByteCode.cs') 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 Instructions; + + public ByteCode() { + Instructions = new List(); + } + } +} + -- cgit v1.2.3