Ejemplo n.º 1
0
    /// <summary>
    /// Create a Texture2D in memory from a BLP image file
    /// </summary>
    /// <param name="file"></param>
    public Texture2D BlpToTexture2d(CASCFile file)
    {
        Texture2D blpTex = null;

        using (var blp = new BlpFile(new MemoryStream(CascFileBytes(file)))) {
            blpTex = blp.GetTexture2d(0); // getting mipmap 0, TODO: get all mipmaps
        }
        return(blpTex);
    }