Esempio n. 1
0
        public static EncodingDefinition GetEncodingDefinition(MtTexPlatform platform)
        {
            var definition = new EncodingDefinition();

            switch (platform)
            {
            case MtTexPlatform.N3DS:
                definition.AddColorEncodings(CtrFormats);
                break;

            case MtTexPlatform.Switch:
                definition.AddColorEncodings(SwitchFormats);
                break;

            case MtTexPlatform.PS3:
                definition.AddColorEncodings(Ps3Formats);
                definition.AddColorShaders(Shaders);
                break;

            case MtTexPlatform.Mobile:
                definition.AddColorEncodings(MobileFormats);
                break;

            case MtTexPlatform.Wii:
                throw new InvalidOperationException("Cannot obtain encoding definition for Wii MT Tex.");
            }

            return(definition);
        }
Esempio n. 2
0
        public IList <ImageInfo> Load(Stream input, MtTexPlatform platform)
        {
            _platform    = platform;
            using var br = new BinaryReaderX(input);

            // Determine byte order
            if (br.PeekString() == "\0XET")
            {
                br.ByteOrder = ByteOrder.BigEndian;
            }

            // Read header
            _header = br.ReadType <MtTexHeader>();

            input.Position = 0;
            _mobileHeader  = br.ReadType <MobileMtTexHeader>();

            switch (platform)
            {
            case MtTexPlatform.Wii:
                return(new[] { LoadWii(br) });

            case MtTexPlatform.N3DS:
                return(new[] { Load3ds(br) });

            case MtTexPlatform.PS3:
                return(new[] { LoadPs3(br) });

            case MtTexPlatform.Switch:
                return(new[] { LoadSwitch(br) });

            case MtTexPlatform.Mobile:
                return(LoadMobile(br));

            default:
                throw new InvalidOperationException();
            }
        }
Esempio n. 3
0
 private bool ShouldLock(MtTexPlatform platform, ImageInfo info)
 {
     // Lock transcoding for mobile formats, since the 3 images are linked together
     return(platform == MtTexPlatform.Mobile);
 }