/// <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; }); }
/// <summary> /// Mod_Init /// </summary> public void Initialise(Host host) { Host = host; SkinTextures = new List <BaseTexture>(); SpriteTextures = new List <BaseTexture>(); AliasModelBuilder = new AliasModelBuilder(); if (_glSubDivideSize == null) { _glSubDivideSize = Host.CVars.Add("gl_subdivide_size", 128, ClientVariableFlags.Archive); } }