예제 #1
0
 protected static void ExportTextureToPNG(string destDir, ModelBase.TextureDefBase texture)
 {
     try
     {
         ExportTextureToPNG(destDir, texture.m_ID, texture.GetBitmap());
     }
     catch (IOException)
     {
         Console.Write("Cannot write image for texture: " + texture.m_ID);
     }
 }
예제 #2
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());
            }
        }