Exemplo n.º 1
0
Arquivo: Zone.cs Projeto: Scrama/Quarp
        // Cache_Free
        //
        // Frees the memory and removes it from the LRU list
        static void Free(cache_user_t c)
        {
            if (c.data == null)
            {
                Sys.Error("Cache_Free: not allocated");
            }

            CacheEntry entry = (CacheEntry)c;

            entry.Remove();
        }
Exemplo n.º 2
0
Arquivo: Zone.cs Projeto: Scrama/Quarp
        // Cache_Check
        /// <summary>
        /// Cache_Check
        /// Returns value of c.data if still cached or null
        /// </summary>
        public static object Check(cache_user_t c)
        {
            CacheEntry cs = (CacheEntry)c;

            if (cs == null || cs.data == null)
            {
                return(null);
            }

            // move to head of LRU
            cs.RemoveFromLRU();
            cs.LRUInstertAfter(_Head);

            return(cs.data);
        }
Exemplo n.º 3
0
        public void CopyFrom(model_t src)
        {
            this.name              = src.name;
            this.needload          = src.needload;
            this.type              = src.type;
            this.numframes         = src.numframes;
            this.synctype          = src.synctype;
            this.flags             = src.flags;
            this.mins              = src.mins;
            this.maxs              = src.maxs;
            this.radius            = src.radius;
            this.clipbox           = src.clipbox;
            this.clipmins          = src.clipmins;
            this.clipmaxs          = src.clipmaxs;
            this.firstmodelsurface = src.firstmodelsurface;
            this.nummodelsurfaces  = src.nummodelsurfaces;

            this.numsubmodels = src.numsubmodels;
            this.submodels    = src.submodels;

            this.numplanes = src.numplanes;
            this.planes    = src.planes;

            this.numleafs = src.numleafs;
            this.leafs    = src.leafs;

            this.numvertexes = src.numvertexes;
            this.vertexes    = src.vertexes;

            this.numedges = src.numedges;
            this.edges    = src.edges;

            this.numnodes = src.numnodes;
            this.nodes    = src.nodes;

            this.numtexinfo = src.numtexinfo;
            this.texinfo    = src.texinfo;

            this.numsurfaces = src.numsurfaces;
            this.surfaces    = src.surfaces;

            this.numsurfedges = src.numsurfedges;
            this.surfedges    = src.surfedges;

            this.numclipnodes = src.numclipnodes;
            this.clipnodes    = src.clipnodes;

            this.nummarksurfaces = src.nummarksurfaces;
            this.marksurfaces    = src.marksurfaces;

            for (int i = 0; i < src.hulls.Length; i++)
            {
                this.hulls[i].CopyFrom(src.hulls[i]);
            }

            this.numtextures = src.numtextures;
            this.textures    = src.textures;

            this.visdata   = src.visdata;
            this.lightdata = src.lightdata;
            this.entities  = src.entities;

            this.cache = src.cache;
        }
Exemplo n.º 4
0
        public void Clear()
        {
            this.name              = null;
            this.needload          = false;
            this.type              = 0;
            this.numframes         = 0;
            this.synctype          = 0;
            this.flags             = 0;
            this.mins              = Vector3.Zero;
            this.maxs              = Vector3.Zero;
            this.radius            = 0;
            this.clipbox           = false;
            this.clipmins          = Vector3.Zero;
            this.clipmaxs          = Vector3.Zero;
            this.firstmodelsurface = 0;
            this.nummodelsurfaces  = 0;

            this.numsubmodels = 0;
            this.submodels    = null;

            this.numplanes = 0;
            this.planes    = null;

            this.numleafs = 0;
            this.leafs    = null;

            this.numvertexes = 0;
            this.vertexes    = null;

            this.numedges = 0;
            this.edges    = null;

            this.numnodes = 0;
            this.nodes    = null;

            this.numtexinfo = 0;
            this.texinfo    = null;

            this.numsurfaces = 0;
            this.surfaces    = null;

            this.numsurfedges = 0;
            this.surfedges    = null;

            this.numclipnodes = 0;
            this.clipnodes    = null;

            this.nummarksurfaces = 0;
            this.marksurfaces    = null;

            foreach (hull_t h in this.hulls)
            {
                h.Clear();
            }

            this.numtextures = 0;
            this.textures    = null;

            this.visdata   = null;
            this.lightdata = null;
            this.entities  = null;

            this.cache = null;
        }
Exemplo n.º 5
0
        public cache_user_t cache; // cache_user_t

        public void Clear()
        {
            this.name = null;
            cache     = null;
        }