]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
removed modelsortedsurfaces
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Sep 2002 14:30:09 +0000 (14:30 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Sep 2002 14:30:09 +0000 (14:30 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2343 d7cf8633-e32d-0410-b094-e92efae38249

gl_rsurf.c
model_brush.c
model_shared.h

index d1c0c38d6a51a5554d6aeae22071fe0467c9caac..f33bd315ab773fcb5af9d3b9c30dc4d7e9fb7a4c 100644 (file)
@@ -1489,7 +1489,7 @@ void R_DrawSurfaces(entity_render_t *ent, int sky, int normal)
        Matrix4x4_Transform(&ent->inversematrix, r_origin, modelorg);
        for (i = 0;i < model->nummodelsurfaces;i++)
        {
-               surf = model->modelsortedsurfaces[i];
+               surf = model->surfaces + i + model->firstmodelsurface;
                if (surf->visframe == r_framecount)
                {
                        // mark any backface surfaces as not visible
index 28aa2d240ff69717b7a9383da55a96a77234893a..edcb60930aff8f03c1e89c331adf28e83ddcf751 100644 (file)
@@ -1381,33 +1381,6 @@ static void Mod_LoadFaces (lump_t *l)
        }
 }
 
-static model_t *sortmodel;
-
-static int Mod_SurfaceQSortCompare(const void *voida, const void *voidb)
-{
-       const msurface_t *a, *b;
-       a = *((const msurface_t **)voida);
-       b = *((const msurface_t **)voidb);
-       if (a->shader != b->shader)
-               return (qbyte *) a->shader - (qbyte *) b->shader;
-       if (a->texinfo->texture != b->texinfo->texture);
-               return a->texinfo->texture - b->texinfo->texture;
-       return 0;
-}
-
-static void Mod_BrushSortedSurfaces(model_t *model, mempool_t *pool)
-{
-       int surfnum;
-       sortmodel = model;
-       sortmodel->modelsortedsurfaces = Mem_Alloc(pool, sortmodel->nummodelsurfaces * sizeof(msurface_t *));
-       for (surfnum = 0;surfnum < sortmodel->nummodelsurfaces;surfnum++)
-               sortmodel->modelsortedsurfaces[surfnum] = &sortmodel->surfaces[surfnum + sortmodel->firstmodelsurface];
-
-       if (r_sortsurfaces.integer)
-               qsort(sortmodel->modelsortedsurfaces, sortmodel->nummodelsurfaces, sizeof(msurface_t *), Mod_SurfaceQSortCompare);
-}
-
-
 /*
 =================
 Mod_SetParent
@@ -2536,8 +2509,6 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
                mod->Draw = R_DrawBrushModelNormal;
                mod->DrawShadow = NULL;
 
-               Mod_BrushSortedSurfaces(mod, mainmempool);
-
                // LordHavoc: only register submodels if it is the world
                // (prevents bsp models from replacing world submodels)
                if (loadmodel->isworldmodel && i < (mod->numsubmodels - 1))
index d970b84f07e4813da1b138f9b63c2b3230ee8397..d35e06a5a38bb103e4669ca4a244f858f93ca981 100644 (file)
@@ -115,8 +115,6 @@ typedef struct model_s
 
        // brush model specific
        int                             firstmodelsurface, nummodelsurfaces;
-       // LordHavoc: sorted surface pointer array, sorted by shader type and then by texture
-       msurface_t              **modelsortedsurfaces; // [nummodelsurfaces]
 
        // lightmap format, set to r_lightmaprgba when model is loaded
        int                             lightmaprgba;