Example #1
0
        public void Unpack(BinaryReader reader)
        {
            IconImage     = reader.ReadUInt32();
            IconImageBald = reader.ReadUInt32();

            ObjDesc.Unpack(reader);
            ObjDescBald.Unpack(reader);
        }
Example #2
0
        public static ObjDesc ReadFromDat(ref DatReader datReader)
        {
            ObjDesc od = new ObjDesc();

            datReader.AlignBoundary(); // Align to the DWORD boundary before and after the ObjDesc
            datReader.ReadByte();      // ObjDesc always starts with 11.
            int numPalettes          = datReader.ReadByte();
            int numTextureMapChanges = datReader.ReadByte();
            int numAnimPartChanges   = datReader.ReadByte();

            for (int k = 0; k < numPalettes; k++)
            {
                // TODO - This isn't actually used anywhere in the CharGen system, so let's find a test care to make sure this is accurate!
                SubPalette subpalette = new SubPalette();
                subpalette.SubID     = datReader.ReadUInt16();
                subpalette.SubID     = datReader.ReadUInt16();
                subpalette.NumColors = Convert.ToUInt16(datReader.ReadByte());
                od.SubPalettes.Add(subpalette);
            }
            for (int k = 0; k < numTextureMapChanges; k++)
            {
                TextureMapChange texturechange = new TextureMapChange();
                texturechange.PartIndex  = datReader.ReadByte();
                texturechange.OldTexture = datReader.ReadUInt16();
                texturechange.NewTexture = datReader.ReadUInt16();
                od.TextureChanges.Add(texturechange);
            }
            for (int k = 0; k < numAnimPartChanges; k++)
            {
                AnimationPartChange apchange = new AnimationPartChange();
                apchange.PartIndex = datReader.ReadByte();
                apchange.PartID    = datReader.ReadUInt16();
                if (apchange.PartID == 0x8000) // To be honest, I'm not quite sure WHAT this is/means, but the math works out
                {
                    apchange.PartID = datReader.ReadUInt16();
                }
                apchange.PartID += 0x01000000u; // convert to full uint value
                od.AnimPartChanges.Add(apchange);
            }
            datReader.AlignBoundary(); // Align to the DWORD boundary before and after the ObjDesc

            return(od);
        }
Example #3
0
        public uint GetDefaultMouthTexture(uint mouthStrip)
        {
            ObjDesc mouth = MouthStripList[Convert.ToInt32(mouthStrip)].ObjDesc;

            return(mouth.TextureChanges[0].OldTexture);
        }
Example #4
0
        public uint GetDefaultNoseTexture(uint noseStrip)
        {
            ObjDesc nose = NoseStripList[Convert.ToInt32(noseStrip)].ObjDesc;

            return(nose.TextureChanges[0].OldTexture);
        }