]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.c
Added a mempool parameter to FS_LoadFile
[xonotic/darkplaces.git] / model_brush.c
index baed0e5735d26e2edb4800e60d7f066a8bc17f9c..40c3dc94f9acea845eff5bf5da3900ddd866fcfb 100644 (file)
@@ -1209,7 +1209,7 @@ static void Mod_Q1BSP_LoadLighting(lump_t *l)
                strlcpy (litfilename, loadmodel->name, sizeof (litfilename));
                FS_StripExtension (litfilename, litfilename, sizeof (litfilename));
                strlcat (litfilename, ".lit", sizeof (litfilename));
-               data = (qbyte*) FS_LoadFile(litfilename, false);
+               data = (qbyte*) FS_LoadFile(litfilename, tempmempool, false);
                if (data)
                {
                        if (fs_filesize > 8 && data[0] == 'Q' && data[1] == 'L' && data[2] == 'I' && data[3] == 'T')
@@ -1264,7 +1264,7 @@ static void Mod_Q1BSP_LoadLightList(void)
        strlcpy (lightsfilename, loadmodel->name, sizeof (lightsfilename));
        FS_StripExtension (lightsfilename, lightsfilename, sizeof(lightsfilename));
        strlcat (lightsfilename, ".lights", sizeof (lightsfilename));
-       s = lightsstring = (char *) FS_LoadFile(lightsfilename, false);
+       s = lightsstring = (char *) FS_LoadFile(lightsfilename, tempmempool, false);
        if (s)
        {
                numlights = 0;
@@ -3592,7 +3592,7 @@ static void Mod_Q3BSP_LoadTextures(lump_t *l)
        {
                for (i = 0;i < search->numfilenames;i++)
                {
-                       if ((f = FS_LoadFile(search->filenames[i], false)))
+                       if ((f = FS_LoadFile(search->filenames[i], tempmempool, false)))
                        {
                                text = f;
                                while (COM_ParseToken(&text, false))
@@ -5310,7 +5310,7 @@ static int Mod_Q3BSP_BoxTouchingPVS(model_t *model, const qbyte *pvs, const vec3
        int clusterindex, side, nodestackindex = 0;
        q3mnode_t *node, *nodestack[1024];
        node = model->brushq3.data_nodes;
-       if (!loadmodel->brush.num_pvsclusters)
+       if (!model->brush.num_pvsclusters)
                return true;
        for (;;)
        {
@@ -5335,9 +5335,9 @@ static int Mod_Q3BSP_BoxTouchingPVS(model_t *model, const qbyte *pvs, const vec3
                        // leaf - check cluster bit
                        clusterindex = ((q3mleaf_t *)node)->clusterindex;
 #if 0
-                       if (clusterindex >= loadmodel->brush.num_pvsclusters)
+                       if (clusterindex >= model->brush.num_pvsclusters)
                        {
-                               Con_Printf("%i >= %i\n", clusterindex, loadmodel->brush.num_pvsclusters);
+                               Con_Printf("%i >= %i\n", clusterindex, model->brush.num_pvsclusters);
                                return true;
                        }
 #endif
@@ -5406,7 +5406,7 @@ static int Mod_Q3BSP_FatPVS(model_t *model, const vec3_t org, vec_t radius, qbyt
 {
        int bytes = model->brush.num_pvsclusterbytes;
        bytes = min(bytes, pvsbufferlength);
-       if (r_novis.integer || !loadmodel->brush.num_pvsclusters || !Mod_Q3BSP_GetPVS(model, org))
+       if (r_novis.integer || !model->brush.num_pvsclusters || !Mod_Q3BSP_GetPVS(model, org))
        {
                memset(pvsbuffer, 0xFF, bytes);
                return bytes;
@@ -5529,7 +5529,7 @@ void Mod_Q3BSP_Load(model_t *mod, void *buffer)
        i = LittleLong(header->version);
        if (i != Q3BSPVERSION)
                Host_Error("Mod_Q3BSP_Load: %s has wrong version number (%i, should be %i)", mod->name, i, Q3BSPVERSION);
-       if (loadmodel->isworldmodel)
+       if (mod->isworldmodel)
        {
                Cvar_SetValue("halflifebsp", false);
                // until we get a texture for it...