Example #1
0
        public readonly uint ProjectId; //Project ID.

        #endregion Properties

        #region Constructors

        private Inode(byte[] bytes)
        {
            FileMode          = (FILE_MODE)BitConverter.ToUInt16(bytes, 0x00);
            UserId            = BitConverter.ToUInt16(bytes, 0x02);
            i_size_lo         = BitConverter.ToUInt32(bytes, 0x04);
            AccessTime        = Helper.FromUnixTime(BitConverter.ToUInt32(bytes, 0x08));
            ChangeTime        = Helper.FromUnixTime(BitConverter.ToUInt32(bytes, 0x0C));
            ModifiedTime      = Helper.FromUnixTime(BitConverter.ToUInt32(bytes, 0x10));
            DeletionTime      = Helper.FromUnixTime(BitConverter.ToUInt32(bytes, 0x14));
            GroupId           = BitConverter.ToUInt16(bytes, 0x18);
            i_links_count     = BitConverter.ToUInt16(bytes, 0x1A);
            i_blocks_lo       = BitConverter.ToUInt16(bytes, 0x1C);
            Flags             = (FLAGS)BitConverter.ToUInt32(bytes, 0x20);
            osd1              = BitConverter.ToUInt32(bytes, 0x24);
            i_block           = Helper.GetSubArray(bytes, 0x28, 0x3C);
            FileVersion       = BitConverter.ToUInt32(bytes, 0x64);
            i_file_acl_lo     = BitConverter.ToUInt32(bytes, 0x68);
            i_size_high       = BitConverter.ToUInt32(bytes, 0x6C);
            i_obso_faddr      = BitConverter.ToUInt32(bytes, 0x70);
            osd2              = Helper.GetSubArray(bytes, 0x74, 0x0C);
            i_extra_isize     = BitConverter.ToUInt16(bytes, 0x80);
            i_checksum_hi     = BitConverter.ToUInt16(bytes, 0x82);
            ChangeTimeExtra   = BitConverter.ToUInt32(bytes, 0x84);
            ModifiedTimeExtra = BitConverter.ToUInt32(bytes, 0x88);
            AccessTimeExtra   = BitConverter.ToUInt32(bytes, 0x8C);
            CreationTime      = Helper.FromUnixTime(BitConverter.ToUInt32(bytes, 0x90));
            CreationTimeExtra = BitConverter.ToUInt32(bytes, 0x94);
            i_version_hi      = BitConverter.ToUInt32(bytes, 0x98);
            ProjectId         = BitConverter.ToUInt32(bytes, 0x9C);
        }
Example #2
0
 private BSDInfo(byte[] bytes, int offset)
 {
     OwnerID    = Helper.SwapEndianness(BitConverter.ToUInt32(bytes, offset));
     GroupID    = Helper.SwapEndianness(BitConverter.ToUInt32(bytes, offset + 0x04));
     AdminFlags = (ADMIN_FLAGS)bytes[offset + 0x08];
     OwnerFlags = (OWNER_FLAGS)bytes[offset + 0x09];
     FileMode   = (FILE_MODE)Helper.SwapEndianness(BitConverter.ToUInt16(bytes, offset + 0x0A));
     Special    = Helper.SwapEndianness(BitConverter.ToUInt32(bytes, offset + 0x0C));
 }
Example #3
0
    private bool FileOpen(FILE_MODE fileMode)
    {
        switch (fileMode)
        {
        case FILE_MODE.SAVE:
            FileBrower.OpenSaveDialog((s) => { CreateW6MFile(s, fileMode); });
            break;

        case FILE_MODE.LOAD:
            FileBrower.OpenLoadDialog((s) => { CreateW6MFile(s, fileMode); });
            break;
        }
        return(true);
    }
Example #4
0
    private void CreateW6MFile(string path, FILE_MODE fileMode)
    {
        if (path != null)
        {
            _w6mFile = new W6MFile(path);

            switch (fileMode)
            {
            case FILE_MODE.SAVE:
                _w6mFile.Save(_tileManager.GetTilesBinary());
                break;

            case FILE_MODE.LOAD:
                _tileManager.LoadTiles(_w6mFile.Load());
                break;
            }
        }
    }