Exemple #1
0
        public GMPath(ProjectReader reader)
        {
            Name            = reader.ReadString();
            LastChanged     = reader.ReadDate();
            Version         = reader.ReadInt32();
            Smooth          = reader.ReadBoolean();
            Closed          = reader.ReadBoolean();
            Precision       = reader.ReadUInt32();
            _BackgroundRoom = reader.ReadInt32();

            int _x = reader.ReadInt32();
            int _y = reader.ReadInt32();

            Snap = new Point(_x, _y);

            int pointcnt = reader.ReadInt32();

            Points = new List <PathPoint>(pointcnt);
            for (int i = 0; i < pointcnt; i++)
            {
                double _px     = reader.ReadDouble();
                double _py     = reader.ReadDouble();
                double _pspeed = reader.ReadDouble();
                Points.Add(new PathPoint(_px, _py, _pspeed));
            }

            reader.Dispose();
        }
Exemple #2
0
        public GMSound(ProjectReader reader)
        {
            Name        = reader.ReadString();
            LastChanged = reader.ReadDate();
            Version     = reader.ReadInt32();
            if (Version != 800)
            {
                throw new InvalidDataException("This library only supports .gmk GM8.0 files.");
            }

            Kind     = (SoundKind)reader.ReadInt32();
            FileType = reader.ReadString();
            FileName = reader.ReadString();
            Data     = null;
            if (reader.ReadBoolean())
            {
                int size = reader.ReadInt32();
                Data = reader.ReadBytes(size);
            }

            int eff    = reader.ReadInt32();
            int efflen = (int)SoundEffects.__LENGTH;

            Effects = new bool[efflen];
            for (int i = 0; i < efflen; i++)
            {
                Effects[i] = (eff & 1) != 0;
                eff      >>= 1;
            }

            // to check for an effect you do:
            // if (Effects[(int)SoundEffects.CHORUS]) { }

            Volume  = reader.ReadDouble();
            Panning = reader.ReadDouble();
            Preload = reader.ReadBoolean();

            reader.Dispose();
        }