]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix bug with r_novis 1 not enabling r_wateralpha support on unvised maps
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 25 Feb 2008 07:49:10 +0000 (07:49 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 25 Feb 2008 07:49:10 +0000 (07:49 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8128 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index dd4353a1f0d6f8c9a03a73399cbbb30f9e6811c3..84e323990710f7083e1345186652583838564508 100644 (file)
@@ -2169,7 +2169,7 @@ struct alloc_lm_state
 static void init_alloc_lm_state (struct alloc_lm_state* state)
 {
        int r;
-       
+
        state->currentY = 0;
        for (r = 0; r < MAX_SINGLE_LM_SIZE; r++)
        {
@@ -2404,12 +2404,12 @@ static void Mod_Q1BSP_LoadFaces(lump_t *l)
                {
                        int i, iu, iv, lightmapx, lightmapy;
                        float u, v, ubase, vbase, uscale, vscale;
-                       
+
                        smax = surface->lightmapinfo->extents[0] >> 4;
                        tmax = surface->lightmapinfo->extents[1] >> 4;
                        ssize = (surface->lightmapinfo->extents[0] >> 4) + 1;
                        tsize = (surface->lightmapinfo->extents[1] >> 4) + 1;
-                       
+
                        // stainmap for permanent marks on walls
                        surface->lightmapinfo->stainsamples = (unsigned char *)Mem_Alloc(loadmodel->mempool, ssize * tsize * 3);
                        // clear to white
@@ -2624,11 +2624,14 @@ qboolean Mod_Q1BSP_CheckWaterAlphaSupport(void)
        int i, j;
        mleaf_t *leaf;
        const unsigned char *pvs;
+       // if there's no vis data, assume supported (because everything is visible all the time)
+       if (!loadmodel->brush.data_pvsclusters)
+               return true;
        // check all liquid leafs to see if they can see into empty leafs, if any
        // can we can assume this map supports r_wateralpha
        for (i = 0, leaf = loadmodel->brush.data_leafs;i < loadmodel->brush.num_leafs;i++, leaf++)
        {
-               if ((leaf->contents == CONTENTS_WATER || leaf->contents == CONTENTS_SLIME) && (leaf->clusterindex >= 0 && loadmodel->brush.data_pvsclusters))
+               if ((leaf->contents == CONTENTS_WATER || leaf->contents == CONTENTS_SLIME) && leaf->clusterindex >= 0)
                {
                        pvs = loadmodel->brush.data_pvsclusters + leaf->clusterindex * loadmodel->brush.num_pvsclusterbytes;
                        for (j = 0;j < loadmodel->brush.num_leafs;j++)