Esempio n. 1
0
        private bool BuildMTEX(BinaryReader reader)
        {
            try
            {
                var dataHeader = new DataChunkHeader(reader);
                if (dataHeader.Token != Tokens.MTEX)
                {
                    throw new Exception($"Invalid token, got [{dataHeader.Token}] expected {"[MTEX]"}");
                }

                var dataChunk = reader.ReadBytes(dataHeader.Size);
                MTEXChunk = MTEXChunk.BuildFromChunk(dataChunk);
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            return(false);
        }
Esempio n. 2
0
        private bool BuildMTEX(BinaryReader reader)
        {
            try
            {
                DataChunkHeader.Fill(reader);
                if (DataChunkHeader.Token != Tokens.MTEX)
                {
                    throw new Exception($"Invalid token, got [{DataChunkHeader.Token}] expected {"[MTEX]"}");
                }

                var dataChunk = reader.ReadBytes(DataChunkHeader.Size);
                MTEXChunk = MTEXChunk.BuildFromChunk(dataChunk);
                return(true);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
            }

            return(false);
        }