Ejemplo n.º 1
0
            public UniformTableEntry(DVLE parent, int offset)
            {
                int readOffset = (int)(parent.Offset + offset);

                UniformID = parent.ParentDVLB.Data[readOffset + 0x02];
                X         = ConvertFloat24(BitConverter.ToUInt32(parent.ParentDVLB.Data, readOffset + 0x04));
                Y         = ConvertFloat24(BitConverter.ToUInt32(parent.ParentDVLB.Data, readOffset + 0x08));
                Z         = ConvertFloat24(BitConverter.ToUInt32(parent.ParentDVLB.Data, readOffset + 0x0C));
                W         = ConvertFloat24(BitConverter.ToUInt32(parent.ParentDVLB.Data, readOffset + 0x10));
            }
Ejemplo n.º 2
0
            public VariableTableEntry(DVLE parent, int offset)
            {
                int readOffset = (int)(parent.Offset + offset);

                SymbolOffset  = BitConverter.ToUInt32(parent.ParentDVLB.Data, readOffset + 0x00);
                StartRegister = BitConverter.ToUInt16(parent.ParentDVLB.Data, readOffset + 0x04);
                EndRegister   = BitConverter.ToUInt16(parent.ParentDVLB.Data, readOffset + 0x06);

                readOffset = (int)(parent.Offset + parent.SymbolTableOffset + SymbolOffset);
                int len = Array.IndexOf(parent.ParentDVLB.Data, (byte)0, readOffset) - readOffset;

                VariableSymbol = Encoding.ASCII.GetString(parent.ParentDVLB.Data, readOffset, len);
            }
Ejemplo n.º 3
0
            public LabelTableEntry(DVLE parent, int offset)
            {
                int readOffset = (int)(parent.Offset + offset);

                LabelID        = parent.ParentDVLB.Data[readOffset + 0x00];
                LocationOffset = BitConverter.ToUInt32(parent.ParentDVLB.Data, readOffset + 0x04);
                Unknown        = BitConverter.ToUInt32(parent.ParentDVLB.Data, readOffset + 0x08);
                SymbolOffset   = BitConverter.ToUInt32(parent.ParentDVLB.Data, readOffset + 0x0C);

                readOffset = (int)(parent.Offset + parent.SymbolTableOffset + SymbolOffset);
                int len = Array.IndexOf(parent.ParentDVLB.Data, (byte)0, readOffset) - readOffset;

                LabelSymbol = Encoding.ASCII.GetString(parent.ParentDVLB.Data, readOffset, len);
            }
Ejemplo n.º 4
0
        public void Load()
        {
            Disposed = false;

            Magic = Encoding.ASCII.GetString(Data, 0x00, 4);
            if (Magic != DVLBMagic)
            {
                throw new Exception(string.Format("Trying to read data with tag '{0}' as {1}, expected tag '{2}'", Magic, this.GetType().Name, DVLBMagic));
            }

            NumberOfDVLEs = BitConverter.ToUInt32(Data, 0x04);
            DVLEOffsets   = new uint[NumberOfDVLEs];
            DVLEs         = new DVLE[NumberOfDVLEs];

            for (int i = 0; i < NumberOfDVLEs; i++)
            {
                DVLEOffsets[i] = BitConverter.ToUInt32(Data, 0x08 + i * sizeof(uint));
                DVLEs[i]       = new DVLE(this, DVLEOffsets[i]);
            }

            DVLP = new DVLP(this, 0x08 + (NumberOfDVLEs * sizeof(uint)));
        }