Beispiel #1
0
        private static void ConvertCTexImage(
            NativeEnvironment e,
            ITexImage src,
            CTexImage *dst)
        {
            var mipmaps = src.Mipmaps;

            dst->mipmap_count   = mipmaps.Count;
            dst->mipmaps_length = mipmaps.Count;

            if (mipmaps.Count == 0)
            {
                dst->mipmaps = null;
                return;
            }

            var cmipmaps = e.AllocateStructArray <CTexMipmap>(mipmaps.Count);

            dst->mipmaps = cmipmaps;

            for (var i = 0; i < mipmaps.Count; i++)
            {
                ConvertCTexMipmap(e, mipmaps[i], &cmipmaps[i]);
            }
        }
Beispiel #2
0
        public WCTexImage(CTexImage *self, NativeEnvironment environment)
        {
            Self = self;

            _mipmaps = new WCList <CTexMipmap, ITexMipmap>(
                &Self->mipmap_count,
                &Self->mipmaps,
                environment,
                (x, e) => new WCTexMipmap(x, e));
        }