コード例 #1
0
        public GMIncludedFile(ProjectReader reader)
        {
            LastChanged = reader.ReadDate();
            Version     = reader.ReadInt32();
            if (Version != 800)
            {
                throw new InvalidDataException("Wrong Included File version, got " + Version);
            }

            FileName       = reader.ReadString();
            FilePath       = reader.ReadString();
            Original       = reader.ReadBoolean();
            FileSize       = reader.ReadInt32();
            StoreInProject = reader.ReadBoolean();
            Data           = null;
            if (StoreInProject)
            {
                int size = reader.ReadInt32(); // ??? why it's repeated twice?
                Data = reader.ReadBytes(size);
            }
            ExportKind      = (ExportActionKind)reader.ReadInt32();
            ExportFolder    = reader.ReadString();
            Overwrite       = reader.ReadBoolean();
            FreeMemory      = reader.ReadBoolean();
            RemoveAtGameEnd = reader.ReadBoolean();
        }
コード例 #2
0
ファイル: GMSound.cs プロジェクト: gm-archive/RussellLib
        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();
        }