Exemplo n.º 1
0
        private bool LoadFile(System.IO.Stream stream, Util.Endianness endian, Util.Bitness bits)
        {
            string magic = stream.ReadAscii(8);

            if (magic != "T8BTMA  ")
            {
                return(false);
            }

            uint arteCount   = stream.ReadUInt32().FromEndian(endian);
            uint stringStart = stream.ReadUInt32().FromEndian(endian);

            ArteList = new List <Arte>((int)arteCount);
            for (uint i = 0; i < arteCount; ++i)
            {
                Arte a = new Arte(stream, stringStart, endian, bits);
                ArteList.Add(a);
            }

            ArteIdDict = new Dictionary <uint, Arte>(ArteList.Count);
            foreach (var arte in ArteList)
            {
                ArteIdDict.Add(arte.InGameID, arte);
            }

            return(true);
        }
Exemplo n.º 2
0
        private bool LoadFile( byte[] Bytes )
        {
            uint arteCount = BitConverter.ToUInt32( Bytes, 0x8 ).SwapEndian();
            uint stringStart = BitConverter.ToUInt32( Bytes, 0xC ).SwapEndian();

            uint location = 0x10;
            ArteList = new List<Arte>( (int)arteCount );
            for ( uint i = 0; i < arteCount; ++i ) {
                uint entrySize = BitConverter.ToUInt32( Bytes, (int)location ).SwapEndian();
                Arte a = new Arte( Bytes, location, entrySize, stringStart );
                ArteList.Add( a );
                location += entrySize;
            }

            ArteIdDict = new Dictionary<uint, Arte>( ArteList.Count );
            foreach ( var arte in ArteList ) {
                ArteIdDict.Add( arte.InGameID, arte );
            }

            return true;
        }
Exemplo n.º 3
0
        private bool LoadFile(byte[] Bytes)
        {
            uint arteCount   = BitConverter.ToUInt32(Bytes, 0x8).SwapEndian();
            uint stringStart = BitConverter.ToUInt32(Bytes, 0xC).SwapEndian();

            uint location = 0x10;

            ArteList = new List <Arte>((int)arteCount);
            for (uint i = 0; i < arteCount; ++i)
            {
                uint entrySize = BitConverter.ToUInt32(Bytes, (int)location).SwapEndian();
                Arte a         = new Arte(Bytes, location, entrySize, stringStart);
                ArteList.Add(a);
                location += entrySize;
            }

            ArteIdDict = new Dictionary <uint, Arte>(ArteList.Count);
            foreach (var arte in ArteList)
            {
                ArteIdDict.Add(arte.InGameID, arte);
            }

            return(true);
        }