Esempio n. 1
0
        public static ConvertedTexture ConvertTexture(ModelBase.TextureDefBase texture)
        {
            if (!texture.IsNitro())
            {
                return ConvertTexture(texture.m_ID, texture.GetTexName(), texture.GetPalName(), texture.GetBitmap());
            }
            else
            {
                int textype = (int)texture.m_Format;
                int dswidth = 0, dsheight = 0, widthPowerOfTwo = 8, heightPowerOfTwo = 8;
                GetDSWidthAndHeight((int)texture.GetWidth(), (int)texture.GetHeight(), out dswidth, out dsheight,
                    out widthPowerOfTwo, out heightPowerOfTwo);
                uint dstp = GetDSTextureParamsPart1(dswidth, dsheight, textype, texture.GetColor0Mode());

                return new ConvertedTexture(dstp, texture.GetNitroTexData(), texture.GetNitroPalette(), texture.GetTexName(),
                    texture.GetPalName());
            }
        }