Exemplo n.º 1
0
        /// <summary>
        /// Mod_LoadAliasModel
        /// </summary>
        public void LoadAliasModel(AliasModelData mod, byte[] buffer)
        {
            mod.Load(
                this.Host.Video.Device.Palette.Table8to24, mod.Name, buffer, (n, b, h) =>
            {
                var texture = ( GLTexture )BaseTexture.FromBuffer(
                    this.Host.Video.Device, n,
                    b, h.skinwidth, h.skinheight, true, false);

                this.SkinTextures.Add(texture);

                return(texture.GLDesc.TextureNumber);
            }, (m, h) =>
            {
                //
                // build the draw lists
                //
                mesh.MakeAliasModelDisplayLists(m);

                //
                // move the complete, relocatable alias model to the cache
                //
                mod.cache = this.Host.Cache.Alloc(aliashdr_t.SizeInBytes * h.frames.Length * maliasframedesc_t.SizeInBytes, null);
                if (mod.cache == null)
                {
                    return;
                }
                mod.cache.data = h;
            });
        }
Exemplo n.º 2
0
        /// <summary>
        /// Mod_LoadAliasModel
        /// </summary>
        private void LoadAlias(AliasModelData mod, Byte[] buffer)
        {
            mod.Load(Host.Video.Device.Palette.Table8to24, mod.Name, buffer, (n, b, h) =>
            {
                var texture = (Renderer.OpenGL.Textures.GLTexture)BaseTexture.FromBuffer(Host.Video.Device, n,
                                                                                         b, h.skinwidth, h.skinheight, true, false);

                SkinTextures.Add(texture);

                return(texture.GLDesc.TextureNumber);
            }, (model, header) =>
            {
                // Build the draw lists
                AliasModelBuilder.MakeDisplayLists(model);

                // Move the complete, relocatable alias model to the cache
                mod.cache = Host.Cache.Alloc(aliashdr_t.SizeInBytes * header.frames.Length * maliasframedesc_t.SizeInBytes, null);

                if (mod.cache == null)
                {
                    return;
                }

                mod.cache.data = header;
            });
        }