]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.c
USE_SDL define
[xonotic/darkplaces.git] / model_brush.c
index d41a589110b1754c0baca5fcc55fa516102a3fe4..e58ba5c4f23b776276ee9eb102cb7bea1268ff2a 100644 (file)
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 
 //cvar_t r_subdivide_size = {CVAR_SAVE, "r_subdivide_size", "128", "how large water polygons should be (smaller values produce more polygons which give better warping effects)"};
-cvar_t mod_bsp_portalize = {0, "mod_bsp_portalize", "0", "enables portal generation from BSP tree (may take several seconds per map), used by r_drawportals, r_useportalculling, r_shadow_realtime_world_compileportalculling, sv_cullentities_portal - all of which are off by default"};
+cvar_t mod_bsp_portalize = {0, "mod_bsp_portalize", "1", "enables portal generation from BSP tree (may take several seconds per map), used by r_drawportals, r_useportalculling, r_shadow_realtime_world_compileportalculling, sv_cullentities_portal"};
 cvar_t r_novis = {0, "r_novis", "0", "draws whole level, see also sv_cullentities_pvs 0"};
 cvar_t r_nosurftextures = {0, "r_nosurftextures", "0", "pretends there was no texture lump found in the q1bsp/hlbsp loading (useful for debugging this rare case)"};
 cvar_t r_subdivisions_tolerance = {0, "r_subdivisions_tolerance", "4", "maximum error tolerance on curve subdivision for rendering purposes (in other words, the curves will be given as many polygons as necessary to represent curves at this quality)"};
@@ -2565,6 +2565,8 @@ static void Mod_Q1BSP_LoadNodes(lump_t *l)
        if (l->filelen % sizeof(*in))
                Host_Error("Mod_Q1BSP_LoadNodes: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
+       if (count == 0)
+               Host_Error("Mod_Q1BSP_LoadNodes: missing BSP tree in %s",loadmodel->name);
        out = (mnode_t *)Mem_Alloc(loadmodel->mempool, count*sizeof(*out));
 
        loadmodel->brush.data_nodes = out;
@@ -5499,6 +5501,8 @@ static void Mod_Q3BSP_LoadNodes(lump_t *l)
        if (l->filelen % sizeof(*in))
                Host_Error("Mod_Q3BSP_LoadNodes: funny lump size in %s",loadmodel->name);
        count = l->filelen / sizeof(*in);
+       if (count == 0)
+               Host_Error("Mod_Q3BSP_LoadNodes: missing BSP tree in %s",loadmodel->name);
        out = (mnode_t *)Mem_Alloc(loadmodel->mempool, count * sizeof(*out));
 
        loadmodel->brush.data_nodes = out;