Exemple #1
0
        public Descent1PIGFile(bool macPig = false, bool loadData = true)
        {
            Textures  = new ushort[800];
            TMapInfo  = new TMAPInfo[800];
            SoundIDs  = new byte[250];
            AltSounds = new byte[250];
            VClips    = new VClip[70];
            EClips    = new EClip[60];
            WClips    = new WClip[30];
            Robots    = new Robot[30];
            Joints    = new JointPos[600];
            Weapons   = new Weapon[30];
            Models    = new Polymodel[85];
            if (macPig)
            {
                Gauges = new ushort[85];
            }
            else
            {
                Gauges = new ushort[80];
            }
            ObjBitmaps        = new ushort[210];
            ObjBitmapPointers = new ushort[210];
            Cockpits          = new ushort[4];
            ObjectTypes       = new EditorObjectDefinition[100];
            Powerups          = new Powerup[29];
            BitmapXLATData    = new ushort[1800];
            reactor           = new Reactor();

            Bitmaps = new List <PIGImage>();
            Sounds  = new List <SoundData>();

            this.big      = macPig;
            this.LoadData = loadData;
        }
Exemple #2
0
        public WClip Clone()
        {
            WClip clip = (WClip)MemberwiseClone();

            clip.Frames = new ushort[50];
            Array.Copy(Frames, clip.Frames, 50);
            clip.Filename = new char[13];
            Array.Copy(Filename, clip.Filename, 13);

            return(clip);
        }
Exemple #3
0
 public void WriteWClip(WClip clip, BinaryWriter bw)
 {
     bw.Write(clip.PlayTime.value);
     bw.Write(clip.NumFrames);
     for (int x = 0; x < 50; x++)
     {
         bw.Write(clip.Frames[x]);
     }
     bw.Write(clip.OpenSound);
     bw.Write(clip.CloseSound);
     bw.Write(clip.Flags);
     for (int x = 0; x < 13; x++)
     {
         bw.Write((byte)clip.Filename[x]);
     }
     bw.Write(clip.Pad);
 }
Exemple #4
0
        internal void WriteWClipDescent1(WClip clip, DescentWriter bw)
        {
            bw.WriteFix(clip.PlayTime);
            bw.WriteInt16(clip.NumFrames);

            for (int f = 0; f < 20; f++)
            {
                bw.WriteUInt16(clip.Frames[f]);
            }

            bw.WriteInt16(clip.OpenSound);
            bw.WriteInt16(clip.CloseSound);
            bw.WriteInt16(clip.Flags);

            var nameBytes = NameHelper.GetNameBytes(clip.Filename, 13);

            bw.Write(nameBytes);

            bw.WriteByte(clip.Pad);
        }
        public WClip ReadWClipDescent1(BinaryReader br)
        {
            WClip clip = new WClip();

            clip.PlayTime  = new Fix(br.ReadInt32());
            clip.NumFrames = br.ReadInt16();
            for (int f = 0; f < 20; f++)
            {
                clip.Frames[f] = br.ReadUInt16();
            }
            clip.OpenSound  = br.ReadInt16();
            clip.CloseSound = br.ReadInt16();
            clip.Flags      = br.ReadInt16();
            for (int c = 0; c < 13; c++)
            {
                clip.Filename[c] = (char)br.ReadByte();
            }
            clip.Pad = br.ReadByte();

            return(clip);
        }
 public PSXDatFile()
 {
     Textures          = new ushort[800];
     TMapInfo          = new TMAPInfo[800];
     Sounds            = new byte[250];
     AltSounds         = new byte[250];
     VClips            = new VClip[70];
     EClips            = new EClip[60];
     WClips            = new WClip[30];
     Robots            = new Robot[30];
     Joints            = new JointPos[600];
     Weapons           = new Weapon[30];
     Models            = new Polymodel[85];
     Gauges            = new ushort[80];
     ObjBitmaps        = new ushort[210];
     ObjBitmapPointers = new ushort[210];
     Cockpits          = new ushort[4];
     ObjectTypes       = new EditorObjectDefinition[100];
     Powerups          = new Powerup[29];
     BitmapXLATData    = new ushort[1800];
     reactor           = new Reactor();
 }