Exemple #1
0
        public TexLayer(BinaryReader br)
        {
            Size = br.ReadUInt32();

            BlendMode          = (MDLTexOp)br.ReadInt32();
            Flags              = (MDLGeo)br.ReadUInt32();
            TextureId          = br.ReadInt32();
            TextureAnimationId = br.ReadInt32();
            CoordId            = br.ReadInt32();
            Alpha              = br.ReadSingle();

            while (true)
            {
                string token = br.ReadString(4);
                br.BaseStream.Position -= 4;
                switch (token)
                {
                case "KMTA": AlphaKeys = new MDXTrack <float>(br); break;

                case "KMTF": FlipKeys = new MDXSimpleTrack(br); break;

                default: return;
                }
            }
        }
        public CAMS(BinaryReader br)
        {
            Size        = br.ReadUInt32();
            Name        = br.ReadString(80).TrimEnd('\0');
            Pivot       = br.ReadStruct <C3Vector>();
            FieldOfView = br.ReadSingle();
            FarClip     = br.ReadSingle();
            NearClip    = br.ReadSingle();
            TargetPivot = br.ReadStruct <C3Vector>();

            while (true)
            {
                string token = br.ReadString(4);
                br.BaseStream.Position -= 4;
                switch (token)
                {
                case "KCTR": TranslationKeys = new MDXTrack <C3Vector>(br); break;

                case "KCRL": RotationKeys = new MDXTrack <float>(br); break;

                case "KTTR": TargetTranslationKeys = new MDXTrack <C3Vector>(br); break;

                case "KVIS": VisibilityKeys = new MDXTrack <float>(br); break;

                default: return;
                }
            }
        }
        public LITE(BinaryReader br)
        {
            Size = br.ReadUInt32();
            Load(br);

            Type = (LightType)br.ReadInt32();
            AttenuationStart = br.ReadSingle();
            AttenuationEnd = br.ReadSingle();
            Color = br.ReadStruct<CBGR>();
            Intensity = br.ReadSingle();
            AmbientColor = br.ReadStruct<CBGR>();    // added at version 700
            AmbientIntensity = br.ReadSingle(); // added at version 700

            while (true)
            {
                string token = br.ReadString(4);
                br.BaseStream.Position -= 4;
                switch (token)
                {
                    case "KLAI": IntensityKeys = new MDXTrack<float>(br); break;
                    case "KLBI": AmbientIntensityKeys = new MDXTrack<float>(br); break;
                    case "KVIS": VisibilityKeys = new MDXTrack<float>(br); break;
                    case "KLAC": ColorKeys = new MDXTrack<CBGR>(br); break;
                    case "KLBC": AmbientColorKeys = new MDXTrack<CBGR>(br); break;
                    case "KLAS": AttenuationStartKeys = new MDXTrack<float>(br); break;
                    case "KLAE": AttenuationEndKeys = new MDXTrack<float>(br); break;
                    default: return;
                }
            }
        }
        public TXAN(BinaryReader br)
        {
            Size = br.ReadUInt32();

            while (true)
            {
                string tagname = br.ReadString(4);
                br.BaseStream.Position -= 4;
                switch (tagname)
                {
                case "KTAT": TranslationKeys = new MDXTrack <C3Vector>(br); break;

                case "KTAR": RotationKeys = new MDXTrack <C4QuaternionCompressed>(br); break;

                case "KTAS": ScaleKeys = new MDXTrack <C3Vector>(br); break;

                default: return;
                }
            }
        }
Exemple #5
0
        public ATCH(BinaryReader br)
        {
            Size = br.ReadUInt32();
            Load(br);

            AttachmentId = br.ReadInt32();
            br.ReadByte(); // confirmed padding
            Path = br.ReadString(260).TrimEnd('\0');

            while (true)
            {
                string token = br.ReadString(4);
                br.BaseStream.Position -= 4;
                switch (token)
                {
                case "KVIS": VisibilityKeys = new MDXTrack <float>(br); break;

                default: return;
                }
            }
        }
Exemple #6
0
        public RIBB(BinaryReader br)
        {
            Size = br.ReadUInt32();
            Load(br);

            EmitterSize    = br.ReadUInt32();
            HeightAbove    = br.ReadSingle();
            HeightBelow    = br.ReadSingle();
            Alpha          = br.ReadSingle();
            Color          = br.ReadStruct <CBGR>();
            EdgeLifetime   = br.ReadSingle();
            TextureSlot    = br.ReadUInt32();
            EdgesPerSecond = br.ReadUInt32();
            TextureRows    = br.ReadUInt32();
            TextureColumns = br.ReadUInt32();
            MaterialId     = br.ReadUInt32();
            Gravity        = br.ReadSingle();

            while (true)
            {
                string token = br.ReadString(4);
                br.BaseStream.Position -= 4;
                switch (token)
                {
                case "KRHA": HeightAboveKeys = new MDXTrack <float>(br); break;

                case "KRHB": HeightBelowKeys = new MDXTrack <float>(br); break;

                case "KRAL": AlphaKeys = new MDXTrack <float>(br); break;

                case "KVIS": VisibilityKeys = new MDXTrack <float>(br); break;

                case "KRCO": ColorKeys = new MDXTrack <CBGR>(br); break;

                case "KRTX": TextureSlotKeys = new MDXSimpleTrack(br); break;

                default: return;
                }
            }
        }
