예제 #1
0
        /*
         * ==============
         * R_TrailingEdge
         * ==============
         */
        static void R_TrailingEdge(surf_t surf, edge_t edge)
        {
            espan_t span;
            int     iu;

            // don't generate a span if this is an inverted span, with the end
            // edge preceding the start edge (that is, we haven't seen the
            // start edge yet)
            if (--surf.spanstate == 0)
            {
                if (surf.insubmodel)
                {
                    r_bmodelactive--;
                }

                if (surf == surfaces[0].next)
                {
                    // emit a span (current top going away)
                    iu = edge.u >> 20;
                    if (iu > surf.last_u)
                    {
                        span       = basespans[span_p++];
                        span.u     = surf.last_u;
                        span.count = iu - span.u;
                        span.v     = current_iv;
                        span.pnext = surf.spans;
                        surf.spans = span;
                    }

                    // set last_u on the surface below
                    surf.next.last_u = iu;
                }

                surf.prev.next = surf.next;
                surf.next.prev = surf.prev;
            }
        }
예제 #2
0
파일: r_edge.cs 프로젝트: sbrown345/quakejs
        /*
        ==============
        R_TrailingEdge
        ==============
        */
        static void R_TrailingEdge(surf_t surf, edge_t edge)
        {
            espan_t			span;
            int				iu;

            // don't generate a span if this is an inverted span, with the end
            // edge preceding the start edge (that is, we haven't seen the
            // start edge yet)
            if (--surf.spanstate == 0)
            {
                if (surf.insubmodel)
                    r_bmodelactive--;

                if (surf == surfaces[0].next)
                {
                // emit a span (current top going away)
                    iu = edge.u >> 20;
                    if (iu > surf.last_u)
                    {
                        span = basespans[span_p++];
                        span.u = surf.last_u;
                        span.count = iu - span.u;
                        span.v = current_iv;
                        span.pnext = surf.spans;
                        surf.spans = span;
                    }

                // set last_u on the surface below
                    surf.next.last_u = iu;
                }

                surf.prev.next = surf.next;
                surf.next.prev = surf.prev;
            }
        }
예제 #3
0
파일: r_main.cs 프로젝트: sbrown345/quakejs
        /*
        ===============
        R_NewMap
        ===============
        */
        public static void R_NewMap()
        {
            int i;

            // clear out efrags in case the level hasn't been reloaded
            // FIXME: is this one short?
            for (i = 0; i < client.cl.worldmodel.numleafs; i++)
                client.cl.worldmodel.leafs[i].efrags = null;

            r_viewleaf = null;
            R_ClearParticles();

            r_cnumsurfs = (int)r_maxsurfs.value;

            if (r_cnumsurfs <= MINSURFACES)
                r_cnumsurfs = MINSURFACES;

            if (r_cnumsurfs <= NUMSTACKSURFACES)
            {
                surfaces = new surf_t[r_cnumsurfs];
                for (int kk = 0; kk < r_cnumsurfs; kk++) surfaces[kk] = new surf_t();
                surface_p = 0;
                surf_max = r_cnumsurfs;
                r_surfsonstack = false;
                // surface 0 doesn't really exist; it's just a dummy because index 0
                // is used to indicate no edge attached to surface
            }
            else
            {
                r_surfsonstack = true;
            }

            r_maxedgesseen = 0;
            r_maxsurfsseen = 0;

            r_numallocatededges = (int)r_maxedges.value;

            if (r_numallocatededges < MINEDGES)
                r_numallocatededges = MINEDGES;

            if (r_numallocatededges <= NUMSTACKEDGES)
            {
                auxedges = new edge_t[r_numallocatededges];
                for (int kk = 0; kk < r_numallocatededges; kk++) auxedges[kk] = new edge_t();
            }

            r_dowarpold = false;
            r_viewchanged = false;
        }
예제 #4
0
        /*
         * ===============
         * R_NewMap
         * ===============
         */
        public static void R_NewMap()
        {
            int i;

            // clear out efrags in case the level hasn't been reloaded
            // FIXME: is this one short?
            for (i = 0; i < client.cl.worldmodel.numleafs; i++)
            {
                client.cl.worldmodel.leafs[i].efrags = null;
            }

            r_viewleaf = null;
            R_ClearParticles();

            r_cnumsurfs = (int)r_maxsurfs.value;

            if (r_cnumsurfs <= MINSURFACES)
            {
                r_cnumsurfs = MINSURFACES;
            }

            if (r_cnumsurfs <= NUMSTACKSURFACES)
            {
                surfaces = new surf_t[r_cnumsurfs];
                for (int kk = 0; kk < r_cnumsurfs; kk++)
                {
                    surfaces[kk] = new surf_t();
                }
                surface_p      = 0;
                surf_max       = r_cnumsurfs;
                r_surfsonstack = false;
                // surface 0 doesn't really exist; it's just a dummy because index 0
                // is used to indicate no edge attached to surface
            }
            else
            {
                r_surfsonstack = true;
            }

            r_maxedgesseen = 0;
            r_maxsurfsseen = 0;

            r_numallocatededges = (int)r_maxedges.value;

            if (r_numallocatededges < MINEDGES)
            {
                r_numallocatededges = MINEDGES;
            }

            if (r_numallocatededges <= NUMSTACKEDGES)
            {
                auxedges = new edge_t[r_numallocatededges];
                for (int kk = 0; kk < r_numallocatededges; kk++)
                {
                    auxedges[kk] = new edge_t();
                }
            }

            r_dowarpold   = false;
            r_viewchanged = false;
        }