Example #1
0
        static public int give360TextureMemFootprint(string name)
        {
            if (!File.Exists(name))
            {
                return(0);
            }

            if (Path.GetExtension(name) != ".ddx")
            {
                return(0);
            }

            int width           = 0;
            int height          = 0;
            int format          = 0;
            int numMips         = 0;
            int fullTextureSize = 0;

            unsafe
            {
                try
                {
                    System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
                    byte[] dat = encoding.GetBytes(name);

                    if (!mInitalized)
                        init();

                    fixed(byte *v = dat)
                    DDXDLL_Interface.loadDDXTextureInfo((sbyte *)v, &width, &height, &format, &numMips, &fullTextureSize);
                }
                catch (System.IO.FileLoadException e)
                {
                    return(-1);
                }
            }

            return(fullTextureSize);
        }
Example #2
0
 static public void destroy()
 {
     DDXDLL_Interface.release();
     mInitalized = false;
 }
Example #3
0
 static public void init()
 {
     DDXDLL_Interface.init();
     mInitalized = true;
 }