Exemple #7
0
        public GEOA(BinaryReader br)
        {
            Size         = br.ReadInt32();
            GeosetId     = br.ReadInt32();
            Alpha        = br.ReadSingle();
            Color        = br.ReadStruct <CBGR>();
            HasColorKeys = br.ReadInt32() == 1;

            while (true)
            {
                string token = br.ReadString(4);
                br.BaseStream.Position -= 4;
                switch (token)
                {
                case "KGAO": AlphaKeys = new MDXTrack <float>(br); break;

                case "KGAC": ColorKeys = new MDXTrack <CBGR>(br); break;

                default: return;
                }
            }
        }
Exemple #8
0
        protected void Load(BinaryReader br)
        {
            ObjSize  = br.ReadInt32();
            Name     = br.ReadString(80).TrimEnd('\0');
            ObjectId = br.ReadInt32();
            ParentId = br.ReadInt32();
            Flags    = (GenObj_Flags)br.ReadUInt32();

            while (true)
            {
                string token = br.ReadString(4);
                br.BaseStream.Position -= 4;
                switch (token)
                {
                case "KGTR": TranslationKeys = new MDXTrack <C3Vector>(br); break;

                case "KGRT": RotationKeys = new MDXTrack <C4QuaternionCompressed>(br); break;

                case "KGSC": ScaleKeys = new MDXTrack <C3Vector>(br); break;

                default: return;
                }
            }
        }
Exemple #9
0
        public PRE2(BinaryReader br)
        {
            Size = br.ReadUInt32();
            Load(br);

            EmitterSize           = br.ReadInt32();
            EmitterType           = (EmitterType)br.ReadUInt32();
            Speed                 = br.ReadSingle();
            Variation             = br.ReadSingle();
            Latitude              = br.ReadSingle();
            Longitude             = br.ReadSingle();
            Gravity               = br.ReadSingle();
            ZSource               = br.ReadSingle();
            Lifespan              = br.ReadSingle();
            EmissionRate          = br.ReadSingle();
            Length                = br.ReadSingle();
            Width                 = br.ReadSingle();
            Rows                  = br.ReadInt32();
            Cols                  = br.ReadInt32();
            ParticleType          = (CellType)br.ReadUInt32();
            TailLength            = br.ReadSingle();
            MiddleTime            = br.ReadSingle();
            StartColor            = br.ReadStruct <CBGR>();
            MiddleColor           = br.ReadStruct <CBGR>();
            EndColor              = br.ReadStruct <CBGR>();
            StartAlpha            = br.ReadByte() / 255f;
            MiddleAlpha           = br.ReadByte() / 255f;
            EndAlpha              = br.ReadByte() / 255f;
            StartScale            = br.ReadSingle();
            MiddleScale           = br.ReadSingle();
            EndScale              = br.ReadSingle();
            LifespanUVAnimStart   = br.ReadUInt32();
            LifespanUVAnimEnd     = br.ReadUInt32();
            LifespanUVAnimRepeat  = br.ReadUInt32();
            DecayUVAnimStart      = br.ReadUInt32();
            DecayUVAnimEnd        = br.ReadUInt32();
            DecayUVAnimRepeat     = br.ReadUInt32();
            TailUVAnimStart       = br.ReadUInt32();
            TailUVAnimEnd         = br.ReadUInt32();
            TailUVAnimRepeat      = br.ReadUInt32();
            TailDecayUVAnimStart  = br.ReadUInt32();
            TailDecayUVAnimEnd    = br.ReadUInt32();
            TailDecayUVAnimRepeat = br.ReadUInt32();
            BlendMode             = (BlendMode)br.ReadUInt32();
            TextureId             = br.ReadUInt32();
            PriorityPlane         = br.ReadInt32();
            ReplaceableId         = br.ReadUInt32();
            GeometryModel         = br.ReadString(260).TrimEnd('\0');
            RecursionModel        = br.ReadString(260).TrimEnd('\0');
            TwinkleFPS            = br.ReadSingle();
            TwinkleOnOff          = br.ReadSingle();
            TwinkleScaleMin       = br.ReadSingle();
            TwinkleScaleMax       = br.ReadSingle();
            IvelScale             = br.ReadSingle();
            TumbleX               = br.ReadStruct <CRange>();
            TumbleY               = br.ReadStruct <CRange>();
            TumbleZ               = br.ReadStruct <CRange>();
            Drag                  = br.ReadSingle();
            Spin                  = br.ReadSingle();
            WindVector            = br.ReadStruct <C3Vector>();
            WindTime              = br.ReadSingle();
            FollowSpeed1          = br.ReadSingle();
            FollowScale1          = br.ReadSingle();
            FollowSpeed2          = br.ReadSingle();
            FollowScale2          = br.ReadSingle();
            Splines               = br.ReadStructArray <C3Vector>(br.ReadInt32());
            Squirts               = br.ReadUInt32() == 1; // for footsteps and impact spell effects

            while (true)
            {
                string token = br.ReadString(4);
                br.BaseStream.Position -= 4;
                switch (token)
                {
                case "KP2S": SpeedKeys = new MDXTrack <float>(br); break;

                case "KP2R": VariationKeys = new MDXTrack <float>(br); break;

                case "KP2G": GravityKeys = new MDXTrack <float>(br); break;

                case "KP2W": WidthKeys = new MDXTrack <float>(br); break;

                case "KP2N": LengthKeys = new MDXTrack <float>(br); break;

                case "KVIS": VisibilityKeys = new MDXTrack <float>(br); break;

                case "KP2E": EmissionRateKeys = new MDXTrack <float>(br); break;

                case "KP2L": LatitudeKeys = new MDXTrack <float>(br); break;

                case "KLIF": LifespanKeys = new MDXTrack <float>(br); break;

                case "KPLN": LongitudeKeys = new MDXTrack <float>(br); break;

                case "KP2Z": ZSourceKeys = new MDXTrack <float>(br); break;

                default: return;
                }
            }
        }